summaryrefslogtreecommitdiff
path: root/src/frontend/cinfodisplay.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/frontend/cinfodisplay.cpp')
-rw-r--r--src/frontend/cinfodisplay.cpp44
1 files changed, 23 insertions, 21 deletions
diff --git a/src/frontend/cinfodisplay.cpp b/src/frontend/cinfodisplay.cpp
index e9c2811..59aa452 100644
--- a/src/frontend/cinfodisplay.cpp
+++ b/src/frontend/cinfodisplay.cpp
@@ -7,34 +7,31 @@
*
**********/
-// BibleTime includes
-#include "cinfodisplay.h"
+#include "frontend/cinfodisplay.h"
+#include <boost/scoped_ptr.hpp>
+#include <QAction>
+#include <QDebug>
+#include <QLabel>
+#include <QLayout>
+#include <QRegExp>
+#include <QSize>
+#include <QVBoxLayout>
+#include <QtAlgorithms>
+
+#include "backend/config/cbtconfig.h"
#include "backend/drivers/cswordmoduleinfo.h"
#include "backend/keys/cswordkey.h"
#include "backend/keys/cswordversekey.h"
-#include "backend/managers/creferencemanager.h"
+#include "backend/managers/referencemanager.h"
#include "backend/managers/cdisplaytemplatemgr.h"
-
-#include "backend/config/cbtconfig.h"
#include "frontend/crossrefrendering.h"
-
#include "frontend/display/cdisplay.h"
#include "frontend/display/creaddisplay.h"
-#include <boost/scoped_ptr.hpp>
-
-// Sword includes
+// Sword includes:
#include <listkey.h>
-// Qt includes
-#include <QLayout>
-#include <QLabel>
-#include <QRegExp>
-#include <QVBoxLayout>
-#include <QAction>
-#include <QDebug>
-#include <QSize>
using namespace Rendering;
using namespace sword;
@@ -85,7 +82,7 @@ CInfoDisplay::~CInfoDisplay() {
}
void CInfoDisplay::lookupInfo(const QString &mod_name, const QString &key_text) {
- qDebug("CInfoDisplay::lookup");
+ qDebug() << "CInfoDisplay::lookup";
qDebug() << mod_name << key_text;
CSwordModuleInfo* m = CPointers::backend()->findModuleByName(mod_name);
Q_ASSERT(m);
@@ -288,13 +285,18 @@ const QString CInfoDisplay::decodeCrossReference( const QString& data ) {
// qWarning("rendered the tree: %s", renderer.renderKeyTree(tree).latin1());
//spanns containing rtl text need dir=rtl on their parent tag to be aligned properly
QString lang = "en"; // default english
- if (module)
+ if (module) {
lang = module->language()->abbrev();
+ }
+
+ QString RenderedText = renderer.renderKeyTree(tree);
+ qDeleteAll(tree);
+
return QString("<div class=\"crossrefinfo\" lang=\"%1\"><h3>%2</h3><div class=\"para\" dir=\"%3\">%4</div></div>")
.arg(lang)
.arg(tr("Cross references"))
.arg(module ? ((module->textDirection() == CSwordModuleInfo::LeftToRight) ? "ltr" : "rtl") : "")
- .arg(renderer.renderKeyTree(tree));
+ .arg(RenderedText);
}
/*!
@@ -426,7 +428,7 @@ const QString CInfoDisplay::decodeMorph( const QString& data ) {
break;
default:
skipFirstChar = false;
- //TODO: we can't tell here if it's a greek or hebrew moprh code, that's a problem we have to solve
+ /// \todo we can't tell here if it's a greek or hebrew moprh code, that's a problem we have to solve
// module = CBTConfig::get(CBTConfig::standardGreekMorphLexicon);
break;
}