diff options
author | Boris Barbulovski <bbarbulovski@gmail.com> | 2014-02-08 23:56:47 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-02-09 08:19:38 -0800 |
commit | aeaa0503069f2f1f095afed6f19d4fefa19a5385 (patch) | |
tree | e30d84022b4e8cc6924be7fb3a4ffcd26a1d5e05 /qt-ui/simplewidgets.cpp | |
parent | 449c6fc6f2cd17bc9c4322aabc32f2b2bf88a220 (diff) | |
download | subsurface-aeaa0503069f2f1f095afed6f19d4fefa19a5385.tar.gz |
ShiftImageTimesDialog class cleanup.
* Remove static ShiftImageTimesDialog::instance() method
* Add ShiftImageTimesDialog::amount() member
Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/simplewidgets.cpp')
-rw-r--r-- | qt-ui/simplewidgets.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/qt-ui/simplewidgets.cpp b/qt-ui/simplewidgets.cpp index c76921c32..d69425ef9 100644 --- a/qt-ui/simplewidgets.cpp +++ b/qt-ui/simplewidgets.cpp @@ -156,27 +156,27 @@ ShiftTimesDialog::ShiftTimesDialog(QWidget *parent): QDialog(parent) ui.setupUi(this); connect(ui.buttonBox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(buttonClicked(QAbstractButton*))); } -ShiftImageTimesDialog* ShiftImageTimesDialog::instance() -{ - static ShiftImageTimesDialog* self = new ShiftImageTimesDialog(mainWindow()); - return self; -} void ShiftImageTimesDialog::buttonClicked(QAbstractButton* button) { if (ui.buttonBox->buttonRole(button) == QDialogButtonBox::AcceptRole) { - amount = ui.timeEdit->time().hour() * 3600 + ui.timeEdit->time().minute() * 60; + m_amount = ui.timeEdit->time().hour() * 3600 + ui.timeEdit->time().minute() * 60; if (ui.backwards->isChecked()) - amount *= -1; + m_amount *= -1; } } -ShiftImageTimesDialog::ShiftImageTimesDialog(QWidget *parent): QDialog(parent) +ShiftImageTimesDialog::ShiftImageTimesDialog(QWidget *parent): QDialog(parent), m_amount(0) { ui.setupUi(this); connect(ui.buttonBox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(buttonClicked(QAbstractButton*))); } +int ShiftImageTimesDialog::amount() const +{ + return m_amount; +} + bool isGnome3Session() { #if defined(QT_OS_WIW) || defined(QT_OS_MAC) |