Skip to content

Commit

Permalink
Minor changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
hdweiss committed Mar 13, 2012
1 parent d11c8c1 commit 32ceb78
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/com/matburt/mobileorg/Gui/Capture/EditActivity.java
Expand Up @@ -263,8 +263,8 @@ private void save() {
if (this.actionMode.equals(ACTIONMODE_CREATE)) {
MobileOrgApplication appInst = (MobileOrgApplication) this.getApplication();
OrgDatabase orgDB = appInst.getDB();
long file_id = orgDB.addOrUpdateFile(OrgFile.CAPTURE_FILE, "Captures", "", true);
Long parent = orgDB.getFileNodeId(OrgFile.CAPTURE_FILE);
long file_id = orgDB.addOrUpdateFile(OrgFile.CAPTURE_FILE, OrgFile.CAPTURE_FILE_ALIAS, "", true);
Long parent = orgDB.getFileId(OrgFile.CAPTURE_FILE);
long node_id = orgDB.addNode(parent, newTitle, newTodo, newPriority, newTags, file_id);

boolean addTimestamp = PreferenceManager.getDefaultSharedPreferences(
Expand All @@ -281,7 +281,7 @@ private void save() {
} else if (this.actionMode.equals(ACTIONMODE_ADDCHILD)) {
MobileOrgApplication appInst = (MobileOrgApplication) this.getApplication();
OrgDatabase orgDB = appInst.getDB();
long file_id = orgDB.addOrUpdateFile(OrgFile.CAPTURE_FILE, "Captures", "", true);
long file_id = orgDB.addOrUpdateFile(OrgFile.CAPTURE_FILE, OrgFile.CAPTURE_FILE_ALIAS, "", true);
Long parent = this.node_id;
long node_id = orgDB.addNode(parent, newTitle, newTodo, newPriority, newTags, file_id);

Expand Down
6 changes: 3 additions & 3 deletions src/com/matburt/mobileorg/Parsing/OrgDatabase.java
Expand Up @@ -106,7 +106,7 @@ public Cursor getFileCursor() {
"orgdata.payload", "orgdata.parent_id", "orgdata.file_id"};


public long getFileNodeId(String filename) {
public long getFileId(String filename) {
Cursor cursor = db.query("files", new String[] { "node_id" },
"filename=?", new String[] {filename}, null, null, null);

Expand Down Expand Up @@ -434,7 +434,7 @@ public void addEdit(String edittype, String nodeId, String nodeTitle,
}

public String fileToString(String filename) {
long fileNodeId = getFileNodeId(filename);
long fileNodeId = getFileId(filename);

if(fileNodeId < 0)
return "";
Expand Down Expand Up @@ -702,7 +702,7 @@ public long getNodeFromPath(String path) {
if(file.indexOf(":") > -1)
file = file.substring(0, file.indexOf(":"));

Cursor cursor = getNode(getFileNodeId(file));
Cursor cursor = getNode(getFileId(file));

if(cursor.getCount() == 0) {
cursor.close();
Expand Down
1 change: 1 addition & 0 deletions src/com/matburt/mobileorg/Parsing/OrgFile.java
Expand Up @@ -20,6 +20,7 @@
public class OrgFile {

public static final String CAPTURE_FILE = "mobileorg.org";
public static final String CAPTURE_FILE_ALIAS = "Captures";

private Context context;
private String fileName;
Expand Down
4 changes: 2 additions & 2 deletions src/com/matburt/mobileorg/Parsing/OrgFileParser.java
Expand Up @@ -60,7 +60,7 @@ public void parse(String filename, String filenameAlias, String checksum,
this.parentIdStack = new Stack<Long>();

this.starStack.push(0);
Long fileID = db.getFileNodeId(filename);
Long fileID = db.getFileId(filename);
this.parentIdStack.push(fileID);

this.payload = new StringBuilder();
Expand Down Expand Up @@ -118,7 +118,7 @@ private void updateCalendar(String filename, Context context) {

private void combineBlockAgendas() {
final String filename = "agendas.org";
long agendaFileNodeID = db.getFileNodeId(filename);
long agendaFileNodeID = db.getFileId(filename);
Cursor cursor = db.getNodeChildren(agendaFileNodeID);

cursor.moveToFirst();
Expand Down

0 comments on commit 32ceb78

Please sign in to comment.