r20233 by jghali - fix help browser issue on Windows

scribus-commit scribus-commit at lists.scribus.net
Fri Jul 3 23:38:53 UTC 2015


Author: jghali
Date: Fri Jul  3 23:38:53 2015
New Revision: 20233

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20233
Log:
fix help browser issue on Windows

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

Modified: trunk/Scribus/scribus/ui/helpbrowser.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20233&path=/trunk/Scribus/scribus/ui/helpbrowser.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/helpbrowser.cpp (original)
+++ trunk/Scribus/scribus/ui/helpbrowser.cpp Fri Jul  3 23:38:53 2015
@@ -513,37 +513,34 @@
 void HelpBrowser::loadHelp(const QString& filename)
 {
 	struct histd2 his;
-	bool Avail = true;
+	bool Avail = false;
 	QString toLoad;
 	QFileInfo fi;
 	fi = QFileInfo(filename);
 	if (fi.fileName().length()>0)
 	{
 		if (fi.exists())
-			toLoad=filename;
+			toLoad = filename;
 		else
 		{
-			toLoad = QDir::toNativeSeparators(finalBaseDir + "/index.html");
-// 			language="en";
+			toLoad = finalBaseDir + "/index.html";
 			fi = QFileInfo(toLoad);
-			if (!fi.exists())
-			{
-				displayNoHelp();
-				Avail = false;
-			}
-		}
-	}
-	else
-		Avail=false;
+		}
+		Avail = fi.exists();
+	}
 	if (Avail)
 	{
-		textBrowser->setSource(toLoad);
+		textBrowser->setSource(QUrl::fromLocalFile(toLoad));
 		
 //		his.title = textBrowser->title();
 		if (his.title.isEmpty())
 			his.title = toLoad;
 		his.url = toLoad;
 		mHistory[histMenu->addAction(his.title)] = his;
+	}
+	else
+	{
+		displayNoHelp();
 	}
 	if (mHistory.count() > 15)
 	{
@@ -739,7 +736,7 @@
 	QString noHelpMsg=tr("<h2><p>Sorry, no manual is installed!</p><p>Please see:</p><ul><li>http://docs.scribus.net for updated documentation</li><li>http://www.scribus.net for downloads</li></ul></h2>",
 						 "HTML message for no documentation available to show");
 
-	textBrowser->setPlainText(noHelpMsg);
+	textBrowser->setHtml(noHelpMsg);
 	
 	filePrint->setEnabled(false);
 	editFind->setEnabled(false);




More information about the scribus-commit mailing list