Changeset 58848 in vbox
- Timestamp:
- Nov 25, 2015 12:52:04 PM (9 years ago)
- File:
-
- 1 edited
-
trunk/src/VBox/Frontends/VirtualBox/src/main.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/main.cpp
r58328 r58848 226 226 #endif /* Q_WS_X11 */ 227 227 228 /** Qt message handler, function that prints out 229 * debug messages, warnings, critical and fatal error messages. 230 * @param type describes the type of message sent to a message handler. 231 * @param pMsg holds the pointer to the message body. */ 228 #if QT_VERSION >= 0x050000 229 /** Qt5 message handler, function that prints out 230 * debug, warning, critical, fatal and system error messages. 231 * @param type Holds the type of the message. 232 * @param context Holds the message context. 233 * @param strMessage Holds the message body. */ 234 static void QtMessageOutput(QtMsgType type, const QMessageLogContext &context, const QString &strMessage) 235 { 236 NOREF(context); 237 # ifndef Q_WS_X11 238 NOREF(strMessage); 239 # endif /* !Q_WS_X11 */ 240 switch (type) 241 { 242 case QtDebugMsg: 243 Log(("Qt DEBUG: %s\n", strMessage.toUtf8().constData())); 244 break; 245 case QtWarningMsg: 246 Log(("Qt WARNING: %s\n", strMessage.toUtf8().constData())); 247 # ifdef Q_WS_X11 248 /* Needed for instance for the message ``cannot connect to X server'': */ 249 RTStrmPrintf(g_pStdErr, "Qt WARNING: %s\n", strMessage.toUtf8().constData()); 250 # endif /* Q_WS_X11 */ 251 break; 252 case QtCriticalMsg: 253 Log(("Qt CRITICAL: %s\n", strMessage.toUtf8().constData())); 254 # ifdef Q_WS_X11 255 /* Needed for instance for the message ``cannot connect to X server'': */ 256 RTStrmPrintf(g_pStdErr, "Qt CRITICAL: %s\n", strMessage.toUtf8().constData()); 257 # endif /* Q_WS_X11 */ 258 break; 259 case QtFatalMsg: 260 Log(("Qt FATAL: %s\n", strMessage.toUtf8().constData())); 261 # ifdef Q_WS_X11 262 /* Needed for instance for the message ``cannot connect to X server'': */ 263 RTStrmPrintf(g_pStdErr, "Qt FATAL: %s\n", strMessage.toUtf8().constData()); 264 # endif /* Q_WS_X11 */ 265 } 266 } 267 #else /* QT_VERSION < 0x050000 */ 268 /** Qt4 message handler, function that prints out 269 * debug, warning, critical, fatal and system error messages. 270 * @param type Holds the type of the message. 271 * @param pMsg Holds the the message body. */ 232 272 static void QtMessageOutput(QtMsgType type, const char *pMsg) 233 273 { 234 # ifndef Q_WS_X11274 # ifndef Q_WS_X11 235 275 NOREF(pMsg); 236 # endif /* !Q_WS_X11 */276 # endif /* !Q_WS_X11 */ 237 277 switch (type) 238 278 { … … 242 282 case QtWarningMsg: 243 283 Log(("Qt WARNING: %s\n", pMsg)); 244 # ifdef Q_WS_X11284 # ifdef Q_WS_X11 245 285 /* Needed for instance for the message ``cannot connect to X server'': */ 246 286 RTStrmPrintf(g_pStdErr, "Qt WARNING: %s\n", pMsg); 247 # endif /* Q_WS_X11 */287 # endif /* Q_WS_X11 */ 248 288 break; 249 289 case QtCriticalMsg: 250 290 Log(("Qt CRITICAL: %s\n", pMsg)); 251 # ifdef Q_WS_X11291 # ifdef Q_WS_X11 252 292 /* Needed for instance for the message ``cannot connect to X server'': */ 253 293 RTStrmPrintf(g_pStdErr, "Qt CRITICAL: %s\n", pMsg); 254 # endif /* Q_WS_X11 */294 # endif /* Q_WS_X11 */ 255 295 break; 256 296 case QtFatalMsg: 257 297 Log(("Qt FATAL: %s\n", pMsg)); 258 # ifdef Q_WS_X11298 # ifdef Q_WS_X11 259 299 /* Needed for instance for the message ``cannot connect to X server'': */ 260 300 RTStrmPrintf(g_pStdErr, "Qt FATAL: %s\n", pMsg); 261 # endif /* Q_WS_X11 */301 # endif /* Q_WS_X11 */ 262 302 } 263 303 } 304 #endif /* QT_VERSION < 0x050000 */ 264 305 265 306 /** Shows all available command line parameters. */ … … 389 430 #endif /* Q_WS_X11 */ 390 431 432 #if QT_VERSION >= 0x050000 433 /* Install Qt console message handler: */ 434 qInstallMessageHandler(QtMessageOutput); 435 #else /* QT_VERSION < 0x050000 */ 391 436 /* Install Qt console message handler: */ 392 437 qInstallMsgHandler(QtMessageOutput); 438 #endif /* QT_VERSION < 0x050000 */ 393 439 394 440 /* Create application: */
Note:
See TracChangeset
for help on using the changeset viewer.

