Improve cppcheck configuration

- Ignore autotests sources
- Teach cppcheck about a okular specific define
- Keep the default options from the KDE setup

This at least for me brings the cppcheck entries from "unusable" to "something that probably should be looked into"
This commit is contained in:
Sune Vuorela 2023-08-05 08:25:36 +00:00 committed by Albert Astals Cid
parent f7bc35a856
commit 22550bbc05
2 changed files with 6 additions and 1 deletions

View File

@ -27,3 +27,8 @@ Dependencies:
- 'on': ['Android']
'require':
'frameworks/kirigami': '@stable'
Options:
cppcheck-arguments: '--enable=warning,style,performance -DOKULAR_EXPORT_PLUGIN'
cppcheck-ignore-files:
- autotests

View File

@ -41,10 +41,10 @@ public:
const RecentItemsModel *model = static_cast<RecentItemsModel *>(aModel);
const RecentItemsModel::RecentItem *item = model->getItem(index);
bool willOpenMenu = false;
QPoint menuPosition;
if (item != nullptr) {
bool willOpenMenu = false;
if (event->type() == QEvent::ContextMenu) {
willOpenMenu = true;
menuPosition = static_cast<QContextMenuEvent *>(event)->globalPos();