Temporarily enabled `-Wall` and fixed more warnings, but there are several uninitialized variables usages which may require review by the code author in order to ensure the refactor is correct so we leave these additional warnings disabled for now.
Fixed:
* removed unused lambda captures
* removed unused variables
* fixed sign comparisons between variables
Moved the `throw` statements introduced in an earlier commit to after the `switch` statement and removed the `default` which could mask an unhandled case.
Changed some situations where every enum item was listed, but fell through to a default action by replacing the explicitly enumerated items with a `default`. This was primarily where the enum was defined in an external library.
Adding a configuration to invoke clang-format v13 on all modified files
as part of the commit process, and a new script file `setup-env.sh` to
manage installing the pre-commit hook.
The hook is installed using a local python venv to ensure the correct
version of clang-format is used. This approach also enables the hook to
be installed on any platform which supports python although the setup
script is limited to platforms which support bash.
We used v14 of clang-format in commit 2dfb5a483e2a3518cd0bb40f39a05915253d88b6 which introduced unwanted changes. Revert to the formatting enforced by v13 of clang-format.
The refactor to remove deprecated symbols also broke compatibility with versions of QT prior to QT5.14. This commit adds back support for earlier versions of QT. Mostly this is via the new "qtsupport.h" header file, but for supporting the changed `QSet` constructor we had to put the changes into each source file. This is, of course, not optimal.
* add default to switch statements throwing an exception on unhandled
case. This removes `control reaches end of non-void function` in many
functions.
* fix QT5.14 deprecations, which will also make it easier to move to QT6
- fix QSet initialization
- rename `endl` -> `Qt::endl`
- rename `QString::SkipEmptyParts` -> `Qt::SkipEmptyParts`
- and more...
* Scintilla editor
- add missing `override`
- replace deprecated functions
* Settings
- fix deprecated QDir assignment
- code-style: replace assignment with initializers (to match QDir in this file)
The script was designed to find the latest version of clang-format, however, this project currently specifically requires the use of v13. We now only check for v13 of clang-format.
Secondly, for cmake-format the script also requires a specific version. Instead of installing that unmanaged version globally we now install it inside a python venv.
Similar to `Delete` and `Rename`, create a sub-menu if the list of branches available to checkout is larger.
TODO: Perhaps make the collapsible branches an option?
Ideally I would like the dialog to start with a suitable size based on the current branch name, but not force it to be the minimum. However, I could not find a way to do this.
Secondly, it would be nice if the dialog automatically expanded up to some maximum size as the name gets longer, again, there seems to be no easy way to do this.
Instead of having a big list of references which can be deleted or renamed in the main popup menu we add a sub-menu for each kind of operation if there is more than one reference for an operation. If there is only a single reference for an operation, it is added directly to the menu as per the previous implementation.
There's a pro/con here:
* pro: best use of menu with easiest operation in the most common scenario (a single reference).
* con: menu dynamically changes depending on the data, which means users can't learn muscle-memory. For that it's best to maintain a constant top-level menu and enable/disable menu items as required. This might also make the code a little cleaner.
I didn't feel like writing yet another Haiku version of this,
there's no reason not to use this API which is present since Qt 4.2.
Not tested much but seems to work.