diff options
Diffstat (limited to 'qt-models')
-rw-r--r-- | qt-models/divelocationmodel.cpp | 23 | ||||
-rw-r--r-- | qt-models/divelocationmodel.h | 2 |
2 files changed, 0 insertions, 25 deletions
diff --git a/qt-models/divelocationmodel.cpp b/qt-models/divelocationmodel.cpp index f68209a7e..0be755fd2 100644 --- a/qt-models/divelocationmodel.cpp +++ b/qt-models/divelocationmodel.cpp @@ -7,9 +7,7 @@ #include "core/metrics.h" #ifndef SUBSURFACE_MOBILE #include "cleanertablemodel.h" // for trashIcon() and editIcon() -#include "desktop-widgets/mainwindow.h" // to place message box #include "commands/command.h" -#include <QMessageBox> #endif #include <QLineEdit> #include <QIcon> @@ -262,27 +260,6 @@ bool DiveSiteSortedModel::setData(const QModelIndex &index, const QVariant &valu } } -// TODO: Remove or edit. It doesn't make sense to call the model here, which calls the undo command, -// which in turn calls the model. -void DiveSiteSortedModel::remove(const QModelIndex &index) -{ - struct dive_site *ds = getDiveSite(index); - if (!ds) - return; - switch (index.column()) { - case LocationInformationModel::EDIT: - MainWindow::instance()->editDiveSite(ds); - break; - case LocationInformationModel::REMOVE: - if (ds->dives.nr > 0 && - QMessageBox::warning(MainWindow::instance(), tr("Delete dive site?"), - tr("This dive site has %n dive(s). Do you really want to delete it?\n", "", ds->dives.nr), - QMessageBox::Yes|QMessageBox::No) == QMessageBox::No) - return; - Command::deleteDiveSites(QVector<dive_site *>{ds}); - break; - } -} #endif // SUBSURFACE_MOBILE void DiveSiteSortedModel::setFilter(const QString &text) diff --git a/qt-models/divelocationmodel.h b/qt-models/divelocationmodel.h index a42354737..661debc53 100644 --- a/qt-models/divelocationmodel.h +++ b/qt-models/divelocationmodel.h @@ -46,8 +46,6 @@ private: QString fullText; #ifndef SUBSURFACE_MOBILE bool setData(const QModelIndex &index, const QVariant &value, int role) override; -public slots: - void remove(const QModelIndex &index); #endif // SUBSURFACE_MOBILE public: DiveSiteSortedModel(); |