diff options
-rw-r--r-- | dive.h | 3 | ||||
-rw-r--r-- | file.c | 9 | ||||
-rw-r--r-- | parse-xml.c | 13 | ||||
-rw-r--r-- | qt-ui/divelogimportdialog.cpp | 3 | ||||
-rw-r--r-- | qt-ui/maintab.cpp | 5 | ||||
-rw-r--r-- | qt-ui/mainwindow.cpp | 26 | ||||
-rw-r--r-- | qt-ui/mainwindow.h | 1 | ||||
-rw-r--r-- | tests/testparse.cpp | 18 | ||||
-rw-r--r-- | tests/testparse.h | 1 |
9 files changed, 4 insertions, 75 deletions
@@ -49,9 +49,6 @@ extern "C" { #endif extern int last_xml_version; -extern bool abort_read_of_old_file; -extern bool v2_question_shown; -extern bool imported_via_xslt; enum dive_comp_type {OC, CCR, PSCR, FREEDIVE, NUM_DC_TYPE}; // Flags (Open-circuit and Closed-circuit-rebreather) for setting dive computer type enum cylinderuse {OC_GAS, DILUENT, OXYGEN, NUM_GAS_USE}; // The different uses for cylinders @@ -1168,16 +1168,7 @@ int parse_manual_file(const char *filename, int sepidx, int units, int dateforma if (try_to_xslt_open_csv(filename, &mem, "manualCSV")) return -1; - // right now input files created by XSLT processing report being v2 XML which makes - // the parse function abort until the dialog about importing v2 files has been shown. - // Until the XSLT has been updated we just override this check - // - // FIXME - // - bool remember = v2_question_shown; - v2_question_shown = true; ret = parse_xml_buffer(filename, mem.buffer, mem.size, &dive_table, (const char **)params); - v2_question_shown = remember; free(mem.buffer); return ret; diff --git a/parse-xml.c b/parse-xml.c index b00ce10a9..345bf61ed 100644 --- a/parse-xml.c +++ b/parse-xml.c @@ -22,9 +22,6 @@ int verbose, quit; int metric = 1; int last_xml_version = -1; -bool abort_read_of_old_file = false; -bool v2_question_shown = false; -bool imported_via_xslt = false; static xmlDoc *test_xslt_transforms(xmlDoc *doc, const char **params); @@ -1718,14 +1715,6 @@ static bool entry(const char *name, char *buf) if (!strncmp(name, "version.program", sizeof("version.program") - 1) || !strncmp(name, "version.divelog", sizeof("version.divelog") - 1)) { last_xml_version = atoi(buf); - if (last_xml_version < 3 && !v2_question_shown && !imported_via_xslt) { - // let's ask the user what they want to do about reverse geo coding - // and warn them that opening older XML files can take a while - // since C code shouldn't call the UI we set a global flag and bail - // from reading the file for now - abort_read_of_old_file = true; - return false; - } } if (in_userid) { try_to_fill_userid(name, buf); @@ -1996,7 +1985,6 @@ int parse_xml_buffer(const char *url, const char *buffer, int size, } dive_end(); xmlFreeDoc(doc); - imported_via_xslt = false; return ret; } @@ -3213,7 +3201,6 @@ static xmlDoc *test_xslt_transforms(xmlDoc *doc, const char **params) } free((void *)attribute); } - imported_via_xslt = true; xmlSubstituteEntitiesDefault(1); xslt = get_stylesheet(info->file); if (xslt == NULL) { diff --git a/qt-ui/divelogimportdialog.cpp b/qt-ui/divelogimportdialog.cpp index 409064833..d3bb5e7a7 100644 --- a/qt-ui/divelogimportdialog.cpp +++ b/qt-ui/divelogimportdialog.cpp @@ -574,7 +574,6 @@ void DiveLogImportDialog::loadFileContents(int value, whatChanged triggeredBy) void DiveLogImportDialog::on_buttonBox_accepted() { - imported_via_xslt = true; QStringList r = resultModel->result(); if (ui->knownImports->currentText() != "Manual import") { for (int i = 0; i < fileNames.size(); ++i) { @@ -594,7 +593,6 @@ void DiveLogImportDialog::on_buttonBox_accepted() ui->CSVUnits->currentIndex(), delta.toUtf8().data() ) < 0) { - imported_via_xslt = false; return; } // Seabear CSV stores NDL and TTS in Minutes, not seconds @@ -670,7 +668,6 @@ void DiveLogImportDialog::on_buttonBox_accepted() } process_dives(true, false); MainWindow::instance()->refreshDisplay(); - imported_via_xslt = false; } TagDragDelegate::TagDragDelegate(QObject *parent) : QStyledItemDelegate(parent) diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index 3f72fc11a..8b141a16f 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -237,11 +237,6 @@ void MainTab::enableGeoLookupEdition() { ui.waitingSpinner->stop(); ui.addDiveSite->show(); - // if we showed an informational text about loading the files, hide it, but don't - // hide the message area if it contains other warnings - if (MainWindow::instance()->getNotificationWidget()->getNotificationText() == - tr("Please Wait, Importing your files...")) - MainWindow::instance()->getNotificationWidget()->hideNotification(); } void MainTab::disableGeoLookupEdition() diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index 16a58b321..5621269b3 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -1495,24 +1495,6 @@ void MainWindow::importTxtFiles(const QStringList fileNames) refreshDisplay(); } -void MainWindow::showV2Dialog() -{ - // here we need to ask the user if / how they want to do the reverse geo coding - // - // since the reverse geo coding now happens in its own thread the warning isn't needed - // anymore, but I'll leave this function / the logic to call it around because we are likely - // too have to add questions about how the user wants to do the reverse geo coding... - // -#if 0 - QMessageBox d(QMessageBox::Information, - tr("Welcom to Subsurface %1").arg(subsurface_version()), - tr("Importing data files from earlier versions of Subsurface can take a significant amount of time"), - QMessageBox::Ok, - this); - d.exec(); -#endif -} - void MainWindow::loadFiles(const QStringList fileNames) { bool showWarning = false; @@ -1537,14 +1519,6 @@ void MainWindow::loadFiles(const QStringList fileNames) getNotificationWidget()->showNotification(warning , KMessageWidget::Information); } } else { - if (!v2_question_shown && abort_read_of_old_file) { - v2_question_shown = true; - abort_read_of_old_file = false; - showV2Dialog(); - getNotificationWidget()->showNotification(tr("Please Wait, Importing your files..."), KMessageWidget::Information); - i--; // so we re-try this file - continue; - } failedParses.append(fileNames.at(i)); } } diff --git a/qt-ui/mainwindow.h b/qt-ui/mainwindow.h index 0d9f61098..0cdc2e1c5 100644 --- a/qt-ui/mainwindow.h +++ b/qt-ui/mainwindow.h @@ -92,7 +92,6 @@ public: void printPlan(); void checkSurvey(QSettings *s); void setApplicationState(const QByteArray& state); - void showV2Dialog(); QUndoStack *undoStack; NotificationWidget *getNotificationWidget(); void enableDisableCloudActions(); diff --git a/tests/testparse.cpp b/tests/testparse.cpp index e5abbaa6a..7b6efa104 100644 --- a/tests/testparse.cpp +++ b/tests/testparse.cpp @@ -6,8 +6,7 @@ void TestParse::testParseCSV() { // some basic file parsing tests // - // even with the V2 question not shown, CSV import should work - v2_question_shown = false; + // CSV import should work verbose = 1; QCOMPARE(parse_manual_file(SUBSURFACE_SOURCE "/dives/test41.csv", 0, // tab separator @@ -21,25 +20,16 @@ void TestParse::testParseCSV() void TestParse::testParseV2NoQuestion() { - // but parsing of a V2 file should fail - v2_question_shown = false; - QCOMPARE(parse_file(SUBSURFACE_SOURCE "/dives/test40.xml"), -1); + // parsing of a V2 file should work + QCOMPARE(parse_file(SUBSURFACE_SOURCE "/dives/test40.xml"), 0); } void TestParse::testParseV3() { - // while parsing of a V3 files should succeed - v2_question_shown = false; + // parsing of a V3 files should succeed QCOMPARE(parse_file(SUBSURFACE_SOURCE "/dives/test42.xml"), 0); } -void TestParse::testParseV2YesQuestion() -{ - // once we claim to have shown the V2 question, parsing the V2 file should work as well - v2_question_shown = true; - QCOMPARE(parse_file(SUBSURFACE_SOURCE "/dives/test40.xml"), 0); -} - void TestParse::testParseCompareOutput() { QCOMPARE(save_dives("./testout.ssrf"), 0); diff --git a/tests/testparse.h b/tests/testparse.h index df0afa9f5..2e24ec844 100644 --- a/tests/testparse.h +++ b/tests/testparse.h @@ -8,7 +8,6 @@ class TestParse : public QObject{ private slots: void testParseCSV(); void testParseV2NoQuestion(); - void testParseV2YesQuestion(); void testParseV3(); void testParseCompareOutput(); }; |