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);
......
This diff is collapsed.
......@@ -22,7 +22,7 @@
#include "kdenlivesettings.h"
#include "profiles/profilemodel.hpp"
#include "profiles/profilerepository.hpp"
#include "utils/KoIconUtils.h"
#include "klocalizedstring.h"
#include <KMessageBox>
......@@ -61,11 +61,11 @@ ProfilesDialog::ProfilesDialog(const QString &profileDescription, QWidget *paren
QStringList profilesFilter;
profilesFilter << QStringLiteral("*");
m_view.button_delete->setIcon(KoIconUtils::themedIcon(QStringLiteral("trash-empty")));
m_view.button_delete->setIcon(QIcon::fromTheme(QStringLiteral("trash-empty")));
m_view.button_delete->setToolTip(i18n("Delete profile"));
m_view.button_save->setIcon(KoIconUtils::themedIcon(QStringLiteral("document-save")));
m_view.button_save->setIcon(QIcon::fromTheme(QStringLiteral("document-save")));
m_view.button_save->setToolTip(i18n("Save profile"));
m_view.button_create->setIcon(KoIconUtils::themedIcon(QStringLiteral("document-new")));
m_view.button_create->setIcon(QIcon::fromTheme(QStringLiteral("document-new")));
m_view.button_create->setToolTip(i18n("Create new profile"));
fillList(profileDescription);
......@@ -115,7 +115,7 @@ ProfilesDialog::ProfilesDialog(const QString &profilePath, bool, QWidget *parent
QStringList profilesFilter;
profilesFilter << QStringLiteral("*");
m_view.button_save->setIcon(KoIconUtils::themedIcon(QStringLiteral("document-save")));
m_view.button_save->setIcon(QIcon::fromTheme(QStringLiteral("document-save")));
m_view.button_save->setToolTip(i18n("Save profile"));
m_view.button_create->setHidden(true);
m_view.profiles_list->setHidden(true);
......
......@@ -25,7 +25,7 @@
#include "profiles/profilerepository.hpp"
#include "timecode.h"
#include "ui_saveprofile_ui.h"
#include "utils/KoIconUtils.h"
#include "klocalizedstring.h"
#include <KColorScheme>
......@@ -136,22 +136,22 @@ void RenderJobItem::setStatus(int status)
m_status = status;
switch (status) {
case WAITINGJOB:
setIcon(0, KoIconUtils::themedIcon(QStringLiteral("media-playback-pause")));
setIcon(0, QIcon::fromTheme(QStringLiteral("media-playback-pause")));
setData(1, Qt::UserRole, i18n("Waiting..."));
break;
case FINISHEDJOB:
setData(1, Qt::UserRole, i18n("Rendering finished"));
setIcon(0, KoIconUtils::themedIcon(QStringLiteral("dialog-ok")));
setIcon(0, QIcon::fromTheme(QStringLiteral("dialog-ok")));
setData(1, ProgressRole, 100);
break;
case FAILEDJOB:
setData(1, Qt::UserRole, i18n("Rendering crashed"));
setIcon(0, KoIconUtils::themedIcon(QStringLiteral("dialog-close")));
setIcon(0, QIcon::fromTheme(QStringLiteral("dialog-close")));
setData(1, ProgressRole, 100);
break;
case ABORTEDJOB:
setData(1, Qt::UserRole, i18n("Rendering aborted"));
setIcon(0, KoIconUtils::themedIcon(QStringLiteral("dialog-cancel")));
setIcon(0, QIcon::fromTheme(QStringLiteral("dialog-cancel")));
setData(1, ProgressRole, 100);
default:
break;
......@@ -188,20 +188,20 @@ RenderWidget::RenderWidget(const QString &projectfolder, bool enableProxy, QWidg
m_view.buttonSave->setIconSize(iconSize);
m_view.buttonFavorite->setIconSize(iconSize);
m_view.buttonDelete->setIcon(KoIconUtils::themedIcon(QStringLiteral("trash-empty")));
m_view.buttonDelete->setIcon(QIcon::fromTheme(QStringLiteral("trash-empty")));
m_view.buttonDelete->setToolTip(i18n("Delete profile"));
m_view.buttonDelete->setEnabled(false);
m_view.buttonEdit->setIcon(KoIconUtils::themedIcon(QStringLiteral("document-edit")));
m_view.buttonEdit->setIcon(QIcon::fromTheme(QStringLiteral("document-edit")));
m_view.buttonEdit->setToolTip(i18n("Edit profile"));
m_view.buttonEdit->setEnabled(false);
m_view.buttonSave->setIcon(KoIconUtils::themedIcon(QStringLiteral("document-new")));
m_view.buttonSave->setIcon(QIcon::fromTheme(QStringLiteral("document-new")));
m_view.buttonSave->setToolTip(i18n("Create new profile"));
m_view.hide_log->setIcon(KoIconUtils::themedIcon(QStringLiteral("go-down")));
m_view.hide_log->setIcon(QIcon::fromTheme(QStringLiteral("go-down")));
m_view.buttonFavorite->setIcon(KoIconUtils::themedIcon(QStringLiteral("favorite")));
m_view.buttonFavorite->setIcon(QIcon::fromTheme(QStringLiteral("favorite")));
m_view.buttonFavorite->setToolTip(i18n("Copy profile to favorites"));
m_view.out_file->button()->setToolTip(i18n("Select output destination"));
......@@ -238,7 +238,7 @@ RenderWidget::RenderWidget(const QString &projectfolder, bool enableProxy, QWidg
m_view.errorBox->setStyleSheet(
QStringLiteral("QGroupBox { background-color: rgb(%1, %2, %3); border-radius: 5px;}; ").arg(bg.red()).arg(bg.green()).arg(bg.blue()));
int height = QFontInfo(font()).pixelSize();
m_view.errorIcon->setPixmap(KoIconUtils::themedIcon(QStringLiteral("dialog-warning")).pixmap(height, height));
m_view.errorIcon->setPixmap(QIcon::fromTheme(QStringLiteral("dialog-warning")).pixmap(height, height));
m_view.errorBox->setHidden(true);
m_infoMessage = new KMessageWidget;
......@@ -260,7 +260,7 @@ RenderWidget::RenderWidget(const QString &projectfolder, bool enableProxy, QWidg
m_view.rescale_keep->setChecked(KdenliveSettings::rescalekeepratio());
connect(m_view.rescale_width, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &RenderWidget::slotUpdateRescaleWidth);
connect(m_view.rescale_height, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &RenderWidget::slotUpdateRescaleHeight);
m_view.rescale_keep->setIcon(KoIconUtils::themedIcon(QStringLiteral("edit-link")));
m_view.rescale_keep->setIcon(QIcon::fromTheme(QStringLiteral("edit-link")));
m_view.rescale_keep->setToolTip(i18n("Preserve aspect ratio"));
connect(m_view.rescale_keep, &QAbstractButton::clicked, this, &RenderWidget::slotSwitchAspectRatio);
......@@ -364,7 +364,7 @@ RenderWidget::RenderWidget(const QString &projectfolder, bool enableProxy, QWidg
#ifdef KF5_USE_PURPOSE
m_shareMenu = new Purpose::Menu();
m_view.shareButton->setMenu(m_shareMenu);
m_view.shareButton->setIcon( KoIconUtils::themedIcon(QStringLiteral("document-share")));
m_view.shareButton->setIcon( QIcon::fromTheme(QStringLiteral("document-share")));
connect(m_shareMenu, &Purpose::Menu::finished, this, &RenderWidget::slotShareActionFinished);
#else
m_view.shareButton->setEnabled(false);
......@@ -1443,7 +1443,7 @@ void RenderWidget::slotExport(bool scriptExport, int zoneIn, int zoneOut, const
} else {
renderItem->setData(1, ProgressRole, 0);
renderItem->setStatus(WAITINGJOB);
renderItem->setIcon(0, KoIconUtils::themedIcon(QStringLiteral("media-playback-pause")));
renderItem->setIcon(0, QIcon::fromTheme(QStringLiteral("media-playback-pause")));
renderItem->setData(1, Qt::UserRole, i18n("Waiting..."));
renderItem->setData(1, ParametersRole, dest);
}
......@@ -1569,8 +1569,8 @@ void RenderWidget::adjustViewToProfile()
void RenderWidget::refreshView()
{
m_view.formats->blockSignals(true);
QIcon brokenIcon = KoIconUtils::themedIcon(QStringLiteral("dialog-close"));
QIcon warningIcon = KoIconUtils::themedIcon(QStringLiteral("dialog-warning"));
QIcon brokenIcon = QIcon::fromTheme(QStringLiteral("dialog-close"));
QIcon warningIcon = QIcon::fromTheme(QStringLiteral("dialog-warning"));
KColorScheme scheme(palette().currentColorGroup(), KColorScheme::Window);
const QColor disabled = scheme.foreground(KColorScheme::InactiveText).color();
......@@ -2113,7 +2113,7 @@ void RenderWidget::parseFile(const QString &exportFile, bool editable)
if (editable) {
childitem->setData(0, EditableRole, exportFile);