summaryrefslogtreecommitdiff
path: root/src/backend/filters/bt_thmlhtml.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/filters/bt_thmlhtml.cpp')
-rw-r--r--src/backend/filters/bt_thmlhtml.cpp46
1 files changed, 23 insertions, 23 deletions
diff --git a/src/backend/filters/bt_thmlhtml.cpp b/src/backend/filters/bt_thmlhtml.cpp
index 4ee333d..478339c 100644
--- a/src/backend/filters/bt_thmlhtml.cpp
+++ b/src/backend/filters/bt_thmlhtml.cpp
@@ -7,25 +7,24 @@
*
**********/
-//BibleTime includes
-#include "bt_thmlhtml.h"
-#include "backend/managers/clanguagemgr.h"
-#include "backend/drivers/cswordmoduleinfo.h"
-#include "backend/managers/creferencemanager.h"
+#include "backend/filters/bt_thmlhtml.h"
+#include <QString>
+#include <QRegExp>
+#include <QUrl>
+#include <QTextCodec>
#include "backend/config/cbtconfig.h"
+#include "backend/drivers/cswordmoduleinfo.h"
+#include "backend/managers/clanguagemgr.h"
+#include "backend/managers/referencemanager.h"
#include "util/cpointers.h"
-#include <boost/scoped_ptr.hpp>
-//Sword includes
+// Sword includes:
#include <swmodule.h>
+#include <utilstr.h>
#include <utilxml.h>
#include <versekey.h>
-#include <utilstr.h>
-//Qt includes
-#include <QString>
-#include <QRegExp>
Filters::BT_ThMLHTML::BT_ThMLHTML() {
setEscapeStringCaseSensitive(true);
@@ -258,7 +257,7 @@ bool Filters::BT_ThMLHTML::handleToken(sword::SWBuf &buf, const char *token, swo
CSwordModuleInfo* mod = CBTConfig::get(CBTConfig::standardBible);
//Q_ASSERT(mod); tested later
if (mod) {
- CReferenceManager::ParseOptions options;
+ ReferenceManager::ParseOptions options;
options.refBase = QString::fromUtf8(myUserData->key->getText()); //current module key
options.refDestinationModule = QString(mod->name());
options.sourceLanguage = QString(myModule->Lang());
@@ -274,7 +273,7 @@ bool Filters::BT_ThMLHTML::handleToken(sword::SWBuf &buf, const char *token, swo
if (! oldRef.isEmpty() ) {
options.refBase = oldRef; //use the last ref as a base, e.g. Rom 1,2-3, when the next ref is only 3:3-10
}
- const QString completeRef( CReferenceManager::parseVerseReference((*it), options) );
+ const QString completeRef( ReferenceManager::parseVerseReference((*it), options) );
oldRef = completeRef; //use the parsed result as the base for the next ref.
@@ -284,10 +283,10 @@ bool Filters::BT_ThMLHTML::handleToken(sword::SWBuf &buf, const char *token, swo
buf.append("<a href=\"");
buf.append(
- CReferenceManager::encodeHyperlink(
+ ReferenceManager::encodeHyperlink(
mod->name(),
completeRef,
- CReferenceManager::typeFromModule(mod->type())
+ ReferenceManager::typeFromModule(mod->type())
).toUtf8().constData()
);
@@ -317,23 +316,23 @@ bool Filters::BT_ThMLHTML::handleToken(sword::SWBuf &buf, const char *token, swo
CSwordModuleInfo* mod = CBTConfig::get(CBTConfig::standardBible);
//Q_ASSERT(mod); tested later
- CReferenceManager::ParseOptions options;
+ ReferenceManager::ParseOptions options;
options.refBase = QString::fromUtf8(myUserData->key->getText());
options.sourceLanguage = myModule->Lang();
options.destinationLanguage = QString("en");
- const QString completeRef = CReferenceManager::parseVerseReference(QString::fromUtf8(ref), options);
+ const QString completeRef = ReferenceManager::parseVerseReference(QString::fromUtf8(ref), options);
if (mod) {
options.refDestinationModule = QString(mod->name());
buf.append("<span class=\"crossreference\">");
buf.append("<a href=\"");
buf.append(
- CReferenceManager::encodeHyperlink(
+ ReferenceManager::encodeHyperlink(
mod->name(),
completeRef,
- CReferenceManager::typeFromModule(mod->type())
+ ReferenceManager::typeFromModule(mod->type())
).toUtf8().constData()
);
buf.append("\" crossrefs=\"");
@@ -370,10 +369,11 @@ bool Filters::BT_ThMLHTML::handleToken(sword::SWBuf &buf, const char *token, swo
value++; //strip the first /
}
- buf.append("<img src=\"file:");
- buf.append(myUserData->module->getConfigEntry("AbsoluteDataPath"));
- buf.append('/');
- buf.append(value);
+ buf.append("<img src=\"");
+ QString absPath(QTextCodec::codecForLocale()->toUnicode(myUserData->module->getConfigEntry("AbsoluteDataPath")));
+ QString relPath(QString::fromUtf8(value));
+ QString url(QUrl::fromLocalFile(absPath.append('/').append(relPath)).toString());
+ buf.append(url.toUtf8().data());
buf.append("\" />");
}
else { // let unknown token pass thru