r24768 by jghali - Code cleanup

scribus-commit scribus-commit at lists.scribus.net
Sat Nov 6 13:51:11 UTC 2021


Author: jghali
Date: Sat Nov  6 13:51:10 2021
New Revision: 24768

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24768
Log:
Code cleanup

Modified:
    trunk/Scribus/scribus/main_win32.cpp

Modified: trunk/Scribus/scribus/main_win32.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24768&path=/trunk/Scribus/scribus/main_win32.cpp
==============================================================================
--- trunk/Scribus/scribus/main_win32.cpp	(original)
+++ trunk/Scribus/scribus/main_win32.cpp	Sat Nov  6 13:51:10 2021
@@ -39,7 +39,6 @@
 #include <QApplication>
 #include <QMessageBox>
 #include <exception>
-using namespace std;
 
 #define MAX_LINES 500
 
@@ -53,6 +52,8 @@
 #include <windows.h>
 #include <wincon.h>
 
+using namespace std;
+
 int mainApp(ScribusQApp& app);
 
 // Windows exception handling
@@ -72,9 +73,9 @@
 extern const char ARG_CONSOLE[];
 extern const char ARG_CONSOLE_SHORT[];
 
-ScribusCore SCRIBUS_API *ScCore;
-ScribusQApp SCRIBUS_API *ScQApp;
-bool emergencyActivated;
+ScribusCore SCRIBUS_API* ScCore { nullptr };
+ScribusQApp SCRIBUS_API *ScQApp { nullptr };
+bool emergencyActivated { false };
 
 #if !defined(_CONSOLE)
 #if defined(_DEBUG)
@@ -103,7 +104,7 @@
 #endif
 
 	ScribusQApp app(argc, argv);
-	setPythonEnvironment(app.applicationDirPath());
+	setPythonEnvironment(ScribusQApp::applicationDirPath());
 	result =  mainApp(app);
 
 	return result;
@@ -131,8 +132,8 @@
 		appRetVal = app.init();
 		if (appRetVal != EXIT_FAILURE)
 		{
-			if (app.useGUI)
-				appRetVal = app.exec();
+			if (ScribusQApp::useGUI)
+				appRetVal = ScribusQApp::exec();
 		}
 #ifndef _DEBUG
 	}
@@ -175,7 +176,7 @@
 	tmp += "\\python\\tcl";
 	_wputenv((const wchar_t*) tmp.utf16());
 
-	wchar_t* oldenv = _wgetenv(L"PATH");
+	const wchar_t* oldenv = _wgetenv(L"PATH");
 	tmp = "PATH=";
 	tmp += nativePath;
 	tmp += ";";




More information about the scribus-commit mailing list