}\r
}\r
\r
- \r
- // Check a note to see if it passes the attribute selection criteria\r
- public boolean checkAttributeSelection(Note n) {\r
- if (Global.createdSinceFilter.check(n) &&\r
- Global.createdBeforeFilter.check(n) && \r
- Global.changedSinceFilter.check(n) &&\r
- Global.changedBeforeFilter.check(n) )\r
- return true;\r
- \r
- return false;\r
- }\r
// Delete a note\r
public void deleteNote(String guid) {\r
NSqlQuery query = new NSqlQuery(db.getConnection());\r
// Update a note\r
public void updateNote(Note n, boolean isNew) {\r
boolean isExpunged = isNoteExpunged(n.getGuid());\r
- \r
+ int titleColor = getNoteTitleColor(n.getGuid());\r
expungeNote(n.getGuid(), !isExpunged, false);\r
addNote(n, false);\r
+ if (titleColor != -1)\r
+ setNoteTitleColor(n.getGuid(), titleColor);\r
}\r
// Does a note exist?\r
public boolean exists(String guid) {\r
returnValue.add(pair); \r
} \r
\r
- \r
- \r
return returnValue;\r
}\r
// Set a title color\r
- // Reset the dirty bit\r
public void setNoteTitleColor(String guid, int color) {\r
NSqlQuery query = new NSqlQuery(db.getConnection());\r
\r
if (!query.exec())\r
logger.log(logger.EXTREME, "Error updating title color.");\r
}\r
+ // Get in individual note's title color\r
+ // Get the title color of all notes\r
+ public Integer getNoteTitleColor(String guid) {\r
+ List<Pair<String,Integer>> returnValue = new ArrayList<Pair<String,Integer>>();\r
+ NSqlQuery query = new NSqlQuery(db.getConnection());\r
+ \r
+ query.prepare("Select titleColor from Note where titleColor != -1 and guid=:guid");\r
+ query.bindValue(":guid", guid);\r
+ if (!query.exec())\r
+ logger.log(logger.EXTREME, "Note SQL retrieve has failed on getNoteTitleColor(guid).");\r
\r
+ Integer color = -1;\r
+ \r
+ // Get a list of the notes\r
+ while (query.next()) {\r
+ Pair<String, Integer> pair = new Pair<String,Integer>();\r
+ guid = query.valueString(0);\r
+ color = query.valueInteger(1);\r
+ pair.setFirst(guid);\r
+ pair.setSecond(color);\r
+ returnValue.add(pair); \r
+ } \r
+\r
+ \r
+ return color;\r
+ }\r
\r
\r
//**********************************************************************************\r