* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include "shortcutsmodel.h"
***************************************************************************/
#include "shortcutsmodel.h"
-ShortcutsModel::ShortcutsModel(const QHash<QString, ActionCollection *> &actionCollections, QObject *parent)
- : QAbstractItemModel(parent),
- _changedCount(0)
+ShortcutsModel::ShortcutsModel(const QHash<QString, ActionCollection*>& actionCollections, QObject* parent)
+ : QAbstractItemModel(parent)
+ , _changedCount(0)
- return createIndex(row, column, static_cast<Item *>(parent.internalPointer())->actionItems.at(row));
+ return createIndex(row, column, static_cast<Item*>(parent.internalPointer())->actionItems.at(row));
// top level category item
return createIndex(row, column, _categoryItems.at(row));
}
// top level category item
return createIndex(row, column, _categoryItems.at(row));
}
QVariant ShortcutsModel::headerData(int section, Qt::Orientation orientation, int role) const
{
if (orientation != Qt::Horizontal || role != Qt::DisplayRole)
QVariant ShortcutsModel::headerData(int section, Qt::Orientation orientation, int role) const
{
if (orientation != Qt::Horizontal || role != Qt::DisplayRole)
- foreach(Item *catItem, _categoryItems) {
- foreach(Item *actItem, catItem->actionItems) {
+ foreach (Item* catItem, _categoryItems) {
+ foreach (Item* actItem, catItem->actionItems) {
- emit dataChanged(index(0, 1), index(rowCount()-1, 1));
+ emit dataChanged(index(0, 1), index(rowCount() - 1, 1));
- foreach(Item *catItem, _categoryItems) {
- foreach(Item *actItem, catItem->actionItems) {
+ foreach (Item* catItem, _categoryItems) {
+ foreach (Item* actItem, catItem->actionItems) {
actItem->action->setShortcut(actItem->shortcut, Action::ActiveShortcut);
}
}
if (_changedCount != 0) {
_changedCount = 0;
actItem->action->setShortcut(actItem->shortcut, Action::ActiveShortcut);
}
}
if (_changedCount != 0) {
_changedCount = 0;