Tomdroid two-way sync to SD card messes up titles

Bug #1040551 reported by Konrad Klimaszewski on 2012-08-23
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Tomdroid
Fix Released
Undecided
Unassigned
tomboy
New
Undecided
Unassigned

Bug Description

Tomdroid 0.7.1 apk
Tomboy: HEAD @ Ubuntu 11.04

I'm trying to edit a note in Tomdroid and then sync it with SD card. Then the note is synced via dropbox with my desktop directly into $HOME/.local/share/tomboy. When I open the note in tomboy the title inside the note is changed into the first line of the notes' contents. When using the Directory Watcher plugin this results in dialogs popping up asking to relink notes.

I looked into the notes themselves.
Note before edit:
...
 <title>TestNote</title>
 <text xml:space="preserve"><note-content version="0.1">TestNote

Hello World!
...

Note after edit (adding one line at the end):
...
 <title>TestNote</title>
 <text xml:space="preserve"><note-content version="0.1">Hello World!
This is new line
...

As you can see in the original note the notes' title was present two times. Once in the <title> tag and then for the second time in the <note-content>.

I think that the fix is rather easy (I have no idea how two concatenate strings in C# so this is a wild guess ;-) ):
src/org/tomdroid/sync/sd/NoteHandler.java: line ~128

else if (localName.equals(NOTE_CONTENT)) {
   inNoteContentTag = false;
   note.setXmlContent(title.toString()+"\n"+noteContent.toString());
  }

Cheers,
Konrad

Hello!
Removing the Title from the note content is done on purpuse.
Ubuntu One, as well as newer Tomboy versions also do this by default.
I fear that we can't change this behaviour, as we would get the title displayed inside the note content otherwise.

I have two possible solutions for you:

* ) Use Snowy or Ubuntu One sync for your notes
*) Upgrade you Tomboy (or even Ubuntu) to the latest stable release (LTS 12.04)

Greetings,
Stefan

Changed in tomdroid:
status: New → Triaged
Konrad Klimaszewski (graag) wrote :

Hi!

I suspected that this could be the case. Therefore I cloned git://git.gnome.org/tomboy and compiled it to test the latest version.
And it still creates notes with title present two times.

Do you know if this is Ubuntu specific behaviour? I tried to build source package from quantal but it fails due to dependencies and I'm not ready for a OS upgrade :-(.

Thanks for your help.

Cheers,
Konrad

Stefan,
You sure about that?
AFAIK, Tomboy still stores the Title in two locations. Is this something that is changed on the Ubuntu source, but not in Tomboy?

I know why it works that way in Tomboy, but yes it does cause a bit of trouble when trying to code on different editors for it, i.e. Macboy.

NoahY (noahy) wrote :

I can confirm the Tomboy does store the titles in the content. I'm pushing a change that should fix this; all it does is include the title one exporting from a note file and remove it when importing. The two functions used are :

 NoteManager.stripTitleFromContent(String xmlContent, String title)

which removes the title from an incoming note and

Note.getXmlFileString()

which turns a note into an xml file string.

Changed in tomdroid:
status: Triaged → Fix Committed
Olivier Bilodeau (plaxx) wrote :

If Tomboy ever changes fileformat I'm pretty sure they would have bumped one of the version fields. In which case we could differentiate between the two and do the right thing.

Changed in tomdroid:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers