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.
| 45 | //* <dirty> tag in the note. |
| 46 | //*********************************************************** |
| 47 | ImportData::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 | //*********************************************************** |
nothing calls this directly
no test coverage detected