Perform the import via the command line
| 14 | |
| 15 | // Perform the import via the command line |
| 16 | int ImportNotes::import() { |
| 17 | |
| 18 | if (inputFile.trimmed() == "") { |
| 19 | std::cout << QString(tr("Input file not specified.")).toStdString() << std::endl; |
| 20 | return 16; |
| 21 | } |
| 22 | QFile f(inputFile); |
| 23 | if (!f.exists()) { |
| 24 | std::cout << QString(tr("Input file not found.")).toStdString() << std::endl; |
| 25 | return 16; |
| 26 | } |
| 27 | |
| 28 | ImportData importData(false,true,0); |
| 29 | importData.import(inputFile); |
| 30 | if (importData.lastError != 0) { |
| 31 | std::cout << importData.errorMessage.toStdString() << std::endl; |
| 32 | return 16; |
| 33 | } |
| 34 | return 0; |
| 35 | } |
no test coverage detected