Skip to content

Commit

Permalink
Tools|Amethyst: Updated for Qt 5
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Oct 27, 2014
1 parent 144e5a2 commit 29c9c52
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
4 changes: 4 additions & 0 deletions 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.
Expand Down
2 changes: 1 addition & 1 deletion doomsday/tools/amethyst/src/defs.h
Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions doomsday/tools/amethyst/src/main.cpp
Expand Up @@ -22,18 +22,18 @@
#include <QDebug>

#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();
}
}
Expand Down Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions doomsday/tools/amethyst/src/outputstate.cpp
Expand Up @@ -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++];
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions doomsday/tools/amethyst/src/utils.cpp
Expand Up @@ -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 '{':
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 29c9c52

Please sign in to comment.