summaryrefslogtreecommitdiffstats
path: root/src/common/cli/cli_log.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-30 00:15:53 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-30 00:15:53 +0000
commit0aaa8e3fc8f8a1481333b564f0922277c8d8ad59 (patch)
treeb95c0ca86c4876dd139af376b9f4afd8917cf0cd /src/common/cli/cli_log.cpp
parentb79a2c28534cf09987eeeba3077fff9236df182a (diff)
downloadpiklab-0aaa8e3fc8f8a1481333b564f0922277c8d8ad59.tar.gz
piklab-0aaa8e3fc8f8a1481333b564f0922277c8d8ad59.zip
TQt4 port piklab
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/piklab@1238822 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/common/cli/cli_log.cpp')
-rw-r--r--src/common/cli/cli_log.cpp30
1 files changed, 7 insertions, 23 deletions
diff --git a/src/common/cli/cli_log.cpp b/src/common/cli/cli_log.cpp
index 603d5f8..948675b 100644
--- a/src/common/cli/cli_log.cpp
+++ b/src/common/cli/cli_log.cpp
@@ -11,53 +11,37 @@
#include "common/global/global.h"
#include "cli_global.h"
-void CLI::View::doLog(Log::LineType type, const QString &text, Log::Action)
+void CLI::View::doLog(Log::LineType type, const TQString &text, Log::Action)
{
- QString s = text + "\n";
+ TQString s = text + "\n";
switch (type.type()) {
case Log::LineType::Error:
case Log::LineType::SoftError: s = "Error: " + s; break;
case Log::LineType::Warning: s = "Warning: " + s; break;
default: break;
}
-#if QT_VERSION<0x040000
if ( type==Log::LineType::Error || type==Log::LineType::SoftError ) fprintf(stderr, "%s", s.latin1());
else fprintf(stdout, "%s", s.latin1());
-#else
- QByteArray ba = s.toLatin1();
- if ( type==Log::LineType::Error || type==Log::LineType::SoftError ) fprintf(stderr, "%s", ba.constData());
- else fprintf(stdout, "%s", ba.constData());
-#endif
}
-void CLI::View::doLog(Log::DebugLevel, const QString &text, Log::Action)
+void CLI::View::doLog(Log::DebugLevel, const TQString &text, Log::Action)
{
- QString s = text + "\n";
-#if QT_VERSION<0x040000
+ TQString s = text + "\n";
fprintf(stdout, "%s", s.latin1());
-#else
- QByteArray ba = s.toLatin1();
- fprintf(stdout, "%s", ba.constData());
-#endif
}
-void CLI::View::appendToLastLine(const QString &text)
+void CLI::View::appendToLastLine(const TQString &text)
{
-#if QT_VERSION<0x040000
fprintf(stdout, "%s", text.latin1());
-#else
- QByteArray ba = text.toLatin1();
- fprintf(stdout, "%s", ba.constData());
-#endif
}
-void CLI::View::sorry(const QString &message, const QString &details)
+void CLI::View::sorry(const TQString &message, const TQString &details)
{
if ( details.isEmpty() ) log(Log::LineType::Error, message, Log::Immediate);
else log(Log::LineType::Error, message + " (" + details + ")", Log::Immediate);
}
-bool CLI::View::askContinue(const QString &message)
+bool CLI::View::askContinue(const TQString &message)
{
log(Log::LineType::Warning, message + " " + (_force ? i18n("*yes*") : i18n("*no*")), Log::Immediate);
if (_force) return true;