From 95f47187c7381e47883b5c095ca38d8fcecd1269 Mon Sep 17 00:00:00 2001 From: Pascal Quantin Date: Wed, 11 May 2016 14:31:59 +0200 Subject: 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 Petri-Dish: Pascal Quantin Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann --- wireshark-qt.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'wireshark-qt.cpp') 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(); } -- cgit v1.2.3