wireshark/ui/qt/utils
Guy Harris 19f7e572a4 Work around macOS running applications in /.
If an application is launched from the Finder, it appears to get / as
its current directory.  This causes Wireshark open/save dialogs to open
up / if the user hasn't already opened a file in another directory, so
that there's no "last open directory" in the recent file.

Have get_persdatafile_dir(), on UN*X, cache the personal data directory
just as it does on Windows and, if nothing's been cached, have it fetch
the current directory and, if that succeeds *and* it's not the root
directory, use that.  Otherwise, use the user's home directory.

Fixes #9862.

In addition, separate the notion of "last open directory" and "open
dialog initial directory", where the latter is the last open directory
*if* a file has been opened in this session or the recent file has the
last open directory from a previous session, otherwise it's the user's
personal data directory.

Use the latter notion in file open/save dialogs; use the former notion
when reading from and writing to the recent file.

This means we don't need to set the "last open directory" at startup
time.  That way, running Wireshark without opening a file won't cause
the "last open directory" to be set, so that if a user runs it from a
directory, the "open dialog initial directory" won't be the last
directory from which Wireshark was run.
2023-11-12 06:53:36 +00:00
..
color_utils.cpp Qt: Dark mode updates 2023-09-08 11:52:01 +00:00
color_utils.h Qt: Add a common hover color. 2022-01-03 19:03:46 +00:00
data_printer.cpp Add option to copy bytes as Go literal 2023-10-24 18:04:05 +00:00
data_printer.h Add option to copy bytes as Go literal 2023-10-24 18:04:05 +00:00
field_information.cpp Qt: Call EditResolvedName from the PacketList 2023-09-03 07:23:50 +00:00
field_information.h Qt: Call EditResolvedName from the PacketList 2023-09-03 07:23:50 +00:00
frame_information.cpp regex: Prefer C99/POSIX types 2021-11-15 02:41:59 +00:00
frame_information.h Add UI header files to Doxygen 2021-11-30 08:01:36 -05:00
idata_printable.h Add UI header files to Doxygen 2021-11-30 08:01:36 -05:00
proto_node.cpp Qt: Speed up ProtoTreeModel with lots of items 2022-11-14 06:28:16 -05:00
proto_node.h Fix build on OpenSUSE 15.3 2022-11-16 08:21:13 +00:00
qt_ui_utils.cpp Work around macOS running applications in /. 2023-11-12 06:53:36 +00:00
qt_ui_utils.h Work around macOS running applications in /. 2023-11-12 06:53:36 +00:00
rtp_audio_file.cpp Fix spelling errors. 2021-09-11 10:01:27 +00:00
rtp_audio_file.h Windows: Use SpeexDSP binary package 2022-12-16 11:11:28 +00:00
rtp_audio_routing.cpp WSUG: Added description of new features of telephony dialogs 2021-04-11 15:46:48 +00:00
rtp_audio_routing.h Add UI header files to Doxygen 2021-11-30 08:01:36 -05:00
rtp_audio_routing_filter.cpp Qt: Ensure AudioRoutingFilter is freed 2023-05-15 08:15:16 -04:00
rtp_audio_routing_filter.h Add UI header files to Doxygen 2021-11-30 08:01:36 -05:00
rtp_audio_silence_generator.cpp Qt: uninit class member in constructor (CID 1530129) 2023-09-23 15:32:55 +00:00
rtp_audio_silence_generator.h Qt: Ensure the AudioSilenceGenerator is freed 2023-05-15 11:55:30 +00:00
stock_icon.cpp Qt: Make utils more independent. 2021-12-22 19:00:13 -08:00
stock_icon.h Add UI header files to Doxygen 2021-11-30 08:01:36 -05:00
tango_colors.h Add UI header files to Doxygen 2021-11-30 08:01:36 -05:00
variant_pointer.h Add UI header files to Doxygen 2021-11-30 08:01:36 -05:00
wireshark_mime_data.cpp Remove modelines in ui/qt. 2021-03-08 18:11:32 +00:00
wireshark_mime_data.h Add UI header files to Doxygen 2021-11-30 08:01:36 -05:00
wireshark_zip_helper.cpp Qt: minizip and minizip-ng size compatibility issues 2022-10-12 22:03:34 -04:00
wireshark_zip_helper.h Add UI header files to Doxygen 2021-11-30 08:01:36 -05:00