r22650 by jghali - code style fixes

scribus-commit scribus-commit at lists.scribus.net
Sat Aug 25 21:11:28 UTC 2018


Author: jghali
Date: Sat Aug 25 21:11:28 2018
New Revision: 22650

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22650
Log:
code style fixes

Modified:
    trunk/Scribus/scribus/scpaths.cpp

Modified: trunk/Scribus/scribus/scpaths.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22650&path=/trunk/Scribus/scribus/scpaths.cpp
==============================================================================
--- trunk/Scribus/scribus/scpaths.cpp	(original)
+++ trunk/Scribus/scribus/scpaths.cpp	Sat Aug 25 21:11:28 2018
@@ -118,15 +118,15 @@
 		QApplication::setLibraryPaths( QStringList(qtpluginDir) );
 #endif
 	
-// 	if(!m_shareDir.endsWith("/"))        m_shareDir += "/";
-// 	if(!m_docDir.endsWith("/"))          m_docDir += "/";
-// 	if(!m_fontDir.endsWith("/"))         m_fontDir += "/";
-	if(!m_iconDir.endsWith("/"))         m_iconDir += "/";
-// 	if(!m_sampleScriptDir.endsWith("/")) m_sampleScriptDir += "/";
-// 	if(!m_scriptDir.endsWith("/"))       m_scriptDir += "/";
-// 	if(!m_templateDir.endsWith("/"))     m_templateDir += "/";
-// 	if(!m_libDir.endsWith("/"))          m_libDir += "/";
-// 	if(!m_pluginDir.endsWith("/"))       m_pluginDir += "/";
+// 	if (!m_shareDir.endsWith("/"))        m_shareDir += "/";
+// 	if (!m_docDir.endsWith("/"))          m_docDir += "/";
+// 	if (!m_fontDir.endsWith("/"))         m_fontDir += "/";
+	if (!m_iconDir.endsWith("/"))         m_iconDir += "/";
+// 	if (!m_sampleScriptDir.endsWith("/")) m_sampleScriptDir += "/";
+// 	if (!m_scriptDir.endsWith("/"))       m_scriptDir += "/";
+// 	if (!m_templateDir.endsWith("/"))     m_templateDir += "/";
+// 	if (!m_libDir.endsWith("/"))          m_libDir += "/";
+// 	if (!m_pluginDir.endsWith("/"))       m_pluginDir += "/";
 }
 
 ScPaths::~ScPaths() {};
@@ -396,7 +396,7 @@
 	fontDirs.append("/Network/Library/Fonts/");
 	fontDirs.append("/System/Library/Fonts/");
 #elif defined(_WIN32)
-	fontDirs.append( windowsSpecialDir(CSIDL_FONTS) );
+	fontDirs.append(windowsSpecialDir(CSIDL_FONTS));
 #endif
 	return fontDirs;
 }
@@ -420,21 +420,21 @@
 	// On Windows it's more complicated, profiles location depends on OS version
 	WCHAR sysDir[MAX_PATH + 1];
 	OSVERSIONINFO osVersion;
-	ZeroMemory( &osVersion, sizeof(OSVERSIONINFO));
+	ZeroMemory(&osVersion, sizeof(OSVERSIONINFO));
 	osVersion.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); // Necessary for GetVersionEx to succeed
 	GetVersionEx(&osVersion);  // Get Windows version infos
-	GetSystemDirectoryW( sysDir, MAX_PATH ); // windowsSpecialDir(CSIDL_SYSTEM) fails on Win9x
+	GetSystemDirectoryW(sysDir, MAX_PATH); // windowsSpecialDir(CSIDL_SYSTEM) fails on Win9x
 	QString winSysDir = QString::fromUtf16((const ushort*) sysDir);
 	winSysDir = winSysDir.replace('\\','/');
