File kseg-setFilePath.patch of Package kseg
diff -ur kseg/KSegWindow.cpp kseg.orig/KSegWindow.cpp
--- kseg/KSegWindow.cpp 2007-06-08 14:07:49 +0400
+++ kseg.orig/KSegWindow.cpp 2007-06-08 14:46:58 +0400
@@ -950,17 +950,16 @@
void KSegWindow::help()
{
QString langChars = KSegProperties::getProperty("Language").mid(5, 2);
- QString helpSource = KSegProperties::getProperty("LanguageDir") + "/kseg_help_";
- helpSource = helpSource + langChars + ".html";
+ QString langDir = KSegProperties::getProperty("LanguageDir");
+ QString helpSource = "kseg_help_" + langChars + ".html";
//the above assumes the language is kseg_??.qm and the helpfile is in the language directory
- if(QFileInfo(helpSource).exists() == false)
- helpSource = KSegProperties::getProperty("LanguageDir") + "/kseg_help_en.html";
+ if(QFileInfo(langDir + "/" + helpSource).exists() == false)
+ helpSource = "kseg_help_en.html";
- if(QFileInfo(helpSource).exists() == false) {
+ if(QFileInfo(langDir + "/" + helpSource).exists() == false) {
QMessageBox::warning(0, tr("File Not Found"),
- tr("Sorry, I am afraid that file %1 does not exist.").arg(helpSource),
- QMessageBox::Ok, 0);
+ tr("Sorry, I am afraid that file '%1' does not exist at '%2' directory.").arg(helpSource,langDir), QMessageBox::Ok, 0);
return;
}
@@ -973,6 +972,7 @@
charset = "text/html;charset=Windows-1254";
QTextBrowser *b = new QTextBrowser();
+ b->mimeSourceFactory()->setFilePath(langDir);
b->mimeSourceFactory()->setExtensionType("html", charset);
b->setSource(helpSource);
b->setCaption(b->documentTitle());