aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2020-05-12 01:11:19 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2020-05-12 01:11:19 +0800
commitdb54b5d51d5269c2e17964e0e9842f4a2f210673 (patch)
treeebc7b5858e1cc712fcc6de4ec50896051ebfaf0b
parenta7407edaf81c685d4a389785a405a53a5de4b148 (diff)
downloadQMidiPlayer-db54b5d51d5269c2e17964e0e9842f4a2f210673.tar.xz
Stop using a dumber version of QRect().
This is going to break old configuration, so bump QMP_CONFIGURATION_FILE_REV.
-rw-r--r--qmidiplayer-desktop/qmpchannelswindow.cpp8
-rw-r--r--qmidiplayer-desktop/qmpefxwindow.cpp8
-rw-r--r--qmidiplayer-desktop/qmpmainwindow.cpp4
-rw-r--r--qmidiplayer-desktop/qmpplistwindow.cpp8
-rw-r--r--qmidiplayer-desktop/qmpsettings.cpp2
5 files changed, 15 insertions, 15 deletions
diff --git a/qmidiplayer-desktop/qmpchannelswindow.cpp b/qmidiplayer-desktop/qmpchannelswindow.cpp
index e22d75e..8957254 100644
--- a/qmidiplayer-desktop/qmpchannelswindow.cpp
+++ b/qmidiplayer-desktop/qmpchannelswindow.cpp
@@ -300,8 +300,8 @@ qmpChannelsWindow::qmpChannelsWindow(QWidget *parent):
0,
true
);
- if (mainwindow->getSettings()->getOptionRaw("DialogStatus/ChnlW", QRect(-999, -999, 999, 999)).toRect() != QRect(-999, -999, 999, 999))
- setGeometry(mainwindow->getSettings()->getOptionRaw("DialogStatus/ChnlW", QRect(-999, -999, 999, 999)).toRect());
+ if (!mainwindow->getSettings()->getOptionRaw("DialogStatus/ChnlW", QRect()).toRect().isNull())
+ setGeometry(mainwindow->getSettings()->getOptionRaw("DialogStatus/ChnlW", QRect()).toRect());
if (mainwindow->getSettings()->getOptionRaw("DialogStatus/ChnlWShown", 0).toInt())
{
show();
@@ -315,8 +315,8 @@ void qmpChannelsWindow::showEvent(QShowEvent *event)
{
mainwindow->getSettings()->setOptionRaw("DialogStatus/ChnlWShown", 1);
}
- if (mainwindow->getSettings()->getOptionRaw("DialogStatus/ChnlW", QRect(-999, -999, 999, 999)).toRect() != QRect(-999, -999, 999, 999))
- setGeometry(mainwindow->getSettings()->getOptionRaw("DialogStatus/ChnlW", QRect(-999, -999, 999, 999)).toRect());
+ if (!mainwindow->getSettings()->getOptionRaw("DialogStatus/ChnlW", QRect()).toRect().isNull())
+ setGeometry(mainwindow->getSettings()->getOptionRaw("DialogStatus/ChnlW", QRect()).toRect());
event->accept();
}
diff --git a/qmidiplayer-desktop/qmpefxwindow.cpp b/qmidiplayer-desktop/qmpefxwindow.cpp
index ec1cef3..154b053 100644
--- a/qmidiplayer-desktop/qmpefxwindow.cpp
+++ b/qmidiplayer-desktop/qmpefxwindow.cpp
@@ -34,8 +34,8 @@ qmpEfxWindow::qmpEfxWindow(QWidget *parent) :
0,
true
);
- if (settings->getOptionRaw("DialogStatus/EfxW", QRect(-999, -999, 999, 999)).toRect() != QRect(-999, -999, 999, 999))
- setGeometry(settings->getOptionRaw("DialogStatus/EfxW", QRect(-999, -999, 999, 999)).toRect());
+ if (!settings->getOptionRaw("DialogStatus/EfxW", QRect()).toRect().isNull())
+ setGeometry(settings->getOptionRaw("DialogStatus/EfxW", QRect()).toRect());
if (settings->getOptionRaw("DialogStatus/EfxWShown", 0).toInt())
{
show();
@@ -104,8 +104,8 @@ void qmpEfxWindow::showEvent(QShowEvent *event)
}
initialized = true;
qmpSettings *settings = qmpMainWindow::getInstance()->getSettings();
- if (settings->getOptionRaw("DialogStatus/EfxW", QRect(-999, -999, 999, 999)).toRect() != QRect(-999, -999, 999, 999))
- setGeometry(settings->getOptionRaw("DialogStatus/EfxW", QRect(-999, -999, 999, 999)).toRect());
+ if (!settings->getOptionRaw("DialogStatus/EfxW", QRect()).toRect().isNull())
+ setGeometry(settings->getOptionRaw("DialogStatus/EfxW", QRect()).toRect());
if (settings->getOptionBool("Behavior/DialogStatus"))
{
settings->setOptionRaw("DialogStatus/EfxWShown", 1);
diff --git a/qmidiplayer-desktop/qmpmainwindow.cpp b/qmidiplayer-desktop/qmpmainwindow.cpp
index 98378aa..456ae60 100644
--- a/qmidiplayer-desktop/qmpmainwindow.cpp
+++ b/qmidiplayer-desktop/qmpmainwindow.cpp
@@ -147,8 +147,8 @@ void qmpMainWindow::init()
if (settings->getOptionBool("Behavior/DialogStatus"))
{
- QRect g = settings->getOptionRaw("DialogStatus/MainW", QRect(-999, -999, 999, 999)).toRect();
- if (g != QRect(-999, -999, 999, 999))
+ QRect g = settings->getOptionRaw("DialogStatus/MainW", QRect()).toRect();
+ if (!g.isNull())
setGeometry(g);
}
diff --git a/qmidiplayer-desktop/qmpplistwindow.cpp b/qmidiplayer-desktop/qmpplistwindow.cpp
index 55cc980..59bea38 100644
--- a/qmidiplayer-desktop/qmpplistwindow.cpp
+++ b/qmidiplayer-desktop/qmpplistwindow.cpp
@@ -82,8 +82,8 @@ qmpPlistWindow::qmpPlistWindow(QWidget *parent):
0,
true
);
- if (settings->getOptionRaw("DialogStatus/PListW", QRect(-999, -999, 999, 999)).toRect() != QRect(-999, -999, 999, 999))
- setGeometry(settings->getOptionRaw("DialogStatus/PListW", QRect(-999, -999, 999, 999)).toRect());
+ if (!settings->getOptionRaw("DialogStatus/PListW", QRect()).toRect().isNull())
+ setGeometry(settings->getOptionRaw("DialogStatus/PListW", QRect()).toRect());
if (settings->getOptionRaw("DialogStatus/PListWShown", 0).toInt())
{
show();
@@ -104,8 +104,8 @@ void qmpPlistWindow::showEvent(QShowEvent *event)
{
settings->setOptionRaw("DialogStatus/PListWShown", 1);
}
- if (settings->getOptionRaw("DialogStatus/PListW", QRect(-999, -999, 999, 999)).toRect() != QRect(-999, -999, 999, 999))
- setGeometry(settings->getOptionRaw("DialogStatus/PListW", QRect(-999, -999, 999, 999)).toRect());
+ if (!settings->getOptionRaw("DialogStatus/PListW", QRect()).toRect().isNull())
+ setGeometry(settings->getOptionRaw("DialogStatus/PListW", QRect()).toRect());
event->accept();
}
diff --git a/qmidiplayer-desktop/qmpsettings.cpp b/qmidiplayer-desktop/qmpsettings.cpp
index 8ba0d5e..6ce542a 100644
--- a/qmidiplayer-desktop/qmpsettings.cpp
+++ b/qmidiplayer-desktop/qmpsettings.cpp
@@ -2,7 +2,7 @@
#include <QFile>
#include <QStandardPaths>
-#define QMP_CONFIGURATION_FILE_REV 1
+#define QMP_CONFIGURATION_FILE_REV 2
QSettings *qmpSettings::settings = nullptr;
qmpSettings::qmpSettings()