summaryrefslogtreecommitdiffstats
path: root/bibletime/util/ctoolclass.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-17 17:31:58 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-17 17:31:58 +0000
commitb6027ae3f71e2c1961357500b9da203e3a04a194 (patch)
treef6e7cbb9ad81542a6287c7c60602d5a38cf24457 /bibletime/util/ctoolclass.cpp
parent1ed307edd091effc390a7b98986fccb0f8307582 (diff)
downloadbibletime-b6027ae3f71e2c1961357500b9da203e3a04a194.tar.gz
bibletime-b6027ae3f71e2c1961357500b9da203e3a04a194.zip
TQt4 port Bibletime
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/bibletime@1232459 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'bibletime/util/ctoolclass.cpp')
-rw-r--r--bibletime/util/ctoolclass.cpp56
1 files changed, 28 insertions, 28 deletions
diff --git a/bibletime/util/ctoolclass.cpp b/bibletime/util/ctoolclass.cpp
index 717f00c..a89c557 100644
--- a/bibletime/util/ctoolclass.cpp
+++ b/bibletime/util/ctoolclass.cpp
@@ -47,22 +47,22 @@ TQString CToolClass::locatehtml(const TQString &filename) {
TQString CToolClass::htmlToText(const TQString& html) {
TQString newText = html;
// convert some tags we need in code
- newText.replace( TQRegExp(" "),"#SPACE#" );
- newText.replace( TQRegExp("<br/?>\\s*"), "<br/>\n" );
- newText.replace( TQRegExp("#SPACE#")," " );
+ newText.tqreplace( TQRegExp(" "),"#SPACE#" );
+ newText.tqreplace( TQRegExp("<br/?>\\s*"), "<br/>\n" );
+ newText.tqreplace( TQRegExp("#SPACE#")," " );
TQRegExp re("<.+>");
re.setMinimal(true);
- newText.replace( re,"" );
+ newText.tqreplace( re,"" );
return newText;
}
/** Converts text to HTML (\n to <BR>) */
TQString CToolClass::textToHTML(const TQString& text) {
TQString newText = text;
- newText.replace( TQRegExp("<BR>\n"),"#NEWLINE#" );
- newText.replace( TQRegExp("\n"),"<BR>\n" );
- newText.replace( TQRegExp("#NEWLINE#"),"<BR>\n");
+ newText.tqreplace( TQRegExp("<BR>\n"),"#NEWLINE#" );
+ newText.tqreplace( TQRegExp("\n"),"<BR>\n" );
+ newText.tqreplace( TQRegExp("#NEWLINE#"),"<BR>\n");
return newText;
}
@@ -74,9 +74,9 @@ bool CToolClass::savePlainFile( const TQString& filename, const TQString& text,
if (saveFile.exists()) {
if (!forceOverwrite && KMessageBox::warningYesNo(0,
- TQString::fromLatin1("<qt><B>%1</B><BR>%2</qt>")
- .arg( i18n("The file already exists.") )
- .arg( i18n("Do you want to overwrite it?")
+ TQString::tqfromLatin1("<qt><B>%1</B><BR>%2</qt>")
+ .tqarg( i18n("The file already exists.") )
+ .tqarg( i18n("Do you want to overwrite it?")
)
) == KMessageBox::No
) {
@@ -95,9 +95,9 @@ bool CToolClass::savePlainFile( const TQString& filename, const TQString& text,
ret = true;
}
else {
- KMessageBox::error(0, TQString::fromLatin1("<qt>%1<BR><B>%2</B></qt>")
- .arg( i18n("The file couldn't be saved.") )
- .arg( i18n("Please check permissions etc.")));
+ KMessageBox::error(0, TQString::tqfromLatin1("<qt>%1<BR><B>%2</B></qt>")
+ .tqarg( i18n("The file couldn't be saved.") )
+ .tqarg( i18n("Please check permissions etc.")));
saveFile.close();
ret = false;
}
@@ -159,8 +159,8 @@ TQPixmap CToolClass::getIconForModule( CSwordModuleInfo* module_info ) {
return img;
}
-TQLabel* CToolClass::explanationLabel(TQWidget* parent, const TQString& heading, const TQString& text ) {
- TQLabel* label = new TQLabel( TQString::fromLatin1("<B>%1</B><BR>%2").arg(heading).arg(text),parent );
+TQLabel* CToolClass::explanationLabel(TQWidget* tqparent, const TQString& heading, const TQString& text ) {
+ TQLabel* label = new TQLabel( TQString::tqfromLatin1("<B>%1</B><BR>%2").tqarg(heading).tqarg(text),tqparent );
label->setAutoResize(true);
label->setMargin(1);
label->setFrameStyle(TQFrame::Box | TQFrame::Plain);
@@ -169,10 +169,10 @@ TQLabel* CToolClass::explanationLabel(TQWidget* parent, const TQString& heading,
/** No descriptions */
bool CToolClass::inHTMLTag(int pos, TQString & text) {
- int i1=text.findRev("<",pos);
- int i2=text.findRev(">",pos);
- int i3=text.find(">",pos);
- int i4=text.find("<",pos);
+ int i1=text.tqfindRev("<",pos);
+ int i2=text.tqfindRev(">",pos);
+ int i3=text.tqfind(">",pos);
+ int i4=text.tqfind("<",pos);
// if ((i1>0) && (i2==-1)) //we're in th first html tag
@@ -192,25 +192,25 @@ bool CToolClass::inHTMLTag(int pos, TQString & text) {
TQString CToolClass::moduleToolTip(CSwordModuleInfo* module) {
Q_ASSERT(module);
if (!module) {
- return TQString::null;
+ return TQString();
}
TQString text;
- text = TQString("<b>%1</b> ").arg( module->name() )
- + ((module->category() == CSwordModuleInfo::Cult) ? TQString::fromLatin1("<small><b>%1</b></small><br>").arg(i18n("Take care, this work contains cult / questionable material!")) : TQString::null);
+ text = TQString("<b>%1</b> ").tqarg( module->name() )
+ + ((module->category() == CSwordModuleInfo::Cult) ? TQString::tqfromLatin1("<small><b>%1</b></small><br>").tqarg(i18n("Take care, this work contains cult / questionable material!")) : TQString());
text += TQString("<small>(") + module->config(CSwordModuleInfo::Description) + TQString(")</small><hr>");
- text += i18n("Language") + TQString(": %1<br>").arg( module->language()->translatedName() );
+ text += i18n("Language") + TQString(": %1<br>").tqarg( module->language()->translatedName() );
if (module->isEncrypted()) {
text += i18n("Unlock key") + TQString(": %1<br>")
- .arg(!module->config(CSwordModuleInfo::CipherKey).isEmpty() ? module->config(CSwordModuleInfo::CipherKey) : TQString("<font COLOR=\"red\">%1</font>").arg(i18n("not set")));
+ .tqarg(!module->config(CSwordModuleInfo::CipherKey).isEmpty() ? module->config(CSwordModuleInfo::CipherKey) : TQString("<font COLOR=\"red\">%1</font>").tqarg(i18n("not set")));
}
if (module->hasVersion()) {
- text += i18n("Version") + TQString(": %1<br>").arg( module->config(CSwordModuleInfo::ModuleVersion) );
+ text += i18n("Version") + TQString(": %1<br>").tqarg( module->config(CSwordModuleInfo::ModuleVersion) );
}
TQString options;
@@ -218,7 +218,7 @@ TQString CToolClass::moduleToolTip(CSwordModuleInfo* module) {
for (opts = CSwordModuleInfo::filterTypesMIN; opts <= CSwordModuleInfo::filterTypesMAX; ++opts) {
if (module->has( static_cast<CSwordModuleInfo::FilterTypes>(opts) )) {
if (!options.isEmpty()) {
- options += TQString::fromLatin1(", ");
+ options += TQString::tqfromLatin1(", ");
}
options += CSwordBackend::translatedOptionName(
@@ -228,10 +228,10 @@ TQString CToolClass::moduleToolTip(CSwordModuleInfo* module) {
}
if (!options.isEmpty()) {
- text += i18n("Options") + TQString::fromLatin1(": <small>") + options + TQString("</small>");
+ text += i18n("Options") + TQString::tqfromLatin1(": <small>") + options + TQString("</small>");
}
- if (text.right(4) == TQString::fromLatin1("<br>")) {
+ if (text.right(4) == TQString::tqfromLatin1("<br>")) {
text = text.left(text.length()-4);
}