importing a text squishes newlines
teleshoes opened this issue · 5 comments
root:/root$ cat txt
5555555555,2,2012-03-24 16:02:41,"line1
line2
line3"
root:/root$ smsbackuprestore import txt
Handling 1 messages
Handled 1 messages
About to commit the changes
root:/root$ smsbackuprestore export newtxtx
root:/root$ cat newtxtx
5555555555,2,2012-03-24 16:02:41,"line1line2line3"
the problem is on import; it shows up in the ui as "line1line2line3"
util.cpp line 77 needs to be
freeText += nextLine + "\n";
http://qt-project.org/doc/qt-4.8/qtextstream.html#readLine
The returned line has no trailing end-of-line characters ("\n" or "\r\n")
actually needs to be this:
freeText += "\n" + nextLine;
you dont want \n at the end because you trim the last character, which is apparently presumed to be "
ive never sent a pull request before so decided this would be a good time ;)
i tested the fix with 7000 texts, seems to work ok.
also, i added scratchbox scripts to install deps, mount the project, configure it, and make it with cmake, in case youre interested.