diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:49:52 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:49:52 +0000 |
commit | cfc42a28c327b96c6a2afee92af3bac1a479eb8a (patch) | |
tree | e3219edf5f827eaa4db3feb509a17846a1a5a752 /amor/amortips.cpp | |
parent | a73fc4d7e66fe0824313aa4e9a650c4cddef6e9f (diff) | |
download | tdetoys-cfc42a28c327b96c6a2afee92af3bac1a479eb8a.tar.gz tdetoys-cfc42a28c327b96c6a2afee92af3bac1a479eb8a.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdetoys@1157650 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'amor/amortips.cpp')
-rw-r--r-- | amor/amortips.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/amor/amortips.cpp b/amor/amortips.cpp index 1ef7c8f..798657e 100644 --- a/amor/amortips.cpp +++ b/amor/amortips.cpp @@ -29,8 +29,8 @@ #include "amortips.h" #include <kstandarddirs.h> #include <klocale.h> -#include <qfile.h> -#include <qregexp.h> +#include <tqfile.h> +#include <tqregexp.h> #include <kdebug.h> //--------------------------------------------------------------------------- @@ -45,11 +45,11 @@ AmorTips::AmorTips() // Set the file containing tips. This reads all tips into memory at the // moment - need to make more efficient. // -bool AmorTips::setFile(const QString& file) +bool AmorTips::setFile(const TQString& file) { bool rv = false; - QString path( locate("appdata", file) ); + TQString path( locate("appdata", file) ); if(path.length() && read(path)) rv = true; @@ -71,11 +71,11 @@ void AmorTips::reset() // // Get a tip randomly from the list // -QString AmorTips::tip() +TQString AmorTips::tip() { if (mTips.count()) { - QString tip = *mTips.at(kapp->random() % mTips.count()); + TQString tip = *mTips.at(kapp->random() % mTips.count()); return i18n(tip.utf8()); } @@ -88,24 +88,24 @@ QString AmorTips::tip() // bool AmorTips::readKTips() { - QString fname; + TQString fname; - fname = locate("data", QString("kdewizard/tips")); + fname = locate("data", TQString("kdewizard/tips")); if (fname.isEmpty()) return false; - QFile f(fname); + TQFile f(fname); if (f.open(IO_ReadOnly)) { // Reading of tips must be exactly as in KTipDatabase::loadTips for translation - QString content = f.readAll(); - const QRegExp rx("\\n+"); + TQString content = f.readAll(); + const TQRegExp rx("\\n+"); int pos = -1; while ((pos = content.find("<html>", pos + 1, false)) != -1) { - QString tip = content + TQString tip = content .mid(pos + 6, content.find("</html>", pos, false) - pos - 6) .replace(rx, "\n"); if (!tip.endsWith("\n")) @@ -130,9 +130,9 @@ bool AmorTips::readKTips() // // Read all tips from the specified file. // -bool AmorTips::read(const QString& path) +bool AmorTips::read(const TQString& path) { - QFile file(path); + TQFile file(path); if (file.open(IO_ReadOnly)) { @@ -151,17 +151,17 @@ bool AmorTips::read(const QString& path) // // Read a single tip. // -bool AmorTips::readTip(QFile &file) +bool AmorTips::readTip(TQFile &file) { char buffer[1024] = ""; - QString tip; + TQString tip; while (!file.atEnd() && buffer[0] != '%') { file.readLine(buffer, 1024); if (buffer[0] != '%') { - tip += QString::fromUtf8(buffer); + tip += TQString::fromUtf8(buffer); } } |