diff options
author | Peter Wu <peter@lekensteyn.nl> | 2018-01-25 14:11:57 +0100 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2018-01-25 17:17:13 +0000 |
commit | 9be01dc6161acb0b11ce82d1e0475d06f8cc1c40 (patch) | |
tree | 842dc17a7da79e933c8b6aec5d0cf13a2fe811fb /wireshark-qt.cpp | |
parent | 6bd9be470e9c78ed8dfff31912c12eb138f5bf5f (diff) |
Qt 4.8 compatibility fixes
Add missing include headers, define Q_NULLPTR for all Qt objects (to
avoid having to include an ugly compat header), use old signal/slot
syntax (Q_SIGNALS are protected in Qt 4.8), disable Qt 5 log message
handler, etc.
Change-Id: I449beb0b74050fdfb0fc5828d8fb74eedb2b45bf
Reviewed-on: https://code.wireshark.org/review/25469
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'wireshark-qt.cpp')
-rw-r--r-- | wireshark-qt.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/wireshark-qt.cpp b/wireshark-qt.cpp index 37aa0dbf97..b78f7de5a0 100644 --- a/wireshark-qt.cpp +++ b/wireshark-qt.cpp @@ -257,6 +257,7 @@ get_wireshark_runtime_info(GString *str) #endif } +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) static void g_log_message_handler(QtMsgType type, const QMessageLogContext &, const QString &msg) { @@ -283,6 +284,7 @@ g_log_message_handler(QtMsgType type, const QMessageLogContext &, const QString } g_log(LOG_DOMAIN_MAIN, log_level, "%s", qUtf8Printable(msg)); } +#endif #ifdef HAVE_LIBPCAP /* Check if there's something important to tell the user during startup. @@ -610,7 +612,9 @@ int main(int argc, char *qt_argv[]) #endif set_console_log_handler(); +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) qInstallMessageHandler(g_log_message_handler); +#endif #ifdef DEBUG_STARTUP_TIME g_log(LOG_DOMAIN_MAIN, G_LOG_LEVEL_INFO, "set_console_log_handler, elapsed time %" G_GUINT64_FORMAT " us \n", g_get_monotonic_time() - start_time); #endif |