For quite a while, cppcheck-gui hasn't shown any of the standard
library packages on my Gentoo system. It turns out that cppcheck-gui
doesn't use CFGDIR, but it does use a DATADIR variable stored in
QSettings. Problem is, DATADIR isn't set unless you manually specify
--data-dir, which isn't very intuitive.
This commit adds CFGDIR to the default list of cfg paths if the
CFGDIR macro is defined during the build.
- Moved setting from "Advanced" to "General" tab
-> Moved remaining single item, too, as it does not make sense to keep a tab for a single option. This option is now shown at the bottom of the dialog
- Replaced [inconclusive] string in "Summary" Column by extra column "Inconclusive", which is only visible if inconclusive checking is enabled
- Support enforcing language (#5456)
- Fixed several broken settings by saving them before creating Settings instance (changing them required restarting cppcheck)
- Updated german translation
Added Print... and Print Preview... actions to main window
Added PrintableReport responsible for formatting of ErrorItems and
exposing of a QTextDocument that can be used for printing
- Allow translating texts before before Window is created
-> Translate help text
- Use AboutDialog instead of message box on Windows when starting GUI with -v
If user tried to save results after re-checking files and not
getting new results by the re-check, the save was failed since
Cppcheck thought there were no results. This was caused by wrong
clearing of "has results" flag when removing single items from
the results.
Ticket: #4121 (Bogus error message when saving the report)
Currently if there were results in the GUI the results from XML
file were imported to list of results. This is confusing and not
what users usually want to do.
This patch makes GUI to clear the results before opening new
results from XML file.
Ticket #3829 (Rename open xml to import xml)
It is handy to remember the last location of the opened project file.
Currently the Open Project -dialog was always opened to location of
the executable file. Which is never the correct place. But last
opened project file location might at least be near the location user
wants to open next.
Ticket: #3493 (GUI: remember last path in Open Project File)
The GUI crashed if the project file was tried to open from the
command line. The project file loading was run before the MRU menu
was created but tried to add a new item to it.
Project file can't be opened when the check is running. So the menu
items must be disabled.
Fixes ticket: #3446 (GUI: MRU items must be disabled while checking)
We are using ShowTypes around the GUI codebase so it makes sense
to have it in its own class. And the class also contains related
helper functions instead of scattering them around different
classes.
ShowTypes also contains the visibility settings for all the
GUI severities. Implementation in this commit makes ShowTypes
class to load the visibility settings when it is created. And save
the settings when it is destroyed.
When GUI was started not all the categories visibility statuses
were not preserved. I.e.
Ticket: #3087 (GUI does not show all reported files until a filter button state is changed)
When running in Windows platforms, set the GUI's checked platform
initially to Windows 32-bit ANSI. Other platforms are set
initially to default/unspecified which means the type sizes are
from the platform GUI was compiled on.
This was suggested by Rober in ticket #3119.
We have now one list for checked platforms, menu items are created
dynamically based on that list. This makes it much easier to alter
the platforms list later on.
This is quick and dirty patch to add the platform selection for
the GUI. It is simple menu selection in Check-menu. It always
defaults to "Default" at startup. And it forget the selection
when the application is closed.
Ticket: #3119 (GUI: add ability to specify platform type)
The CLI/LIB change earlier added own enable-flag for performance-
and portability-checks. This commit updates GUI to also enable
those new enable-flags.
Per project include directories must be added to the list before
the global include directories. Include directories are searched
in listed order. So placing per project include directories first
we ensure per project include file is found instead of the global
include file if same file exist in both.
The extra menu separator was added before the MRU menu items. When
updating the (menu) MRU items existing items were first removed
and new items added back. But the added separator was not removed.
Earlier the GUI (project) went into some weird state after creating
a new project. The project could not be checked in any discoverable
way.
This commit fixes the above bug by automatically checking the new
project after the project dialog is closed. I think this is what
most users expect to happen.
Exclude is the correct term to use when removing paths from the
list of checked items. Ignore as a term was a poor choise to begin
with. XML file reading still recognizes and reads the 'ignore'
element but writes 'exclude' element.
Ticket: #2995 (GUI: Rename ignore-feature to exclude-feature)
If the "extra version" is defined (not empty) then it is shown
after the actual version number in the About-dialog.
Ticket: #2164 ([GUI] Add revision info to "About" window)
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)
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.)
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.
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.
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.
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)
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.
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.
Add applying of filtering into list of files to check if we have
an active project file. Filtering is quite much similar to the
filtering in CLI.
If we have directory filter ("gui/") then we check all paths if
they contain "gui" part. In practice we search for string "/gui"
from the paths. If we have filename filtering
("gui/projectfile.cpp") then we check if any of the paths end
with that.
If there were unknown language in settings the fallback to English
language didn't work as expected. And there were no proper current
language set after that. Initialize current language to English
so we always have English as proper fallback.
GUI was storing selected language as index to the languages list.
This is fragile since the order and count of items can change.
This commit changes to using ISO language code (e.g. "en" for
"English").
Fixes ticket #2446 (GUI: Don't use index number for language selection)
Settings-dialog is more natural place for language selection than
the main menu. We also have more space and freedom there to have
longer text etc to make the selection easier (menus are quite limited
controls).