diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2016-05-11 14:31:59 +0200 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2016-05-11 14:19:33 +0000 |
commit | 95f47187c7381e47883b5c095ca38d8fcecd1269 (patch) | |
tree | 359fc081b525bcd68416541f5f6d46549eb80e18 /wireshark-qt.cpp | |
parent | b5cbbc5a4057d214363809cf8ebbed741381ff5e (diff) |
Qt: fix loading of profile by command line
recent_read_static() must be called before processing the -C option
as it will select the last profile used.
While we are at it, add a missing profile_store_persconffiles(FALSE) call
to match what is done in GTK based UI
Bug: 12425
Change-Id: I9cfdca3ed25f0ed97535178973e3f0427b9ad2b1
Reviewed-on: https://code.wireshark.org/review/15371
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'wireshark-qt.cpp')
-rw-r--r-- | wireshark-qt.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/wireshark-qt.cpp b/wireshark-qt.cpp index 5f038aeaa1..b460483419 100644 --- a/wireshark-qt.cpp +++ b/wireshark-qt.cpp @@ -557,6 +557,17 @@ int main(int argc, char *argv[]) // xxx qtshark runtime_info_str = get_runtime_version_info(get_wireshark_runtime_info); + profile_store_persconffiles(TRUE); + + /* 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 parameter */ + if (!recent_read_static(&rf_path, &rf_open_errno)) { + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, + "Could not open common recent file\n\"%s\": %s.", + rf_path, strerror(rf_open_errno)); + g_free(rf_path); + } + /* * In order to have the -X opts assigned before the wslua machine starts * we need to call getopt_long before epan_init() gets called. @@ -710,17 +721,6 @@ int main(int argc, char *argv[]) WSAStartup( MAKEWORD( 1, 1 ), &wsaData ); #endif /* _WIN32 */ - profile_store_persconffiles(TRUE); - - /* 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 parameter */ - if (!recent_read_static(&rf_path, &rf_open_errno)) { - simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, - "Could not open common recent file\n\"%s\": %s.", - rf_path, strerror(rf_open_errno)); - g_free(rf_path); - } - /* Read the profile dependent (static part) of the recent file. */ /* Only the static part of it will be read, as we don't have the gui now to fill the */ /* recent lists which is done in the dynamic part. */ @@ -1412,6 +1412,8 @@ int main(int argc, char *argv[]) } #endif /* HAVE_LIBPCAP */ + profile_store_persconffiles(FALSE); + return wsApp->exec(); } |