aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Boris Barbulovski <bbarbulovski@gmail.com>2014-02-08 20:22:09 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-02-09 08:17:08 -0800
commit449c6fc6f2cd17bc9c4322aabc32f2b2bf88a220 (patch)
treeaa2732a491223e585e75600cdd02c933f5bc25b6
parent02e9a6d07ba6abf558ba1dc9c5721f2429cfd566 (diff)
downloadsubsurface-449c6fc6f2cd17bc9c4322aabc32f2b2bf88a220.tar.gz
DownloadFromDCWidget class cleanup
Remove static DownloadFromDCWidget::instance() method Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/downloadfromdivecomputer.cpp13
-rw-r--r--qt-ui/downloadfromdivecomputer.h2
-rw-r--r--qt-ui/mainwindow.cpp5
3 files changed, 3 insertions, 17 deletions
diff --git a/qt-ui/downloadfromdivecomputer.cpp b/qt-ui/downloadfromdivecomputer.cpp
index 70ec28a5b..3148a566c 100644
--- a/qt-ui/downloadfromdivecomputer.cpp
+++ b/qt-ui/downloadfromdivecomputer.cpp
@@ -36,13 +36,6 @@ namespace DownloadFromDcGlobal {
const char *err_string;
};
-DownloadFromDCWidget *DownloadFromDCWidget::instance()
-{
- static DownloadFromDCWidget *dialog = new DownloadFromDCWidget(mainWindow());
- dialog->setAttribute(Qt::WA_QuitOnClose, false);
- return dialog;
-}
-
DownloadFromDCWidget::DownloadFromDCWidget(QWidget* parent, Qt::WindowFlags f) :
QDialog(parent, f), thread(0), timer(new QTimer(this)),
dumpWarningShown(false), currentState(INITIAL)
@@ -79,12 +72,6 @@ DownloadFromDCWidget::DownloadFromDCWidget(QWidget* parent, Qt::WindowFlags f) :
updateState(INITIAL);
}
-void DownloadFromDCWidget::runDialog()
-{
- updateState(INITIAL);
- exec();
-}
-
void DownloadFromDCWidget::updateProgressBar()
{
if (*progress_bar_text != '\0') {
diff --git a/qt-ui/downloadfromdivecomputer.h b/qt-ui/downloadfromdivecomputer.h
index 8f1f6aa2b..f18170fd9 100644
--- a/qt-ui/downloadfromdivecomputer.h
+++ b/qt-ui/downloadfromdivecomputer.h
@@ -24,7 +24,6 @@ class DownloadFromDCWidget : public QDialog{
Q_OBJECT
public:
explicit DownloadFromDCWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
- static DownloadFromDCWidget *instance();
void reject();
enum states {
@@ -44,7 +43,6 @@ public slots:
void onDownloadThreadFinished();
void updateProgressBar();
- void runDialog();
void checkLogFile(int state);
void checkDumpFile(int state);
void pickDumpFile();
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index 0cafa08cf..a477bbdd4 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -270,8 +270,9 @@ void MainWindow::on_actionQuit_triggered()
void MainWindow::on_actionDownloadDC_triggered()
{
- DownloadFromDCWidget* downloadWidget = DownloadFromDCWidget::instance();
- downloadWidget->runDialog();
+ DownloadFromDCWidget dlg(this);
+
+ dlg.exec();
}
void MainWindow::on_actionDownloadWeb_triggered()