X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Feffectslistwidget.cpp;h=44a066b1569defbd0c9f1fbe1ed3cacf221fdb1e;hb=8d1e6aae86d4a2b7f22658d4d94c6a4857c9eb19;hp=7d75ac888b722f3e112be20d3293f15bc67831a7;hpb=65291fac2609fe71e4be801a4d5349ddda5b9243;p=kdenlive diff --git a/src/effectslistwidget.cpp b/src/effectslistwidget.cpp index 7d75ac88..44a066b1 100644 --- a/src/effectslistwidget.cpp +++ b/src/effectslistwidget.cpp @@ -146,9 +146,9 @@ void EffectsListWidget::initList(QMenu *effectsMenu, KActionCategory *effectActi //insertTopLevelItems(0, folders); - loadEffects(&MainWindow::videoEffects, KIcon("kdenlive-show-video"), misc, &folders, QString::number((int) EFFECT_VIDEO), current, &found); - loadEffects(&MainWindow::audioEffects, KIcon("kdenlive-show-audio"), audio, &folders, QString::number((int) EFFECT_AUDIO), current, &found); - loadEffects(&MainWindow::customEffects, KIcon("kdenlive-custom-effect"), custom, static_cast *>(0), QString::number((int) EFFECT_CUSTOM), current, &found); + loadEffects(&MainWindow::videoEffects, KIcon("kdenlive-show-video"), misc, &folders, EFFECT_VIDEO, current, &found); + loadEffects(&MainWindow::audioEffects, KIcon("kdenlive-show-audio"), audio, &folders, EFFECT_AUDIO, current, &found); + loadEffects(&MainWindow::customEffects, KIcon("kdenlive-custom-effect"), custom, static_cast *>(0), EFFECT_CUSTOM, current, &found); if (!found && !currentFolder.isEmpty()) { // previously selected effect was removed, focus on its parent folder @@ -220,16 +220,17 @@ void EffectsListWidget::initList(QMenu *effectsMenu, KActionCategory *effectActi } } -void EffectsListWidget::loadEffects(const EffectsList *effectlist, KIcon icon, QTreeWidgetItem *defaultFolder, const QList *folders, const QString type, const QString current, bool *found) +void EffectsListWidget::loadEffects(const EffectsList *effectlist, KIcon icon, QTreeWidgetItem *defaultFolder, const QList *folders, int type, const QString current, bool *found) { QStringList effectInfo, l; QTreeWidgetItem *parentItem; QTreeWidgetItem *item; int ct = effectlist->count(); + for (int ix = 0; ix < ct; ix ++) { effectInfo = effectlist->effectIdInfo(ix); - effectInfo.append(type); + effectInfo.append(QString::number(type)); parentItem = NULL; if (folders) { @@ -324,6 +325,8 @@ void EffectsListWidget::keyPressEvent(QKeyEvent *e) { if (e->key() == Qt::Key_Enter || e->key() == Qt::Key_Return) { emit applyEffect(currentEffect()); + e->accept(); + return; } QTreeWidget::keyPressEvent(e); }