r23570 by craig - Remove redundant code, ensure value returned is ok from screen code

scribus-commit scribus-commit at lists.scribus.net
Wed Apr 8 21:52:55 UTC 2020


Author: craig
Date: Wed Apr  8 21:52:55 2020
New Revision: 23570

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23570
Log:
Remove redundant code, ensure value returned is ok from screen code

Modified:
    trunk/Scribus/scribus/prefsmanager.cpp
    trunk/Scribus/scribus/scribus.cpp

Modified: trunk/Scribus/scribus/prefsmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23570&path=/trunk/Scribus/scribus/prefsmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/prefsmanager.cpp	(original)
+++ trunk/Scribus/scribus/prefsmanager.cpp	Wed Apr  8 21:52:55 2020
@@ -986,15 +986,6 @@
 	appPrefs.uiPrefs.mainWinSettings.width = ScCore->primaryMainWindow()->size().width();
 	appPrefs.uiPrefs.mainWinSettings.height = ScCore->primaryMainWindow()->size().height();
 	appPrefs.uiPrefs.mainWinSettings.maximized = ScCore->primaryMainWindow()->isMaximized();
-	QList<QScreen*> screens = QGuiApplication::screens();
-#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
-	QWindow* w = ScCore->primaryMainWindow()->windowHandle();
-	if (w != nullptr)
-		currentScreen=screens.indexOf(w->screen());
-#else
-	QScreen* s = ScCore->primaryMainWindow()->screen();
-	currentScreen=screens.indexOf(s);
-#endif
 	appPrefs.uiPrefs.mainWinSettings.screenNumber = currentScreen;
 	appPrefs.uiPrefs.mainWinState = ScCore->primaryMainWindow()->saveState();
 	appPrefs.uiPrefs.RecentDocs.clear();

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23570&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp	(original)
+++ trunk/Scribus/scribus/scribus.cpp	Wed Apr  8 21:52:55 2020
@@ -497,7 +497,7 @@
 	QRect r(0,0,0,0);
 	if (s!=nullptr)
 		r=s->geometry();
-	move(r.left()+abs(m_prefsManager.appPrefs.uiPrefs.mainWinSettings.xPosition), r.top()+m_prefsManager.appPrefs.uiPrefs.mainWinSettings.yPosition);
+	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);
 
 	if (!m_prefsManager.appPrefs.uiPrefs.mainWinState.isEmpty())
@@ -511,6 +511,8 @@
 	QWindow* w = ScCore->primaryMainWindow()->windowHandle();
 	if (w != nullptr)
 		screenNumber=screens.indexOf(w->screen());
+	else
+		screenNumber=screens.indexOf(QGuiApplication::primaryScreen());
 #else
 	QScreen* s = ScCore->primaryMainWindow()->screen();
 	screenNumber = screens.indexOf(s);




More information about the scribus-commit mailing list