projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
modernize: Replace most remaining old-style connects by PMF ones
[quassel.git]
/
src
/
qtui
/
settingspages
/
shortcutsmodel.cpp
diff --git
a/src/qtui/settingspages/shortcutsmodel.cpp
b/src/qtui/settingspages/shortcutsmodel.cpp
index
1123137
..
b4abf87
100644
(file)
--- a/
src/qtui/settingspages/shortcutsmodel.cpp
+++ b/
src/qtui/settingspages/shortcutsmodel.cpp
@@
-1,5
+1,5
@@
/***************************************************************************
/***************************************************************************
- * Copyright (C) 2005-201
6
by the Quassel Project *
+ * Copyright (C) 2005-201
8
by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
@@
-30,14
+30,14
@@
ShortcutsModel::ShortcutsModel(const QHash<QString, ActionCollection *> &actionC
{
for (int r = 0; r < actionCollections.values().count(); r++) {
ActionCollection *coll = actionCollections.values().at(r);
{
for (int r = 0; r < actionCollections.values().count(); r++) {
ActionCollection *coll = actionCollections.values().at(r);
-
Item
*item = new Item();
+
auto
*item = new Item();
item->row = r;
item->collection = coll;
for (int i = 0; i < coll->actions().count(); i++) {
item->row = r;
item->collection = coll;
for (int i = 0; i < coll->actions().count(); i++) {
-
Action
*action = qobject_cast<Action *>(coll->actions().at(i));
+
auto
*action = qobject_cast<Action *>(coll->actions().at(i));
if (!action)
continue;
if (!action)
continue;
-
Item
*actionItem = new Item();
+
auto
*actionItem = new Item();
actionItem->parentItem = item;
actionItem->row = i;
actionItem->collection = coll;
actionItem->parentItem = item;
actionItem->row = i;
actionItem->collection = coll;
@@
-59,13
+59,13
@@
ShortcutsModel::~ShortcutsModel()
QModelIndex ShortcutsModel::parent(const QModelIndex &child) const
{
if (!child.isValid())
QModelIndex ShortcutsModel::parent(const QModelIndex &child) const
{
if (!child.isValid())
- return
QModelIndex()
;
+ return
{}
;
-
Item
*item = static_cast<Item *>(child.internalPointer());
+
auto
*item = static_cast<Item *>(child.internalPointer());
Q_ASSERT(item);
if (!item->parentItem)
Q_ASSERT(item);
if (!item->parentItem)
- return
QModelIndex()
;
+ return
{}
;
return createIndex(item->parentItem->row, 0, item->parentItem);
}
return createIndex(item->parentItem->row, 0, item->parentItem);
}
@@
-87,7
+87,7
@@
int ShortcutsModel::columnCount(const QModelIndex &parent) const
if (!parent.isValid())
return 2;
if (!parent.isValid())
return 2;
-
Item
*item = static_cast<Item *>(parent.internalPointer());
+
auto
*item = static_cast<Item *>(parent.internalPointer());
Q_ASSERT(item);
if (!item->parentItem)
Q_ASSERT(item);
if (!item->parentItem)
@@
-102,7
+102,7
@@
int ShortcutsModel::rowCount(const QModelIndex &parent) const
if (!parent.isValid())
return _categoryItems.count();
if (!parent.isValid())
return _categoryItems.count();
-
Item
*item = static_cast<Item *>(parent.internalPointer());
+
auto
*item = static_cast<Item *>(parent.internalPointer());
Q_ASSERT(item);
if (!item->parentItem)
Q_ASSERT(item);
if (!item->parentItem)
@@
-132,7
+132,7
@@
QVariant ShortcutsModel::data(const QModelIndex &index, int role) const
if (!index.isValid())
return QVariant();
if (!index.isValid())
return QVariant();
-
Item
*item = static_cast<Item *>(index.internalPointer());
+
auto
*item = static_cast<Item *>(index.internalPointer());
Q_ASSERT(item);
if (!item->parentItem) {
Q_ASSERT(item);
if (!item->parentItem) {
@@
-146,7
+146,7
@@
QVariant ShortcutsModel::data(const QModelIndex &index, int role) const
}
}
}
}
-
Action
*action = qobject_cast<Action *>(item->action);
+
auto
*action = qobject_cast<Action *>(item->action);
Q_ASSERT(action);
switch (role) {
Q_ASSERT(action);
switch (role) {
@@
-190,7
+190,7
@@
bool ShortcutsModel::setData(const QModelIndex &index, const QVariant &value, in
if (!index.parent().isValid())
return false;
if (!index.parent().isValid())
return false;
-
Item
*item = static_cast<Item *>(index.internalPointer());
+
auto
*item = static_cast<Item *>(index.internalPointer());
Q_ASSERT(item);
QKeySequence newSeq = value.value<QKeySequence>();
Q_ASSERT(item);
QKeySequence newSeq = value.value<QKeySequence>();
@@
-202,11
+202,11
@@
bool ShortcutsModel::setData(const QModelIndex &index, const QVariant &value, in
if (oldSeq == storedSeq && newSeq != storedSeq) {
if (++_changedCount == 1)
if (oldSeq == storedSeq && newSeq != storedSeq) {
if (++_changedCount == 1)
- emit
hasC
hanged(true);
+ emit
c
hanged(true);
}
else if (oldSeq != storedSeq && newSeq == storedSeq) {
if (--_changedCount == 0)
}
else if (oldSeq != storedSeq && newSeq == storedSeq) {
if (--_changedCount == 0)
- emit
hasC
hanged(false);
+ emit
c
hanged(false);
}
return true;
}
return true;
@@
-223,7
+223,7
@@
void ShortcutsModel::load()
emit dataChanged(index(0, 1), index(rowCount()-1, 1));
if (_changedCount != 0) {
_changedCount = 0;
emit dataChanged(index(0, 1), index(rowCount()-1, 1));
if (_changedCount != 0) {
_changedCount = 0;
- emit
hasC
hanged(false);
+ emit
c
hanged(false);
}
}
}
}
@@
-237,7
+237,7
@@
void ShortcutsModel::commit()
}
if (_changedCount != 0) {
_changedCount = 0;
}
if (_changedCount != 0) {
_changedCount = 0;
- emit
hasC
hanged(false);
+ emit
c
hanged(false);
}
}
}
}