summaryrefslogtreecommitdiffstats
path: root/bibletime/util/ctoolclass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'bibletime/util/ctoolclass.cpp')
-rw-r--r--bibletime/util/ctoolclass.cpp86
1 files changed, 43 insertions, 43 deletions
diff --git a/bibletime/util/ctoolclass.cpp b/bibletime/util/ctoolclass.cpp
index d00f335..717f00c 100644
--- a/bibletime/util/ctoolclass.cpp
+++ b/bibletime/util/ctoolclass.cpp
@@ -17,11 +17,11 @@
#include "backend/cswordmoduleinfo.h"
//QT includes
-#include <qlabel.h>
-#include <qfile.h>
-#include <qfiledialog.h>
-#include <qtextstream.h>
-#include <qregexp.h>
+#include <tqlabel.h>
+#include <tqfile.h>
+#include <tqfiledialog.h>
+#include <tqtextstream.h>
+#include <tqregexp.h>
//KDE includes
#include <klocale.h>
@@ -34,8 +34,8 @@
#include <kapplication.h>
-QString CToolClass::locatehtml(const QString &filename) {
- QString path = locate("html", KGlobal::locale()->language() + '/' + filename);
+TQString CToolClass::locatehtml(const TQString &filename) {
+ TQString path = locate("html", KGlobal::locale()->language() + '/' + filename);
if (path.isNull())
path = locate("html", "default/" + filename);
if (path.isNull())
@@ -44,37 +44,37 @@ QString CToolClass::locatehtml(const QString &filename) {
}
/** Converts HTML text to plain text */
-QString CToolClass::htmlToText(const QString& html) {
- QString newText = html;
+TQString CToolClass::htmlToText(const TQString& html) {
+ TQString newText = html;
// convert some tags we need in code
- newText.replace( QRegExp(" "),"#SPACE#" );
- newText.replace( QRegExp("<br/?>\\s*"), "<br/>\n" );
- newText.replace( QRegExp("#SPACE#")," " );
+ newText.replace( TQRegExp(" "),"#SPACE#" );
+ newText.replace( TQRegExp("<br/?>\\s*"), "<br/>\n" );
+ newText.replace( TQRegExp("#SPACE#")," " );
- QRegExp re("<.+>");
+ TQRegExp re("<.+>");
re.setMinimal(true);
newText.replace( re,"" );
return newText;
}
/** Converts text to HTML (\n to <BR>) */
-QString CToolClass::textToHTML(const QString& text) {
- QString newText = text;
- newText.replace( QRegExp("<BR>\n"),"#NEWLINE#" );
- newText.replace( QRegExp("\n"),"<BR>\n" );
- newText.replace( QRegExp("#NEWLINE#"),"<BR>\n");
+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");
return newText;
}
/** Creates the file filename and put text into the file.
*/
-bool CToolClass::savePlainFile( const QString& filename, const QString& text, const bool& forceOverwrite, const QTextStream::Encoding& fileEncoding) {
- QFile saveFile(filename);
+bool CToolClass::savePlainFile( const TQString& filename, const TQString& text, const bool& forceOverwrite, const TQTextStream::Encoding& fileEncoding) {
+ TQFile saveFile(filename);
bool ret;
if (saveFile.exists()) {
if (!forceOverwrite && KMessageBox::warningYesNo(0,
- QString::fromLatin1("<qt><B>%1</B><BR>%2</qt>")
+ TQString::fromLatin1("<qt><B>%1</B><BR>%2</qt>")
.arg( i18n("The file already exists.") )
.arg( i18n("Do you want to overwrite it?")
)
@@ -88,14 +88,14 @@ bool CToolClass::savePlainFile( const QString& filename, const QString& text, co
};
if ( saveFile.open(IO_ReadWrite) ) {
- QTextStream textstream( &saveFile );
+ TQTextStream textstream( &saveFile );
textstream.setEncoding(fileEncoding);
textstream << text;
saveFile.close();
ret = true;
}
else {
- KMessageBox::error(0, QString::fromLatin1("<qt>%1<BR><B>%2</B></qt>")
+ 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.")));
saveFile.close();
@@ -106,7 +106,7 @@ bool CToolClass::savePlainFile( const QString& filename, const QString& text, co
/** Returns the icon used for the module given as aparameter. */
-QPixmap CToolClass::getIconForModule( CSwordModuleInfo* module_info ) {
+TQPixmap CToolClass::getIconForModule( CSwordModuleInfo* module_info ) {
if (!module_info)
return SmallIcon(CResMgr::modules::book::icon_locked, 16);
@@ -115,7 +115,7 @@ QPixmap CToolClass::getIconForModule( CSwordModuleInfo* module_info ) {
};
- QPixmap img;
+ TQPixmap img;
switch (module_info->type()) {
case CSwordModuleInfo::Bible:
@@ -159,16 +159,16 @@ QPixmap CToolClass::getIconForModule( CSwordModuleInfo* module_info ) {
return img;
}
-QLabel* CToolClass::explanationLabel(QWidget* parent, const QString& heading, const QString& text ) {
- QLabel* label = new QLabel( QString::fromLatin1("<B>%1</B><BR>%2").arg(heading).arg(text),parent );
+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 );
label->setAutoResize(true);
label->setMargin(1);
- label->setFrameStyle(QFrame::Box | QFrame::Plain);
+ label->setFrameStyle(TQFrame::Box | TQFrame::Plain);
return label;
}
/** No descriptions */
-bool CToolClass::inHTMLTag(int pos, QString & text) {
+bool CToolClass::inHTMLTag(int pos, TQString & text) {
int i1=text.findRev("<",pos);
int i2=text.findRev(">",pos);
int i3=text.find(">",pos);
@@ -189,36 +189,36 @@ bool CToolClass::inHTMLTag(int pos, QString & text) {
return false;
}
-QString CToolClass::moduleToolTip(CSwordModuleInfo* module) {
+TQString CToolClass::moduleToolTip(CSwordModuleInfo* module) {
Q_ASSERT(module);
if (!module) {
- return QString::null;
+ return TQString::null;
}
- QString text;
+ TQString text;
- text = QString("<b>%1</b> ").arg( module->name() )
- + ((module->category() == CSwordModuleInfo::Cult) ? QString::fromLatin1("<small><b>%1</b></small><br>").arg(i18n("Take care, this work contains cult / questionable material!")) : QString::null);
+ 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 += QString("<small>(") + module->config(CSwordModuleInfo::Description) + QString(")</small><hr>");
+ text += TQString("<small>(") + module->config(CSwordModuleInfo::Description) + TQString(")</small><hr>");
- text += i18n("Language") + QString(": %1<br>").arg( module->language()->translatedName() );
+ text += i18n("Language") + TQString(": %1<br>").arg( module->language()->translatedName() );
if (module->isEncrypted()) {
- text += i18n("Unlock key") + QString(": %1<br>")
- .arg(!module->config(CSwordModuleInfo::CipherKey).isEmpty() ? module->config(CSwordModuleInfo::CipherKey) : QString("<font COLOR=\"red\">%1</font>").arg(i18n("not set")));
+ 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")));
}
if (module->hasVersion()) {
- text += i18n("Version") + QString(": %1<br>").arg( module->config(CSwordModuleInfo::ModuleVersion) );
+ text += i18n("Version") + TQString(": %1<br>").arg( module->config(CSwordModuleInfo::ModuleVersion) );
}
- QString options;
+ TQString options;
unsigned int opts;
for (opts = CSwordModuleInfo::filterTypesMIN; opts <= CSwordModuleInfo::filterTypesMAX; ++opts) {
if (module->has( static_cast<CSwordModuleInfo::FilterTypes>(opts) )) {
if (!options.isEmpty()) {
- options += QString::fromLatin1(", ");
+ options += TQString::fromLatin1(", ");
}
options += CSwordBackend::translatedOptionName(
@@ -228,10 +228,10 @@ QString CToolClass::moduleToolTip(CSwordModuleInfo* module) {
}
if (!options.isEmpty()) {
- text += i18n("Options") + QString::fromLatin1(": <small>") + options + QString("</small>");
+ text += i18n("Options") + TQString::fromLatin1(": <small>") + options + TQString("</small>");
}
- if (text.right(4) == QString::fromLatin1("<br>")) {
+ if (text.right(4) == TQString::fromLatin1("<br>")) {
text = text.left(text.length()-4);
}