When Filter-toolbar was enabled/disabled from the View-menu its
state was not updated to the context menu. And vice versa.
Ticket: #2923 (GUI: Filter toolbar menu items not synchronized)
There always should be default editor if there is editor
application configured. But it is possible in some cases that
default application is "lost". So check that we have default
application configured before trying to use it. And inform user
to configure default application instead of silently failing to
open the application (and the file) for the user.
Don't use recursion in the script. The Python's os.walk() already
lists all files in subdirectories and using recursion only caused
tests to be found twice. Also handle the case the project file
defines binary path with DESTDIR define.
Improve the runner script to run only tests whose binary file
exists. Tests with inexistant binary file are not counted into
test counts in the summary.
Add the MIT license header. I'm now maintaining this script in
external repository with MIT license. So I can use the script
in other projects too.
Use build-time define to set the path to the source files
directory. Which then can be used to format path to the test
data. This allows running tests from out-of-source-tree -builds
that e.g. QtCreator does.
Test was using and assuming that severity string starts with
capital letter (e.g. "Style"). But the strings are all lowercase
letters.
Ticket #2832 (GUI: XML version 1 test fails)
Start building each test as separate project as QtestLib tests
usually are built. This commit adds the infrastructure and moves
TranslationHandler test as own project.
Fix I did yesterday gave only filename of the project file for
function loading project file. Causing the loading failing if
not in "current" directory.
If we there is project file in the directory to check then ask
user if one wants to use the project file instead. If there are
multiple project files then just tell there are project files
and ask if user wants to continue without using them.
Ticket: #2816 (GUI regression: Interrupted checking because of too many #ifdef configurations.)
If the project file does not define paths to check then check the
project root directory (which likely is the directory where the
project file is located).
Ticket #2816 (GUI regression: Interrupted checking because of too many #ifdef configurations.)
Setting organization and program name in main() allows us to
cleanup Settings class usage. As we don't need to keep using the
one instance of Settings but can create new Settings class
whenever we need to access settings. According to the Qt
documentation creating Settings class is fast.
Use project file's location as base path when adding new paths
(checked, included or ignored) to the project. In most cases user
wants to add paths in the same project so this reduces browsing
paths considerably when adding them.
When project files support was added to the GUI there was no GUI
for them and automatic/silent loading was added. So that if the
directory contained project file with the same name (and .cppcheck
extension) then the project file was automatically loaded and used
for the checking.
This can be very confusing for the user as there is no any
indication that the project file is used. But this solution was
necessary at that time to get project file support added.
Now that we have usable GUI for the project files this automatic/
silent loading can be removed. Nobody really should be using it
anymore. And even if the automatic loading is needed one can give
the project file for the GUI using command line parameter.
The project file to check just GUI code was missing the directory
to check. This is probably due it was used originally as
"automatically" loaded project file which assumed current
directory is checked and only added some additional parameters.
If the project file in MRU list does not exist ask user if one
wants to remove the file from the list. If user agrees then the
file is removed from the list. Otherwise the file is left to the
list but not tried to open. User may have accidentally moved or
renamed the file so we give a possibility to add it back and not
just blindly removing it from the list.
Add MRU items for project files to File-menu. When user creates
a new project file or opens existing project file it is added to
the list of recently used projects. Last 5 projects are remembered
and available for quick acess in the File-menu.
The ErrorLogger::reportStatus() is not lib code interface. The CLI
code does the looping through file list and gives one file at a
time for the core code. Hence lib has no any idea about the
progress and it can't provide such information.
Also the recent commit (6d858b6) caused a GUI build failure by
adding CLI code dependency to GUI. Which is big no-no.
This is admittedly a hack. But it allow us to build all modules
again.
Two Qt modules are not needed any more in the CMake script for the graphical
user interface after the commit "GUI: Open online-help instead of local help".
3965a08b7b (commit)
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Unify usage and API of CppCheck class. Allow only one file checked
at a time, instead of list of files. Clients can then handle file
lists more naturally and as they see fit. Also clients have better
knowledge of how checking status should be handled.
The single-threaded CLI checking was only one using the file list.
Other clients were giving files (to list) one file at a time.
Add new "Advanced" page to preferences-dialog and add there a
checkbox for enabling inconclusive checks. Now that checkbox is
the only control in that new page but there will be more controls
later on.
This is the first (and quick) support for the inconclusive errors.
We simply add [Inconclusive] to begin of the summary. This is
temporary solution until better GUI is implemented. XML v1 won't
be supporting inconclusive errors. For XML v2 we need still to
decide what to do.
GUI now recognizes -p <project file> command line parameter. When
given (with path to valid project file) GUI automatically loads
the project file and starts checking paths in it.
Ticket: #2613 (GUI: Should accept project file from command line)
I earlier added a check for missing (editor) application command
line parameters. If parameters are missing at GUI startup an
message is shown to user to check the settings. Unfortunately
my check was incomplete and it also triggered when there was no
applications defined. Which happens when user starts GUI for a
first time.
Fix the check so that user is only informed in case the parameters
are missing and name + path are set.
In GNOME the whole big text area was not shown without making the
dialog bigger. So improve the layout for better scaling and adjust
dialog size when it gets initialized.
Earlier user had to add quotation marks around application executable
path in application dialog. Because we could not determine which part
is path and which part is parameters. As we now have separate
variables we can automatically add the quotation marks when needed
before starting the application. This reduces the confusion users
have had about the correct formatting of paths.
Currently combined editor application path + params is a bit
problematic (at least in Windows). We really don't know where the app
path ends and parameters start. So proper quoting is not always
possible.
And application path and command line parameters are clearly
different settings anyway. So make them separate settings. It has
bunch of other positive sides too. Like one can now browse new path
for the application without loosing the parameters.
When starting Cppcheck version with these new settings user is warned
that loading settings had problems and asked to check and fix the
settings.
The library "htmlhelp" is not needed by the graphical user interface at the moment.
2fea5f01d6 (gui)/gui.pro
There are difficulties to fulfil this dependency.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
The executable file for the graphical user interface was renamed in a CMake
script to synchronise this setting with the qmake build specification.
b88ce77e4a (gui)/gui.pro
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Local help does not currently work (ticket #2316) and building it
is a bit painful in Windows. Hence it was decided on ticket #2677
and at IRC that we open on-line help from GUI until the local
help issue is solved.