QList <QTreeWidgetItem *> folders;
QStringList folderNames;
QDomNodeList groups = doc.documentElement().elementsByTagName("group");
- for (int i = 0; i < groups.count(); i++) {
+ for (int i = 0; i < groups.count(); ++i) {
folderNames << i18n(groups.at(i).firstChild().firstChild().nodeValue().toUtf8().constData());
}
- for (int i = 0; i < topLevelItemCount(); i++) {
+ for (int i = 0; i < topLevelItemCount(); ++i) {
topLevelItem(i)->takeChildren();
QString currentName = topLevelItem(i)->text(0);
if (currentName != i18n("Misc") && currentName != i18n("Audio") && currentName != i18nc("Folder Name", "Custom") && !folderNames.contains(currentName)) {
takeTopLevelItem(i);
- i--;
+ --i;
}
}
- for (int i = 0; i < groups.count(); i++) {
+ for (int i = 0; i < groups.count(); ++i) {
item = findFolder(folderNames.at(i));
if (item) {
item->setData(0, IdRole, groups.at(i).toElement().attribute("list"));
if (!found && !currentFolder.isEmpty()) {
// previously selected effect was removed, focus on its parent folder
- for (int i = 0; i < topLevelItemCount(); i++) {
+ for (int i = 0; i < topLevelItemCount(); ++i) {
if (topLevelItem(i)->text(0) == currentFolder) {
setCurrentItem(topLevelItem(i));
break;
QMenu *sub2 = NULL;
QMenu *sub3 = NULL;
QMenu *sub4 = NULL;
- for (int i = 0; i < topLevelItemCount(); i++) {
+ for (int i = 0; i < topLevelItemCount(); ++i) {
if (!topLevelItem(i)->childCount())
continue;
QMenu *sub = new QMenu(topLevelItem(i)->text(0), effectsMenu);
}
}
-void EffectsListWidget::loadEffects(const EffectsList *effectlist, KIcon icon, QTreeWidgetItem *defaultFolder, const QList<QTreeWidgetItem *> *folders, int type, const QString current, bool *found)
+void EffectsListWidget::loadEffects(const EffectsList *effectlist, KIcon icon, QTreeWidgetItem *defaultFolder, const QList<QTreeWidgetItem *> *folders, int type, const QString ¤t, bool *found)
{
QStringList effectInfo, l;
QTreeWidgetItem *parentItem;
int ct = effectlist->count();
- for (int ix = 0; ix < ct; ix ++) {
+ for (int ix = 0; ix < ct; ++ix) {
effectInfo = effectlist->effectIdInfo(ix);
effectInfo.append(QString::number(type));
parentItem = NULL;
if (folders) {
- for (int i = 0; i < folders->count(); i++) {
- l = folders->at(i)->data(0, IdRole).toString().split(',', QString::SkipEmptyParts);
+ for (int i = 0; i < folders->count(); ++i) {
+ l = folders->at(i)->data(0, IdRole).toString().split(QLatin1Char(','), QString::SkipEmptyParts);
if (l.contains(effectInfo.at(2))) {
parentItem = folders->at(i);
break;
QTreeWidgetItem *item = NULL;
QList<QTreeWidgetItem *> result = findItems(name, Qt::MatchExactly);
if (!result.isEmpty()) {
- for (int j = 0; j < result.count(); j++) {
+ for (int j = 0; j < result.count(); ++j) {
if (result.at(j)->data(0, TypeRole) == EFFECT_FOLDER) {
item = result.at(j);
break;
void EffectsListWidget::contextMenuEvent(QContextMenuEvent * event)
{
QTreeWidgetItem *item = itemAt(event->pos());
- if (item && item->data(0, TypeRole).toInt() == EFFECT_CUSTOM) m_menu->popup(event->globalPos());
+ if (item && item->data(0, TypeRole).toInt() == EFFECT_CUSTOM)
+ m_menu->popup(event->globalPos());
}
#include "effectslistwidget.moc"