diff options
author | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2012-01-21 18:56:01 +0000 |
---|---|---|
committer | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2012-01-21 18:56:01 +0000 |
commit | 94e4fa3e7661779c0a6efbdf75634573e2cea90d (patch) | |
tree | de9e6fe3ba59d4c6e4d45970228b46972d9098b1 | |
parent | 3a4a342cbcbd9c7b105d88925a56191d7007e7e4 (diff) |
Fix -v for QtShark
./Wireshark -v
wireshark 1.7.1 (SVN Rev Unknown from unknown)
Copyright 1998-2012 Gerald Combs <gerald@wireshark.org> and contributors.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Compiled (64-bit) with Qt 4.7.4 with GLib 2.30.0, with libpcap (version
unknown), with libz 1.2.3.4, with POSIX capabilities (Linux), with SMI 0.4.8,
with c-ares 1.7.4, with Lua 5.1, without Python, with GnuTLS 2.10.5, with Gcrypt
1.5.0, with MIT Kerberos, with GeoIP, with PortAudio V19-devel (built Jul 27
2011 11:52:20), without AirPcap.
Running on Linux 3.0.0-13-generic, with locale fr_FR.UTF-8, with libpcap version
1.1.1, with libz 1.2.3.4, GnuTLS 2.10.5, Gcrypt 1.5.0.
Built using gcc 4.6.1.
get_gui_compiled_info & get_gui_runtime_info copied from ../gtk/main.c
the function is common to GTK and Qt need to put in version_info.[ch] ?
svn path=/trunk/; revision=40633
-rw-r--r-- | u3.h | 8 | ||||
-rw-r--r-- | ui/qt/QtShark.pro | 2 | ||||
-rw-r--r-- | ui/qt/main.cpp | 65 |
3 files changed, 72 insertions, 3 deletions
@@ -25,6 +25,10 @@ #ifndef __U3_H__ #define __U3_H__ +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + gboolean u3_active(void); void u3_runtime_info(GString *str); @@ -35,4 +39,8 @@ void u3_deregister_pid(void); char * u3_expand_device_path(char *path); char * u3_contract_device_path(char *path); +#ifdef __cplusplus +} +#endif /* __cplusplus */ + #endif /* __U3_H__ */ diff --git a/ui/qt/QtShark.pro b/ui/qt/QtShark.pro index 906c41169c..570d506a8d 100644 --- a/ui/qt/QtShark.pro +++ b/ui/qt/QtShark.pro @@ -198,7 +198,7 @@ macx:QMAKE_LFLAGS += \ -framework ApplicationServices -framework CoreFoundation -framework CoreServices unix:LIBS += -L../../lib -Wl,-rpath ../../lib -lwireshark -lwiretap -lwsutil \ - -lpcap + -lpcap -lportaudio macx:LIBS += -Wl,-macosx_version_min,10.5 -liconv win32:LIBS += \ diff --git a/ui/qt/main.cpp b/ui/qt/main.cpp index 61e8fc3f4e..6b39a0432e 100644 --- a/ui/qt/main.cpp +++ b/ui/qt/main.cpp @@ -34,6 +34,10 @@ #include "wsutil/wsgetopt.h" #endif +#ifdef HAVE_LIBPORTAUDIO +#include <portaudio.h> +#endif /* HAVE_LIBPORTAUDIO */ + #include <epan/epan.h> #include <epan/filesystem.h> #include <wsutil/privileges.h> @@ -544,6 +548,63 @@ console_log_handler(const char *log_domain, GLogLevelFlags log_level, qDebug() << qt.toString() << log_domain << " " << level << message; } +// xxx based from ../gtk/main.c:get_gtk_compiled_info +static void +get_qt_compiled_info(GString *str) +{ + g_string_append(str, "with "); + g_string_append_printf(str, +#ifdef QT_VERSION + "Qt %s ", QT_VERSION_STR); +#else + "Qt (version unknown) "); +#endif +} + +// xxx copied from ../gtk/main.c +static void +get_gui_compiled_info(GString *str) +{ + epan_get_compiled_version_info(str); + + g_string_append(str, ", "); +#ifdef HAVE_LIBPORTAUDIO +#ifdef PORTAUDIO_API_1 + g_string_append(str, "with PortAudio <= V18"); +#else /* PORTAUDIO_API_1 */ + g_string_append(str, "with "); + g_string_append(str, Pa_GetVersionText()); +#endif /* PORTAUDIO_API_1 */ +#else /* HAVE_LIBPORTAUDIO */ + g_string_append(str, "without PortAudio"); +#endif /* HAVE_LIBPORTAUDIO */ + + g_string_append(str, ", "); +#ifdef HAVE_AIRPCAP + get_compiled_airpcap_version(str); +#else + g_string_append(str, "without AirPcap"); +#endif +} + +// xxx copied from ../gtk/main.c +static void +get_gui_runtime_info(GString *str) +{ + epan_get_runtime_version_info(str); + +#ifdef HAVE_AIRPCAP + g_string_append(str, ", "); + get_runtime_airpcap_version(str); +#endif + + + if(u3_active()) { + g_string_append(str, ", "); + u3_runtime_info(str); + } + +} /* And now our feature presentation... [ fade to music ] */ int main(int argc, char *argv[]) @@ -699,12 +760,12 @@ int main(int argc, char *argv[]) comp_info_str = g_string_new("Compiled "); // xxx qtshark - //get_compiled_version_info(comp_info_str, get_gtk_compiled_info, get_gui_compiled_info); + get_compiled_version_info(comp_info_str, get_qt_compiled_info, get_gui_compiled_info); /* Assemble the run-time version information string */ runtime_info_str = g_string_new("Running "); // xxx qtshark - //get_runtime_version_info(runtime_info_str, get_gui_runtime_info); + get_runtime_version_info(runtime_info_str, get_gui_runtime_info); /* Read the profile independent recent file. We have to do this here so we can */ /* set the profile before it can be set from the command line parameterts */ |