MCPcopy Create free account
hub / github.com/baumgarr/nixnote2 / ImportData

Method ImportData

xml/importdata.cpp:47–78  ·  view source on GitHub ↗

Constructor. If full == true then this is a restore. if full=false then this is considered an import. The only real difference is that an import automatically gets a new guid and is always considered "dirty" where an import will keep the guid and will obey the tag in the note.

Source from the content-addressed store, hash-verified

45//* <dirty> tag in the note.
46//***********************************************************
47ImportData::ImportData(bool full, bool cmdline, QObject *parent) : QObject(parent)
48{
49 importTags = false;
50 importNotebooks = false;
51 backup = full;
52 createTags = false;
53 stopNow = false;
54 this->cmdline = cmdline;
55
56 // get the
57 if (!full) {
58 NotebookTable t(global.db);
59 QString name = tr("Imported Notes");
60 qint32 lid=t.findByName(name);
61 if (lid == 0) {
62 // We have a new notebook to add
63 Notebook book;
64 book.name = name;
65 bool isSynchronized = true;
66 QUuid uuid;
67 notebookGuid = uuid.createUuid().toString().replace("{","").replace("}","");
68 book.guid = notebookGuid;
69 t.add(0,book,true, !isSynchronized);
70 } else {
71 t.getGuid(notebookGuid, lid);
72 }
73 }
74 if (!this->cmdline) {
75 progress = new QProgressDialog();
76 progress->setVisible(false);
77 }
78}
79
80
81//***********************************************************

Callers

nothing calls this directly

Calls 4

findByNameMethod · 0.45
toStringMethod · 0.45
addMethod · 0.45
getGuidMethod · 0.45

Tested by

no test coverage detected