From 29c9c528c453ab9cd0bf52f41f6a9cbde29be332 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaakko=20Kera=CC=88nen?= Date: Mon, 27 Oct 2014 16:57:33 +0200 Subject: [PATCH] Tools|Amethyst: Updated for Qt 5 --- doomsday/tools/amethyst/changelog.txt | 4 ++++ doomsday/tools/amethyst/src/defs.h | 2 +- doomsday/tools/amethyst/src/main.cpp | 8 ++++---- doomsday/tools/amethyst/src/outputstate.cpp | 8 ++++---- doomsday/tools/amethyst/src/utils.cpp | 4 ++-- 5 files changed, 15 insertions(+), 11 deletions(-) diff --git a/doomsday/tools/amethyst/changelog.txt b/doomsday/tools/amethyst/changelog.txt index 560bdd1528..a8be747877 100644 --- a/doomsday/tools/amethyst/changelog.txt +++ b/doomsday/tools/amethyst/changelog.txt @@ -1,6 +1,10 @@ AMETHYST CHANGELOG ================== +1.1.2 (Oct 2014) +---------------- +* Updated for Qt 5. + 1.1.1 (Jan 2012) ---------------- + If macro "CR_NL" defined, \n is output as \r\n. diff --git a/doomsday/tools/amethyst/src/defs.h b/doomsday/tools/amethyst/src/defs.h index d2962522aa..651f61e595 100644 --- a/doomsday/tools/amethyst/src/defs.h +++ b/doomsday/tools/amethyst/src/defs.h @@ -18,7 +18,7 @@ #ifndef __AMETHYST_COMMON_DEFS_H__ #define __AMETHYST_COMMON_DEFS_H__ -#define VERSION_STR "1.1.1" +#define VERSION_STR "1.1.2" #define BUILD_STR "Version "VERSION_STR" ("__DATE__")" #define MAX_COLUMNS 40 diff --git a/doomsday/tools/amethyst/src/main.cpp b/doomsday/tools/amethyst/src/main.cpp index b8a0d50676..57557b7654 100644 --- a/doomsday/tools/amethyst/src/main.cpp +++ b/doomsday/tools/amethyst/src/main.cpp @@ -22,18 +22,18 @@ #include #ifndef _WIN32 -void messagePrinter(QtMsgType type, const char* msg) +void messagePrinter(QtMsgType type, const QMessageLogContext &, const QString &msg) { switch(type) { case QtDebugMsg: case QtWarningMsg: case QtCriticalMsg: - fwprintf(stderr, L"%s\n", msg); + fwprintf(stderr, L"%s\n", msg.toLatin1().constData()); break; case QtFatalMsg: - fwprintf(stderr, L"Fatal Error: %s\n", msg); + fwprintf(stderr, L"Fatal Error: %s\n", msg.toLatin1().constData()); abort(); } } @@ -69,7 +69,7 @@ void printUsage(void) int main(int argc, char **argv) { #ifndef _WIN32 - qInstallMsgHandler(messagePrinter); + qInstallMessageHandler(messagePrinter); #endif QCoreApplication a(argc, argv); // event loop never started diff --git a/doomsday/tools/amethyst/src/outputstate.cpp b/doomsday/tools/amethyst/src/outputstate.cpp index 33fadde279..31fe2675cd 100644 --- a/doomsday/tools/amethyst/src/outputstate.cpp +++ b/doomsday/tools/amethyst/src/outputstate.cpp @@ -62,7 +62,7 @@ String OutputState::filledLine(const QStringList& /*completedLines*/) while(_pos < contextLen && line.size() <= width) { QChar c = (*source)[_pos++]; - switch(c.toAscii()) + switch(c.toLatin1()) { case OutputContext::CtrlAlign: c = (*source)[_pos++]; @@ -204,7 +204,7 @@ void OutputState::rawOutput(String& currentLine, String& linePrefix, QStringList while(_pos < contextLen) { QChar c = (*source)[_pos++]; - switch(c.toAscii()) + switch(c.toLatin1()) { case OutputContext::CtrlAlign: case OutputContext::CtrlFill: @@ -236,13 +236,13 @@ void OutputState::rawOutput(String& currentLine, String& linePrefix, QStringList case OutputContext::CtrlAnchorPrepend: case OutputContext::CtrlAnchorAppend: { - bool prepend = (c.toAscii() == OutputContext::CtrlAnchorPrepend); + bool prepend = (c.toLatin1() == OutputContext::CtrlAnchorPrepend); QString str; // Get the entire anchor string from the source. forever { c = (*source)[_pos++]; - if(c.toAscii() == OutputContext::CtrlAnchorAppend || c.toAscii() == OutputContext::CtrlAnchorPrepend) + if(c.toLatin1() == OutputContext::CtrlAnchorAppend || c.toLatin1() == OutputContext::CtrlAnchorPrepend) break; str += c; } diff --git a/doomsday/tools/amethyst/src/utils.cpp b/doomsday/tools/amethyst/src/utils.cpp index 8f9823714f..d4fee648fc 100644 --- a/doomsday/tools/amethyst/src/utils.cpp +++ b/doomsday/tools/amethyst/src/utils.cpp @@ -546,7 +546,7 @@ String applyFilter(String input, const String& filter, FilterApplyMode mode, Gem continue; } // Normal 2-char escape. - switch(c.toAscii()) + switch(c.toLatin1()) { case '@': case '{': @@ -818,7 +818,7 @@ int visualSize(const String& str) int len = 0; for(int i = 0; i < str.size(); i++) { - switch(str[i].toAscii()) + switch(str[i].toLatin1()) { case OutputContext::CtrlAlign: case OutputContext::CtrlFill: