r23574 by jghali - Code style fixes and some code beautification
scribus-commit
scribus-commit at lists.scribus.net
Wed Apr 8 22:24:09 UTC 2020
Author: jghali
Date: Wed Apr 8 22:24:09 2020
New Revision: 23574
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23574
Log:
Code style fixes and some code beautification
Modified:
trunk/Scribus/scribus/scribus.cpp
Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23574&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Wed Apr 8 22:24:09 2020
@@ -483,21 +483,22 @@
m_prefsManager.appPrefs.verifierPrefs.curCheckProfile = CommonStrings::PDF_1_4;
}
+ const WindowPrefs& mainWinSettings = m_prefsManager.appPrefs.uiPrefs.mainWinSettings;
QWindow* w = ScCore->primaryMainWindow()->windowHandle();
QList<QScreen*> screens = QGuiApplication::screens();
- QScreen* s=nullptr;
+ QScreen* s = nullptr;
if (w != nullptr)
{
- s=screens.at(qMin(m_prefsManager.appPrefs.uiPrefs.mainWinSettings.screenNumber, QGuiApplication::screens().count()-1));
+ s = screens.at(qMin(mainWinSettings.screenNumber, QGuiApplication::screens().count() - 1));
windowHandle()->setScreen(s);
}
else
- s=QGuiApplication::primaryScreen();
- QRect r(0,0,0,0);
- if (s!=nullptr)
- r=s->geometry();
- move(r.left()+abs(m_prefsManager.appPrefs.uiPrefs.mainWinSettings.xPosition), r.top()+abs(m_prefsManager.appPrefs.uiPrefs.mainWinSettings.yPosition));
- resize(m_prefsManager.appPrefs.uiPrefs.mainWinSettings.width, m_prefsManager.appPrefs.uiPrefs.mainWinSettings.height);
+ s = QGuiApplication::primaryScreen();
+ QRect r(0, 0, 0, 0);
+ if (s != nullptr)
+ r = s->geometry();
+ move(r.left() + abs(mainWinSettings.xPosition), r.top() + abs(mainWinSettings.yPosition));
+ resize(mainWinSettings.width, mainWinSettings.height);
if (!m_prefsManager.appPrefs.uiPrefs.mainWinState.isEmpty())
restoreState(m_prefsManager.appPrefs.uiPrefs.mainWinState);
@@ -509,15 +510,16 @@
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
QWindow* w = ScCore->primaryMainWindow()->windowHandle();
if (w != nullptr)
- screenNumber=screens.indexOf(w->screen());
+ screenNumber = screens.indexOf(w->screen());
else
- screenNumber=screens.indexOf(QGuiApplication::primaryScreen());
+ screenNumber = screens.indexOf(QGuiApplication::primaryScreen());
#else
QScreen* s = ScCore->primaryMainWindow()->screen();
screenNumber = screens.indexOf(s);
#endif
- xPos = screens.at(screenNumber)->geometry().left();
- yPos = screens.at(screenNumber)->geometry().top();
+ QRect screenGeom = screens.at(screenNumber)->geometry();
+ xPos = screenGeom.left();
+ yPos = screenGeom.top();
}
More information about the scribus-commit
mailing list