-	if( osVersion.dwPlatformId == VER_PLATFORM_WIN32_NT	) // Windows NT/2k/XP
-	{
-		if( osVersion.dwMajorVersion >= 5 ) // for 2k and XP dwMajorVersion == 5 
-			iccProfDirs.append( winSysDir + "/Spool/Drivers/Color/");
-	}
-	else if( osVersion.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS ) // Windows 9x/Me 
-	{
-		if( osVersion.dwMajorVersion >= 4 && osVersion.dwMinorVersion >= 10) // Win98 or WinMe
-			iccProfDirs.append( winSysDir + "/Color/");
+	if (osVersion.dwPlatformId == VER_PLATFORM_WIN32_NT) // Windows NT/2k/XP
+	{
+		if (osVersion.dwMajorVersion >= 5) // for 2k and XP dwMajorVersion == 5 
+			iccProfDirs.append(winSysDir + "/Spool/Drivers/Color/");
+	}
+	else if (osVersion.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) // Windows 9x/Me 
+	{
+		if (osVersion.dwMajorVersion >= 4 && osVersion.dwMinorVersion >= 10) // Win98 or WinMe
+			iccProfDirs.append(winSysDir + "/Color/");
 	}
 #endif
 	return iccProfDirs;
@@ -484,11 +484,11 @@
 	QString commonAppData = windowsSpecialDir(CSIDL_COMMON_APPDATA);
 	QString programFilesCommon = windowsSpecialDir(CSIDL_PROGRAM_FILES_COMMON);
 	createDirs.append(windowsSpecialDir(CSIDL_APPDATA) + "create/swatches/");
-	if ( !localAppData.isEmpty() )
+	if (!localAppData.isEmpty())
 		createDirs.append(localAppData + "create/swatches/");
-	if ( !commonAppData.isEmpty() )
+	if (!commonAppData.isEmpty())
 		createDirs.append(commonAppData + "create/swatches/");
-	if ( !programFilesCommon.isEmpty() )
+	if (!programFilesCommon.isEmpty())
 		createDirs.append(programFilesCommon + "create/swatches/");
 #endif
 	return createDirs;
@@ -561,7 +561,7 @@
 QString ScPaths::pluginDataDir(bool createIfNotExists)
 {
 	QDir useFilesDirectory(applicationDataDir() + "plugins/");
-	if(createIfNotExists && !useFilesDirectory.exists())
+	if (createIfNotExists && !useFilesDirectory.exists())
 		useFilesDirectory.mkpath(useFilesDirectory.absolutePath());
 	return useFilesDirectory.absolutePath()+"/";
 }
@@ -574,7 +574,7 @@
 	if (dictType == ScPaths::Spell)
 		dictSuffix = "spell/";
 	QDir useFilesDirectory(applicationDataDir() + "dicts/" + dictSuffix);
-	if(createIfNotExists && !useFilesDirectory.exists())
+	if (createIfNotExists && !useFilesDirectory.exists())
 		useFilesDirectory.mkpath(useFilesDirectory.absolutePath());
 	return useFilesDirectory.absolutePath()+"/";
 }
@@ -582,7 +582,7 @@
 QString ScPaths::userFontDir(bool createIfNotExists)
 {
 	QDir useFilesDirectory(applicationDataDir() + "fonts/");
-	if(createIfNotExists && !useFilesDirectory.exists())
+	if (createIfNotExists && !useFilesDirectory.exists())
 		useFilesDirectory.mkpath(useFilesDirectory.absolutePath());
 	return useFilesDirectory.absolutePath()+"/";
 }
@@ -590,7 +590,7 @@
 QString ScPaths::userHelpFilesDir(bool createIfNotExists)
 {
 	QDir useFilesDirectory(applicationDataDir() + "helpfiles/");
-	if(createIfNotExists && !useFilesDirectory.exists())
+	if (createIfNotExists && !useFilesDirectory.exists())
 		useFilesDirectory.mkpath(useFilesDirectory.absolutePath());
 	return useFilesDirectory.absolutePath()+"/";
 }
@@ -598,7 +598,7 @@
 QString ScPaths::userPaletteFilesDir(bool createIfNotExists)
 {
 	QDir useFilesDirectory(applicationDataDir() + "palettes/");
-	if(createIfNotExists && !useFilesDirectory.exists())
+	if (createIfNotExists && !useFilesDirectory.exists())
 	{
 		useFilesDirectory.mkpath(useFilesDirectory.absolutePath());
 		useFilesDirectory.mkpath(useFilesDirectory.absolutePath() + "/locked");
@@ -611,7 +611,7 @@
 	if (PrefsManager::instance()->appPrefs.pathPrefs.documentTemplates.isEmpty())
 		return QString();
 	QDir useFilesDirectory(PrefsManager::instance()->appPrefs.pathPrefs.documentTemplates);
-	if(createIfNotExists && !useFilesDirectory.exists())
+	if (createIfNotExists && !useFilesDirectory.exists())
 		useFilesDirectory.mkpath(useFilesDirectory.absolutePath());
 	return useFilesDirectory.absolutePath()+"/";
 }
@@ -627,7 +627,7 @@
 QString ScPaths::scrapbookDir(bool createIfNotExists)
 {
 	QDir useFilesDirectory(applicationDataDir() + "scrapbook/");
-	if(createIfNotExists && !useFilesDirectory.exists())
+	if (createIfNotExists && !useFilesDirectory.exists())
 	{
 		useFilesDirectory.mkpath(useFilesDirectory.absolutePath());
 		useFilesDirectory.mkpath(useFilesDirectory.absolutePath() + "/main");
@@ -642,10 +642,10 @@
 	QString tempPath;
 	WCHAR wTempPath[1024];
 	DWORD result = GetTempPathW(1024, wTempPath);
-	if ( result )
+	if (result)
 	{
 		tempPath = QString::fromUtf16((const unsigned short*) wTempPath);
-		tempPath.replace( '\\', '/' );
+		tempPath.replace('\\', '/');
 		tempPath += "/";
 		// GetTempPath may return Windows directory, better not use this one
 		// for temporary files
@@ -673,12 +673,12 @@
 	QString qstr;
 #ifdef Q_OS_WIN32
 	WCHAR dir[256];
-	if ( SHGetSpecialFolderPathW(nullptr, dir, folder , false) )
+	if (SHGetSpecialFolderPathW(nullptr, dir, folder , false))
 	{
 		qstr = QString::fromUtf16((const unsigned short*) dir);
-		if( !qstr.endsWith("\\") )
+		if (!qstr.endsWith("\\"))
 			qstr += "\\";
-		qstr.replace( '\\', '/' );
+		qstr.replace('\\', '/');
 	}
 #else
 	Q_ASSERT(false);




More information about the scribus-commit mailing list