From 939ba5956c6828d968c998f9af5fcdb07bdb22e1 Mon Sep 17 00:00:00 2001 From: Philippe Renon Date: Sun, 15 Sep 2013 23:55:50 +0200 Subject: [PATCH] [OP-835] Qt 5.1.0 - fixed compilation error in GCS main.cpp --- ground/openpilotgcs/src/app/main.cpp | 56 ++++++++++++++-------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/ground/openpilotgcs/src/app/main.cpp b/ground/openpilotgcs/src/app/main.cpp index fec6baa38..0866f0108 100644 --- a/ground/openpilotgcs/src/app/main.cpp +++ b/ground/openpilotgcs/src/app/main.cpp @@ -209,6 +209,34 @@ inline QString msgSendArgumentFailed() "Unable to send command line arguments to the already running instance. It appears to be not responding."); } +void mainMessageOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg) +{ + QFile file(QDir::tempPath() + "/gcs.log"); + + if (file.open(QIODevice::Append | QIODevice::Text)) { + QTextStream out(&file); + out << QTime::currentTime().toString("hh:mm:ss.zzz "); + + switch (type) { + case QtDebugMsg: + out << "DBG: "; + break; + case QtWarningMsg: + out << "WRN: "; + break; + case QtCriticalMsg: + out << "CRT: "; + break; + case QtFatalMsg: + out << "FTL: "; + break; + } + + out << msg << '\n'; + out.flush(); + } +} + // Prepare a remote argument: If it is a relative file, add the current directory // since the the central instance might be running in a different directory. inline QString prepareRemoteArgument(const QString &arg) @@ -417,34 +445,6 @@ void loadTranslators(QString language, QTranslator &translator, QTranslator &qtT } } -void mainMessageOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg) -{ - QFile file(QDir::tempPath() + "/gcs.log"); - - if (file.open(QIODevice::Append | QIODevice::Text)) { - QTextStream out(&file); - out << QTime::currentTime().toString("hh:mm:ss.zzz "); - - switch (type) { - case QtDebugMsg: - out << "DBG: "; - break; - case QtWarningMsg: - out << "WRN: "; - break; - case QtCriticalMsg: - out << "CRT: "; - break; - case QtFatalMsg: - out << "FTL: "; - break; - } - - out << msg << '\n'; - out.flush(); - } -} - } // namespace anonymous int main(int argc, char * *argv)