Browse Source

Initial TQt conversion


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/bibletime@1173696 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
tags/v3.5.13
tpearson 9 years ago
parent
commit
62f474f240
100 changed files with 2132 additions and 2132 deletions
  1. 17
    17
      bibletime/backend/bt_gbfhtml.cpp
  2. 10
    10
      bibletime/backend/bt_osishtml.cpp
  3. 2
    2
      bibletime/backend/bt_plainhtml.cpp
  4. 34
    34
      bibletime/backend/bt_thmlhtml.cpp
  5. 1
    1
      bibletime/backend/btstringmgr.cpp
  6. 2
    2
      bibletime/backend/btstringmgr.h
  7. 8
    8
      bibletime/backend/cbookdisplay.cpp
  8. 2
    2
      bibletime/backend/cbookdisplay.h
  9. 3
    3
      bibletime/backend/cchapterdisplay.cpp
  10. 1
    1
      bibletime/backend/cchapterdisplay.h
  11. 21
    21
      bibletime/backend/cdisplayrendering.cpp
  12. 3
    3
      bibletime/backend/cdisplayrendering.h
  13. 26
    26
      bibletime/backend/cdisplaytemplatemgr.cpp
  14. 17
    17
      bibletime/backend/cdisplaytemplatemgr.h
  15. 4
    4
      bibletime/backend/centrydisplay.cpp
  16. 2
    2
      bibletime/backend/centrydisplay.h
  17. 16
    16
      bibletime/backend/chtmlexportrendering.cpp
  18. 3
    3
      bibletime/backend/chtmlexportrendering.h
  19. 13
    13
      bibletime/backend/clanguagemgr.cpp
  20. 26
    26
      bibletime/backend/clanguagemgr.h
  21. 5
    5
      bibletime/backend/cplaintextexportrendering.cpp
  22. 2
    2
      bibletime/backend/cplaintextexportrendering.h
  23. 31
    31
      bibletime/backend/creferencemanager.cpp
  24. 12
    12
      bibletime/backend/creferencemanager.h
  25. 56
    56
      bibletime/backend/cswordbackend.cpp
  26. 15
    15
      bibletime/backend/cswordbackend.h
  27. 9
    9
      bibletime/backend/cswordbiblemoduleinfo.cpp
  28. 8
    8
      bibletime/backend/cswordbiblemoduleinfo.h
  29. 25
    25
      bibletime/backend/cswordkey.cpp
  30. 9
    9
      bibletime/backend/cswordkey.h
  31. 8
    8
      bibletime/backend/cswordldkey.cpp
  32. 6
    6
      bibletime/backend/cswordldkey.h
  33. 22
    22
      bibletime/backend/cswordlexiconmoduleinfo.cpp
  34. 3
    3
      bibletime/backend/cswordlexiconmoduleinfo.h
  35. 91
    91
      bibletime/backend/cswordmoduleinfo.cpp
  36. 24
    24
      bibletime/backend/cswordmoduleinfo.h
  37. 3
    3
      bibletime/backend/cswordmodulesearch.cpp
  38. 7
    7
      bibletime/backend/cswordmodulesearch.h
  39. 11
    11
      bibletime/backend/cswordtreekey.cpp
  40. 6
    6
      bibletime/backend/cswordtreekey.h
  41. 11
    11
      bibletime/backend/cswordversekey.cpp
  42. 7
    7
      bibletime/backend/cswordversekey.h
  43. 26
    26
      bibletime/backend/ctextrendering.cpp
  44. 16
    16
      bibletime/backend/ctextrendering.h
  45. 9
    9
      bibletime/bibletime.cpp
  46. 27
    27
      bibletime/bibletime.h
  47. 23
    23
      bibletime/bibletime_dcop.cpp
  48. 57
    57
      bibletime/bibletime_init.cpp
  49. 36
    36
      bibletime/bibletime_slots.cpp
  50. 1
    1
      bibletime/bibletimeapp.cpp
  51. 14
    14
      bibletime/bibletimeinterface.h
  52. 54
    54
      bibletime/bibletimeinterface_skel.cpp
  53. 25
    25
      bibletime/frontend/btinstallmgr.cpp
  54. 14
    14
      bibletime/frontend/btinstallmgr.h
  55. 72
    72
      bibletime/frontend/cbtconfig.cpp
  56. 30
    30
      bibletime/frontend/cbtconfig.h
  57. 42
    42
      bibletime/frontend/cdragdropmgr.cpp
  58. 28
    28
      bibletime/frontend/cdragdropmgr.h
  59. 56
    56
      bibletime/frontend/cexportmanager.cpp
  60. 16
    16
      bibletime/frontend/cexportmanager.h
  61. 63
    63
      bibletime/frontend/cinfodisplay.cpp
  62. 15
    15
      bibletime/frontend/cinfodisplay.h
  63. 20
    20
      bibletime/frontend/cinputdialog.cpp
  64. 6
    6
      bibletime/frontend/cinputdialog.h
  65. 32
    32
      bibletime/frontend/cmanageindiceswidget.cpp
  66. 5
    5
      bibletime/frontend/cmanageindiceswidget.h
  67. 42
    42
      bibletime/frontend/cmdiarea.cpp
  68. 21
    21
      bibletime/frontend/cmdiarea.h
  69. 4
    4
      bibletime/frontend/cmoduleindexdialog.cpp
  70. 2
    2
      bibletime/frontend/cmoduleindexdialog.h
  71. 124
    124
      bibletime/frontend/coptionsdialog.cpp
  72. 46
    46
      bibletime/frontend/coptionsdialog.h
  73. 10
    10
      bibletime/frontend/cprinter.cpp
  74. 6
    6
      bibletime/frontend/cprinter.h
  75. 58
    58
      bibletime/frontend/cprofile.cpp
  76. 14
    14
      bibletime/frontend/cprofile.h
  77. 16
    16
      bibletime/frontend/cprofilemgr.cpp
  78. 7
    7
      bibletime/frontend/cprofilemgr.h
  79. 7
    7
      bibletime/frontend/cprofilewindow.cpp
  80. 13
    13
      bibletime/frontend/cprofilewindow.h
  81. 8
    8
      bibletime/frontend/crossrefrendering.cpp
  82. 2
    2
      bibletime/frontend/crossrefrendering.h
  83. 123
    123
      bibletime/frontend/cswordsetupdialog.cpp
  84. 39
    39
      bibletime/frontend/cswordsetupdialog.h
  85. 38
    38
      bibletime/frontend/cswordsetupinstallsourcesdialog.cpp
  86. 8
    8
      bibletime/frontend/cswordsetupinstallsourcesdialog.h
  87. 52
    52
      bibletime/frontend/cswordsetupmodulelistview.cpp
  88. 14
    14
      bibletime/frontend/cswordsetupmodulelistview.h
  89. 22
    22
      bibletime/frontend/display/cdisplay.cpp
  90. 23
    23
      bibletime/frontend/display/cdisplay.h
  91. 52
    52
      bibletime/frontend/display/chtmlreaddisplay.cpp
  92. 25
    25
      bibletime/frontend/display/chtmlreaddisplay.h
  93. 27
    27
      bibletime/frontend/display/chtmlwritedisplay.cpp
  94. 10
    10
      bibletime/frontend/display/chtmlwritedisplay.h
  95. 23
    23
      bibletime/frontend/display/cplainwritedisplay.cpp
  96. 15
    15
      bibletime/frontend/display/cplainwritedisplay.h
  97. 5
    5
      bibletime/frontend/display/creaddisplay.cpp
  98. 6
    6
      bibletime/frontend/display/creaddisplay.h
  99. 1
    1
      bibletime/frontend/display/cwritedisplay.cpp
  100. 0
    0
      bibletime/frontend/display/cwritedisplay.h

+ 17
- 17
bibletime/backend/bt_gbfhtml.cpp View File

@@ -24,8 +24,8 @@
#include <utilxml.h>

//Qt includes
#include <qregexp.h>
#include <qstring.h>
#include <tqregexp.h>
#include <tqstring.h>

using namespace Filters;

