diff options
Diffstat (limited to 'desktop-widgets')
-rw-r--r-- | desktop-widgets/CMakeLists.txt | 1 | ||||
-rw-r--r-- | desktop-widgets/command_divelist.cpp | 6 | ||||
-rw-r--r-- | desktop-widgets/divelistview.cpp | 1 | ||||
-rw-r--r-- | desktop-widgets/divelogimportdialog.cpp | 1 | ||||
-rw-r--r-- | desktop-widgets/filterwidget.ui | 140 | ||||
-rw-r--r-- | desktop-widgets/locationinformation.cpp | 2 | ||||
-rw-r--r-- | desktop-widgets/mainwindow.cpp | 7 | ||||
-rw-r--r-- | desktop-widgets/mainwindow.h | 1 | ||||
-rw-r--r-- | desktop-widgets/mainwindow.ui | 60 | ||||
-rw-r--r-- | desktop-widgets/modeldelegates.cpp | 5 | ||||
-rw-r--r-- | desktop-widgets/printdialog.cpp | 1 | ||||
-rw-r--r-- | desktop-widgets/simplewidgets.cpp | 111 | ||||
-rw-r--r-- | desktop-widgets/simplewidgets.h | 54 | ||||
-rw-r--r-- | desktop-widgets/tab-widgets/maintab.cpp | 2 |
14 files changed, 41 insertions, 351 deletions
diff --git a/desktop-widgets/CMakeLists.txt b/desktop-widgets/CMakeLists.txt index 149ba32c0..629c0507e 100644 --- a/desktop-widgets/CMakeLists.txt +++ b/desktop-widgets/CMakeLists.txt @@ -33,7 +33,6 @@ set (SUBSURFACE_UI diveplanner.ui diveshareexportdialog.ui downloadfromdivecomputer.ui - filterwidget.ui filterwidget2.ui findmovedimagesdialog.ui listfilter.ui diff --git a/desktop-widgets/command_divelist.cpp b/desktop-widgets/command_divelist.cpp index 91adb3725..5fb52a809 100644 --- a/desktop-widgets/command_divelist.cpp +++ b/desktop-widgets/command_divelist.cpp @@ -110,11 +110,6 @@ std::vector<DiveToAdd> DiveListBase::removeDives(std::vector<dive *> &divesToDel std::vector<DiveToAdd> res; res.reserve(divesToDelete.size()); - // First, tell the filters that dives are removed. This could - // be done later using the emitted signals, but we do this here - // for symmetry with addDives() - MultiFilterSortModel::instance()->divesDeleted(QVector<dive *>::fromStdVector(divesToDelete)); - for (dive *d: divesToDelete) res.push_back(removeDive(d)); divesToDelete.clear(); @@ -154,7 +149,6 @@ std::vector<dive *> DiveListBase::addDives(std::vector<DiveToAdd> &divesToAdd) QVector<dive *> divesForFilter; for (const DiveToAdd &entry: divesToAdd) divesForFilter.push_back(entry.dive.get()); - MultiFilterSortModel::instance()->divesAdded(divesForFilter); // At the end of the function, to send the proper dives-added signals, // we the the list of added trips. Create this list now. diff --git a/desktop-widgets/divelistview.cpp b/desktop-widgets/divelistview.cpp index 9a9330473..c340b556b 100644 --- a/desktop-widgets/divelistview.cpp +++ b/desktop-widgets/divelistview.cpp @@ -25,6 +25,7 @@ #include "qt-models/divepicturemodel.h" #include "core/metrics.h" #include "core/subsurface-qt/DiveListNotifier.h" +#include "desktop-widgets/simplewidgets.h" DiveListView::DiveListView(QWidget *parent) : QTreeView(parent), mouseClickSelection(false), currentLayout(DiveTripModel::TREE), dontEmitDiveChangedSignal(false), selectionSaved(false), diff --git a/desktop-widgets/divelogimportdialog.cpp b/desktop-widgets/divelogimportdialog.cpp index 668b230a8..f4f9311ff 100644 --- a/desktop-widgets/divelogimportdialog.cpp +++ b/desktop-widgets/divelogimportdialog.cpp @@ -9,6 +9,7 @@ #include <QMimeData> #include <QRegExp> #include <QUndoStack> +#include <QPainter> #include "core/qthelper.h" #include "core/import-csv.h" diff --git a/desktop-widgets/filterwidget.ui b/desktop-widgets/filterwidget.ui deleted file mode 100644 index 6a8b8e863..000000000 --- a/desktop-widgets/filterwidget.ui +++ /dev/null @@ -1,140 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>FilterWidget</class> - <widget class="QWidget" name="FilterWidget"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>594</width> - <height>362</height> - </rect> - </property> - <property name="windowTitle"> - <string/> - </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <property name="spacing"> - <number>0</number> - </property> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>0</number> - </property> - <item> - <layout class="QHBoxLayout" name="horizontalLayout"> - <property name="spacing"> - <number>0</number> - </property> - <item> - <spacer name="horizontalSpacer_2"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QLabel" name="filterText"> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QToolButton" name="clear"> - <property name="toolTip"> - <string>Reset filters</string> - </property> - <property name="icon"> - <iconset> - <normaloff>:edit-clear-icon</normaloff>:edit-clear-icon</iconset> - </property> - <property name="autoRaise"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="maximize"> - <property name="toolTip"> - <string>Show/hide filters</string> - </property> - <property name="icon"> - <iconset> - <normaloff>:hide-icon</normaloff>:hide-icon</iconset> - </property> - <property name="autoRaise"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="close"> - <property name="toolTip"> - <string>Close and reset filters</string> - </property> - <property name="icon"> - <iconset> - <normaloff>:filter-close</normaloff>:filter-close</iconset> - </property> - <property name="autoRaise"> - <bool>true</bool> - </property> - </widget> - </item> - </layout> - </item> - <item> - <widget class="QScrollArea" name="scrollArea"> - <property name="frameShape"> - <enum>QFrame::NoFrame</enum> - </property> - <property name="widgetResizable"> - <bool>true</bool> - </property> - <widget class="QWidget" name="scrollAreaWidgetContents"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>594</width> - <height>332</height> - </rect> - </property> - </widget> - </widget> - </item> - </layout> - </widget> - <resources> - <include location="../subsurface.qrc"/> - </resources> - <connections/> -</ui> diff --git a/desktop-widgets/locationinformation.cpp b/desktop-widgets/locationinformation.cpp index 2d0807474..7356f8370 100644 --- a/desktop-widgets/locationinformation.cpp +++ b/desktop-widgets/locationinformation.cpp @@ -34,8 +34,6 @@ LocationInformationWidget::LocationInformationWidget(QWidget *parent) : QGroupBo ui.diveSiteMessage->addAction(rejectAction); connect(ui.geoCodeButton, SIGNAL(clicked()), this, SLOT(reverseGeocode())); - connect(this, SIGNAL(nameChanged(const QString &, const QString &)), - LocationFilterModel::instance(), SLOT(changeName(const QString &, const QString &))); connect(ui.updateLocationButton, SIGNAL(clicked()), this, SLOT(updateLocationOnMap())); connect(ui.diveSiteCoordinates, SIGNAL(returnPressed()), this, SLOT(updateLocationOnMap())); ui.diveSiteCoordinates->installEventFilter(this); diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index 12c33566b..6c0b42c9d 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -54,6 +54,7 @@ #include "desktop-widgets/updatemanager.h" #include "desktop-widgets/usersurvey.h" #include "desktop-widgets/filterwidget2.h" +#include "desktop-widgets/simplewidgets.h" #include "profile-widget/profilewidget2.h" @@ -205,8 +206,6 @@ MainWindow::MainWindow() : QMainWindow(), setStateProperties("FilterDive", enabledList, enabledList, enabledList, enabledList); setApplicationState("Default"); - ui.multiFilter->hide(); - setWindowIcon(QIcon(":subsurface-icon")); if (!QIcon::hasThemeIcon("window-close")) { QIcon::setThemeName("subsurface"); @@ -497,10 +496,6 @@ void MainWindow::refreshDisplay(bool doRecreateDiveList) void MainWindow::recreateDiveList() { diveList->reload(); - TagFilterModel::instance()->repopulate(); - BuddyFilterModel::instance()->repopulate(); - LocationFilterModel::instance()->repopulate(); - SuitsFilterModel::instance()->repopulate(); MultiFilterSortModel::instance()->myInvalidate(); } diff --git a/desktop-widgets/mainwindow.h b/desktop-widgets/mainwindow.h index 03f87ab7b..a18738de4 100644 --- a/desktop-widgets/mainwindow.h +++ b/desktop-widgets/mainwindow.h @@ -18,6 +18,7 @@ #include "ui_plannerDetails.h" #include "desktop-widgets/notificationwidget.h" #include "core/gpslocation.h" +#include "core/dive.h" #define NUM_RECENT_FILES 4 diff --git a/desktop-widgets/mainwindow.ui b/desktop-widgets/mainwindow.ui index 1263b4093..2dcd3e8a6 100644 --- a/desktop-widgets/mainwindow.ui +++ b/desktop-widgets/mainwindow.ui @@ -15,12 +15,18 @@ <property name="spacing"> <number>0</number> </property> - <property name="margin"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> <number>0</number> </property> - <item> - <widget class="MultiFilter" name="multiFilter" native="true"/> - </item> <item> <widget class="QSplitter" name="mainSplitter"> <property name="orientation"> @@ -53,7 +59,7 @@ <x>0</x> <y>0</y> <width>861</width> - <height>23</height> + <height>29</height> </rect> </property> <widget class="QMenu" name="menuFile"> @@ -133,7 +139,7 @@ </widget> <widget class="QMenu" name="menuShare_on"> <property name="title"> - <string>Share on</string> + <string>Share o&n</string> </property> <addaction name="separator"/> </widget> @@ -438,7 +444,7 @@ <bool>true</bool> </property> <property name="icon"> - <iconset resource="../subsurface.qrc"> + <iconset> <normaloff>:pp-o2-icon</normaloff>:pp-o2-icon</iconset> </property> <property name="text"> @@ -450,7 +456,7 @@ <bool>true</bool> </property> <property name="icon"> - <iconset resource="../subsurface.qrc"> + <iconset> <normaloff>:pp-n2-icon</normaloff>:pp-n2-icon</iconset> </property> <property name="text"> @@ -462,7 +468,7 @@ <bool>true</bool> </property> <property name="icon"> - <iconset resource="../subsurface.qrc"> + <iconset> <normaloff>:pp-he-icon</normaloff>:pp-he-icon</iconset> </property> <property name="text"> @@ -474,7 +480,7 @@ <bool>true</bool> </property> <property name="icon"> - <iconset resource="../subsurface.qrc"> + <iconset> <normaloff>:ceiling-dc-icon</normaloff>:ceiling-dc-icon</iconset> </property> <property name="text"> @@ -486,7 +492,7 @@ <bool>true</bool> </property> <property name="icon"> - <iconset resource="../subsurface.qrc"> + <iconset> <normaloff>:ceiling-calculated-icon</normaloff>:ceiling-calculated-icon</iconset> </property> <property name="text"> @@ -498,7 +504,7 @@ <bool>true</bool> </property> <property name="icon"> - <iconset resource="../subsurface.qrc"> + <iconset> <normaloff>:ceiling-tissues-icon</normaloff>:ceiling-tissues-icon</iconset> </property> <property name="text"> @@ -510,7 +516,7 @@ <bool>true</bool> </property> <property name="icon"> - <iconset resource="../subsurface.qrc"> + <iconset> <normaloff>:ceiling-increments-icon</normaloff>:ceiling-increments-icon</iconset> </property> <property name="text"> @@ -522,7 +528,7 @@ <bool>true</bool> </property> <property name="icon"> - <iconset resource="../subsurface.qrc"> + <iconset> <normaloff>:rate-heart-icon</normaloff>:rate-heart-icon</iconset> </property> <property name="text"> @@ -534,7 +540,7 @@ <bool>true</bool> </property> <property name="icon"> - <iconset resource="../subsurface.qrc"> + <iconset> <normaloff>:depth-mod-icon</normaloff>:depth-mod-icon</iconset> </property> <property name="text"> @@ -546,7 +552,7 @@ <bool>true</bool> </property> <property name="icon"> - <iconset resource="../subsurface.qrc"> + <iconset> <normaloff>:depth-ead-icon</normaloff>:depth-ead-icon</iconset> </property> <property name="text"> @@ -558,7 +564,7 @@ <bool>true</bool> </property> <property name="icon"> - <iconset resource="../subsurface.qrc"> + <iconset> <normaloff>:depth-ndl-icon</normaloff>:depth-ndl-icon</iconset> </property> <property name="text"> @@ -570,7 +576,7 @@ <bool>true</bool> </property> <property name="icon"> - <iconset resource="../subsurface.qrc"> + <iconset> <normaloff>:rate-sac-icon</normaloff>:rate-sac-icon</iconset> </property> <property name="text"> @@ -582,7 +588,7 @@ <bool>true</bool> </property> <property name="icon"> - <iconset resource="../subsurface.qrc"> + <iconset> <normaloff>:ruler-icon</normaloff>:ruler-icon</iconset> </property> <property name="text"> @@ -594,7 +600,7 @@ <bool>true</bool> </property> <property name="icon"> - <iconset resource="../subsurface.qrc"> + <iconset> <normaloff>:scale-graph-icon</normaloff>:scale-graph-icon</iconset> </property> <property name="text"> @@ -606,7 +612,7 @@ <bool>true</bool> </property> <property name="icon"> - <iconset resource="../subsurface.qrc"> + <iconset> <normaloff>:photo-icon</normaloff>:photo-icon</iconset> </property> <property name="text"> @@ -618,7 +624,7 @@ <bool>true</bool> </property> <property name="icon"> - <iconset resource="../subsurface.qrc"> + <iconset> <normaloff>:gaschange-icon</normaloff>:gaschange-icon</iconset> </property> <property name="text"> @@ -641,7 +647,7 @@ <bool>true</bool> </property> <property name="icon"> - <iconset resource="../subsurface.qrc"> + <iconset> <normaloff>:heatmap-icon</normaloff>:heatmap-icon</iconset> </property> <property name="text"> @@ -704,7 +710,7 @@ <bool>true</bool> </property> <property name="text"> - <string>Cloud storage online</string> + <string>Cloud stora&ge online</string> </property> </action> </widget> @@ -715,12 +721,6 @@ <header>desktop-widgets/notificationwidget.h</header> <container>1</container> </customwidget> - <customwidget> - <class>MultiFilter</class> - <extends>QWidget</extends> - <header>desktop-widgets/simplewidgets.h</header> - <container>1</container> - </customwidget> </customwidgets> <resources> <include location="../subsurface.qrc"/> diff --git a/desktop-widgets/modeldelegates.cpp b/desktop-widgets/modeldelegates.cpp index f008f4bc2..41fe1c083 100644 --- a/desktop-widgets/modeldelegates.cpp +++ b/desktop-widgets/modeldelegates.cpp @@ -1,4 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 + #include "desktop-widgets/modeldelegates.h" #include "core/subsurface-string.h" #include "core/gettextfromc.h" @@ -13,6 +14,7 @@ #include "qt-models/divetripmodel.h" #include "qt-models/divelocationmodel.h" #include "core/qthelper.h" +#include "desktop-widgets/simplewidgets.h" #include <QCompleter> #include <QKeyEvent> @@ -22,6 +24,9 @@ #include <QBrush> #include <QColor> #include <QAbstractProxyModel> +#include <QLineEdit> +#include <QAbstractItemView> +#include <QSpinBox> QSize DiveListDelegate::sizeHint(const QStyleOptionViewItem&, const QModelIndex&) const { diff --git a/desktop-widgets/printdialog.cpp b/desktop-widgets/printdialog.cpp index bbbade2e4..4c863fbea 100644 --- a/desktop-widgets/printdialog.cpp +++ b/desktop-widgets/printdialog.cpp @@ -10,6 +10,7 @@ #include <QShortcut> #include <QSettings> #include <QMessageBox> +#include <QDialogButtonBox> #define SETTINGS_GROUP "PrintDialog" diff --git a/desktop-widgets/simplewidgets.cpp b/desktop-widgets/simplewidgets.cpp index 8cfb63100..42569a270 100644 --- a/desktop-widgets/simplewidgets.cpp +++ b/desktop-widgets/simplewidgets.cpp @@ -493,117 +493,6 @@ void DiveComponentSelection::buttonClicked(QAbstractButton *button) } } -void FilterBase::addContextMenuEntry(const QString &s, void (FilterModelBase::*fn)()) -{ - QAction *act = new QAction(s, this); - connect(act, &QAction::triggered, model, fn); - ui.filterList->addAction(act); -} - -FilterBase::FilterBase(FilterModelBase *model_, QWidget *parent) : QWidget(parent), - model(model_) -{ - ui.setupUi(this); -#if QT_VERSION >= 0x050200 - ui.filterInternalList->setClearButtonEnabled(true); -#endif - QSortFilterProxyModel *filter = new QSortFilterProxyModel(); - filter->setSourceModel(model); - filter->setFilterCaseSensitivity(Qt::CaseInsensitive); - connect(ui.filterInternalList, SIGNAL(textChanged(QString)), filter, SLOT(setFilterFixedString(QString))); - connect(ui.notButton, &QToolButton::toggled, model, &FilterModelBase::setNegate); - ui.filterList->setModel(filter); - - addContextMenuEntry(tr("Select All"), &FilterModelBase::selectAll); - addContextMenuEntry(tr("Unselect All"), &FilterModelBase::clearFilter); - addContextMenuEntry(tr("Invert Selection"), &FilterModelBase::invertSelection); - ui.filterList->setContextMenuPolicy(Qt::ActionsContextMenu); -} - -void FilterBase::showEvent(QShowEvent *event) -{ - MultiFilterSortModel::instance()->addFilterModel(model); - QWidget::showEvent(event); -} - -void FilterBase::hideEvent(QHideEvent *event) -{ - MultiFilterSortModel::instance()->removeFilterModel(model); - QWidget::hideEvent(event); -} - -TagFilter::TagFilter(QWidget *parent) : FilterBase(TagFilterModel::instance(), parent) -{ - ui.label->setText(tr("Tags") + QStringLiteral(": ")); -} - -BuddyFilter::BuddyFilter(QWidget *parent) : FilterBase(BuddyFilterModel::instance(), parent) -{ - ui.label->setText(tr("Person") + QStringLiteral(": ")); - ui.label->setToolTip(tr("Searches for buddies and divemasters")); -} - -LocationFilter::LocationFilter(QWidget *parent) : FilterBase(LocationFilterModel::instance(), parent) -{ - ui.label->setText(tr("Location") + QStringLiteral(": ")); -} - -SuitFilter::SuitFilter(QWidget *parent) : FilterBase(SuitsFilterModel::instance(), parent) -{ - ui.label->setText(tr("Suits") + QStringLiteral(": ")); -} - -MultiFilter::MultiFilter(QWidget *parent) : QWidget(parent) -{ - ui.setupUi(this); - - QWidget *expandedWidget = new QWidget(); - QHBoxLayout *l = new QHBoxLayout(); - - TagFilter *tagFilter = new TagFilter(this); - int minimumHeight = tagFilter->ui.filterInternalList->height() + - tagFilter->ui.verticalLayout->spacing() * tagFilter->ui.verticalLayout->count(); - - QListView *dummyList = new QListView(); - QStringListModel *dummy = new QStringListModel(QStringList() << "Dummy Text"); - dummyList->setModel(dummy); - - connect(ui.close, SIGNAL(clicked(bool)), this, SLOT(closeFilter())); - connect(ui.clear, SIGNAL(clicked(bool)), MultiFilterSortModel::instance(), SLOT(clearFilter())); - connect(ui.maximize, SIGNAL(clicked(bool)), this, SLOT(adjustHeight())); - - l->addWidget(tagFilter); - l->addWidget(new BuddyFilter()); - l->addWidget(new LocationFilter()); - l->addWidget(new SuitFilter()); - l->setContentsMargins(0, 0, 0, 0); - l->setSpacing(0); - expandedWidget->setLayout(l); - - ui.scrollArea->setWidget(expandedWidget); - expandedWidget->resize(expandedWidget->width(), minimumHeight + dummyList->sizeHintForRow(0) * 5); - ui.scrollArea->setMinimumHeight(expandedWidget->height() + 5); - - connect(MultiFilterSortModel::instance(), SIGNAL(filterFinished()), this, SLOT(filterFinished())); -} - -void MultiFilter::filterFinished() -{ - ui.filterText->setText(tr("Filter shows %1 (of %2) dives").arg(MultiFilterSortModel::instance()->divesDisplayed).arg(dive_table.nr)); -} - -void MultiFilter::adjustHeight() -{ - ui.scrollArea->setVisible(!ui.scrollArea->isVisible()); -} - -void MultiFilter::closeFilter() -{ - MultiFilterSortModel::instance()->clearFilter(); - hide(); - MainWindow::instance()->setCheckedActionFilterTags(false); -} - TextHyperlinkEventFilter::TextHyperlinkEventFilter(QTextEdit *txtEdit) : QObject(txtEdit), textEdit(txtEdit), scrollView(textEdit->viewport()) diff --git a/desktop-widgets/simplewidgets.h b/desktop-widgets/simplewidgets.h index 040754a98..a814519c4 100644 --- a/desktop-widgets/simplewidgets.h +++ b/desktop-widgets/simplewidgets.h @@ -20,7 +20,6 @@ class FilterModelBase; #include "ui_urldialog.h" #include "ui_divecomponentselection.h" #include "ui_listfilter.h" -#include "ui_filterwidget.h" #include "core/exif.h" #include "core/dive.h" @@ -150,59 +149,6 @@ private: struct dive_components *what; }; -namespace Ui{ - class FilterWidget; -}; - -class MultiFilter : public QWidget { - Q_OBJECT -public -slots: - void closeFilter(); - void adjustHeight(); - void filterFinished(); - -public: - MultiFilter(QWidget *parent); - Ui::FilterWidget ui; -}; - -class FilterBase : public QWidget { - Q_OBJECT - void addContextMenuEntry(const QString &s, void (FilterModelBase::*)()); -protected: - FilterBase(FilterModelBase *model, QWidget *parent = 0); - FilterModelBase *model; - Ui::ListFilter ui; - void showEvent(QShowEvent *) override; - void hideEvent(QHideEvent *) override; - friend class MultiFilter; -}; - -class TagFilter : public FilterBase { - Q_OBJECT -public: - TagFilter(QWidget *parent = 0); -}; - -class BuddyFilter : public FilterBase { - Q_OBJECT -public: - BuddyFilter(QWidget *parent = 0); -}; - -class SuitFilter : public FilterBase { - Q_OBJECT -public: - SuitFilter(QWidget *parent = 0); -}; - -class LocationFilter : public FilterBase { - Q_OBJECT -public: - LocationFilter(QWidget *parent = 0); -}; - class TextHyperlinkEventFilter : public QObject { Q_OBJECT public: diff --git a/desktop-widgets/tab-widgets/maintab.cpp b/desktop-widgets/tab-widgets/maintab.cpp index 567e1737f..f22b7cf1e 100644 --- a/desktop-widgets/tab-widgets/maintab.cpp +++ b/desktop-widgets/tab-widgets/maintab.cpp @@ -27,6 +27,7 @@ #include "core/gettextfromc.h" #include "desktop-widgets/locationinformation.h" #include "desktop-widgets/command.h" +#include "desktop-widgets/simplewidgets.h" #include "TabDiveExtraInfo.h" #include "TabDiveInformation.h" @@ -688,7 +689,6 @@ struct dive_site *MainTab::updateDiveSite(struct dive_site *pickedDs, dive *d) QString name = ui.location->text().isEmpty() ? tr("New dive site") : ui.location->text(); pickedDs = create_dive_site(qPrintable(name), displayed_dive.when); createdNewDive = true; - LocationFilterModel::instance()->addName(name); } if (origDs) { |