← Back to team overview

ubuntu-phone team mailing list archive

Re: exporting notes

 

Hi,

On 09.09.2015 18:35, Matthias Apitz wrote:
> El día Wednesday, September 09, 2015 a las 10:57:24AM +0200, Michael Zanetti escribió:
> 
>> Hi Matthias,
>>
>> the notes are stored in ~/.local/share/com.ubuntu.reminders/. However,
>> they are stored in ENML format (similar to html, with some Evernote
>> specific extensions) which probably isn't what you want.
>>
>> ...
> 
> Hi Michael,
> 
> The lines in the file notes.cache do not reflect the creation order of
> the notes, something which is logic. The *.info files have the creation
> date/time encoded as:
> 
> $ fgrep 'created=' *.info
> note-09f23799-df97-40f9-b4ff-6835688ed644.info:created=@Variant(\0\0\0\x10\0%~\xb9\x3!h\xe3\xff)
> note-a0ae2c53-1c7d-4d2a-b1c5-ea876e3f4ca1.info:created=@Variant(\0\0\0\x10\0%~\xba\x1\xb5@\x1b\xff)
> note-b5bf7139-a499-40d4-9b18-7284d5587537.info:created=@Variant(\0\0\0\x10\0%~\xbb\x3\xebu\xd8\xff)
> note-da5e2110-d1a8-4470-a8bc-d5115720db57.info:created=@Variant(\0\0\0\x10\0%~\xb9\x3\x1ek|\xff)
> note-efc58768-d28a-4df0-9e41-4893e5c2af54.info:created=@Variant(\0\0\0\x10\0%~\xbb\x2n\xf9\x42\xff)
> 
> Do you have a clue about the encoding in @Variant(....), i.e. how to
> recode this to real dates?

Hmm... this must be a unix time stamp encoded somehow, but instead of
figuring it out and coming up with weird maths to convert it I think
it's easier to create a tool to dump things with QSettings directly:

QSettings s("/path/to/file", QSettings::IniFormat);
qDebug() << s.value("created").toDateTime().toString();

You can pass the wanted output format as parameter to toString() [1]

Here's a little tool for it:

https://code.launchpad.net/~mzanetti/+junk/infodump

you should be able to compile it with the Ubuntu SDK as any other app.
It won't deploy as it is just a command line tool but you can copy the
binary from the build directory to your phone and run it manually - or
if you have a build-chroot on your phone you can compile it there using

qmake infodump.pro && make

Or, if you trust me, use the armhf binary from here [2]

[1] http://doc.qt.io/qt-5/qdatetime.html#toString
[2] http://notyetthere.org/data/infodump


> 
> Thanks
> 
> 	matthias
> 

Attachment: signature.asc
Description: OpenPGP digital signature


References