r19830 by craig - Some cleanup in scribuscore
scribus-commit
scribus-commit at lists.scribus.net
Thu Feb 19 07:08:08 UTC 2015
Author: craig
Date: Thu Feb 19 07:08:08 2015
New Revision: 19830
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19830
Log:
Some cleanup in scribuscore
Modified:
trunk/Scribus/scribus/scribuscore.cpp
Modified: trunk/Scribus/scribus/scribuscore.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19830&path=/trunk/Scribus/scribus/scribuscore.cpp
==============================================================================
--- trunk/Scribus/scribus/scribuscore.cpp (original)
+++ trunk/Scribus/scribus/scribuscore.cpp Thu Feb 19 07:08:08 2015
@@ -54,15 +54,12 @@
m_UseGUI=false;
m_HaveCMS=false;
m_currScMW=0;
-
ScColorMgmtStrategy strategy;
strategy.useBlackPointCompensation = true;
strategy.useBlackPreservation = false;
defaultEngine.setStrategy(strategy);
}
-
-
ScribusCore::~ScribusCore()
{
while (ScMWList.count() > 0)
@@ -80,7 +77,6 @@
// if(t!=QtDebugMsg) assert(false);
}
#endif
-
int ScribusCore::init(bool useGUI, const QList<QString>& filesToUse)
{
@@ -89,7 +85,6 @@
#if !defined(NDEBUG) && !defined(_WIN32)
qInstallMsgHandler( & abort_on_error );
#endif
-
return 0;
}
@@ -140,7 +135,6 @@
{
scribus->slotRaiseOnlineHelp();
}
-
return EXIT_SUCCESS;
}
@@ -148,7 +142,6 @@
const QString newGuiLanguage, const QString prefsUserFile)
{
CommonStrings::languageChange();
- int retVal=0;
// FIXME: Splash needs the prefs loaded by initDefaults() to know if it must force the image to grayscale
initSplash(showSplash);
LocaleManager::instance();
@@ -156,11 +149,7 @@
prefsManager->setup();
//CB #4428 Get fonts before prefs are set to default
bool haveFonts=false;
-//#ifdef Q_OS_MAC
-// haveFonts=ScCore->initFonts(true);
-//#else
haveFonts=ScCore->initFonts(showFontInfo);
-//#endif
if (!haveFonts)
return 1;
prefsManager->initDefaults();
@@ -169,18 +158,7 @@
undoManager = UndoManager::instance();
fileWatcher = new FileWatcher(this);
pluginManager = new PluginManager();
-// setSplashStatus( tr("Initializing Plugins") );
-// pluginManager->initPlugs();
-/* #4428, remove block later if ok
- bool haveFonts=false;
-#ifdef Q_OS_MAC
- haveFonts=ScCore->initFonts(true);
-#else
- haveFonts=ScCore->initFonts(showFontInfo);
-#endif
- if (!haveFonts)
- return 1;
-*/
+
setSplashStatus( tr("Initializing Keyboard Shortcuts") );
prefsManager->initDefaultActionKeys();
setSplashStatus( tr("Reading Preferences") );
@@ -189,8 +167,6 @@
else
prefsManager->ReadPrefs(prefsUserFile);
prefsManager->appPrefs.uiPrefs.showSplashOnStartup=showSplash;
-// setSplashStatus( tr("Applying User Shortcuts") );
-// prefsManager->applyLoadedShortCuts();
m_HaveGS = testGSAvailability();
m_HavePngAlpha = testGSDeviceAvailability("pngalpha");
@@ -210,32 +186,26 @@
icm.setMaxCacheEntries(prefsManager->appPrefs.imageCachePrefs.maxCacheEntries);
icm.setCompressionLevel(prefsManager->appPrefs.imageCachePrefs.compressionLevel);
icm.initialize();
-
- return retVal;
-}
-
+ return 0;
+}
void ScribusCore::initSplash(bool showSplash)
{
- if (showSplash)
- {
- //QPixmap pix = loadIcon("Splash.png", true);
- QPixmap pix = loadIcon("scribus_splash.png", true);
- //ScSplashScreen::writeVersion(&pix);
- m_SplashScreen = new ScSplashScreen(pix, Qt::WindowStaysOnTopHint);
- if (m_SplashScreen != NULL)
- m_SplashScreen->show();
- if (m_SplashScreen != NULL && m_SplashScreen->isVisible())
- setSplashStatus(QObject::tr("Initializing..."));
- }
- else
- m_SplashScreen = NULL;
+ m_SplashScreen = NULL;
+ if (!showSplash)
+ return;
+ QPixmap pix = loadIcon("scribus_splash.png", true);
+ m_SplashScreen = new ScSplashScreen(pix, Qt::WindowStaysOnTopHint);
+ if (m_SplashScreen != NULL)
+ m_SplashScreen->show();
+ if (m_SplashScreen != NULL && m_SplashScreen->isVisible())
+ setSplashStatus(QObject::tr("Initializing..."));
}
void ScribusCore::setSplashStatus(const QString& newText)
{
if (m_SplashScreen != NULL)
- m_SplashScreen->setStatus( newText );
+ m_SplashScreen->setStatus( newText );
}
void ScribusCore::showSplash(bool shown)
@@ -246,19 +216,18 @@
bool ScribusCore::splashShowing() const
{
- if (m_SplashScreen != NULL)
- return m_SplashScreen->isVisible();
- return false;
+ if (m_SplashScreen == NULL)
+ return false;
+ return m_SplashScreen->isVisible();
}
void ScribusCore::closeSplash()
{
- if (m_SplashScreen!=NULL)
- {
- m_SplashScreen->close();
- delete m_SplashScreen;
- m_SplashScreen = NULL;
- }
+ if (m_SplashScreen==NULL)
+ return;
+ m_SplashScreen->close();
+ delete m_SplashScreen;
+ m_SplashScreen = NULL;
}
bool ScribusCore::usingGUI() const
@@ -312,11 +281,9 @@
PrinterProfiles.clear();
InputProfiles.clear();
InputProfilesCMYK.clear();
- QString pfad = ScPaths::instance().shareDir();
- pfad += "profiles/";
profDirs = ScPaths::getSystemProfilesDirs();
profDirs.prepend( prefsManager->appPrefs.pathPrefs.colorProfiles );
- profDirs.prepend( pfad );
+ profDirs.prepend( ScPaths::instance().shareDir()+"profiles/");
for(int i = 0; i < profDirs.count(); i++)
{
profDir = profDirs[i];
@@ -534,7 +501,7 @@
}
}
-ScribusMainWindow * ScribusCore::primaryMainWindow( )
+ScribusMainWindow * ScribusCore::primaryMainWindow()
{
if (ScMWList.count() == 0 || m_currScMW > ScMWList.count())
return 0;
More information about the scribus-commit
mailing list