r17397 by fschmid - Fixed Bug 10616: "Self created external tools files in $INSTALLDIR/editorconfig need to get found automatically"

scribus-commit scribus-commit at lists.scribus.net
Thu Mar 22 22:27:29 UTC 2012


Author: fschmid
Date: Thu Mar 22 22:27:28 2012
New Revision: 17397

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17397
Log:
Fixed Bug 10616: "Self created external tools files in $INSTALLDIR/editorconfig need to get found automatically"

Modified:
    trunk/Scribus/scribus/prefsmanager.cpp

Modified: trunk/Scribus/scribus/prefsmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17397&path=/trunk/Scribus/scribus/prefsmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/prefsmanager.cpp (original)
+++ trunk/Scribus/scribus/prefsmanager.cpp Thu Mar 22 22:27:28 2012
@@ -1877,7 +1877,6 @@
 	if (!prefs150FileFound)
 		return false;
 	appPrefs.colorPrefs.DColors.clear();
-	appPrefs.extToolPrefs.latexCommands.clear();
 	ColorSetManager csm;
 	csm.initialiseDefaultPrefs(appPrefs);
 	csm.findPaletteLocations();
@@ -2359,7 +2358,7 @@
 			setUniconvExecutable(dc.attribute("Uniconvertor", "uniconv"));
 			setLatexEditorExecutable(dc.attribute("LatexEditor", ""));
 			appPrefs.extToolPrefs.pdfViewerExecutable=dc.attribute("PDFViewer", "");
-			QStringList configs;
+			QStringList configs = appPrefs.extToolPrefs.latexConfigs;
 			QDomNodeList configNodes = dc.elementsByTagName("LatexConfig");
 			QString latexBase = LatexConfigParser::configBase();
 			for (int i=0; i < configNodes.size(); i++)
@@ -2367,16 +2366,21 @@
 				QString confFile = configNodes.at(i).toElement().attribute("file", "");
 				QString command  = configNodes.at(i).toElement().attribute("command", "");
 				bool configExists = !confFile.isEmpty() && (QFile::exists(confFile) || QFile::exists(latexBase+confFile));
-				if (!configs.contains(confFile) && configExists) {
-					configs.append(confFile);
+				if (configExists)
+				{
+					if (!configs.contains(confFile))
+						configs.append(confFile);
 					appPrefs.extToolPrefs.latexCommands[confFile] = command;
 				}
 			}
-			if (!configs.isEmpty()) {
+			if (!configs.isEmpty())
 				setLatexConfigs(configs);
-			} else {
+			else
+			{
 				qWarning() << tr("No valid renderframe config found. Using defaults!");
-				setLatexConfigs(LatexConfigCache::defaultConfigs());
+//				setLatexConfigs(LatexConfigCache::defaultConfigs());
+				appPrefs.extToolPrefs.latexConfigs = LatexConfigCache::defaultConfigs();
+				appPrefs.extToolPrefs.latexCommands = LatexConfigCache::defaultCommands();
 			}
 		}
 		if (dc.tagName()=="Hyphenator")




More information about the scribus-commit mailing list