Changeset 1645
- Timestamp:
- 02/20/07 12:33:28 (23 months ago)
- Location:
- trunk/src
- Files:
-
- 2 modified
-
vidalia.cpp (modified) (2 diffs)
-
vidalia.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/vidalia.cpp
r1643 r1645 56 56 Log Vidalia::_log; 57 57 58 /** Catches debugging messages from Qt and sends them to Vidalia's logs. If Qt 59 * emits a QtFatalMsg, we will write the message to the log and then abort(). 60 */ 61 void 62 Vidalia::qt_msg_handler(QtMsgType type, const char *s) 63 { 64 QString msg(s); 65 switch (type) { 66 case QtDebugMsg: 67 vDebug("QtDebugMsg: %1").arg(msg); 68 break; 69 case QtWarningMsg: 70 vNotice("QtWarningMsg: %1").arg(msg); 71 break; 72 case QtCriticalMsg: 73 vWarn("QtCriticalMsg: %1").arg(msg); 74 break; 75 case QtFatalMsg: 76 vError("QtFatalMsg: %1").arg(msg); 77 break; 78 } 79 if (type == QtFatalMsg) { 80 vError("Fatal Qt error. Aborting."); 81 abort(); 82 } 83 } 58 84 59 85 /** Constructor. Parses the command-line arguments, resets Vidalia's … … 63 89 : QApplication(argc, argv) 64 90 { 91 qInstallMsgHandler(qt_msg_handler); 92 65 93 /* Read in all our command-line arguments. */ 66 94 parseArguments(args); -
trunk/src/vidalia.h
r1643 r1645 116 116 117 117 private: 118 /** Catches debugging messages from Qt and sends them to 119 * Vidalia's logs. */ 120 static void qt_msg_handler(QtMsgType type, const char *msg); 121 118 122 /** Parse the list of command-line arguments. */ 119 123 void parseArguments(QStringList args);
