Skip to content
Snippets Groups Projects

QDS-11466 Download user projects directly via QR code

Merged Burak Hançerli requested to merge QDS-11466/direct-download-via-qr into master
1 file
+ 10
14
Compare changes
  • Side-by-side
  • Inline
+ 10
14
@@ -35,13 +35,13 @@ static QString appLogs;
void messageHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg)
{
QString logPrefix, logSuffix, newLog;
QByteArray localMsg = msg.toLocal8Bit();
const char *file = context.file ? context.file : "";
const char *function = context.function ? context.function : "";
QString logPrefix, logSuffix, newLog;
QMessageBox msgBox(QMessageBox::Critical, "Critical:", msg, QMessageBox::Ok);
switch (type)
{
switch (type) {
case QtDebugMsg:
logPrefix = QStringLiteral("Debug: ");
break;
@@ -53,7 +53,6 @@ void messageHandler(QtMsgType type, const QMessageLogContext &context, const QSt
break;
case QtCriticalMsg:
logPrefix = QStringLiteral("Critical: ");
msgBox.exec();
break;
case QtFatalMsg:
logPrefix = QStringLiteral("Fatal: ");
@@ -64,16 +63,13 @@ void messageHandler(QtMsgType type, const QMessageLogContext &context, const QSt
newLog += logPrefix + localMsg + logSuffix + "\n";
__android_log_print(ANDROID_LOG_DEBUG, "Qt_UI_Viewer", "%s", qPrintable(newLog));
static int logCounter = 0;
if (logCounter++ >= 100) {
// remove the first line
int index = appLogs.indexOf('\n');
if (index > 0)
appLogs.remove(0, index + 1);
logCounter = 99;
// only show critical and fatal messages in the UI
if (type == QtCriticalMsg || type == QtFatalMsg) {
QMessageBox msgBox{QMessageBox::Critical, "Critical:", msg, QMessageBox::Ok};
msgBox.exec();
if (backend)
backend->setLogs(appLogs += newLog);
}
if (backend)
backend->setLogs(appLogs += newLog);
}
int main(int argc, char *argv[])
Loading