aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-10-11 18:44:05 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-10-11 16:25:02 -0700
commitce8199cdfdef97437ad85178c7104f307baf018b (patch)
tree4979946f2e5128e8508b9359dbdc62dce0bc1864 /desktop-widgets
parent76e5c5ac671fdeb29cf667d478a27757054d67cb (diff)
downloadsubsurface-ce8199cdfdef97437ad85178c7104f307baf018b.tar.gz
Cleanup: remove ReverseGeoLookupThread
Fetching the taxonomy from GPS coordinates was implemented in a QThread. But the only access to the main function was a direct call to run(). Thus, the thread was *never* started. The function call was always asynchronous [it was using an event loop though, so the UI doesn't hang]. Notably this means that the signals connected to the thread would never fire. And the spinner would never be activated. Thus: 1) Turn the thread into a simple function. 2) Remove the spinner. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets')
-rw-r--r--desktop-widgets/locationinformation.cpp3
-rw-r--r--desktop-widgets/mainwindow.cpp3
-rw-r--r--desktop-widgets/tab-widgets/maintab.cpp25
-rw-r--r--desktop-widgets/tab-widgets/maintab.h2
-rw-r--r--desktop-widgets/tab-widgets/maintab.ui9
5 files changed, 1 insertions, 41 deletions
diff --git a/desktop-widgets/locationinformation.cpp b/desktop-widgets/locationinformation.cpp
index 4118e6c65..67c23510d 100644
--- a/desktop-widgets/locationinformation.cpp
+++ b/desktop-widgets/locationinformation.cpp
@@ -330,8 +330,7 @@ void LocationInformationWidget::resetPallete()
void LocationInformationWidget::reverseGeocode()
{
- ReverseGeoLookupThread *geoLookup = ReverseGeoLookupThread::instance();
- geoLookup->run();
+ reverseGeoLookup();
updateLabels();
}
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp
index 0476dfae8..2b4411387 100644
--- a/desktop-widgets/mainwindow.cpp
+++ b/desktop-widgets/mainwindow.cpp
@@ -266,9 +266,6 @@ MainWindow::MainWindow() : QMainWindow(),
redoAction->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_Z));
ui.menu_Edit->addActions({ undoAction, redoAction });
- ReverseGeoLookupThread *geoLookup = ReverseGeoLookupThread::instance();
- connect(geoLookup, SIGNAL(started()),information(), SLOT(disableGeoLookupEdition()));
- connect(geoLookup, SIGNAL(finished()), information(), SLOT(enableGeoLookupEdition()));
#ifndef NO_PRINTING
// copy the bundled print templates to the user path
QStringList templateBackupList;
diff --git a/desktop-widgets/tab-widgets/maintab.cpp b/desktop-widgets/tab-widgets/maintab.cpp
index d45bc246d..053f4e043 100644
--- a/desktop-widgets/tab-widgets/maintab.cpp
+++ b/desktop-widgets/tab-widgets/maintab.cpp
@@ -195,21 +195,6 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
ui.cylinders->view()->horizontalHeader()->addAction(action);
}
- ui.waitingSpinner->setRoundness(70.0);
- ui.waitingSpinner->setMinimumTrailOpacity(15.0);
- ui.waitingSpinner->setTrailFadePercentage(70.0);
- ui.waitingSpinner->setNumberOfLines(8);
- ui.waitingSpinner->setLineLength(5);
- ui.waitingSpinner->setLineWidth(3);
- ui.waitingSpinner->setInnerRadius(5);
- ui.waitingSpinner->setRevolutionsPerSecond(1);
-
- connect(ReverseGeoLookupThread::instance(), SIGNAL(finished()),
- LocationInformationModel::instance(), SLOT(update()));
-
- connect(ReverseGeoLookupThread::instance(), &QThread::finished,
- this, &MainTab::setCurrentLocationIndex);
-
connect(ui.diveNotesMessage, &KMessageWidget::showAnimationFinished,
ui.location, &DiveLocationLineEdit::fixPopupPosition);
@@ -245,16 +230,6 @@ void MainTab::setCurrentLocationIndex()
}
}
-void MainTab::enableGeoLookupEdition()
-{
- ui.waitingSpinner->stop();
-}
-
-void MainTab::disableGeoLookupEdition()
-{
- ui.waitingSpinner->start();
-}
-
void MainTab::toggleTriggeredColumn()
{
QAction *action = qobject_cast<QAction *>(sender());
diff --git a/desktop-widgets/tab-widgets/maintab.h b/desktop-widgets/tab-widgets/maintab.h
index c04a9b267..c38615c93 100644
--- a/desktop-widgets/tab-widgets/maintab.h
+++ b/desktop-widgets/tab-widgets/maintab.h
@@ -98,8 +98,6 @@ slots:
void updateTextLabels(bool showUnits = true);
void escDetected(void);
void showLocation();
- void enableGeoLookupEdition();
- void disableGeoLookupEdition();
void setCurrentLocationIndex();
EditMode getEditMode() const;
private:
diff --git a/desktop-widgets/tab-widgets/maintab.ui b/desktop-widgets/tab-widgets/maintab.ui
index 7a1be9aed..34ce65186 100644
--- a/desktop-widgets/tab-widgets/maintab.ui
+++ b/desktop-widgets/tab-widgets/maintab.ui
@@ -230,9 +230,6 @@
</property>
</widget>
</item>
- <item>
- <widget class="QtWaitingSpinner" name="waitingSpinner" native="true"/>
- </item>
</layout>
</item>
<item>
@@ -600,12 +597,6 @@
<header>desktop-widgets/tagwidget.h</header>
</customwidget>
<customwidget>
- <class>QtWaitingSpinner</class>
- <extends>QWidget</extends>
- <header>desktop-widgets/qtwaitingspinner.h</header>
- <container>1</container>
- </customwidget>
- <customwidget>
<class>DiveLocationLineEdit</class>
<extends>QLineEdit</extends>
<header>desktop-widgets/locationinformation.h</header>