1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

[OP-835] Qt 5.1.0 - fixed compilation error in GCS main.cpp

This commit is contained in:
Philippe Renon 2013-09-15 23:55:50 +02:00
parent 09b22a18f4
commit 939ba5956c

View File

@ -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)