summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Cord-Landwehr <cordlandwehr@kde.org>2016-10-23 09:09:16 (GMT)
committerAndreas Cord-Landwehr <cordlandwehr@kde.org>2016-10-23 09:09:16 (GMT)
commitb2e5193e3d93dcf687e4f562b8e7bf9ea3b738fb (patch)
tree7fc979dd47f600f0b25f7064cc54b837984bbf37
parent2d5de6b0fbecf677cb35db742d02d5aeb3438c40 (diff)
Revisit glossary dialog porting
-rw-r--r--src/kalzium.cpp8
-rw-r--r--src/kdeeduglossary.cpp4
2 files changed, 6 insertions, 6 deletions
diff --git a/src/kalzium.cpp b/src/kalzium.cpp
index 852e608..5986af4 100644
--- a/src/kalzium.cpp
+++ b/src/kalzium.cpp
@@ -341,14 +341,14 @@ void Kalzium::slotGlossary()
m_glossarydlg->setObjectName(QLatin1String("glossary"));
QString dir = QStandardPaths::locate(QStandardPaths::DataLocation, "data/", QStandardPaths::LocateDirectory);
dir = QFileInfo(dir).absolutePath();
- QString picturepath = dir + "kalzium/data/bg.jpg";
- QUrl u = QUrl::fromLocalFile(dir + "kalzium/data/knowledge.xml");
+ QString picturepath = dir + "/bg.jpg";
+ QUrl u = QUrl::fromLocalFile(dir + "/knowledge.xml");
Glossary *g = new Glossary(u);
g->setName(i18n("Knowledge"));
g->setBackgroundPicture(picturepath);
m_glossarydlg->addGlossary(g, true);
- u = QUrl::fromLocalFile(dir + "kalzium/data/tools.xml");
- g = new Glossary(u, dir + "kalzium/data/toolpics/");
+ u = QUrl::fromLocalFile(dir + "/tools.xml");
+ g = new Glossary(u, dir + "/toolpics/");
g->setName(i18n("Tools"));
g->setBackgroundPicture(picturepath);
m_glossarydlg->addGlossary(g, true);
diff --git a/src/kdeeduglossary.cpp b/src/kdeeduglossary.cpp
index 4cd2168..0820fe7 100644
--- a/src/kdeeduglossary.cpp
+++ b/src/kdeeduglossary.cpp
@@ -210,7 +210,7 @@ void Glossary::setBackgroundPicture(const QString& filename)
void Glossary::fixImagePath()
{
- QString imgtag = "<img src=\"" + m_picturepath + '/' + "\\1\" />";
+ QString imgtag = "<img src=\"file://" + m_picturepath + '/' + "\\1\" />";
QRegExp exp("\\[img\\]([^[]+)\\[/img\\]");
foreach (GlossaryItem * item, m_itemlist) {
@@ -469,7 +469,7 @@ void GlossaryDialog::Private::itemActivated(QTreeWidgetItem * item, int column)
QString html;
QString bg_picture = glosstreeitem->glossary()->backgroundPicture();
if (!bg_picture.isEmpty()) {
- html = " background=\"" + bg_picture + "\"";
+ html = " background=\"file://" + bg_picture + "\"";
}
html = m_htmlbasestring.arg(html);