diff options
author | Gerald Combs <gerald@wireshark.org> | 2021-04-19 12:02:31 -0700 |
---|---|---|
committer | Wireshark GitLab Utility <gerald+gitlab-utility@wireshark.org> | 2021-04-20 06:11:40 +0000 |
commit | cd81255da229580146fe9638f9151c29a097ac57 (patch) | |
tree | 8b6ccfde0d2654bdf797996ebbdaa38705db818c /ui/qt/manager/wireshark_preference.cpp | |
parent | 26c56359731e2017ab400ea0f4e078601aea7758 (diff) |
Qt: Fix various compiler warnings.
Fix const-qual and missing-prototypes warnings found by Clang.
Diffstat (limited to 'ui/qt/manager/wireshark_preference.cpp')
-rw-r--r-- | ui/qt/manager/wireshark_preference.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ui/qt/manager/wireshark_preference.cpp b/ui/qt/manager/wireshark_preference.cpp index ef54201443..761589d6dd 100644 --- a/ui/qt/manager/wireshark_preference.cpp +++ b/ui/qt/manager/wireshark_preference.cpp @@ -51,7 +51,7 @@ public: BoolPreference(QObject * parent = Q_NULLPTR) : WiresharkPreference(parent) {} virtual QWidget * editor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) { - ((QAbstractItemModel*)index.model())->setData(index, QString("BOOL"), Qt::EditRole); + const_cast<QAbstractItemModel*>(index.model())->setData(index, QString("BOOL"), Qt::EditRole); return WiresharkPreference::editor(parent, option, index); } }; @@ -180,7 +180,7 @@ public: QString filename = WiresharkFileDialog::getSaveFileName(parent, wsApp->windowTitleString(prefs_get_title(prefsItem()->getPref())), index.model()->data(index, Qt::DisplayRole).toString()); if (!filename.isEmpty()) { - ((QAbstractItemModel*)index.model())->setData(index, QDir::toNativeSeparators(filename), Qt::EditRole); + const_cast<QAbstractItemModel*>(index.model())->setData(index, QDir::toNativeSeparators(filename), Qt::EditRole); } return WiresharkPreference::editor(parent, option, index); } @@ -196,7 +196,7 @@ public: QString filename = WiresharkFileDialog::getOpenFileName(parent, wsApp->windowTitleString(prefs_get_title(prefsItem()->getPref())), index.model()->data(index, Qt::DisplayRole).toString()); if (!filename.isEmpty()) { - ((QAbstractItemModel*)index.model())->setData(index, QDir::toNativeSeparators(filename), Qt::EditRole); + const_cast<QAbstractItemModel*>(index.model())->setData(index, QDir::toNativeSeparators(filename), Qt::EditRole); } return WiresharkPreference::editor(parent, option, index); } @@ -212,7 +212,7 @@ public: QString filename = WiresharkFileDialog::getExistingDirectory(parent, wsApp->windowTitleString(prefs_get_title(prefsItem()->getPref())), index.model()->data(index, Qt::DisplayRole).toString()); if (!filename.isEmpty()) { - ((QAbstractItemModel*)index.model())->setData(index, QDir::toNativeSeparators(filename), Qt::EditRole); + const_cast<QAbstractItemModel*>(index.model())->setData(index, QDir::toNativeSeparators(filename), Qt::EditRole); } return WiresharkPreference::editor(parent, option, index); } |