Commit 07f721a5 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix some cppcheck warning

parent 377a96aa
Pipeline #36183 passed with stage
in 26 minutes and 26 seconds
...@@ -165,7 +165,6 @@ bool QWinMetaFile::load(QBuffer &buffer) ...@@ -165,7 +165,6 @@ bool QWinMetaFile::load(QBuffer &buffer)
WmfEnhMetaHeader eheader; WmfEnhMetaHeader eheader;
WmfMetaHeader header; WmfMetaHeader header;
WmfPlaceableHeader pheader; WmfPlaceableHeader pheader;
WORD checksum;
int filePos, idx, i; int filePos, idx, i;
WmfCmd *cmd, *last; WmfCmd *cmd, *last;
DWORD rdSize; DWORD rdSize;
...@@ -194,7 +193,7 @@ bool QWinMetaFile::load(QBuffer &buffer) ...@@ -194,7 +193,7 @@ bool QWinMetaFile::load(QBuffer &buffer)
st >> pheader.inch; st >> pheader.inch;
st >> pheader.reserved; st >> pheader.reserved;
st >> pheader.checksum; st >> pheader.checksum;
checksum = calcCheckSum(&pheader); const WORD checksum = calcCheckSum(&pheader);
if (pheader.checksum != checksum) { if (pheader.checksum != checksum) {
mIsPlaceable = false; mIsPlaceable = false;
} }
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
PotentialPhishingDetailWidget::PotentialPhishingDetailWidget(QWidget *parent) PotentialPhishingDetailWidget::PotentialPhishingDetailWidget(QWidget *parent)
: QWidget(parent) : QWidget(parent)
, mListWidget(new QListWidget(this))
{ {
QVBoxLayout *mainLayout = new QVBoxLayout(this); QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->setContentsMargins(0, 0, 0, 0); mainLayout->setContentsMargins(0, 0, 0, 0);
...@@ -22,7 +23,6 @@ PotentialPhishingDetailWidget::PotentialPhishingDetailWidget(QWidget *parent) ...@@ -22,7 +23,6 @@ PotentialPhishingDetailWidget::PotentialPhishingDetailWidget(QWidget *parent)
lab->setObjectName(QStringLiteral("label")); lab->setObjectName(QStringLiteral("label"));
mainLayout->addWidget(lab); mainLayout->addWidget(lab);
mListWidget = new QListWidget(this);
mListWidget->setObjectName(QStringLiteral("list_widget")); mListWidget->setObjectName(QStringLiteral("list_widget"));
mainLayout->addWidget(mListWidget); mainLayout->addWidget(mListWidget);
} }
......
...@@ -22,7 +22,7 @@ public: ...@@ -22,7 +22,7 @@ public:
void fillList(const QStringList &lst); void fillList(const QStringList &lst);
private: private:
QListWidget *mListWidget = nullptr; QListWidget *const mListWidget = nullptr;
}; };
#endif // POTENTIALPHISHINGDETAILWIDGET_H #endif // POTENTIALPHISHINGDETAILWIDGET_H
...@@ -225,11 +225,11 @@ void IdentityPage::slotRemoveIdentity() ...@@ -225,11 +225,11 @@ void IdentityPage::slotRemoveIdentity()
KGuiItem(i18n("&Remove"), KGuiItem(i18n("&Remove"),
QStringLiteral("edit-delete"))) QStringLiteral("edit-delete")))
== KMessageBox::Continue) { == KMessageBox::Continue) {
for (QTreeWidgetItem *item : selectedItems) { for (QTreeWidgetItem *selecteditem : selectedItems) {
IdentityListViewItem *identityItem = dynamic_cast<IdentityListViewItem *>(item); IdentityListViewItem *identityItem = dynamic_cast<IdentityListViewItem *>(item);
identityName = identityItem->identity().identityName(); identityName = identityItem->identity().identityName();
if (mIdentityManager->removeIdentity(identityName)) { if (mIdentityManager->removeIdentity(identityName)) {
delete item; delete selecteditem;
} }
if (mIPage.mIdentityList->currentItem()) { if (mIPage.mIdentityList->currentItem()) {
mIPage.mIdentityList->currentItem()->setSelected(true); mIPage.mIdentityList->currentItem()->setSelected(true);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment