Using the "add source files" button has its own configurable default
action. In fact, there are two classes of adding files:
1. Using the "add source files" button including its popup-menu
actions or the context menu on entries in the "files" view
2. Dragging & dropping files from external programs into the
multiplexer, using the copy & paste functionality ("Multiplexer"
menu → "Add files from clipboard") or adding files via command-line
arguments.
The reason separating the two is that the "add source files" button &
the associated context menu entries have always hat the semantics of
adding files to the current multiplex tab whereas dragging & dropping
was often done with files for which new multiplex settings should be
created. In short, both functionality was used for distinct use cases.
Fixes#3035.
The mingw implementation of `std::filesystem::exists()` doesn't work
for UNC paths, even if the referenced file or directory exists. However,
both `std::filesystem::is_directory()` and
`std::filesystem::is_regular_file()` do work; so let's use those
instead of `…exists()`.
The result was that mkvmerge & MKVToolNix GUI couldn't find base
directories for Blu-rays & DVDs when UNC paths were used.
Corresponding gcc bug:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99311
Part of the fix of #3037.
The mingw implementation of `std::filesystem::absolute()` and
`std::filesystem::path().is_absolute()` think that UNC paths such as
`\\server\share\file.txt` are not absolute, unlike the corresponding
functions in `boost::filesystem`.
The result was that mkvmerge & MKVToolNix GUI couldn't find base
directories for Blu-rays & DVDs when UNC paths were used.
Corresponding gcc bug:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99333
Part of the fix of #3037.
`std::filesystem::path` has implemented the `parent_path()` function
differently than `boost::filesystem::path`. In Boost, the
`parent_path()` of a drive-only path (e.g. `E:\`) was an empty
path. For `std::filesystem::path` it's the same path again. Therefore
loops iterating up the directory tree must use something like "current
directory == parent of current directory" as the condition for
stopping iteration.
Fixes#3046.
There are two bugs in at least gcc 10.20.0 for Windows:
• `std::filesystem::exists()` returns `false` for UNC paths pointing
to a share, e.g. `\\server\share`.
• `std::filesystem::create_directories()` fails for creating
directories on UNC paths, e.g. `\\server\share\directory`.
The second is likely due to the former, e.g. if it is implemented as
"for each component of the path, try to create the directory if it
doesn't exist".
See the following gcc bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99311Fixes#3041.