@@ -97,13 +97,13 @@ char BT_GBFHTML::processText(sword::SWBuf& buf, const sword::SWKey * key, const

//Am Anfang<WH07225> schuf<WH01254><WTH8804> Gott<WH0430> Himmel<WH08064> und<WT> Erde<WH0776>.
//A simple word<WT> means: No entry for this word "word"
QString result;
TQString result;

QString t = QString::fromUtf8(buf.c_str());
TQString t = TQString::fromUtf8(buf.c_str());

QRegExp tag("([.,;:]?<W[HGT][^>]*>\\s*)+");
TQRegExp tag("([.,;:]?<W[HGT][^>]*>\\s*)+");

QStringList list;
TQStringList list;

int lastMatchEnd = 0;

@@ -129,11 +129,11 @@ char BT_GBFHTML::processText(sword::SWBuf& buf, const sword::SWKey * key, const
//list is now a list of words with 1-n Strongs at the end, which belong to this word.
//now create the necessary HTML in list entries and concat them to the result
tag = QRegExp("<W([HGT])([^>]*)>");
tag = TQRegExp("<W([HGT])([^>]*)>");
tag.setMinimal(true);

for (QStringList::iterator it = list.begin(); it != list.end(); ++it) {
QString e = (*it); //current entry to process
for (TQStringList::iterator it = list.begin(); it != list.end(); ++it) {
TQString e = (*it); //current entry to process
//qWarning(e.latin1());
//check if there is a word to which the strongs info belongs to.
@@ -141,7 +141,7 @@ char BT_GBFHTML::processText(sword::SWBuf& buf, const sword::SWKey * key, const
//If not, leave out the strongs info, because it can't be tight to a text
//Comparing the first char with < is not enough, because the tokenReplace is done already
//so there might be html tags already.
const bool textPresent = (e.stripWhiteSpace().remove(QRegExp("[.,;:]")).left(2) != "<W");
const bool textPresent = (e.stripWhiteSpace().remove(TQRegExp("[.,;:]")).left(2) != "<W");

if (!textPresent) {
result += (*it);
@@ -153,7 +153,7 @@ char BT_GBFHTML::processText(sword::SWBuf& buf, const sword::SWKey * key, const
bool hasLemmaAttr = false;
bool hasMorphAttr = false;

QString value = QString::null;
TQString value = TQString::null;
int tagAttributeStart = -1;

while (pos != -1) { //work on all strong/lemma tags in this section, should be between 1-3 loops
@@ -170,14 +170,14 @@ char BT_GBFHTML::processText(sword::SWBuf& buf, const sword::SWKey * key, const
pos += 7;

//skip blanks, commas, dots and stuff at the beginning, it doesn't belong to the morph code
QString rep("<span ");
TQString rep("<span ");
rep.append(isMorph ? "morph" : "lemma").append("=\"").append(value).append("\">");

hasMorphAttr = isMorph;
hasLemmaAttr = !isMorph;

int startPos = 0;
QChar c = e[startPos];
TQChar c = e[startPos];

while ((startPos < pos) && (c.isSpace() || c.isPunct())) {
++startPos;
@@ -198,12 +198,12 @@ char BT_GBFHTML::processText(sword::SWBuf& buf, const sword::SWKey * key, const

if ((!isMorph && hasLemmaAttr) || (isMorph && hasMorphAttr)) { //we append another attribute value, e.g. 3000 gets 3000|5000
//search the existing attribute start
QRegExp attrRegExp( isMorph ? "morph=\".+(?=\")" : "lemma=\".+(?=\")" );
TQRegExp attrRegExp( isMorph ? "morph=\".+(?=\")" : "lemma=\".+(?=\")" );
attrRegExp.setMinimal(true);
const int foundPos = e.find(attrRegExp, tagAttributeStart);

if (foundPos != -1) {
e.insert(foundPos + attrRegExp.matchedLength(), QString("|").append(value));
e.insert(foundPos + attrRegExp.matchedLength(), TQString("|").append(value));
pos += value.length() + 1;

hasLemmaAttr = !isMorph;
@@ -211,7 +211,7 @@ char BT_GBFHTML::processText(sword::SWBuf& buf, const sword::SWKey * key, const
}
}
else { //attribute was not yet inserted
QString attr;
TQString attr;
attr.setLatin1(isMorph ? "morph" : "lemma").append("=\"").append(value).append("\" ");

e.insert(tagAttributeStart, attr);
@@ -272,7 +272,7 @@ bool BT_GBFHTML::handleToken(sword::SWBuf &buf, const char *token, sword::BasicF
buf.append('/');
buf.append(myUserData->key->getShortText());
buf.append('/');
buf.append( QString::number(myUserData->swordFootnote++).latin1() );
buf.append( TQString::number(myUserData->swordFootnote++).latin1() );
buf.append("\">*</span> ");

userData->suspendTextPassThru = true;

+ 10
- 10
bibletime/backend/bt_osishtml.cpp View File

@@ -31,7 +31,7 @@
#include <klocale.h>

//Qt includes
#include <qstring.h>
#include <tqstring.h>

using sword::SWBuf;
using sword::XMLTag;
@@ -298,7 +298,7 @@ bool BT_OSISHTML::handleToken(sword::SWBuf &buf, const char *token, sword::Basic
buf.append('/');
buf.append(myUserData->key->getShortText());
buf.append('/');
buf.append( QString::number(myUserData->swordFootnote++).latin1() ); //inefficient
buf.append( TQString::number(myUserData->swordFootnote++).latin1() ); //inefficient

const SWBuf n = tag.getAttribute("n");
@@ -334,8 +334,8 @@ bool BT_OSISHTML::handleToken(sword::SWBuf &buf, const char *token, sword::Basic
else if (!strcmp(tag.getName(), "reference")) { // <reference> tag

if (!tag.isEndTag() && !tag.isEmpty()) {
QString ref( tag.getAttribute("osisRef") );
QString hrefRef( ref );
TQString ref( tag.getAttribute("osisRef") );
TQString hrefRef( ref );
Q_ASSERT(!ref.isEmpty());

if (!ref.isEmpty()) {
@@ -357,7 +357,7 @@ bool BT_OSISHTML::handleToken(sword::SWBuf &buf, const char *token, sword::Basic
int pos = ref.find(":");

if ((pos >= 0) && ref.at(pos-1).isLetter() && ref.at(pos+1).isLetter()) {
QString newModuleName = ref.left(pos);
TQString newModuleName = ref.left(pos);
hrefRef = ref.mid(pos+1);

if (CPointers::backend()->findModuleByName(newModuleName)) {
@@ -366,10 +366,10 @@ bool BT_OSISHTML::handleToken(sword::SWBuf &buf, const char *token, sword::Basic
}

CReferenceManager::ParseOptions options;
options.refBase = QString::fromUtf8(myUserData->key->getText());
options.refDestinationModule = QString(mod->name());
options.sourceLanguage = QString(myModule->Lang());
options.destinationLanguage = QString("en");
options.refBase = TQString::fromUtf8(myUserData->key->getText());
options.refDestinationModule = TQString(mod->name());
options.sourceLanguage = TQString(myModule->Lang());
options.destinationLanguage = TQString("en");

buf.append("<a href=\"");
buf.append( //create the hyperlink with key and mod
@@ -599,7 +599,7 @@ bool BT_OSISHTML::handleToken(sword::SWBuf &buf, const char *token, sword::Basic
else { // seg end tag
buf.append("</span>");
}
//qWarning(QString("handled <seg> token. result: %1").arg(buf.c_str()).latin1());
//qWarning(TQString("handled <seg> token. result: %1").arg(buf.c_str()).latin1());
}
//divine name, don't use simple tag replacing because it may have attributes

+ 2
- 2
bibletime/backend/bt_plainhtml.cpp View File

@@ -24,8 +24,8 @@
#include <utilxml.h>

//Qt includes
#include <qregexp.h>
#include <qstring.h>
#include <tqregexp.h>
#include <tqstring.h>

using namespace Filters;


+ 34
- 34
bibletime/backend/bt_thmlhtml.cpp View File

@@ -29,8 +29,8 @@
#include "versekey.h"

//Qt includes
#include <qstring.h>
#include <qregexp.h>
#include <tqstring.h>
#include <tqregexp.h>

//System includes
#include <stdlib.h>
@@ -60,12 +60,12 @@ char BT_ThMLHTML::processText(sword::SWBuf& buf, const sword::SWKey* key, const
return 1;
}

QString result;
TQString result;

QString t = QString::fromUtf8(buf.c_str());
QRegExp tag("([.,;]?<sync[^>]+(type|value)=\"([^\"]+)\"[^>]+(type|value)=\"([^\"]+)\"([^<]*)>)+");
TQString t = TQString::fromUtf8(buf.c_str());
TQRegExp tag("([.,;]?<sync[^>]+(type|value)=\"([^\"]+)\"[^>]+(type|value)=\"([^\"]+)\"([^<]*)>)+");

QStringList list;
TQStringList list;
int lastMatchEnd = 0;
int pos = tag.search(t,0);

@@ -84,12 +84,12 @@ char BT_ThMLHTML::processText(sword::SWBuf& buf, const sword::SWKey* key, const
list.append(t.right(t.length() - lastMatchEnd));
}

tag = QRegExp("<sync[^>]+(type|value|class)=\"([^\"]+)\"[^>]+(type|value|class)=\"([^\"]+)\"[^>]+((type|value|class)=\"([^\"]+)\")*([^<]*)>");
tag = TQRegExp("<sync[^>]+(type|value|class)=\"([^\"]+)\"[^>]+(type|value|class)=\"([^\"]+)\"[^>]+((type|value|class)=\"([^\"]+)\")*([^<]*)>");

for (QStringList::iterator it = list.begin(); it != list.end(); ++it) {
QString e( *it );
for (TQStringList::iterator it = list.begin(); it != list.end(); ++it) {
TQString e( *it );

const bool textPresent = (e.stripWhiteSpace().remove(QRegExp("[.,;:]")).left(1) != "<");
const bool textPresent = (e.stripWhiteSpace().remove(TQRegExp("[.,;:]")).left(1) != "<");

if (!textPresent) {
continue;
@@ -101,14 +101,14 @@ char BT_ThMLHTML::processText(sword::SWBuf& buf, const sword::SWKey* key, const

int pos = tag.search(e, 0);
bool insertedTag = false;
QString value;
QString valueClass;
TQString value;
TQString valueClass;

while (pos != -1) {
bool isMorph = false;
bool isStrongs = false;
value = QString::null;
valueClass = QString::null;
value = TQString::null;
valueClass = TQString::null;

// check 3 attribute/value pairs

@@ -143,10 +143,10 @@ char BT_ThMLHTML::processText(sword::SWBuf& buf, const sword::SWKey* key, const
e.replace(pos, tag.matchedLength(), "</span>");
pos += 7;

QString rep;
TQString rep;
rep.setLatin1("<span lemma=\"").append(value).append("\">");
int startPos = 0;
QChar c = e[startPos];
TQChar c = e[startPos];

while ((startPos < pos) && (c.isSpace() || c.isPunct())) {
++startPos;
@@ -164,12 +164,12 @@ char BT_ThMLHTML::processText(sword::SWBuf& buf, const sword::SWKey* key, const

if ((!isMorph && hasLemmaAttr) || (isMorph && hasMorphAttr)) { //we append another attribute value, e.g. 3000 gets 3000|5000
//search the existing attribute start
QRegExp attrRegExp( isMorph ? "morph=\".+(?=\")" : "lemma=\".+(?=\")" );
TQRegExp attrRegExp( isMorph ? "morph=\".+(?=\")" : "lemma=\".+(?=\")" );
attrRegExp.setMinimal(true);
const int foundAttrPos = e.find(attrRegExp, pos);

if (foundAttrPos != -1) {
e.insert(foundAttrPos + attrRegExp.matchedLength(), QString("|").append(value));
e.insert(foundAttrPos + attrRegExp.matchedLength(), TQString("|").append(value));
pos += value.length() + 1;

hasLemmaAttr = !isMorph;
@@ -177,10 +177,10 @@ char BT_ThMLHTML::processText(sword::SWBuf& buf, const sword::SWKey* key, const
}
}
else { //attribute was not yet inserted
const int attrPos = e.find(QRegExp("morph=|lemma="), 0);
const int attrPos = e.find(TQRegExp("morph=|lemma="), 0);

if (attrPos >= 0) {
QString attr;
TQString attr;
attr.append(isMorph ? "morph" : "lemma").append("=\"").append(value).append("\" ");
e.insert(attrPos, attr);

@@ -217,7 +217,7 @@ bool BT_ThMLHTML::handleToken(sword::SWBuf &buf, const char *token, sword::Basic

if (tag.getAttribute("lang")) {
const char* abbrev = tag.getAttribute("lang");
//const CLanguageMgr::Language* const language = CPointers::languageMgr()->languageForAbbrev( QString::fromLatin1(abbrev) );
//const CLanguageMgr::Language* const language = CPointers::languageMgr()->languageForAbbrev( TQString::fromLatin1(abbrev) );

buf.append("<span class=\"foreign\" lang=\"");
buf.append(abbrev);
@@ -241,7 +241,7 @@ bool BT_ThMLHTML::handleToken(sword::SWBuf &buf, const char *token, sword::Basic
buf.append('/');
buf.append(myUserData->key->getShortText());
buf.append('/');
buf.append( QString::number(myUserData->swordFootnote++).latin1() );
buf.append( TQString::number(myUserData->swordFootnote++).latin1() );
buf.append("\">*</span> ");

myUserData->suspendTextPassThru = true;
@@ -270,22 +270,22 @@ bool BT_ThMLHTML::handleToken(sword::SWBuf &buf, const char *token, sword::Basic
Q_ASSERT(mod);
if (mod) {
CReferenceManager::ParseOptions options;
options.refBase = QString::fromUtf8(myUserData->key->getText()); //current module key
options.refDestinationModule = QString(mod->name());
options.sourceLanguage = QString(myModule->Lang());
options.destinationLanguage = QString("en");
options.refBase = TQString::fromUtf8(myUserData->key->getText()); //current module key
options.refDestinationModule = TQString(mod->name());
options.sourceLanguage = TQString(myModule->Lang());
options.destinationLanguage = TQString("en");

//it's ok to split the reference, because to descriptive text is given
bool insertSemicolon = false;
buf.append("<span class=\"crossreference\">");
QStringList refs = QStringList::split(";", QString::fromUtf8(myUserData->lastTextNode.c_str()));
QString oldRef; //the previous reference to use as a base for the next refs
for (QStringList::iterator it(refs.begin()); it != refs.end(); ++it) {
TQStringList refs = TQStringList::split(";", TQString::fromUtf8(myUserData->lastTextNode.c_str()));
TQString oldRef; //the previous reference to use as a base for the next refs
for (TQStringList::iterator it(refs.begin()); it != refs.end(); ++it) {

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 TQString completeRef( CReferenceManager::parseVerseReference((*it), options) );

oldRef = completeRef; //use the parsed result as the base for the next ref.

@@ -329,12 +329,12 @@ bool BT_ThMLHTML::handleToken(sword::SWBuf &buf, const char *token, sword::Basic
Q_ASSERT(mod);

CReferenceManager::ParseOptions options;
options.refBase = QString::fromUtf8(myUserData->key->getText());
options.refDestinationModule = QString(mod->name());
options.refBase = TQString::fromUtf8(myUserData->key->getText());
options.refDestinationModule = TQString(mod->name());
options.sourceLanguage = myModule->Lang();
options.destinationLanguage = QString("en");
options.destinationLanguage = TQString("en");

const QString completeRef = CReferenceManager::parseVerseReference(QString::fromUtf8(ref), options);
const TQString completeRef = CReferenceManager::parseVerseReference(TQString::fromUtf8(ref), options);

if (mod) {
buf.append("<span class=\"crossreference\">");

+ 1
- 1
bibletime/backend/btstringmgr.cpp View File

@@ -19,7 +19,7 @@ char* BTStringMgr::upperUTF8(char* text, unsigned int maxlen) const {
const int max = (maxlen>0) ? maxlen : strlen(text);

if (isUtf8(text)) {
strncpy(text, (const char*)QString::fromUtf8(text).upper().utf8(), max);
strncpy(text, (const char*)TQString::fromUtf8(text).upper().utf8(), max);

return text;
}

+ 2
- 2
bibletime/backend/btstringmgr.h View File

@@ -16,12 +16,12 @@
#include <stringmgr.h>

//Qt includes
#include <qstring.h>
#include <tqstring.h>

using namespace sword;

/** Unicode string manager implementation.
* This is the StringManager implementation which works with QString.
* This is the StringManager implementation which works with TQString.
* @author The BibleTime developers
*/


+ 8
- 8
bibletime/backend/cbookdisplay.cpp View File

@@ -23,7 +23,7 @@ namespace Rendering {


/** Returns the rendered text using the modules in the list and using the key parameter. The displayoptions and filter options are used, too. */
const QString CBookDisplay::text( const ListCSwordModuleInfo& modules, const QString& keyName, const CSwordBackend::DisplayOptions displayOptions, const CSwordBackend::FilterOptions filterOptions ) {
const TQString CBookDisplay::text( const ListCSwordModuleInfo& modules, const TQString& keyName, const CSwordBackend::DisplayOptions displayOptions, const CSwordBackend::FilterOptions filterOptions ) {
CSwordBookModuleInfo* book = dynamic_cast<CSwordBookModuleInfo*>(modules.first());
Q_ASSERT(book);

@@ -50,7 +50,7 @@ namespace Rendering {
if ((displayLevel <= 1) || (key->key().isEmpty() || (key->key() == "/") )) {
tree.append( new CDisplayRendering::KeyTreeItem( key->key(), modules, itemSettings ) );

const QString renderedText = render.renderKeyTree(tree);
const TQString renderedText = render.renderKeyTree(tree);
key->setOffset( offset );
return renderedText;
};
@@ -79,7 +79,7 @@ namespace Rendering {
//display current level, we could also decide to display the available levels together
tree.append( new CDisplayRendering::KeyTreeItem( key->key(), modules, itemSettings ) );

const QString renderedText = render.renderKeyTree(tree);
const TQString renderedText = render.renderKeyTree(tree);
key->setOffset( offset );
return renderedText;
};
@@ -95,7 +95,7 @@ namespace Rendering {
if ( !key->parent() ) { //something went wrong although we checked before! Be safe and return entry's text
tree.append( new CDisplayRendering::KeyTreeItem( key->key(), modules, itemSettings ) );

const QString renderedText = render.renderKeyTree(tree);
const TQString renderedText = render.renderKeyTree(tree);
key->setOffset( offset );
return renderedText;
};
@@ -111,16 +111,16 @@ namespace Rendering {

setupRenderTree(key.get(), &tree, keyName);

const QString renderedText = render.renderKeyTree(tree);
const TQString renderedText = render.renderKeyTree(tree);

key->setOffset( offset ); //restore key

return renderedText;
}

void CBookDisplay::setupRenderTree(CSwordTreeKey * swordTree, CTextRendering::KeyTree * renderTree, const QString& highlightKey) {
// const QString key = swordTree->getFullName();
const QString key = swordTree->key();
void CBookDisplay::setupRenderTree(CSwordTreeKey * swordTree, CTextRendering::KeyTree * renderTree, const TQString& highlightKey) {
// const TQString key = swordTree->getFullName();
const TQString key = swordTree->key();
const unsigned long offset = swordTree->getOffset();

CTextRendering::KeyTreeItem::Settings settings;

+ 2
- 2
bibletime/backend/cbookdisplay.h View File

@@ -35,10 +35,10 @@ public: // Public methods
* Returns the rendered text using the modules in the list and using the key parameter.
* The displayoptions and filter options are used, too.
*/
virtual const QString text( const ListCSwordModuleInfo& modules, const QString& key, const CSwordBackend::DisplayOptions displayOptions, const CSwordBackend::FilterOptions filterOptions);
virtual const TQString text( const ListCSwordModuleInfo& modules, const TQString& key, const CSwordBackend::DisplayOptions displayOptions, const CSwordBackend::FilterOptions filterOptions);

protected:
void setupRenderTree(CSwordTreeKey* swordTree, CTextRendering::KeyTree* renderTree, const QString& highlightKey);
void setupRenderTree(CSwordTreeKey* swordTree, CTextRendering::KeyTree* renderTree, const TQString& highlightKey);
};
};


+ 3
- 3
bibletime/backend/cchapterdisplay.cpp View File

@@ -19,7 +19,7 @@

namespace Rendering {

const QString CChapterDisplay::text( const ListCSwordModuleInfo& modules, const QString& keyName, const CSwordBackend::DisplayOptions displayOptions, const CSwordBackend::FilterOptions filterOptions ) {
const TQString CChapterDisplay::text( const ListCSwordModuleInfo& modules, const TQString& keyName, const CSwordBackend::DisplayOptions displayOptions, const CSwordBackend::FilterOptions filterOptions ) {
Q_ASSERT( modules.count() >= 1 );
Q_ASSERT( !keyName.isEmpty() );

@@ -33,8 +33,8 @@ namespace Rendering {
? CTextRendering::KeyTreeItem::Settings::SimpleKey
: CTextRendering::KeyTreeItem::Settings::NoKey;

QString startKey = keyName;
QString endKey = startKey;
TQString startKey = keyName;
TQString endKey = startKey;

//check whether there's an intro we have to include
Q_ASSERT((module->type() == CSwordModuleInfo::Bible));

+ 1
- 1
bibletime/backend/cchapterdisplay.h View File

@@ -31,7 +31,7 @@ public: // Public methods
* Returns the rendered text using the modules in the list and using the key parameter.
* The displayoptions and filter options are used, too.
*/
virtual const QString text( const ListCSwordModuleInfo& modules, const QString& key, const CSwordBackend::DisplayOptions displayOptions, const CSwordBackend::FilterOptions filterOptions);
virtual const TQString text( const ListCSwordModuleInfo& modules, const TQString& key, const CSwordBackend::DisplayOptions displayOptions, const CSwordBackend::FilterOptions filterOptions);
};

};

+ 21
- 21
bibletime/backend/cdisplayrendering.cpp View File

@@ -19,16 +19,16 @@
#include "cswordversekey.h"

//Qt includes
#include <qstring.h>
#include <qregexp.h>
#include <tqstring.h>
#include <tqregexp.h>

namespace Rendering {

CDisplayRendering::CDisplayRendering(CSwordBackend::DisplayOptions displayOptions, CSwordBackend::FilterOptions filterOptions)
: CHTMLExportRendering(CHTMLExportRendering::Settings(true), displayOptions, filterOptions) {}

const QString CDisplayRendering::entryLink( const KeyTreeItem& item, CSwordModuleInfo* module ) {
QString linkText;
const TQString CDisplayRendering::entryLink( const KeyTreeItem& item, CSwordModuleInfo* module ) {
TQString linkText;

const bool isBible = module && (module->type() == CSwordModuleInfo::Bible);
CSwordVerseKey vk(module); //only valid for bible modules, i.e. isBible == true
@@ -39,19 +39,19 @@ namespace Rendering {
}

if (isBible && (vk.Verse() == 0)) {
return QString::null; //Warning: return already here
return TQString::null; //Warning: return already here
}

switch (item.settings().keyRenderingFace) {

case KeyTreeItem::Settings::NoKey: {
linkText = QString::null;
linkText = TQString::null;
break; //no key is valid for all modules
}

case KeyTreeItem::Settings::CompleteShort: {
if (isBible) {
linkText = QString::fromUtf8(vk.getShortText());
linkText = TQString::fromUtf8(vk.getShortText());
break;
}

@@ -69,7 +69,7 @@ namespace Rendering {

case KeyTreeItem::Settings::SimpleKey: {
if (isBible) {
linkText = QString::number(vk.Verse());
linkText = TQString::number(vk.Verse());
break;
}

@@ -83,10 +83,10 @@ namespace Rendering {
}

if (linkText.isEmpty()) {
return QString("<a name=\"").append(keyToHTMLAnchor(item.key())).append("\" />");
return TQString("<a name=\"").append(keyToHTMLAnchor(item.key())).append("\" />");
}
else {
return QString("<a name=\"").append(keyToHTMLAnchor(item.key())).append("\" ")
return TQString("<a name=\"").append(keyToHTMLAnchor(item.key())).append("\" ")
.append("href=\"")
.append(CReferenceManager::encodeHyperlink(
module->name(), item.key(), CReferenceManager::typeFromModule(module->type()))
@@ -94,18 +94,18 @@ namespace Rendering {
.append("\">").append(linkText).append("</a>\n");
}

return QString::null;
return TQString::null;
}

const QString CDisplayRendering::keyToHTMLAnchor(const QString& key) {
QString ret = key;
ret = ret.stripWhiteSpace().remove(QRegExp("[^A-Za-z0-9]+"));
ret = ret.remove(QRegExp("^\\d+|"));
const TQString CDisplayRendering::keyToHTMLAnchor(const TQString& key) {
TQString ret = key;
ret = ret.stripWhiteSpace().remove(TQRegExp("[^A-Za-z0-9]+"));
ret = ret.remove(TQRegExp("^\\d+|"));

return ret;
}

const QString CDisplayRendering::finishText( const QString& oldText, KeyTree& tree ) {
const TQString CDisplayRendering::finishText( const TQString& oldText, KeyTree& tree ) {
ListCSwordModuleInfo modules = tree.collectModules();


@@ -114,9 +114,9 @@ namespace Rendering {
/*
//mark all words by spans

QString text = oldText;
TQString text = oldText;

QRegExp re("(\\b)(?=\\w)"); //word begin marker
TQRegExp re("(\\b)(?=\\w)"); //word begin marker
int pos = text.find(re, 0);

while (pos != -1) { //word begin found
@@ -126,7 +126,7 @@ namespace Rendering {
//qWarning("matched %s", text.mid(pos+1, 4).latin1());

//find end of word and put a marker around it
endPos = text.find(QRegExp("\\b|[,.:]"), pos+1);
endPos = text.find(TQRegExp("\\b|[,.:]"), pos+1);
if ((endPos != -1) && !CToolClass::inHTMLTag(endPos, text) && (endPos - pos >= 3)) { //reuire wordslonger than 3 chars
text.insert(endPos, "</span>");
text.insert(pos, "<span class=\"word\">");
@@ -150,10 +150,10 @@ namespace Rendering {
settings.modules = modules;
settings.langAbbrev = ((modules.count() == 1) && lang->isValid())
? lang->abbrev()
: QString::null;
: TQString::null;
settings.pageDirection = (modules.count() == 1)
? ((modules.first()->textDirection() == CSwordModuleInfo::LeftToRight) ? "ltr" : "rtl")
: QString::null;
: TQString::null;

return tMgr->fillTemplate(CBTConfig::get
(CBTConfig::displayStyle), oldText, settings);

+ 3
- 3
bibletime/backend/cdisplayrendering.h View File

@@ -23,7 +23,7 @@ namespace Rendering {

class CDisplayRendering : public CHTMLExportRendering {
public:
static const QString keyToHTMLAnchor(const QString& key);
static const TQString keyToHTMLAnchor(const TQString& key);

CDisplayRendering(
CSwordBackend::DisplayOptions displayOptions = CBTConfig::getDisplayOptionDefaults(),
@@ -31,8 +31,8 @@ public:
);

protected:
virtual const QString entryLink( const KeyTreeItem& item, CSwordModuleInfo* const module );
virtual const QString finishText( const QString&, KeyTree& tree );
virtual const TQString entryLink( const KeyTreeItem& item, CSwordModuleInfo* const module );
virtual const TQString finishText( const TQString&, KeyTree& tree );
};

}

+ 26
- 26
bibletime/backend/cdisplaytemplatemgr.cpp View File

@@ -22,9 +22,9 @@
#include "config.h"

//Qt includes
#include <qstringlist.h>
#include <qfile.h>
#include <qfileinfo.h>
#include <tqstringlist.h>
#include <tqfile.h>
#include <tqfileinfo.h>

//KDE includes
#include <klocale.h>
@@ -41,12 +41,12 @@ CDisplayTemplateMgr::~CDisplayTemplateMgr() {}


/*!
\fn CDisplayTemplateMgr::fillTemplate( const QString& name, const QString& title, const QString& content )
\fn CDisplayTemplateMgr::fillTemplate( const TQString& name, const TQString& title, const TQString& content )
*/
const QString CDisplayTemplateMgr::fillTemplate( const QString& name, const QString& content, Settings& settings ) {
const QString templateName = m_templateMap.contains(name) ? name : defaultTemplate();
const TQString CDisplayTemplateMgr::fillTemplate( const TQString& name, const TQString& content, Settings& settings ) {
const TQString templateName = m_templateMap.contains(name) ? name : defaultTemplate();

QString displayTypeString;
TQString displayTypeString;

if (!settings.pageCSS_ID.isEmpty()) {
displayTypeString = settings.pageCSS_ID;
@@ -77,18 +77,18 @@ const QString CDisplayTemplateMgr::fillTemplate( const QString& name, const QStr
};
}

QString newContent = content;
TQString newContent = content;
const int moduleCount = settings.modules.count();

if (moduleCount >= 2) {
//create header for the modules
QString header;
TQString header;

ListCSwordModuleInfo::iterator end_it = settings.modules.end();

for (ListCSwordModuleInfo::iterator it(settings.modules.begin()); it != end_it; ++it) {
header.append("<th style=\"width:")
.append(QString::number(int( 100.0 / (float)moduleCount )))
.append(TQString::number(int( 100.0 / (float)moduleCount )))
.append("%;\">")
.append((*it)->name())
.append("</th>");
@@ -101,7 +101,7 @@ const QString CDisplayTemplateMgr::fillTemplate( const QString& name, const QStr
.append("</table>");
}

QString langCSS;
TQString langCSS;
CLanguageMgr::LangMap langMap = CPointers::languageMgr()->availableLanguages();

for ( CLanguageMgr::LangMapIterator it( langMap ); it.current(); ++it ) {
@@ -110,18 +110,18 @@ const QString CDisplayTemplateMgr::fillTemplate( const QString& name, const QStr

//if (lang->isValid() && CBTConfig::get(lang).first) {
if (!lang->abbrev().isEmpty() && CBTConfig::get(lang).first) {
const QFont f = CBTConfig::get(lang).second;
const TQFont f = CBTConfig::get(lang).second;

//don't use important, because it would reset the title formatting, etc. to the setup font
QString css("{ ");
TQString css("{ ");
css.append("font-family:").append(f.family())/*.append(" !important")*/;
css.append("; font-size:").append(QString::number(f.pointSize())).append("pt /*!important*/");
css.append("; font-size:").append(TQString::number(f.pointSize())).append("pt /*!important*/");
css.append("; font-weight:").append(f.bold() ? "bold" : "normal /*!important*/");
css.append("; font-style:").append(f.italic() ? "italic" : "normal /*!important*/");
css.append("; }\n");

langCSS +=
QString("\n*[lang=%1] %2")
TQString("\n*[lang=%1] %2")
.arg(lang->abbrev())
.arg(css);
}
@@ -133,9 +133,9 @@ const QString CDisplayTemplateMgr::fillTemplate( const QString& name, const QStr
const CLanguageMgr::Language* lang = it.current();

if (lang && !lang->abbrev().isEmpty()/*&& lang->isValid()*/) {
const QFont standardFont = CBTConfig::getDefault(lang); //we just need a dummy lang param
const TQFont standardFont = CBTConfig::getDefault(lang); //we just need a dummy lang param
langCSS.prepend(
QString("\n#content {font-family:%1; font-size:%2pt; font-weight:%3; font-style: %4;}\n")
TQString("\n#content {font-family:%1; font-size:%2pt; font-weight:%3; font-style: %4;}\n")
.arg(standardFont.family())
.arg(standardFont.pointSize())
.arg(standardFont.bold() ? "bold" : "normal")
@@ -144,9 +144,9 @@ const QString CDisplayTemplateMgr::fillTemplate( const QString& name, const QStr
}

// qWarning("Outputing unformated text");
const QString t = QString(m_templateMap[ templateName ]) //don't change the map's content directly, use a copy
const TQString t = TQString(m_templateMap[ templateName ]) //don't change the map's content directly, use a copy
.replace("#TITLE#", settings.title)
.replace("#LANG_ABBREV#", settings.langAbbrev.isEmpty() ? QString("en") : settings.langAbbrev)
.replace("#LANG_ABBREV#", settings.langAbbrev.isEmpty() ? TQString("en") : settings.langAbbrev)
.replace("#DISPLAYTYPE#", displayTypeString)
.replace("#LANG_CSS#", langCSS)
.replace("#PAGE_DIRECTION#", settings.pageDirection)
@@ -154,9 +154,9 @@ const QString CDisplayTemplateMgr::fillTemplate( const QString& name, const QStr
//printf("%s\n\n", t.latin1());

return t;
/* QString(m_templateMap[ templateName ]) //don't change the map's content directly, use a copy
/* TQString(m_templateMap[ templateName ]) //don't change the map's content directly, use a copy
.replace("#TITLE#", settings.title)
.replace("#LANG_ABBREV#", settings.langAbbrev.isEmpty() ? QString("en") : settings.langAbbrev)
.replace("#LANG_ABBREV#", settings.langAbbrev.isEmpty() ? TQString("en") : settings.langAbbrev)
.replace("#DISPLAYTYPE#", displayTypeString)
.replace("#LANG_CSS#", langCSS)
.replace("#PAGE_DIRECTION#", settings.pageDirection)
@@ -169,19 +169,19 @@ const QString CDisplayTemplateMgr::fillTemplate( const QString& name, const QStr
*/
void CDisplayTemplateMgr::loadUserTemplates() {
qDebug("Loading user templates");
QStringList files = KGlobal::dirs()->findAllResources("BT_DisplayTemplates");
TQStringList files = KGlobal::dirs()->findAllResources("BT_DisplayTemplates");

for ( QStringList::iterator it( files.begin() ); it != files.end(); ++it) {
for ( TQStringList::iterator it( files.begin() ); it != files.end(); ++it) {
qDebug("Found user template %s", (*it).latin1());

QFile f( *it );
TQFile f( *it );
Q_ASSERT( f.exists() );

if (f.open( IO_ReadOnly )) {
QString fileContent = QTextStream( &f ).read();
TQString fileContent = TQTextStream( &f ).read();

if (!fileContent.isEmpty()) {
m_templateMap[ QFileInfo(*it).fileName() + QString(" ") + i18n("(user template)")] = fileContent;
m_templateMap[ TQFileInfo(*it).fileName() + TQString(" ") + i18n("(user template)")] = fileContent;
}
}
}

+ 17
- 17
bibletime/backend/cdisplaytemplatemgr.h View File

@@ -16,9 +16,9 @@
#include "cswordmoduleinfo.h"

//Qt includes
#include <qmap.h>
#include <qstring.h>
#include <qstringlist.h>
#include <tqmap.h>
#include <tqstring.h>
#include <tqstringlist.h>

//KDE includes
#include <klocale.h>
@@ -38,34 +38,34 @@ public:
/** Constructor. Constructs the new settings object. The default values are empty.
*/
Settings() {
title = QString::null;
langAbbrev = QString::null;
pageCSS_ID = QString::null;
pageDirection = QString("ltr");
title = TQString::null;
langAbbrev = TQString::null;
pageCSS_ID = TQString::null;
pageDirection = TQString("ltr");
};

ListCSwordModuleInfo modules; /**< the list of modules */
QString title; /**< the title which is used for the new processed HTML page */
QString langAbbrev; /**< the language for the HTML page. */
QString pageDirection; /**< the language for the HTML page. */
QString pageCSS_ID; /**< the CSS ID which is used in the content part of the page */
TQString title; /**< the title which is used for the new processed HTML page */
TQString langAbbrev; /**< the language for the HTML page. */
TQString pageDirection; /**< the language for the HTML page. */
TQString pageCSS_ID; /**< the CSS ID which is used in the content part of the page */
};

/** Available templates.
* @return The list of templates, which are available.
*/
inline const QStringList availableTemplates();
inline const TQStringList availableTemplates();
/** Fill template. Fill rendered content into the template given by the name.
* @param name The name of the template
* @param content The content which should be filled into the template
* @param settings The settings which are used to process the templating process
* @return The full HTML template HTML code including the CSS data.
*/
const QString fillTemplate( const QString& name, const QString& content, Settings& settings);
const TQString fillTemplate( const TQString& name, const TQString& content, Settings& settings);
/** Default template.
* @return The i18n'ed name of the default template
*/
inline static const QString defaultTemplate();
inline static const TQString defaultTemplate();

protected:

@@ -81,17 +81,17 @@ protected:

private:
void init();
QMap<QString, QString> m_templateMap;
TQMap<TQString, TQString> m_templateMap;
};

inline const QString CDisplayTemplateMgr::defaultTemplate() {
inline const TQString CDisplayTemplateMgr::defaultTemplate() {
return i18n("Default");
}

/**
* CDisplayTemplateMgr::availableTemplates()
*/
inline const QStringList CDisplayTemplateMgr::availableTemplates() {
inline const TQStringList CDisplayTemplateMgr::availableTemplates() {
return m_templateMap.keys();
}


+ 4
- 4
bibletime/backend/centrydisplay.cpp View File

@@ -24,21 +24,21 @@
#include "util/scoped_resource.h"

//Qt includes
#include <qapplication.h>
#include <qregexp.h>
#include <tqapplication.h>
#include <tqregexp.h>

using namespace Rendering;

/** Returns the rendered text using the modules in the list and using the key parameter.
* The displayoptions and filter options are used, too.
*/
const QString CEntryDisplay::text( const ListCSwordModuleInfo& modules, const QString& keyName, const CSwordBackend::DisplayOptions displayOptions, const CSwordBackend::FilterOptions filterOptions ) {
const TQString CEntryDisplay::text( const ListCSwordModuleInfo& modules, const TQString& keyName, const CSwordBackend::DisplayOptions displayOptions, const CSwordBackend::FilterOptions filterOptions ) {
CDisplayRendering render(displayOptions, filterOptions);

//no highlighted key and no extra key link in the text
CTextRendering::KeyTreeItem::Settings normal_settings(false, CTextRendering::KeyTreeItem::Settings::CompleteShort);
CSwordModuleInfo* module = modules.first();
QString result;
TQString result;

//in Bibles and Commentaries we need to check if 0:0 and X:0 contain something
if (module->type() == CSwordModuleInfo::Bible || module->type() == CSwordModuleInfo::Commentary) {

+ 2
- 2
bibletime/backend/centrydisplay.h View File

@@ -23,7 +23,7 @@
#include <swdisp.h>

//Qt includes
#include <qstring.h>
#include <tqstring.h>

class CSwordModuleInfo;

@@ -44,7 +44,7 @@ public:
* Returns the rendered text using the modules in the list and using the key parameter.
* The displayoptions and filter options are used, too.
*/
virtual const QString text( const ListCSwordModuleInfo& modules, const QString& key, const CSwordBackend::DisplayOptions displayOptions, const CSwordBackend::FilterOptions filterOptions);
virtual const TQString text( const ListCSwordModuleInfo& modules, const TQString& key, const CSwordBackend::DisplayOptions displayOptions, const CSwordBackend::FilterOptions filterOptions);
};



+ 16
- 16
bibletime/backend/chtmlexportrendering.cpp View File

@@ -35,11 +35,11 @@ namespace Rendering {

CHTMLExportRendering::~CHTMLExportRendering() {}

const QString CHTMLExportRendering::renderEntry( const KeyTreeItem& i, CSwordKey* k) {
const TQString CHTMLExportRendering::renderEntry( const KeyTreeItem& i, CSwordKey* k) {
// qDebug("CHTMLExportRendering::renderEntry");

if (i.hasAlternativeContent()) {
QString ret;
TQString ret;
ret.setLatin1(i.settings().highlight ? "<div class=\"currententry\">" : "<div class=\"entry\">");
ret.append(i.getAlternativeContent());

@@ -51,7 +51,7 @@ namespace Rendering {
const ListCSwordModuleInfo& modules( tree->collectModules() );

if (modules.count() == 1) { //insert the direction into the sorrounding div
ret.insert( 5, QString("dir=\"%1\" ").arg((modules.first()->textDirection() == CSwordModuleInfo::LeftToRight) ? "ltr" : "rtl" ));
ret.insert( 5, TQString("dir=\"%1\" ").arg((modules.first()->textDirection() == CSwordModuleInfo::LeftToRight) ? "ltr" : "rtl" ));
}

for ( KeyTreeItem* c = tree->first(); c; c = tree->next() ) {
@@ -80,26 +80,26 @@ namespace Rendering {
myVK->Headings(1);
}

QString renderedText( (modules.count() > 1) ? "<tr>" : "" );
TQString renderedText( (modules.count() > 1) ? "<tr>" : "" );

if (modules.count() == 0) {
return QString(""); //no module present for rendering
return TQString(""); //no module present for rendering
}

// Only insert the table stuff if we are displaying parallel.
// Otherwise, strip out he table stuff -> the whole chapter will be rendered in one cell!

//declarations out of the loop for optimization
QString entry;
TQString entry;

QString keyText;
TQString keyText;

bool isRTL;

//taken out of the loop for optimization
QString preverseHeading;
TQString preverseHeading;

QString langAttr;
TQString langAttr;

ListCSwordModuleInfo::const_iterator end_modItr = modules.end();

@@ -109,7 +109,7 @@ namespace Rendering {

keyText = key->key();
isRTL = ((*mod_Itr)->textDirection() == CSwordModuleInfo::RightToLeft);
entry = QString::null;
entry = TQString::null;

if ((*mod_Itr)->language()->isValid()) {
langAttr.setLatin1("xml:lang=\"")
@@ -126,7 +126,7 @@ namespace Rendering {
.append("\"");
}

const QString key_renderedText = key->renderedText();
const TQString key_renderedText = key->renderedText();

// qWarning(key_renderedText.latin1());

@@ -137,7 +137,7 @@ namespace Rendering {
(*mod_Itr)->module()->getEntryAttributes()["Heading"]["Preverse"].end();

for (; it != end; ++it) {
preverseHeading = QString::fromUtf8(it->second.c_str());
preverseHeading = TQString::fromUtf8(it->second.c_str());

//TODO: Take care of the heading type!

@@ -163,7 +163,7 @@ namespace Rendering {
entry.append("<span class=\"entryname\" dir=\"ltr\">").append(entryLink(i, *mod_Itr)).append("</span>");

if (m_settings.addText) {
//entry.append( QString::fromLatin1("<span %1>%2</span>").arg(langAttr).arg(key_renderedText) );
//entry.append( TQString::fromLatin1("<span %1>%2</span>").arg(langAttr).arg(key_renderedText) );
entry.append( key_renderedText );
}

@@ -206,7 +206,7 @@ namespace Rendering {
CPointers::backend()->setFilterOptions( m_filterOptions );
}

const QString CHTMLExportRendering::finishText( const QString& text, KeyTree& tree ) {
const TQString CHTMLExportRendering::finishText( const TQString& text, KeyTree& tree ) {
ListCSwordModuleInfo modules = tree.collectModules();

const CLanguageMgr::Language* const lang = modules.first()->language();
@@ -219,7 +219,7 @@ namespace Rendering {
: "unknown";
settings.pageDirection = (modules.count() == 1)
? ((modules.first()->textDirection() == CSwordModuleInfo::LeftToRight) ? "ltr" : "rtl")
: QString::null;
: TQString::null;

return tMgr->fillTemplate(i18n("Export"), text, settings);
}
@@ -227,7 +227,7 @@ namespace Rendering {
/*!
\fn CHTMLExportRendering::entryLink( KeyTreeItem& item )
*/
const QString CHTMLExportRendering::entryLink( const KeyTreeItem& item, CSwordModuleInfo* ) {
const TQString CHTMLExportRendering::entryLink( const KeyTreeItem& item, CSwordModuleInfo* ) {
return item.key();
}


+ 3
- 3
bibletime/backend/chtmlexportrendering.h View File

@@ -45,9 +45,9 @@ public:
virtual ~CHTMLExportRendering();

protected:
virtual const QString renderEntry( const KeyTreeItem&, CSwordKey* = 0 );
virtual const QString finishText( const QString&, KeyTree& tree );
virtual const QString entryLink( const KeyTreeItem& item, CSwordModuleInfo* module );
virtual const TQString renderEntry( const KeyTreeItem&, CSwordKey* = 0 );
virtual const TQString finishText( const TQString&, KeyTree& tree );
virtual const TQString entryLink( const KeyTreeItem& item, CSwordModuleInfo* module );
virtual void initRendering();

CSwordBackend::DisplayOptions m_displayOptions;

+ 13
- 13
bibletime/backend/clanguagemgr.cpp View File

@@ -18,7 +18,7 @@


//Qt includes
#include <qptrlist.h>
#include <tqptrlist.h>

//KDE includes
#include <klocale.h>
@@ -28,9 +28,9 @@ CLanguageMgr::LanguageList CLanguageMgr::m_langList;
CLanguageMgr::LanguageList CLanguageMgr::m_cleanupLangPtrs;

CLanguageMgr::Language::Language() : m_altAbbrevs(0) {
m_abbrev = QString::null;
m_englishName = QString::null;
m_translatedName = QString::null;
m_abbrev = TQString::null;
m_englishName = TQString::null;
m_translatedName = TQString::null;
};

CLanguageMgr::Language::Language(const Language& l) {
@@ -39,7 +39,7 @@ CLanguageMgr::Language::Language(const Language& l) {
m_translatedName = l.m_translatedName;

if (l.m_altAbbrevs) { //copy alternative abbrevs in a new list
m_altAbbrevs = new QStringList(*l.m_altAbbrevs);
m_altAbbrevs = new TQStringList(*l.m_altAbbrevs);
//*m_altAbbrevs = *l.m_altAbbrevs;
}
else {
@@ -47,13 +47,13 @@ CLanguageMgr::Language::Language(const Language& l) {
}
}

CLanguageMgr::Language::Language( const QString& abbrev, const QString& name, const QString& translatedName, const QStringList& altAbbrevs ) : m_altAbbrevs(0) {
CLanguageMgr::Language::Language( const TQString& abbrev, const TQString& name, const TQString& translatedName, const TQStringList& altAbbrevs ) : m_altAbbrevs(0) {
m_abbrev = abbrev;
m_englishName = name;
m_translatedName = translatedName;

if (altAbbrevs.count() > 0) {
m_altAbbrevs = new QStringList();
m_altAbbrevs = new TQStringList();
*m_altAbbrevs = altAbbrevs;
}
};
@@ -88,7 +88,7 @@ const CLanguageMgr::LangMap& CLanguageMgr::availableLanguages() {
m_availableModulesCache.moduleCount = mods.count();

//collect the languages abbrevs of all modules
QStrList abbrevs;
TQStrList abbrevs;
char *abbrev;

ListCSwordModuleInfo::iterator end_it = mods.end();
@@ -121,7 +121,7 @@ const CLanguageMgr::LangMap& CLanguageMgr::availableLanguages() {
return m_availableModulesCache.availableLanguages;
};

const CLanguageMgr::Language* const CLanguageMgr::languageForAbbrev( const QString& abbrev ) const {
const CLanguageMgr::Language* const CLanguageMgr::languageForAbbrev( const TQString& abbrev ) const {
Language* lang = m_langMap.find(abbrev);

if (lang) {
@@ -143,7 +143,7 @@ const CLanguageMgr::Language* const CLanguageMgr::languageForAbbrev( const QStri
return newLang;
};

const CLanguageMgr::Language* const CLanguageMgr::languageForName( const QString& name ) const {
const CLanguageMgr::Language* const CLanguageMgr::languageForName( const TQString& name ) const {
for ( LangMapIterator it( m_langMap ); it.current(); ++it ) {
if (it.current()->name() == name) {
return it.current();
@@ -153,7 +153,7 @@ const CLanguageMgr::Language* const CLanguageMgr::languageForName( const QString
return &m_defaultLanguage;//invalid language
};

const CLanguageMgr::Language* const CLanguageMgr::languageForTranslatedName( const QString& name ) const {
const CLanguageMgr::Language* const CLanguageMgr::languageForTranslatedName( const TQString& name ) const {
for ( LangMapIterator it( m_langMap ); it.current(); ++it ) {
if (it.current()->translatedName() == name) {
return it.current();
@@ -464,11 +464,11 @@ void CLanguageMgr::init() {

m_langList.append( new Language("x-E-HAT" , "Haitian Creole French" , i18n("Haitian Creole French")) );

m_langList.append( new Language("x-E-ITZ" , QString::fromUtf8("Itzá") , i18n("Itzá")) );
m_langList.append( new Language("x-E-ITZ" , TQString::fromUtf8("Itzá") , i18n("Itzá")) );

m_langList.append( new Language("x-E-JIV" , "Shuar" , i18n("Shuar")) );

m_langList.append( new Language("x-E-KEK" , QString::fromUtf8("Kekchí") , i18n("Kekchí")) );
m_langList.append( new Language("x-E-KEK" , TQString::fromUtf8("Kekchí") , i18n("Kekchí")) );

m_langList.append( new Language("x-E-KAB" , "Kabyle" , i18n("Kabyle")) );


+ 26
- 26
bibletime/backend/clanguagemgr.h View File

@@ -13,11 +13,11 @@
#define CLANGUAGEMGR_H

//Qt includes
#include <qstring.h>
#include <qstringlist.h>
#include <qvaluelist.h>
#include <qmap.h>
#include <qdict.h>
#include <tqstring.h>
#include <tqstringlist.h>
#include <tqvaluelist.h>
#include <tqmap.h>
#include <tqdict.h>

/** Manages the anguages of BibleTime and provides functions to work with them.
* @author The BibleTime team
@@ -42,30 +42,30 @@ public:
Language(const Language&);
/** Constructor which takes all necessary data.
*/
Language(const QString& abbrev, const QString& englishName, const QString& translatedName, const QStringList& altAbbrevs = QStringList());
Language(const TQString& abbrev, const TQString& englishName, const TQString& translatedName, const TQStringList& altAbbrevs = TQStringList());
/** Destructor.
*/
~Language();
/** Returns the abbreviation.
* @return The abbreviation of the chosen language.
*/
inline const QString& abbrev() const;
inline const TQString& abbrev() const;
/** Returns the translated name.
* @return The translated name of the language.
*/
inline const QString& translatedName() const;
inline const TQString& translatedName() const;
//always define inlines in the header file, or make them not inline.
/** The english name of the language.
* @return The english name of the chosen language.
*/
inline const QString& name() const {
inline const TQString& name() const {
return m_englishName;
}

/** The alternative abbreviations which are avalable for this language.
* @return A pointer to the list of alternate abbreviations
*/
inline const QStringList* const alternativeAbbrevs() const {
inline const TQStringList* const alternativeAbbrevs() const {
return m_altAbbrevs;
};

@@ -76,16 +76,16 @@ public:
inline const bool isValid() const;

private:
QString m_abbrev;
QString m_englishName;
QString m_translatedName;
QStringList* m_altAbbrevs;
TQString m_abbrev;
TQString m_englishName;
TQString m_translatedName;
TQStringList* m_altAbbrevs;
};

typedef QPtrList<CLanguageMgr::Language> LanguageList;
typedef TQPtrList<CLanguageMgr::Language> LanguageList;

typedef QDict<Language> LangMap;
typedef QDictIterator<Language> LangMapIterator;
typedef TQDict<Language> LangMap;
typedef TQDictIterator<Language> LangMapIterator;

/** Constructor.
*/
@@ -95,7 +95,7 @@ public:
virtual ~CLanguageMgr();
/**
* Returns the standard languages available as standard. Does nothing for Sword.
* @return A QDict<Language> map which contains all known languages
* @return A TQDict<Language> map which contains all known languages
*/
inline const CLanguageMgr::LangMap* const languages() const;
/**
@@ -107,17 +107,17 @@ public:
* @param abbrev The language abbreviation
* @return Pointer to a language for the given string abbreviation.
*/
const CLanguageMgr::Language* const languageForAbbrev( const QString& abbrev ) const;
const CLanguageMgr::Language* const languageForAbbrev( const TQString& abbrev ) const;
/** Language for english name.
* @param abbrev The english language name.
* @return Pointer to a language for the given name
*/
const CLanguageMgr::Language* const languageForName( const QString& language ) const;
const CLanguageMgr::Language* const languageForName( const TQString& language ) const;
/** Language for translated language name.
* @param abbrev The translated language name
* @return Pointer to a language for the given translated language name
*/
const CLanguageMgr::Language* const languageForTranslatedName( const QString& language ) const;
const CLanguageMgr::Language* const languageForTranslatedName( const TQString& language ) const;
/** Default language so we don't return NULL pointers.
* @return Pointer to the default language
*/
@@ -125,14 +125,14 @@ public:

private:
void init();
inline const QStringList makeStringList(const QString& abbrevs) {
return QStringList::split( ";", abbrevs, false );
inline const TQStringList makeStringList(const TQString& abbrevs) {
return TQStringList::split( ";", abbrevs, false );
}

mutable LangMap m_langMap;
Language m_defaultLanguage;

//typedef QPtrList<CLanguageMgr::Language> LanguageList;
//typedef TQPtrList<CLanguageMgr::Language> LanguageList;
static LanguageList m_langList;
static LanguageList m_cleanupLangPtrs;

@@ -149,7 +149,7 @@ inline const bool CLanguageMgr::Language::isValid() const {
return (!abbrev().isEmpty() && !name().isEmpty());
}

inline const QString& CLanguageMgr::Language::abbrev() const {
inline const TQString& CLanguageMgr::Language::abbrev() const {
if (m_altAbbrevs && m_abbrev.isEmpty() && m_altAbbrevs->count()) { //no standard abbrev but alternative ones
return m_altAbbrevs->first();
}
@@ -157,7 +157,7 @@ inline const QString& CLanguageMgr::Language::abbrev() const {
return m_abbrev;
}

inline const QString& CLanguageMgr::Language::translatedName() const {
inline const TQString& CLanguageMgr::Language::translatedName() const {
return m_translatedName;
}


+ 5
- 5
bibletime/backend/cplaintextexportrendering.cpp View File

@@ -26,16 +26,16 @@ namespace Rendering {

CPlainTextExportRendering::~CPlainTextExportRendering() {}

const QString CPlainTextExportRendering::renderEntry( const KeyTreeItem& i, CSwordKey* ) {
const TQString CPlainTextExportRendering::renderEntry( const KeyTreeItem& i, CSwordKey* ) {
if (!m_settings.addText) {
return QString(i.key()).append("\n");
return TQString(i.key()).append("\n");
}

ListCSwordModuleInfo modules = i.modules();
util::scoped_ptr<CSwordKey> key( CSwordKey::createInstance(modules.first()) );
QString renderedText = QString(i.key()).append(":\n");
TQString renderedText = TQString(i.key()).append(":\n");

QString entry;
TQString entry;
// for (CSwordModuleInfo* m = modules.first(); m; m = modules.next()) {
ListCSwordModuleInfo::iterator end_it = modules.end();

@@ -51,7 +51,7 @@ namespace Rendering {
return renderedText;
}

const QString CPlainTextExportRendering::finishText( const QString& oldText, KeyTree& ) {
const TQString CPlainTextExportRendering::finishText( const TQString& oldText, KeyTree& ) {
return oldText;
}


+ 2
- 2
bibletime/backend/cplaintextexportrendering.h View File

@@ -33,8 +33,8 @@ public:
virtual ~CPlainTextExportRendering();

protected:
virtual const QString renderEntry( const KeyTreeItem&, CSwordKey* = 0 );
virtual const QString finishText( const QString&, KeyTree& tree );
virtual const TQString renderEntry( const KeyTreeItem&, CSwordKey* = 0 );
virtual const TQString finishText( const TQString&, KeyTree& tree );
};

};

+ 31
- 31
bibletime/backend/creferencemanager.cpp View File

@@ -15,14 +15,14 @@
#include "../frontend/cbtconfig.h"

//QT includes
#include <qregexp.h>
#include <tqregexp.h>

//stl includes
#include <algorithm> // STL algorithms class library

/** Returns a hyperlink used to be imbedded in the display windows. At the moment the format is sword://module/key */
const QString CReferenceManager::encodeHyperlink( const QString moduleName, const QString key, const CReferenceManager::Type type) {
QString ret = QString::null;
const TQString CReferenceManager::encodeHyperlink( const TQString moduleName, const TQString key, const CReferenceManager::Type type) {
TQString ret = TQString::null;

switch (type) {

@@ -70,12 +70,12 @@ const QString CReferenceManager::encodeHyperlink( const QString moduleName, cons
}

if (type == GenericBook) {
const QString s = (!key.isEmpty() ? key : QString::null);
QString newKey = QString::null;
const TQString s = (!key.isEmpty() ? key : TQString::null);
TQString newKey = TQString::null;
//replace all / of the key (e.g. of a CSwordTreeKey) with
// the escape sequence \/ so we know it's a link internal divider (e.g. of CSwordTreeKey)!

QChar c;
TQChar c;

for(unsigned int i = 0; i < s.length(); ++i) {
c = s.at(i);
@@ -120,15 +120,15 @@ const QString CReferenceManager::encodeHyperlink( const QString moduleName, cons
}

/** Decodes the given hyperlink to module and key. */
const bool CReferenceManager::decodeHyperlink( const QString& hyperlink, QString& module, QString& key, CReferenceManager::Type& type ) {
const bool CReferenceManager::decodeHyperlink( const TQString& hyperlink, TQString& module, TQString& key, CReferenceManager::Type& type ) {
/**
* We have to decide between three types of URLS: sword://Type/Module/Key, morph://Testament/key and strongs://Testament/Key
*/
module = QString::null;
key = QString::null;
module = TQString::null;
key = TQString::null;

type = Unknown; //not yet known
QString ref = hyperlink;
TQString ref = hyperlink;
//remove the trailing slash

if (ref.right(1)=="/" && ref.right(2) != "\\/") //trailing slash, but not escaped
@@ -188,7 +188,7 @@ const bool CReferenceManager::decodeHyperlink( const QString& hyperlink, QString
// }

//replace \/ escapes with /
key.replace(QRegExp("\\\\/"), "/");
key.replace(TQRegExp("\\\\/"), "/");
}
else if (ref.left(8).lower() == "morph://" || ref.left(10).lower() == "strongs://") { //strongs or morph URL have the same format
enum PreType {IsMorph, IsStrongs};
@@ -207,7 +207,7 @@ const bool CReferenceManager::decodeHyperlink( const QString& hyperlink, QString
const int pos = ref.find("/");

if (pos>0) { //found
const QString language = ref.mid(0,pos);
const TQString language = ref.mid(0,pos);

if (language.lower() == "hebrew") {
switch (preType) {
@@ -247,14 +247,14 @@ const bool CReferenceManager::decodeHyperlink( const QString& hyperlink, QString
return true;
}

const QString CReferenceManager::encodeReference(const QString &module, const QString &reference) {
//return QString("(%1)%2").arg(module).arg(reference);
return QString("(").append(module).append(")").append(reference);
const TQString CReferenceManager::encodeReference(const TQString &module, const TQString &reference) {
//return TQString("(%1)%2").arg(module).arg(reference);
return TQString("(").append(module).append(")").append(reference);
}

void CReferenceManager::decodeReference(QString &dragreference, QString &module, QString &reference) {
void CReferenceManager::decodeReference(TQString &dragreference, TQString &module, TQString &reference) {
const int pos = dragreference.find(")");
const QString fallbackModule = dragreference.mid( 1, pos - 1);
const TQString fallbackModule = dragreference.mid( 1, pos - 1);
dragreference = dragreference.mid(pos+1);

module = fallbackModule;
@@ -262,15 +262,15 @@ void CReferenceManager::decodeReference(QString &dragreference, QString &module,
}

/** Returns true if the parameter is a hyperlink. */
const bool CReferenceManager::isHyperlink( const QString& hyperlink ) {
const bool CReferenceManager::isHyperlink( const TQString& hyperlink ) {
return ( hyperlink.left(8) == "sword://")
|| (hyperlink.left(10) == "strongs://")
|| (hyperlink.left(8) == "morph://");
}

/** Returns the preferred module name for the given type. */
const QString CReferenceManager::preferredModule( const CReferenceManager::Type type ) {
QString moduleName = QString::null;
const TQString CReferenceManager::preferredModule( const CReferenceManager::Type type ) {
TQString moduleName = TQString::null;
CSwordModuleInfo* module = 0;

switch (type) {
@@ -324,7 +324,7 @@ const QString CReferenceManager::preferredModule( const CReferenceManager::Type
break;
}

return module ? module->name() : QString::null;
return module ? module->name() : TQString::null;
}

/** No descriptions */
@@ -349,7 +349,7 @@ CReferenceManager::Type CReferenceManager::typeFromModule( const CSwordModuleInf
}

/** Parses the given verse references using the given language and the module.*/
const QString CReferenceManager::parseVerseReference( const QString& ref, const CReferenceManager::ParseOptions& options) {
const TQString CReferenceManager::parseVerseReference( const TQString& ref, const CReferenceManager::ParseOptions& options) {

CSwordModuleInfo* const mod = CPointers::backend()->findModuleByName(options.refDestinationModule);
Q_ASSERT(mod);
@@ -361,11 +361,11 @@ const QString CReferenceManager::parseVerseReference( const QString& ref, const

if ((mod->type() != CSwordModuleInfo::Bible) && (mod->type() != CSwordModuleInfo::Commentary)) {
qDebug("CReferenceManager: Only verse based modules are supported as ref destination module");
return QString::null;
return TQString::null;
}

QString sourceLanguage = options.sourceLanguage;
QString destinationLanguage = options.destinationLanguage;
TQString sourceLanguage = options.sourceLanguage;
TQString destinationLanguage = options.destinationLanguage;

StringList locales = sword::LocaleMgr::getSystemLocaleMgr()->getAvailableLocales();
if (/*options.sourceLanguage == "en" ||*/ std::find(locales.begin(), locales.end(), sourceLanguage) == locales.end()) { //sourceLanguage not available
@@ -377,8 +377,8 @@ const QString CReferenceManager::parseVerseReference( const QString& ref, const
}


QString ret;
QStringList refList = QStringList::split(";", ref);
TQString ret;
TQStringList refList = TQStringList::split(";", ref);

CSwordVerseKey baseKey(0);
baseKey.setLocale( sourceLanguage.latin1() );
@@ -387,7 +387,7 @@ const QString CReferenceManager::parseVerseReference( const QString& ref, const

// CSwordVerseKey dummy(0);
//HACK: We have to workaround a Sword bug, we have to set the default locale to the same as the sourceLanguage !
const QString oldLocaleName = CPointers::backend()->booknameLanguage();
const TQString oldLocaleName = CPointers::backend()->booknameLanguage();
CPointers::backend()->booknameLanguage(sourceLanguage);

VerseKey dummy;
@@ -396,7 +396,7 @@ const QString CReferenceManager::parseVerseReference( const QString& ref, const

// qDebug("Parsing '%s' in '%s' using '%s' as base, source lang '%s', dest lang '%s'", ref.latin1(), options.refDestinationModule.latin1(), baseKey.key().latin1(), sourceLanguage.latin1(), destinationLanguage.latin1());

for (QStringList::iterator it = refList.begin(); it != refList.end(); it++) {
for (TQStringList::iterator it = refList.begin(); it != refList.end(); it++) {
//The listkey may contain more than one item, because a ref lik "Gen 1:3,5" is parsed into two single refs
ListKey lk = dummy.ParseVerseList((const char*)(*it).utf8(), (const char*)baseKey.key().utf8(), true);
Q_ASSERT(!dummy.Error());
@@ -413,7 +413,7 @@ const QString CReferenceManager::parseVerseReference( const QString& ref, const
Q_ASSERT(k);
k->setLocale( destinationLanguage.latin1() );

ret.append( QString::fromUtf8(k->getRangeText()) ).append("; ");
ret.append( TQString::fromUtf8(k->getRangeText()) ).append("; ");
}
else { // a single ref
VerseKey vk;
@@ -421,7 +421,7 @@ const QString CReferenceManager::parseVerseReference( const QString& ref, const
vk = lk.getElement(i)->getText();
vk.setLocale( destinationLanguage.latin1() );

ret.append( QString::fromUtf8(vk.getText()) ).append("; ");
ret.append( TQString::fromUtf8(vk.getText()) ).append("; ");
}
}


+ 12
- 12
bibletime/backend/creferencemanager.h View File

@@ -13,7 +13,7 @@
#define CREFERENCEMANAGER_H

//Qt includes
#include <qstring.h>
#include <tqstring.h>

#include "cswordmoduleinfo.h"

@@ -44,7 +44,7 @@ public:
* @param key The string which will contain the key after decoding
* @param type The type param will contain the reference type after decoding
*/
static const bool decodeHyperlink( const QString& hyperlink, QString& module, QString& key, Type& type);
static const bool decodeHyperlink( const TQString& hyperlink, TQString& module, TQString& key, Type& type);
/**
* Returns a hyperlink used to be imbedded in the display windows.
* At the moment the format is sword://module/key
@@ -53,7 +53,7 @@ public:
* @param type The type which is used to encode the hyperlink
* @return The encoded hyperlink
*/
static const QString encodeHyperlink( const QString module, const QString key, const Type type);
static const TQString encodeHyperlink( const TQString module, const TQString key, const Type type);
/**
* Puts a module Name and a Reference together in the 'draggable' form
* (module)reference
@@ -62,24 +62,24 @@ public:
* @return The encoded reference using module and reference
* @author Martin Gruner
*/
static const QString encodeReference(const QString &module, const QString &reference);
static const TQString encodeReference(const TQString &module, const TQString &reference);
/**
* decodes a 'draggable' reference into a modulename and a reference
* @author Martin Gruner
*/
static void decodeReference(QString &dragreference, QString &module, QString &reference);
static void decodeReference(TQString &dragreference, TQString &module, TQString &reference);
/**
* Returns true if the parameter is a hyperlink.
* @param hyperlink The string which is tested
* @return True if the passed string is a hyperlink
*/
static const bool isHyperlink( const QString& hyperlink );
static const bool isHyperlink( const TQString& hyperlink );
/**
* Returns the preferred module name for the given type.
* @param type The type which is used to find the module
* @return The default module name for the passed type
*/
static const QString preferredModule( const Type type );
static const TQString preferredModule( const Type type );
/**
* Returns the type of the passed module type
* @param type The CSwordModuleInfo module typpe
@@ -89,10 +89,10 @@ public:


struct ParseOptions {
QString refDestinationModule;
QString refBase; /* only valid for verse based destination modules*/
QString sourceLanguage; /* only valid for verse based destination modules*/
QString destinationLanguage; /* only valid for verse based destination modules*/
TQString refDestinationModule;
TQString refBase; /* only valid for verse based destination modules*/
TQString sourceLanguage; /* only valid for verse based destination modules*/
TQString destinationLanguage; /* only valid for verse based destination modules*/

ParseOptions() {
destinationLanguage = "en";
@@ -105,7 +105,7 @@ public:
* @param lang The language of the verse reference
* @param newLang The language of the reference, which will be returned. For example: If BibleTime using an english environment parses a spanish ref (lang=es) the returned ref should be in english (newLang=en), because his english standard module only understands en.
*/
static const QString parseVerseReference( const QString& ref, const ParseOptions& options);
static const TQString parseVerseReference( const TQString& ref, const ParseOptions& options);
};

#endif

+ 56
- 56
bibletime/backend/cswordbackend.cpp View File

@@ -33,8 +33,8 @@
#include <ctype.h>

//Qt includes
#include <qdir.h>
#include <qfileinfo.h>
#include <tqdir.h>
#include <tqfileinfo.h>

//KDE includes
#include <klocale.h>
@@ -69,7 +69,7 @@ CSwordBackend::CSwordBackend()
filterInit();
}

CSwordBackend::CSwordBackend(const QString& path, const bool augmentHome)
CSwordBackend::CSwordBackend(const TQString& path, const bool augmentHome)
: sword::SWMgr(!path.isEmpty() ? (const char*)path.local8Bit() : 0, false, new sword::EncodingFilterMgr( sword::ENC_UTF8 ), false, augmentHome) // don't allow module renaming, because we load from a path
{
qDebug("CSwordBackend::CSwordBackend for %s, using %s", path.latin1(), configPath);
@@ -168,7 +168,7 @@ const CSwordBackend::LoadError CSwordBackend::initModules() {
// for (m_moduleList.first(); m_moduleList.current(); m_moduleList.next()) {

if ( (*it)->isEncrypted() ) {
const QString unlockKey = CBTConfig::getModuleEncryptionKey( (*it)->name() ).latin1();
const TQString unlockKey = CBTConfig::getModuleEncryptionKey( (*it)->name() ).latin1();

if (!unlockKey.isNull()) {
setCipherKey( (*it)->name().latin1(), unlockKey.latin1() );
@@ -313,7 +313,7 @@ void CSwordBackend::setDisplayOptions( const CSwordBackend::DisplayOptions ) {
}

/** This function searches for a module with the specified description */
CSwordModuleInfo* const CSwordBackend::findModuleByDescription(const QString& description) {
CSwordModuleInfo* const CSwordBackend::findModuleByDescription(const TQString& description) {
CSwordModuleInfo* ret = 0;
ListCSwordModuleInfo::iterator end_it = m_moduleList.end();

@@ -328,16 +328,16 @@ CSwordModuleInfo* const CSwordBackend::findModuleByDescription(const QString& de
}

/** This function searches for a module with the specified description */
const QString CSwordBackend::findModuleNameByDescription(const QString& description) {
const TQString CSwordBackend::findModuleNameByDescription(const TQString& description) {
if (m_moduleDescriptionMap.contains(description)) {
return m_moduleDescriptionMap[description];
}

return QString::null;
return TQString::null;
}

/** This function searches for a module with the specified name */
CSwordModuleInfo* const CSwordBackend::findModuleByName(const QString& name) {
CSwordModuleInfo* const CSwordBackend::findModuleByName(const TQString& name) {
CSwordModuleInfo* ret = 0;

ListCSwordModuleInfo::iterator end_it = m_moduleList.end();
@@ -382,14 +382,14 @@ CSwordModuleInfo* const CSwordBackend::findModuleByPointer(const CSwordModuleInf
}

/** Returns our local config object to store the cipher keys etc. locally for each user. The values of the config are merged with the global config. */
const bool CSwordBackend::moduleConfig(const QString& module, sword::SWConfig& moduleConfig) {
const bool CSwordBackend::moduleConfig(const TQString& module, sword::SWConfig& moduleConfig) {
sword::SectionMap::iterator section;
DIR *dir = opendir(configPath);

struct dirent *ent;

bool foundConfig = false;
QString modFile;
TQString modFile;

if (dir) { // find and update .conf file
rewinddir(dir);
@@ -398,7 +398,7 @@ const bool CSwordBackend::moduleConfig(const QString& module, sword::SWConfig& m
if ((strcmp(ent->d_name, ".")) && (strcmp(ent->d_name, ".."))) {
modFile.setLatin1(configPath);
modFile.append("/");
modFile.append( QString::fromLocal8Bit(ent->d_name) );
modFile.append( TQString::fromLocal8Bit(ent->d_name) );

moduleConfig = sword::SWConfig( (const char*)modFile.local8Bit() );
section = moduleConfig.Sections.find( (const char*)module.local8Bit() );
@@ -424,7 +424,7 @@ const bool CSwordBackend::moduleConfig(const QString& module, sword::SWConfig& m
}

if (!foundConfig && configType != 2) { //search in $HOME/.sword/
QString myPath(getenv("HOME"));
TQString myPath(getenv("HOME"));
myPath.append("/.sword/mods.d");
dir = opendir(myPath.latin1());

@@ -450,53 +450,53 @@ const bool CSwordBackend::moduleConfig(const QString& module, sword::SWConfig& m
}

/** Returns the text used for the option given as parameter. */
const QString CSwordBackend::optionName( const CSwordModuleInfo::FilterTypes option ) {
const TQString CSwordBackend::optionName( const CSwordModuleInfo::FilterTypes option ) {
switch (option) {

case CSwordModuleInfo::footnotes:
return QString("Footnotes");
return TQString("Footnotes");

case CSwordModuleInfo::strongNumbers:
return QString("Strong's Numbers");
return TQString("Strong's Numbers");

case CSwordModuleInfo::headings:
return QString("Headings");
return TQString("Headings");

case CSwordModuleInfo::morphTags:
return QString("Morphological Tags");
return TQString("Morphological Tags");

case CSwordModuleInfo::lemmas:
return QString("Lemmas");
return TQString("Lemmas");

case CSwordModuleInfo::hebrewPoints:
return QString("Hebrew Vowel Points");
return TQString("Hebrew Vowel Points");

case CSwordModuleInfo::hebrewCantillation:
return QString("Hebrew Cantillation");
return TQString("Hebrew Cantillation");

case CSwordModuleInfo::greekAccents:
return QString("Greek Accents");
return TQString("Greek Accents");

case CSwordModuleInfo::redLetterWords:
return QString("Words of Christ in Red");
return TQString("Words of Christ in Red");

case CSwordModuleInfo::textualVariants:
return QString("Textual Variants");
return TQString("Textual Variants");

case CSwordModuleInfo::scriptureReferences:
return QString("Cross-references");
return TQString("Cross-references");

case CSwordModuleInfo::morphSegmentation:
return QString("Morph Segmentation");
return TQString("Morph Segmentation");
// case CSwordModuleInfo::transliteration:
// return QString("Transliteration");
// return TQString("Transliteration");
}

return QString::null;
return TQString::null;
}

/** Returns the translated name of the option given as parameter. */
const QString CSwordBackend::translatedOptionName(const CSwordModuleInfo::FilterTypes option) {
const TQString CSwordBackend::translatedOptionName(const CSwordModuleInfo::FilterTypes option) {
switch (option) {

case CSwordModuleInfo::footnotes:
@@ -538,57 +538,57 @@ const QString CSwordBackend::translatedOptionName(const CSwordModuleInfo::Filter
// return i18n("Transliteration between scripts");
}

return QString::null;
return TQString::null;
}


const QString CSwordBackend::configOptionName( const CSwordModuleInfo::FilterTypes option ) {
const TQString CSwordBackend::configOptionName( const CSwordModuleInfo::FilterTypes option ) {
switch (option) {

case CSwordModuleInfo::footnotes:
return QString("Footnotes");
return TQString("Footnotes");

case CSwordModuleInfo::strongNumbers:
return QString("Strongs");
return TQString("Strongs");

case CSwordModuleInfo::headings:
return QString("Headings");
return TQString("Headings");

case CSwordModuleInfo::morphTags:
return QString("Morph");
return TQString("Morph");

case CSwordModuleInfo::lemmas:
return QString("Lemma");
return TQString("Lemma");

case CSwordModuleInfo::hebrewPoints:
return QString("HebrewPoints");
return TQString("HebrewPoints");

case CSwordModuleInfo::hebrewCantillation:
return QString("Cantillation");
return TQString("Cantillation");

case CSwordModuleInfo::greekAccents:
return QString("GreekAccents");
return TQString("GreekAccents");

case CSwordModuleInfo::redLetterWords:
return QString("RedLetterWords");
return TQString("RedLetterWords");

case CSwordModuleInfo::textualVariants:
return QString("Variants");
return TQString("Variants");

case CSwordModuleInfo::scriptureReferences:
return QString("Scripref");
return TQString("Scripref");

case CSwordModuleInfo::morphSegmentation:
return QString("MorphSegmentation");
return TQString("MorphSegmentation");

default:
return QString::null;
return TQString::null;
}

return QString::null;
return TQString::null;
}

const QString CSwordBackend::booknameLanguage( const QString& language ) {
const TQString CSwordBackend::booknameLanguage( const TQString& language ) {
if (!language.isEmpty()) {
sword::LocaleMgr::getSystemLocaleMgr()->setDefaultLocaleName( language.latin1() );

@@ -596,7 +596,7 @@ const QString CSwordBackend::booknameLanguage( const QString& language ) {
const ListCSwordModuleInfo::iterator end_it = m_moduleList.end();

//use what sword returns, language may be different
QString newLocaleName( sword::LocaleMgr::getSystemLocaleMgr()->getDefaultLocaleName() );
TQString newLocaleName( sword::LocaleMgr::getSystemLocaleMgr()->getDefaultLocaleName() );

for (ListCSwordModuleInfo::iterator it = m_moduleList.begin(); it != end_it; ++it) {
if ( ((*it)->type() == CSwordModuleInfo::Bible) || ((*it)->type() == CSwordModuleInfo::Commentary) ) {
@@ -607,7 +607,7 @@ const QString CSwordBackend::booknameLanguage( const QString& language ) {

}

return QString( sword::LocaleMgr::getSystemLocaleMgr()->getDefaultLocaleName() );
return TQString( sword::LocaleMgr::getSystemLocaleMgr()->getDefaultLocaleName() );
}


@@ -629,27 +629,27 @@ void CSwordBackend::reloadModules() {
initModules();
}

const QStringList CSwordBackend::swordDirList() {
QStringList ret;
const QString home = QString(getenv("HOME"));
const TQStringList CSwordBackend::swordDirList() {
TQStringList ret;
const TQString home = TQString(getenv("HOME"));

//return a list of used Sword dirs. Useful for the installer
QString configPath = QString("%1/.sword/sword.conf").arg(home);
TQString configPath = TQString("%1/.sword/sword.conf").arg(home);

if (!QFile(configPath).exists()) {
if (!TQFile(configPath).exists()) {
configPath = globalConfPath; //e.g. /etc/sword.conf, /usr/local/etc/sword.conf


}


QStringList configs = QStringList::split(":", configPath);
TQStringList configs = TQStringList::split(":", configPath);

/*ToDo: Use the const iterator as soon as we switch to Qt > 3.1
for (QStringList::const_iterator it = configs.constBegin(); it != configs.constEnd(); ++it) {*/
for (TQStringList::const_iterator it = configs.constBegin(); it != configs.constEnd(); ++it) {*/

for (QStringList::const_iterator it = configs.begin(); it != configs.end(); ++it) {
if (!QFileInfo(*it).exists()) {
for (TQStringList::const_iterator it = configs.begin(); it != configs.end(); ++it) {
if (!TQFileInfo(*it).exists()) {
continue;
}


+ 15
- 15
bibletime/backend/cswordbackend.h View File

@@ -17,10 +17,10 @@
//#include "centrydisplay.h"

//Qt includes
#include <qptrlist.h>
#include <qmap.h>
#include <qstring.h>
#include <qstringlist.h>
#include <tqptrlist.h>
#include <tqmap.h>
#include <tqstring.h>
#include <tqstringlist.h>

//Sword includes
#include <swmgr.h>
@@ -99,7 +99,7 @@ public:
* @param path The path which is used to load modules
* @param augmentHome True if the $HOME/.sword/ modules should be augmented with the other modules
*/
CSwordBackend( const QString& path, const bool augmentHome = true );
CSwordBackend( const TQString& path, const bool augmentHome = true );

/**
* The destrctor of this backend. This function shuts the modules down using @ref shutdownModules.