comparison main.cpp @ 8:21ce6187d32e

Minor changes done by automatic style checker
author Ideenmodellierer
date Mon, 12 Jan 2026 13:51:17 +0000
parents 177f640940f2
children facf83163013
comparison
equal deleted inserted replaced
7:0969ef86c42d 8:21ce6187d32e
44 44
45 #include "SettingsDialog.h" 45 #include "SettingsDialog.h"
46 #include "Utils/Log.h" 46 #include "Utils/Log.h"
47 47
48 #include <QApplication> 48 #include <QApplication>
49 #include <QOperatingSystemVersion>
49 #include <QSettings> 50 #include <QSettings>
50 #include <QSysInfo> 51 #include <QSysInfo>
51 #include <QOperatingSystemVersion>
52 52
53 QSettings* settings = NULL; 53 QSettings *settings = NULL;
54 54
55 ////////////////////////////////////////////////////////////////////////////// 55 //////////////////////////////////////////////////////////////////////////////
56 56
57 int main(int argc, char *argv[]) 57 int main(int argc, char *argv[])
58 { 58 {
67 << " (build " BUILD_VERSION ")."); 67 << " (build " BUILD_VERSION ").");
68 #endif 68 #endif
69 #if 0 69 #if 0
70 #define LOG_TRACE(msg) \ 70 #define LOG_TRACE(msg) \
71 do { \ 71 do { \
72 if(Log::minLevel <= Log::LEVEL_TRACE) { \ 72 if (Log::minLevel <= Log::LEVEL_TRACE) { \
73 std::ostringstream oss; \ 73 std::ostringstream oss; \
74 oss << msg; \ 74 oss << msg; \
75 LogAction(Log::LEVEL_TRACE, __FILE__, __LINE__, LOG_FUNCTION_) << oss.str(); \ 75 LogAction(Log::LEVEL_TRACE, __FILE__, __LINE__, LOG_FUNCTION_) << oss.str(); \
76 } \ 76 } \
77 } while(0) 77 } while (0)
78 #endif 78 #endif
79 #if 0 79 #if 0
80 #define LOG_TRACE(msg) \ 80 #define LOG_TRACE(msg) \
81 do { \ 81 do { \
82 if(Log::minLevel <= Log::LEVEL_TRACE) { \ 82 if (Log::minLevel <= Log::LEVEL_TRACE) { \
83 LogAction(Log::LEVEL_TRACE, __FILE__, __LINE__, LOG_FUNCTION_) << QString("%1").arg(msg); \ 83 LogAction(Log::LEVEL_TRACE, __FILE__, __LINE__, LOG_FUNCTION_) \
84 << QString("%1").arg(msg); \
84 } \ 85 } \
85 } while(0) 86 } while (0)
86 #endif 87 #endif
87 #ifdef Q_OS_WIN32 88 #ifdef Q_OS_WIN32
88 89
89 auto os = QOperatingSystemVersion::current(); 90 auto os = QOperatingSystemVersion::current();
90 91
110 LOG_TRACE(" Windows 10"); break; 111 LOG_TRACE(" Windows 10"); break;
111 default: LOG_TRACE(" Windows " << QString().sprintf("%04X", QSysInfo::windowsVersion()) ); break; 112 default: LOG_TRACE(" Windows " << QString().sprintf("%04X", QSysInfo::windowsVersion()) ); break;
112 } 113 }
113 #endif 114 #endif
114 #elif defined(Q_OS_MACX) 115 #elif defined(Q_OS_MACX)
115 if( QSysInfo::macVersion() < 2 ) 116 if (QSysInfo::macVersion() < 2)
116 LOG_TRACE(" MacOS 9" ); 117 LOG_TRACE(" MacOS 9");
117 else 118 else
118 LOG_TRACE(" MacOS 10." << int(QSysInfo::macVersion()-2)); 119 LOG_TRACE(" MacOS 10." << int(QSysInfo::macVersion() - 2));
119 #elif defined(Q_OS_LINUX) 120 #elif defined(Q_OS_LINUX)
120 LOG_TRACE(" Linux "); 121 LOG_TRACE(" Linux ");
121 #else 122 #else
122 # error Unknown OS not yet implemented 123 #error Unknown OS not yet implemented
123 #endif 124 #endif
124 // LOG_TRACE(" Qt build " << QT_VERSION_STR << " (DLL " << qVersion() << ")"); 125 // LOG_TRACE(" Qt build " << QT_VERSION_STR << " (DLL " << qVersion() << ")");
125 LOG_TRACE(QString(" Qt build %1 (DLL %2)").arg(QT_VERSION_STR).arg(qVersion())); 126 LOG_TRACE(QString(" Qt build %1 (DLL %2)").arg(QT_VERSION_STR).arg(qVersion()));
126 //---- Initialize interface ---------------------------------------------- 127 //---- Initialize interface ----------------------------------------------
127 // Allow nice display on 4K screens: 128 // Allow nice display on 4K screens:
128 QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true); 129 QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true);
129 QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true); 130 QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true);
130 131
131 QApplication a(argc, argv); 132 QApplication a(argc, argv);
132 133
133 settings = new QSettings("OSTC", "Companion", &a); 134 settings = new QSettings("OSTC", "Companion", &a);
134 Settings::reload(0); 135 Settings::reload(0);