[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kcm-grub2] src: static_cast -> qobject_cast
From: Konstantinos Smanis <konstantinos.smanis () gmail ! com>
Date: 2013-10-24 13:13:39
Message-ID: E1VZKjL-0006kO-Sb () scm ! kde ! org
[Download RAW message or body]
Git commit 17a54a0ff2747bfbbcb014e2b5e946c36bdc4b15 by Konstantinos Smanis.
Committed on 24/10/2013 at 13:13.
Pushed by ksmanis into branch 'master'.
static_cast -> qobject_cast
M +3 -3 src/kcm_grub2.cpp
http://commits.kde.org/kcm-grub2/17a54a0ff2747bfbbcb014e2b5e946c36bdc4b15
diff --git a/src/kcm_grub2.cpp b/src/kcm_grub2.cpp
index 2a8fdbf..44850c3 100644
--- a/src/kcm_grub2.cpp
+++ b/src/kcm_grub2.cpp
@@ -104,7 +104,7 @@ void KCMGRUB2::load()
if (!m_entries.isEmpty()) {
int maxLen = 0, maxLvl = 0;
QStandardItemModel *model = new QStandardItemModel(ui->kcombobox_default);
- QTreeView *view = static_cast<QTreeView *>(ui->kcombobox_default->view());
+ QTreeView *view = qobject_cast<QTreeView *>(ui->kcombobox_default->view());
QList<QStandardItem *> ancestors;
ancestors.append(model->invisibleRootItem());
for (int i = 0; i < m_entries.size(); i++) {
@@ -269,8 +269,8 @@ void KCMGRUB2::save()
QString grubDefault;
if (!m_entries.isEmpty()) {
m_settings["GRUB_DEFAULT"] = "saved";
- QStandardItemModel *model = static_cast<QStandardItemModel *>(ui->kcombobox_default->model());
- QTreeView *view = static_cast<QTreeView *>(ui->kcombobox_default->view());
+ QStandardItemModel *model = qobject_cast<QStandardItemModel *>(ui->kcombobox_default->model());
+ QTreeView *view = qobject_cast<QTreeView *>(ui->kcombobox_default->view());
//Ugly, ugly hack. The view's current QModelIndex is invalidated
//while the view is hidden and there is no access to the internal
//QPersistentModelIndex (it is hidden in QComboBox's pimpl).
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic