r21764 by jghali - small refactoring for shortcut prefs
scribus-commit
scribus-commit at lists.scribus.net
Sat Feb 11 00:22:04 UTC 2017
Author: jghali
Date: Sat Feb 11 00:22:04 2017
New Revision: 21764
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=21764
Log:
small refactoring for shortcut prefs
Modified:
branches/Version14x/Scribus/scribus/tabkeyboardshortcutswidget.cpp
Modified: branches/Version14x/Scribus/scribus/tabkeyboardshortcutswidget.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21764&path=/branches/Version14x/Scribus/scribus/tabkeyboardshortcutswidget.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/tabkeyboardshortcutswidget.cpp (original)
+++ branches/Version14x/Scribus/scribus/tabkeyboardshortcutswidget.cpp Sat Feb 11 00:22:04 2017
@@ -359,8 +359,9 @@
QTreeWidgetItem *currMenuLVI = NULL;
QTreeWidgetItem *prevLVI = NULL;
QTreeWidgetItem *prevMenuLVI = NULL;
- for (QVector< QPair<QString, QStringList> >::Iterator itmenu = defMenus->begin(); itmenu != defMenus->end(); ++itmenu )
- {
+ for (int i = 0; i < defMenus->count(); ++i)
+ {
+ const QPair<QString, QStringList> &actionStrings = defMenus->at(i);
if (firstMenu)
{
currMenuLVI = new QTreeWidgetItem(keyTable);
@@ -370,16 +371,16 @@
currMenuLVI = new QTreeWidgetItem(keyTable, prevMenuLVI);
Q_CHECK_PTR(currMenuLVI);
lviToMenuMap.append(currMenuLVI);
- currMenuLVI->setText(0, itmenu->first);
+ currMenuLVI->setText(0, actionStrings.first);
currMenuLVI->setExpanded(true);
currMenuLVI->setFlags(Qt::ItemIsEnabled);
prevMenuLVI=currMenuLVI;
first=true;
currLVI=0;
prevLVI=0;
- for (int i = 0; i < itmenu->second.count(); ++i)
- {
- QString actionName = itmenu->second.at(i);
+ for (int j = 0; j < actionStrings.second.count(); ++j)
+ {
+ QString actionName = actionStrings.second.at(j);
if (!keyMap.contains(actionName))
{
qDebug() << "The action " << actionName << " is not defined in shortcut map";
@@ -403,8 +404,9 @@
}
}
//Non menu actions
- for (QVector< QPair<QString, QStringList> >::Iterator itmenu = defNonMenuActions->begin(); itmenu != defNonMenuActions->end(); ++itmenu )
- {
+ for (int i = 0; i < defNonMenuActions->count(); ++i)
+ {
+ const QPair<QString, QStringList> &actionStrings = defNonMenuActions->at(i);
if (firstMenu)
{
currMenuLVI = new QTreeWidgetItem(keyTable);
@@ -414,16 +416,16 @@
currMenuLVI = new QTreeWidgetItem(keyTable, prevMenuLVI);
Q_CHECK_PTR(currMenuLVI);
lviToMenuMap.append(currMenuLVI);
- currMenuLVI->setText(0, itmenu->first);
+ currMenuLVI->setText(0, actionStrings.first);
currMenuLVI->setExpanded(true);
currMenuLVI->setFlags(Qt::ItemIsEnabled);
prevMenuLVI=currMenuLVI;
first=true;
currLVI=0;
prevLVI=0;
- for (int i = 0; i < itmenu->second.count(); ++i)
- {
- QString actionName = itmenu->second.at(i);
+ for (int j = 0; j < actionStrings.second.count(); ++j)
+ {
+ QString actionName = actionStrings.second.at(j);
if (!keyMap.contains(actionName))
{
qDebug() << "The action " << actionName << " is not defined in shortcut map";
More information about the scribus-commit
mailing list