Commit 55d4bcc1 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Get rid of the now useless hacky KoIconUtils icon method and switch to standard QIcon method

parent 46438552
......@@ -50,6 +50,11 @@ void AssetListWidget::setup()
setFocusPolicy(Qt::StrongFocus);
}
void AssetListWidget::reset()
{
setSource(QUrl(QStringLiteral("qrc:/qml/assetList.qml")));
}
QString AssetListWidget::getName(const QModelIndex &index) const
{
return m_model->getName(m_proxyModel->mapToSource(index));
......
......@@ -59,6 +59,9 @@ public:
void activate(const QModelIndex &ix);
/* @brief Rebuild the view by resetting the source. Is there a better way? */
void reset();
protected:
void setup();
std::shared_ptr<AssetTreeModel> m_model;
......
......@@ -22,7 +22,7 @@
#include "asseticonprovider.hpp"
#include "effects/effectsrepository.hpp"
#include "transitions/transitionsrepository.hpp"
#include "utils/KoIconUtils.h"
#include <QDebug>
#include <QFont>
#include <QIcon>
......@@ -45,7 +45,7 @@ QImage AssetIconProvider::requestImage(const QString &id, QSize *size, const QSi
if (m_effect && EffectsRepository::get()->exists(id)) {
if (EffectsRepository::get()->getType(id) == EffectType::Custom) {
QIcon folder_icon = KoIconUtils::themedIcon(QStringLiteral("folder"));
QIcon folder_icon = QIcon::fromTheme(QStringLiteral("folder"));
result = folder_icon.pixmap(30, 30).toImage();
} else {
QString name = EffectsRepository::get()->getName(id);
......
......@@ -29,7 +29,7 @@
#include "model/assetparametermodel.hpp"
#include "transitions/transitionsrepository.hpp"
#include "transitions/view/transitionstackview.hpp"
#include "utils/KoIconUtils.h"
#include "view/assetparameterview.hpp"
#include <KColorScheme>
......@@ -54,7 +54,7 @@ AssetPanel::AssetPanel(QWidget *parent)
QHBoxLayout *tLayout = new QHBoxLayout;
tLayout->addWidget(m_assetTitle);
m_switchBuiltStack = new QToolButton(this);
m_switchBuiltStack->setIcon(KoIconUtils::themedIcon(QStringLiteral("adjustlevels")));
m_switchBuiltStack->setIcon(QIcon::fromTheme(QStringLiteral("adjustlevels")));
m_switchBuiltStack->setToolTip(i18n("Adjust clip"));
m_switchBuiltStack->setCheckable(true);
m_switchBuiltStack->setChecked(KdenliveSettings::showbuiltstack());
......@@ -63,7 +63,7 @@ AssetPanel::AssetPanel(QWidget *parent)
tLayout->addWidget(m_switchBuiltStack);
m_splitButton = new QToolButton(this);
m_splitButton->setIcon(KoIconUtils::themedIcon(QStringLiteral("view-split-left-right")));
m_splitButton->setIcon(QIcon::fromTheme(QStringLiteral("view-split-left-right")));
m_splitButton->setToolTip(i18n("Compare effect"));
m_splitButton->setCheckable(true);
m_splitButton->setVisible(false);
......@@ -71,7 +71,7 @@ AssetPanel::AssetPanel(QWidget *parent)
tLayout->addWidget(m_splitButton);
m_timelineButton = new QToolButton(this);
m_timelineButton->setIcon(KoIconUtils::themedIcon(QStringLiteral("adjustlevels")));
m_timelineButton->setIcon(QIcon::fromTheme(QStringLiteral("adjustlevels")));
m_timelineButton->setToolTip(i18n("Display keyframes in timeline"));
m_timelineButton->setCheckable(true);
m_timelineButton->setVisible(false);
......
......@@ -19,7 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "utils/KoIconUtils.h"
#include "kdenlive_debug.h"
#include <KConfig>
......@@ -104,17 +104,17 @@ AnimationWidget::AnimationWidget(std::shared_ptr<AssetParameterModel> model, QMo
}
// seek to previous
m_previous = tb->addAction(KoIconUtils::themedIcon(QStringLiteral("media-skip-backward")), i18n("Previous keyframe"), this, SLOT(slotPrevious()));
m_previous = tb->addAction(QIcon::fromTheme(QStringLiteral("media-skip-backward")), i18n("Previous keyframe"), this, SLOT(slotPrevious()));
// Add/remove keyframe
m_addKeyframe = new KDualAction(i18n("Add keyframe"), i18n("Remove keyframe"), this);
m_addKeyframe->setInactiveIcon(KoIconUtils::themedIcon(QStringLiteral("list-add")));
m_addKeyframe->setActiveIcon(KoIconUtils::themedIcon(QStringLiteral("list-remove")));
m_addKeyframe->setInactiveIcon(QIcon::fromTheme(QStringLiteral("list-add")));
m_addKeyframe->setActiveIcon(QIcon::fromTheme(QStringLiteral("list-remove")));
connect(m_addKeyframe, SIGNAL(activeChangedByUser(bool)), this, SLOT(slotAddDeleteKeyframe(bool)));
tb->addAction(m_addKeyframe);
// seek to next
m_next = tb->addAction(KoIconUtils::themedIcon(QStringLiteral("media-skip-forward")), i18n("Next keyframe"), this, SLOT(slotNext()));
m_next = tb->addAction(QIcon::fromTheme(QStringLiteral("media-skip-forward")), i18n("Next keyframe"), this, SLOT(slotNext()));
// Preset combo
m_presetCombo = new QComboBox(this);
......@@ -123,32 +123,32 @@ AnimationWidget::AnimationWidget(std::shared_ptr<AssetParameterModel> model, QMo
tb->addWidget(m_presetCombo);
// Keyframe type widget
m_selectType = new KSelectAction(KoIconUtils::themedIcon(QStringLiteral("keyframes")), i18n("Keyframe interpolation"), this);
QAction *discrete = new QAction(KoIconUtils::themedIcon(QStringLiteral("discrete")), i18n("Discrete"), this);
m_selectType = new KSelectAction(QIcon::fromTheme(QStringLiteral("keyframes")), i18n("Keyframe interpolation"), this);
QAction *discrete = new QAction(QIcon::fromTheme(QStringLiteral("discrete")), i18n("Discrete"), this);
discrete->setData((int)mlt_keyframe_discrete);
discrete->setCheckable(true);
m_selectType->addAction(discrete);
QAction *linear = new QAction(KoIconUtils::themedIcon(QStringLiteral("linear")), i18n("Linear"), this);
QAction *linear = new QAction(QIcon::fromTheme(QStringLiteral("linear")), i18n("Linear"), this);
linear->setData((int)mlt_keyframe_linear);
linear->setCheckable(true);
m_selectType->addAction(linear);
QAction *curve = new QAction(KoIconUtils::themedIcon(QStringLiteral("smooth")), i18n("Smooth"), this);
QAction *curve = new QAction(QIcon::fromTheme(QStringLiteral("smooth")), i18n("Smooth"), this);
curve->setData((int)mlt_keyframe_smooth);
curve->setCheckable(true);
m_selectType->addAction(curve);
m_selectType->setCurrentAction(linear);
connect(m_selectType, SIGNAL(triggered(QAction *)), this, SLOT(slotEditKeyframeType(QAction *)));
KSelectAction *defaultInterp = new KSelectAction(KoIconUtils::themedIcon(QStringLiteral("keyframes")), i18n("Default interpolation"), this);
discrete = new QAction(KoIconUtils::themedIcon(QStringLiteral("discrete")), i18n("Discrete"), this);
KSelectAction *defaultInterp = new KSelectAction(QIcon::fromTheme(QStringLiteral("keyframes")), i18n("Default interpolation"), this);
discrete = new QAction(QIcon::fromTheme(QStringLiteral("discrete")), i18n("Discrete"), this);
discrete->setData((int)mlt_keyframe_discrete);
discrete->setCheckable(true);
defaultInterp->addAction(discrete);
linear = new QAction(KoIconUtils::themedIcon(QStringLiteral("linear")), i18n("Linear"), this);
linear = new QAction(QIcon::fromTheme(QStringLiteral("linear")), i18n("Linear"), this);
linear->setData((int)mlt_keyframe_linear);
linear->setCheckable(true);
defaultInterp->addAction(linear);
curve = new QAction(KoIconUtils::themedIcon(QStringLiteral("smooth")), i18n("Smooth"), this);
curve = new QAction(QIcon::fromTheme(QStringLiteral("smooth")), i18n("Smooth"), this);
curve->setData((int)mlt_keyframe_smooth);
curve->setCheckable(true);
defaultInterp->addAction(curve);
......@@ -180,11 +180,11 @@ AnimationWidget::AnimationWidget(std::shared_ptr<AssetParameterModel> model, QMo
connect(removeNext, &QAction::triggered, this, &AnimationWidget::slotRemoveNext);
// save preset
QAction *savePreset = new QAction(KoIconUtils::themedIcon(QStringLiteral("document-save")), i18n("Save preset"), this);
QAction *savePreset = new QAction(QIcon::fromTheme(QStringLiteral("document-save")), i18n("Save preset"), this);
connect(savePreset, &QAction::triggered, this, &AnimationWidget::savePreset);
// delete preset
QAction *delPreset = new QAction(KoIconUtils::themedIcon(QStringLiteral("edit-delete")), i18n("Delete preset"), this);
QAction *delPreset = new QAction(QIcon::fromTheme(QStringLiteral("edit-delete")), i18n("Delete preset"), this);
connect(delPreset, &QAction::triggered, this, &AnimationWidget::deletePreset);
auto *container = new QMenu;
......@@ -200,7 +200,7 @@ AnimationWidget::AnimationWidget(std::shared_ptr<AssetParameterModel> model, QMo
container->addAction(defaultInterp);
auto *menuButton = new QToolButton;
menuButton->setIcon(KoIconUtils::themedIcon(QStringLiteral("kdenlive-menu")));
menuButton->setIcon(QIcon::fromTheme(QStringLiteral("kdenlive-menu")));
menuButton->setToolTip(i18n("Options"));
menuButton->setMenu(container);
menuButton->setPopupMode(QToolButton::InstantPopup);
......@@ -835,7 +835,7 @@ void AnimationWidget::buildRectWidget(const QString &paramTag, QModelIndex ix)
horLayout->addWidget(m_spinWidth);
// Lock ratio stuff
m_lockRatio = new QAction(KoIconUtils::themedIcon(QStringLiteral("link")), i18n("Lock aspect ratio"), this);
m_lockRatio = new QAction(QIcon::fromTheme(QStringLiteral("link")), i18n("Lock aspect ratio"), this);
m_lockRatio->setCheckable(true);
connect(m_lockRatio, &QAction::triggered, this, &AnimationWidget::slotLockRatio);
auto *ratioButton = new QToolButton;
......@@ -859,27 +859,27 @@ void AnimationWidget::buildRectWidget(const QString &paramTag, QModelIndex ix)
}
// Build buttons
m_originalSize = new QAction(KoIconUtils::themedIcon(QStringLiteral("zoom-original")), i18n("Adjust to original size"), this);
m_originalSize = new QAction(QIcon::fromTheme(QStringLiteral("zoom-original")), i18n("Adjust to original size"), this);
connect(m_originalSize, &QAction::triggered, this, &AnimationWidget::slotAdjustToSource);
m_originalSize->setCheckable(true);
QAction *adjustSize = new QAction(KoIconUtils::themedIcon(QStringLiteral("zoom-fit-best")), i18n("Adjust and center in frame"), this);
QAction *adjustSize = new QAction(QIcon::fromTheme(QStringLiteral("zoom-fit-best")), i18n("Adjust and center in frame"), this);
connect(adjustSize, &QAction::triggered, this, &AnimationWidget::slotAdjustToFrameSize);
QAction *fitToWidth = new QAction(KoIconUtils::themedIcon(QStringLiteral("zoom-fit-width")), i18n("Fit to width"), this);
QAction *fitToWidth = new QAction(QIcon::fromTheme(QStringLiteral("zoom-fit-width")), i18n("Fit to width"), this);
connect(fitToWidth, &QAction::triggered, this, &AnimationWidget::slotFitToWidth);
QAction *fitToHeight = new QAction(KoIconUtils::themedIcon(QStringLiteral("zoom-fit-height")), i18n("Fit to height"), this);
QAction *fitToHeight = new QAction(QIcon::fromTheme(QStringLiteral("zoom-fit-height")), i18n("Fit to height"), this);
connect(fitToHeight, &QAction::triggered, this, &AnimationWidget::slotFitToHeight);
QAction *alignleft = new QAction(KoIconUtils::themedIcon(QStringLiteral("kdenlive-align-left")), i18n("Align left"), this);
QAction *alignleft = new QAction(QIcon::fromTheme(QStringLiteral("kdenlive-align-left")), i18n("Align left"), this);
connect(alignleft, &QAction::triggered, this, &AnimationWidget::slotMoveLeft);
QAction *alignhcenter = new QAction(KoIconUtils::themedIcon(QStringLiteral("kdenlive-align-hor")), i18n("Center horizontally"), this);
QAction *alignhcenter = new QAction(QIcon::fromTheme(QStringLiteral("kdenlive-align-hor")), i18n("Center horizontally"), this);
connect(alignhcenter, &QAction::triggered, this, &AnimationWidget::slotCenterH);
QAction *alignright = new QAction(KoIconUtils::themedIcon(QStringLiteral("kdenlive-align-right")), i18n("Align right"), this);
QAction *alignright = new QAction(QIcon::fromTheme(QStringLiteral("kdenlive-align-right")), i18n("Align right"), this);
connect(alignright, &QAction::triggered, this, &AnimationWidget::slotMoveRight);
QAction *aligntop = new QAction(KoIconUtils::themedIcon(QStringLiteral("kdenlive-align-top")), i18n("Align top"), this);
QAction *aligntop = new QAction(QIcon::fromTheme(QStringLiteral("kdenlive-align-top")), i18n("Align top"), this);
connect(aligntop, &QAction::triggered, this, &AnimationWidget::slotMoveTop);
QAction *alignvcenter = new QAction(KoIconUtils::themedIcon(QStringLiteral("kdenlive-align-vert")), i18n("Center vertically"), this);
QAction *alignvcenter = new QAction(QIcon::fromTheme(QStringLiteral("kdenlive-align-vert")), i18n("Center vertically"), this);
connect(alignvcenter, &QAction::triggered, this, &AnimationWidget::slotCenterV);
QAction *alignbottom = new QAction(KoIconUtils::themedIcon(QStringLiteral("kdenlive-align-bottom")), i18n("Align bottom"), this);
QAction *alignbottom = new QAction(QIcon::fromTheme(QStringLiteral("kdenlive-align-bottom")), i18n("Align bottom"), this);
connect(alignbottom, &QAction::triggered, this, &AnimationWidget::slotMoveBottom);
auto *alignLayout = new QHBoxLayout;
......
......@@ -21,9 +21,9 @@
#include "bezier/beziersplineeditor.h"
#include "colortools.h"
#include "kdenlivesettings.h"
#include "cubic/kis_curve_widget.h"
#include "widgets/dragvalue.h"
#include "utils/KoIconUtils.h"
#include <klocalizedstring.h>
/*@brief this label is a pixmap corresponding to a legend of the axis*/
......@@ -163,14 +163,14 @@ CurveParamWidget<CurveWidget_t>::CurveParamWidget(std::shared_ptr<AssetParameter
layout->addWidget(widget);
// set up icons and initial button states
m_ui.buttonLinkHandles->setIcon(KoIconUtils::themedIcon(QStringLiteral("edit-link")));
m_ui.buttonDeletePoint->setIcon(KoIconUtils::themedIcon(QStringLiteral("list-remove")));
m_ui.buttonZoomIn->setIcon(KoIconUtils::themedIcon(QStringLiteral("zoom-in")));
m_ui.buttonZoomOut->setIcon(KoIconUtils::themedIcon(QStringLiteral("zoom-out")));
m_ui.buttonGridChange->setIcon(KoIconUtils::themedIcon(QStringLiteral("view-grid")));
m_ui.buttonLinkHandles->setIcon(QIcon::fromTheme(QStringLiteral("edit-link")));
m_ui.buttonDeletePoint->setIcon(QIcon::fromTheme(QStringLiteral("list-remove")));
m_ui.buttonZoomIn->setIcon(QIcon::fromTheme(QStringLiteral("zoom-in")));
m_ui.buttonZoomOut->setIcon(QIcon::fromTheme(QStringLiteral("zoom-out")));
m_ui.buttonGridChange->setIcon(QIcon::fromTheme(QStringLiteral("view-grid")));
m_ui.buttonShowPixmap->setIcon(QIcon(QPixmap::fromImage(ColorTools::rgbCurvePlane(QSize(16, 16), ColorTools::ColorsRGB::Luma, 0.8))));
m_ui.buttonResetSpline->setIcon(KoIconUtils::themedIcon(QStringLiteral("view-refresh")));
m_ui.buttonShowAllHandles->setIcon(KoIconUtils::themedIcon(QStringLiteral("draw-bezier-curves")));
m_ui.buttonResetSpline->setIcon(QIcon::fromTheme(QStringLiteral("view-refresh")));
m_ui.buttonShowAllHandles->setIcon(QIcon::fromTheme(QStringLiteral("draw-bezier-curves")));
m_ui.widgetPoint->setEnabled(false);
m_edit->setGridLines(KdenliveSettings::bezier_gridlines());
m_ui.buttonShowPixmap->setChecked(KdenliveSettings::bezier_showpixmap());
......
......@@ -20,7 +20,7 @@
#include "core.h"
#include "kdenlivesettings.h"
#include "monitor/monitormanager.h"
#include "utils/KoIconUtils.h"
#include "widgets/doublewidget.h"
#include "widgets/positionwidget.h"
......@@ -48,13 +48,13 @@ KeyframeEdit::KeyframeEdit(std::shared_ptr<AssetParameterModel> model, QModelInd
buttonSeek->setChecked(KdenliveSettings::keyframeseek());
connect(buttonSeek, &QAbstractButton::toggled, this, &KeyframeEdit::slotSetSeeking);
buttonKeyframes->setIcon(KoIconUtils::themedIcon(QStringLiteral("chronometer")));
button_add->setIcon(KoIconUtils::themedIcon(QStringLiteral("list-add")));
buttonKeyframes->setIcon(QIcon::fromTheme(QStringLiteral("chronometer")));
button_add->setIcon(QIcon::fromTheme(QStringLiteral("list-add")));
button_add->setToolTip(i18n("Add keyframe"));
button_delete->setIcon(KoIconUtils::themedIcon(QStringLiteral("list-remove")));
button_delete->setIcon(QIcon::fromTheme(QStringLiteral("list-remove")));
button_delete->setToolTip(i18n("Delete keyframe"));
buttonResetKeyframe->setIcon(KoIconUtils::themedIcon(QStringLiteral("edit-undo")));
buttonSeek->setIcon(KoIconUtils::themedIcon(QStringLiteral("edit-link")));
buttonResetKeyframe->setIcon(QIcon::fromTheme(QStringLiteral("edit-undo")));
buttonSeek->setIcon(QIcon::fromTheme(QStringLiteral("edit-link")));
connect(keyframe_list, &QTableWidget::currentCellChanged, this, &KeyframeEdit::rowClicked);
connect(keyframe_list, &QTableWidget::cellChanged, this, &KeyframeEdit::slotGenerateParams);
......
......@@ -27,7 +27,7 @@
#include "monitor/monitor.h"
#include "timecode.h"
#include "timecodedisplay.h"
#include "utils/KoIconUtils.h"
#include "widgets/doublewidget.h"
#include "widgets/geometrywidget.h"
......@@ -54,30 +54,30 @@ KeyframeWidget::KeyframeWidget(std::shared_ptr<AssetParameterModel> model, QMode
m_buttonAddDelete = new QToolButton(this);
m_buttonAddDelete->setAutoRaise(true);
m_buttonAddDelete->setIcon(KoIconUtils::themedIcon(QStringLiteral("list-add")));
m_buttonAddDelete->setIcon(QIcon::fromTheme(QStringLiteral("list-add")));
m_buttonAddDelete->setToolTip(i18n("Add keyframe"));
m_buttonPrevious = new QToolButton(this);
m_buttonPrevious->setAutoRaise(true);
m_buttonPrevious->setIcon(KoIconUtils::themedIcon(QStringLiteral("media-skip-backward")));
m_buttonPrevious->setIcon(QIcon::fromTheme(QStringLiteral("media-skip-backward")));
m_buttonPrevious->setToolTip(i18n("Go to previous keyframe"));
m_buttonNext = new QToolButton(this);
m_buttonNext->setAutoRaise(true);
m_buttonNext->setIcon(KoIconUtils::themedIcon(QStringLiteral("media-skip-forward")));
m_buttonNext->setIcon(QIcon::fromTheme(QStringLiteral("media-skip-forward")));
m_buttonNext->setToolTip(i18n("Go to next keyframe"));
// Keyframe type widget
m_selectType = new KSelectAction(KoIconUtils::themedIcon(QStringLiteral("keyframes")), i18n("Keyframe interpolation"), this);
QAction *linear = new QAction(KoIconUtils::themedIcon(QStringLiteral("linear")), i18n("Linear"), this);
m_selectType = new KSelectAction(QIcon::fromTheme(QStringLiteral("keyframes")), i18n("Keyframe interpolation"), this);
QAction *linear = new QAction(QIcon::fromTheme(QStringLiteral("linear")), i18n("Linear"), this);
linear->setData((int)mlt_keyframe_linear);
linear->setCheckable(true);
m_selectType->addAction(linear);
QAction *discrete = new QAction(KoIconUtils::themedIcon(QStringLiteral("discrete")), i18n("Discrete"), this);
QAction *discrete = new QAction(QIcon::fromTheme(QStringLiteral("discrete")), i18n("Discrete"), this);
discrete->setData((int)mlt_keyframe_discrete);
discrete->setCheckable(true);
m_selectType->addAction(discrete);
QAction *curve = new QAction(KoIconUtils::themedIcon(QStringLiteral("smooth")), i18n("Smooth"), this);
QAction *curve = new QAction(QIcon::fromTheme(QStringLiteral("smooth")), i18n("Smooth"), this);
curve->setData((int)mlt_keyframe_smooth);
curve->setCheckable(true);
m_selectType->addAction(curve);
......@@ -210,10 +210,10 @@ void KeyframeWidget::updateTimecodeFormat()
void KeyframeWidget::slotAtKeyframe(bool atKeyframe, bool singleKeyframe)
{
if (atKeyframe) {
m_buttonAddDelete->setIcon(KoIconUtils::themedIcon(QStringLiteral("list-remove")));
m_buttonAddDelete->setIcon(QIcon::fromTheme(QStringLiteral("list-remove")));
m_buttonAddDelete->setToolTip(i18n("Delete keyframe"));
} else {
m_buttonAddDelete->setIcon(KoIconUtils::themedIcon(QStringLiteral("list-add")));
m_buttonAddDelete->setIcon(QIcon::fromTheme(QStringLiteral("list-add")));
m_buttonAddDelete->setToolTip(i18n("Add keyframe"));
}
pCore->getMonitor(m_model->monitorId)->setEffectKeyframe(atKeyframe || singleKeyframe);
......
......@@ -51,7 +51,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "titler/titlewidget.h"
#include "ui_qtextclip_ui.h"
#include "undohelper.hpp"
#include "utils/KoIconUtils.h"
#include "xml/xml.hpp"
#include <KColorScheme>
......@@ -616,9 +616,9 @@ Bin::Bin(const std::shared_ptr<ProjectItemModel> &model, QWidget *parent)
widgetslider->setDefaultWidget(m_slider);
// View type
KSelectAction *listType = new KSelectAction(KoIconUtils::themedIcon(QStringLiteral("view-list-tree")), i18n("View Mode"), this);
KSelectAction *listType = new KSelectAction(QIcon::fromTheme(QStringLiteral("view-list-tree")), i18n("View Mode"), this);
pCore->window()->actionCollection()->addAction(QStringLiteral("bin_view_mode"), listType);
QAction *treeViewAction = listType->addAction(KoIconUtils::themedIcon(QStringLiteral("view-list-tree")), i18n("Tree View"));
QAction *treeViewAction = listType->addAction(QIcon::fromTheme(QStringLiteral("view-list-tree")), i18n("Tree View"));
listType->addAction(treeViewAction);
treeViewAction->setData(BinTreeView);
if (m_listType == treeViewAction->data().toInt()) {
......@@ -626,7 +626,7 @@ Bin::Bin(const std::shared_ptr<ProjectItemModel> &model, QWidget *parent)
}
pCore->window()->actionCollection()->addAction(QStringLiteral("bin_view_mode_tree"), treeViewAction);
QAction *iconViewAction = listType->addAction(KoIconUtils::themedIcon(QStringLiteral("view-list-icons")), i18n("Icon View"));
QAction *iconViewAction = listType->addAction(QIcon::fromTheme(QStringLiteral("view-list-icons")), i18n("Icon View"));
iconViewAction->setData(BinIconView);
if (m_listType == iconViewAction->data().toInt()) {
listType->setCurrentAction(iconViewAction);
......@@ -635,7 +635,7 @@ Bin::Bin(const std::shared_ptr<ProjectItemModel> &model, QWidget *parent)
QAction *disableEffects = new QAction(i18n("Disable Bin Effects"), this);
connect(disableEffects, &QAction::triggered, [this](bool disable) { this->setBinEffectsEnabled(!disable); });
disableEffects->setIcon(KoIconUtils::themedIcon(QStringLiteral("favorite")));
disableEffects->setIcon(QIcon::fromTheme(QStringLiteral("favorite")));
disableEffects->setData("disable_bin_effects");
disableEffects->setCheckable(true);
disableEffects->setChecked(false);
......@@ -659,7 +659,7 @@ Bin::Bin(const std::shared_ptr<ProjectItemModel> &model, QWidget *parent)
QMenu *settingsMenu = new QMenu(i18n("Settings"), this);
settingsMenu->addAction(listType);
QMenu *sliderMenu = new QMenu(i18n("Zoom"), this);
sliderMenu->setIcon(KoIconUtils::themedIcon(QStringLiteral("zoom-in")));
sliderMenu->setIcon(QIcon::fromTheme(QStringLiteral("zoom-in")));
sliderMenu->addAction(widgetslider);
settingsMenu->addMenu(sliderMenu);
......@@ -674,7 +674,7 @@ Bin::Bin(const std::shared_ptr<ProjectItemModel> &model, QWidget *parent)
settingsMenu->addAction(m_showDesc);
settingsMenu->addAction(disableEffects);
auto *button = new QToolButton;
button->setIcon(KoIconUtils::themedIcon(QStringLiteral("kdenlive-menu")));
button->setIcon(QIcon::fromTheme(QStringLiteral("kdenlive-menu")));
button->setToolTip(i18n("Options"));
button->setMenu(settingsMenu);
button->setPopupMode(QToolButton::InstantPopup);
......@@ -868,7 +868,7 @@ void Bin::refreshIcons()
if (ic.isNull() || ic.name().isEmpty()) {
continue;
}
QIcon newIcon = KoIconUtils::themedIcon(ic.name());
QIcon newIcon = QIcon::fromTheme(ic.name());
m->setIcon(newIcon);
}
QList<QToolButton *> allButtons = this->findChildren<QToolButton *>();
......@@ -878,7 +878,7 @@ void Bin::refreshIcons()
if (ic.isNull() || ic.name().isEmpty()) {
continue;
}
QIcon newIcon = KoIconUtils::themedIcon(ic.name());
QIcon newIcon = QIcon::fromTheme(ic.name());
m->setIcon(newIcon);
}
}
......
......@@ -44,7 +44,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "projectsubclip.h"
#include "timecode.h"
#include "timeline2/model/snapmodel.hpp"
#include "utils/KoIconUtils.h"
#include "utils/thumbnailcache.hpp"
#include "xml/xml.hpp"
#include <QPainter>
......@@ -75,7 +75,7 @@ ProjectClip::ProjectClip(const QString &id, const QIcon &thumb, std::shared_ptr<
m_date = date;
m_description = ClipController::description();
if (m_clipType == ClipType::Audio) {
m_thumbnail = KoIconUtils::themedIcon(QStringLiteral("audio-x-generic"));
m_thumbnail = QIcon::fromTheme(QStringLiteral("audio-x-generic"));
} else {
m_thumbnail = thumb;
}
......@@ -111,7 +111,7 @@ ProjectClip::ProjectClip(const QString &id, const QDomElement &description, cons
if (description.hasAttribute(QStringLiteral("type"))) {
m_clipType = (ClipType::ProducerType)description.attribute(QStringLiteral("type")).toInt();
if (m_clipType == ClipType::Audio) {
m_thumbnail = KoIconUtils::themedIcon(QStringLiteral("audio-x-generic"));
m_thumbnail = QIcon::fromTheme(QStringLiteral("audio-x-generic"));
}
}
m_temporaryUrl = getXmlProperty(description, QStringLiteral("resource"));
......@@ -358,7 +358,7 @@ bool ProjectClip::setProducer(std::shared_ptr<Mlt::Producer> producer, bool repl
m_description = ClipController::description();
m_temporaryUrl.clear();
if (m_clipType == ClipType::Audio) {
m_thumbnail = KoIconUtils::themedIcon(QStringLiteral("audio-x-generic"));
m_thumbnail = QIcon::fromTheme(QStringLiteral("audio-x-generic"));
} else if (m_clipType == ClipType::Image) {
if (getProducerIntProperty(QStringLiteral("meta.media.width")) < 8 || getProducerIntProperty(QStringLiteral("meta.media.height")) < 8) {
KMessageBox::information(QApplication::activeWindow(),
......
......@@ -25,7 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "core.h"
#include "projectclip.h"
#include "projectitemmodel.h"
#include "utils/KoIconUtils.h"
#include <KLocalizedString>
#include <QDomElement>
......@@ -35,7 +35,7 @@ ProjectFolder::ProjectFolder(const QString &id, const QString &name, std::shared
{
m_name = name;
m_clipStatus = StatusReady;
m_thumbnail = KoIconUtils::themedIcon(QStringLiteral("folder"));
m_thumbnail = QIcon::fromTheme(QStringLiteral("folder"));
}
std::shared_ptr<ProjectFolder> ProjectFolder::construct(const QString &id, const QString &name, std::shared_ptr<ProjectItemModel> model)
......
......@@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "projectfolderup.h"
#include "projectclip.h"
#include "utils/KoIconUtils.h"
#include <KLocalizedString>
#include <QDomElement>
......@@ -29,7 +29,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
ProjectFolderUp::ProjectFolderUp(std::shared_ptr<ProjectItemModel> model)
: AbstractProjectItem(AbstractProjectItem::FolderUpItem, QString(), model)
{
m_thumbnail = KoIconUtils::themedIcon(QStringLiteral("go-previous"));
m_thumbnail = QIcon::fromTheme(QStringLiteral("go-previous"));
m_name = i18n("Back");
}
......
......@@ -20,7 +20,7 @@
#include "encodingprofilesdialog.h"
#include "kdenlivesettings.h"
#include "utils/KoIconUtils.h"
#include "klocalizedstring.h"
#include <QLineEdit>
......@@ -40,10 +40,10 @@ EncodingProfilesDialog::EncodingProfilesDialog(int profileType, QWidget *parent)
profile_type->addItem(i18n("Screen capture"), 3);
profile_type->addItem(i18n("Decklink capture"), 4);
button_add->setIcon(KoIconUtils::themedIcon(QStringLiteral("list-add")));
button_edit->setIcon(KoIconUtils::themedIcon(QStringLiteral("document-edit")));
button_delete->setIcon(KoIconUtils::themedIcon(QStringLiteral("list-remove")));
button_download->setIcon(KoIconUtils::themedIcon(QStringLiteral("download")));
button_add->setIcon(QIcon::fromTheme(QStringLiteral("list-add")));
button_edit->setIcon(QIcon::fromTheme(QStringLiteral("document-edit")));
button_delete->setIcon(QIcon::fromTheme(QStringLiteral("list-remove")));
button_download->setIcon(QIcon::fromTheme(QStringLiteral("download")));
m_configFile = new KConfig(QStringLiteral("encodingprofiles.rc"), KConfig::CascadeConfig, QStandardPaths::AppDataLocation);
profile_type->setCurrentIndex(profileType);
......
......@@ -28,7 +28,7 @@
#include "profilesdialog.h"
#include "project/dialogs/profilewidget.h"
#include "renderer.h"
#include "utils/KoIconUtils.h"
#ifdef USE_V4L
#include "capture/v4lcapture.h"
......@@ -69,7 +69,7 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(const QMap<QString, QString> &map
QFontInfo ftInfo(font());
m_configMisc.setupUi(p1);
m_page1 = addPage(p1, i18n("Misc"));
m_page1->setIcon(KoIconUtils::themedIcon(QStringLiteral("configure")));
m_page1->setIcon(QIcon::fromTheme(QStringLiteral("configure")));
// Hide avformat-novalidate trick, causes crash (bug #2205 and #2206)
m_configMisc.kcfg_projectloading_avformatnovalidate->setVisible(false);
......@@ -87,7 +87,7 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(const QMap<QString, QString> &map
// Select profile
m_pw->loadProfile(KdenliveSettings::default_profile().isEmpty() ? pCore->getCurrentProfile()->path() : KdenliveSettings::default_profile());
connect(m_pw, &ProfileWidget::profileChanged, this, &KdenliveSettingsDialog::slotDialogModified);
m_page8->setIcon(KoIconUtils::themedIcon(QStringLiteral("project-defaults")));
m_page8->setIcon(QIcon::fromTheme(QStringLiteral("project-defaults")));
connect(m_configProject.kcfg_generateproxy, &QAbstractButton::toggled, m_configProject.kcfg_proxyminsize, &QWidget::setEnabled);
m_configProject.kcfg_proxyminsize->setEnabled(KdenliveSettings::generateproxy());
m_configProject.projecturl->setMode(KFile::Directory);
......@@ -98,7 +98,7 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(const QMap<QString, QString> &map
QWidget *p3 = new QWidget;
m_configTimeline.setupUi(p3);
m_page3 = addPage(p3, i18n("Timeline"));
m_page3->setIcon(KoIconUtils::themedIcon(QStringLiteral("video-display")));
m_page3->setIcon(QIcon::fromTheme(QStringLiteral("video-display")));
m_configTimeline.kcfg_trackheight->setMinimum(ftInfo.pixelSize() * 1.5);
QWidget *p2 = new QWidget;
......@@ -130,7 +130,7 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(const QMap<QString, QString> &map
m_configEnv.supportedmimes->setPlainText(mimes.join(QLatin1Char(' ')));
m_page2 = addPage(p2, i18n("Environment"));
m_page2->setIcon(KoIconUtils::themedIcon(QStringLiteral("application-x-executable-script")));
m_page2->setIcon(QIcon::fromTheme(QStringLiteral("application-x-executable-script")));
QWidget *p4 = new QWidget;
m_configCapture.setupUi(p4);
......@@ -159,7 +159,7 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(const QMap<QString, QString> &map
#endif
m_page4 = addPage(p4, i18n("Capture"));
m_page4->setIcon(KoIconUtils::themedIcon(QStringLiteral("media-record")));
m_page4->setIcon(QIcon::fromTheme(QStringLiteral("media-record")));
m_configCapture.tabWidget->setCurrentIndex(KdenliveSettings::defaultcapture());
#ifdef Q_WS_MAC
m_configCapture.tabWidget->setEnabled(false);
......@@ -170,7 +170,7 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(const QMap<QString, QString> &map