r21029 by craig -

scribus-commit scribus-commit at lists.scribus.net
Tue Feb 23 21:25:45 UTC 2016


Author: craig
Date: Tue Feb 23 21:25:45 2016
New Revision: 21029

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=21029
Log:
Make HelpBrowser try to use the new user help files directory first, then revert to the system dir

Modified:
    trunk/Scribus/scribus/ui/helpbrowser.cpp

Modified: trunk/Scribus/scribus/ui/helpbrowser.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21029&path=/trunk/Scribus/scribus/ui/helpbrowser.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/helpbrowser.cpp	(original)
+++ trunk/Scribus/scribus/ui/helpbrowser.cpp	Tue Feb 23 21:25:45 2016
@@ -546,19 +546,22 @@
 
 void HelpBrowser::loadMenu()
 {
-	QString baseHelpDir = ScPaths::instance().docDir();
-	QString altHelpDir  = ScPaths::instance().getApplicationDataDir();
+//	QString baseHelpDir = ScPaths::instance().docDir();
+//	QString altHelpDir  = ScPaths::instance().getApplicationDataDir();
+	QString baseHelpDir = ScPaths::instance().getUserHelpFilesDir(false);
+	QString installHelpDir  = ScPaths::instance().docDir();
+
 	QString baseHelpMenuFile = QDir::toNativeSeparators(baseHelpDir + language + "/menu.xml");
-	QString altHelpMenuFile = QDir::toNativeSeparators(altHelpDir + "doc/" + language + "/menu.xml");
+	QString installHelpMenuFile = QDir::toNativeSeparators(installHelpDir + language + "/menu.xml");
 	QFileInfo baseFi = QFileInfo(baseHelpMenuFile);
-	QFileInfo altFi = QFileInfo(altHelpMenuFile);
+	QFileInfo installFi = QFileInfo(installHelpMenuFile);
 	QString toLoad = baseHelpMenuFile;
 	if (!baseFi.exists())
 	{
-		if (altFi.exists())
-		{
-			toLoad=altHelpMenuFile;
-			baseFi=altFi;
+		if (installFi.exists())
+		{
+			toLoad=installHelpMenuFile;
+			baseFi=installFi;
 		}
 		else		
 		{
@@ -566,7 +569,7 @@
 			{
 				//Check if we can load, eg "de" when "de_CH" docs don't exist
 				QString baseHelpMenuFile3 = QDir::toNativeSeparators(baseHelpDir + language.left(2) + "/menu.xml");
-				QString altHelpMenuFile3 = QDir::toNativeSeparators(altHelpDir + "doc/" + language.left(2) + "/menu.xml");
+				QString altHelpMenuFile3 = QDir::toNativeSeparators(installHelpDir + "doc/" + language.left(2) + "/menu.xml");
 				QFileInfo fi3 = QFileInfo(baseHelpMenuFile3);
 				QFileInfo altfi3 = QFileInfo(altHelpMenuFile3);
 				if (fi3.exists())
@@ -596,6 +599,11 @@
 			baseFi = QFileInfo(toLoad);
 		}
 	}
+	else
+	{
+		if (installFi.exists())
+			baseFi=installFi;
+	}
 	//Set our final location for loading the help files
 	finalBaseDir=baseFi.path();
 	textBrowser->setSearchPaths(QStringList(finalBaseDir));




More information about the scribus-commit mailing list