Move openContainingFolder to the end of the method block.
Adjust FileBrowserTreeWidget::contextMenuEvent to the coding conventions
and also make the code more readable by splitting up some conditions.
Add comments to clarify as to why the member m_contextMenuItem is set to
nullptr at the end of the execution of contextMenuEvent. Please note
that this implementation is not exception safe and should be changed in
the future, e.g. by passing the FileItem as a parameter of the slot.
Add functionality to open the containing folder of a file that's selected
in LMMS' file browser.
Technical details
------------------
Add a new private method openContainingFolder to FileBrowser. Add a new
action to the context menu of a selected file. This action in turn calls
the added method.
The current implementation of openContainingFolder delegates to
QDesktopServices::openUrl with the directory of the selected file. Please
note that this will only open the directory but not select the file as
this is much more complicated due to different implementations that are
needed for the different platforms (Linux/Windows/MacOS).
Using QDesktopServices::openUrl seems to be the most simple cross
platform way which uses functionality that's already available in Qt.
Moving empty destructors out of the .cpp files and into headers
allows them to be devirtualized in certain cases.
(When the compiler can't "see" a function in a header, it must largely
assume it's some black box that the linker will resolve.)
While we're at it, use C++11's `= default` to define empty virtual
desturctors for us.
For some classes (e.g., Piano), nothing is derived from it, so we can
mark the class as final and remove any explicit virtual dtor.
There are many other places where this can be done, but this is a large
enough patch as-is.
Move the search bar on top of the file browser for the following sidebar
windows:
* "My Projects"
* "My Samples"
* "My Presets"
* "My Home"
* "My Computer"
Add the greyed out text "Search" to the search text edit.
The text is only shown as long as no text is entered in the search field.
Also rename some variable names to something more meaningful. Rename the
member m_l of FileBrowser to m_fileBrowserTreeWidget. Rename the
following local variables in the constructor of FileBrowser:
* ops -> searchWidget
* opl -> searchWidgetLayout