We don't need the findImage anymore.
This commit is contained in:
parent
11098706ce
commit
ff08041bed
4 changed files with 2 additions and 32 deletions
|
@ -232,14 +232,6 @@ bool EffectModel::effectListContains(const QString &effectFilter, int source_row
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString EffectModel::findImage(const QString &imagePath, int size)
|
|
||||||
{
|
|
||||||
const QString relativePath("icons/oxygen/" + QString::number(size) + 'x' + QString::number(size) + '/' + imagePath);
|
|
||||||
const QString fullImagePath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, relativePath, QStandardPaths::LocateFile);
|
|
||||||
return fullImagePath;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void EffectModel::syncEffectsToKWin()
|
void EffectModel::syncEffectsToKWin()
|
||||||
{
|
{
|
||||||
QDBusInterface interface(QStringLiteral("org.kde.kwin"), QStringLiteral("/Effects"));
|
QDBusInterface interface(QStringLiteral("org.kde.kwin"), QStringLiteral("/Effects"));
|
||||||
|
@ -370,11 +362,6 @@ void EffectFilterModel::effectStatus(int rowIndex, bool effectState)
|
||||||
m_effectModel->effectStatus(sourceIndex, effectState);
|
m_effectModel->effectStatus(sourceIndex, effectState);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString EffectFilterModel::findImage(const QString &imagePath, int size)
|
|
||||||
{
|
|
||||||
return m_effectModel->findImage(imagePath, size);
|
|
||||||
}
|
|
||||||
|
|
||||||
void EffectFilterModel::syncConfig()
|
void EffectFilterModel::syncConfig()
|
||||||
{
|
{
|
||||||
m_effectModel->syncConfig();
|
m_effectModel->syncConfig();
|
||||||
|
|
|
@ -76,7 +76,6 @@ public:
|
||||||
virtual QHash< int, QByteArray > roleNames() const override;
|
virtual QHash< int, QByteArray > roleNames() const override;
|
||||||
|
|
||||||
void effectStatus(const QModelIndex &rowIndex, bool effectState);
|
void effectStatus(const QModelIndex &rowIndex, bool effectState);
|
||||||
QString findImage(const QString &imagePath, int size = 128);
|
|
||||||
void syncEffectsToKWin();
|
void syncEffectsToKWin();
|
||||||
void syncConfig();
|
void syncConfig();
|
||||||
void enableWidnowManagement(bool enabled);
|
void enableWidnowManagement(bool enabled);
|
||||||
|
@ -113,7 +112,6 @@ public:
|
||||||
const QString &filter() const;
|
const QString &filter() const;
|
||||||
|
|
||||||
Q_INVOKABLE void effectStatus(int rowIndex, bool effectState);
|
Q_INVOKABLE void effectStatus(int rowIndex, bool effectState);
|
||||||
Q_INVOKABLE QString findImage(const QString &imagePath, int size = 128);
|
|
||||||
Q_INVOKABLE void syncConfig();
|
Q_INVOKABLE void syncConfig();
|
||||||
Q_INVOKABLE void enableWidnowManagement(bool enabled);
|
Q_INVOKABLE void enableWidnowManagement(bool enabled);
|
||||||
|
|
||||||
|
|
|
@ -124,29 +124,20 @@ Component {
|
||||||
anchors.right: aboutButton.left
|
anchors.right: aboutButton.left
|
||||||
visible: effectConfig.effectUiConfigExists(model.ServiceNameRole)
|
visible: effectConfig.effectUiConfigExists(model.ServiceNameRole)
|
||||||
enabled: myCheckBox.checked
|
enabled: myCheckBox.checked
|
||||||
|
iconName: "configure"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
effectConfig.openConfig(model.NameRole);
|
effectConfig.openConfig(model.NameRole);
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
searchModel.image('actions/configure.png')
|
|
||||||
iconSource = searchModel.imagePath;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
id: aboutButton
|
id: aboutButton
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
iconName: "dialog-information"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
animationAbout.running = true;
|
animationAbout.running = true;
|
||||||
animationAboutSpacing.running = true;
|
animationAboutSpacing.running = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
searchModel.image('status/dialog-information.png')
|
|
||||||
iconSource = searchModel.imagePath;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EffectConfig {
|
EffectConfig {
|
||||||
|
|
|
@ -85,14 +85,8 @@ Item {
|
||||||
EffectFilterModel {
|
EffectFilterModel {
|
||||||
id: searchModel
|
id: searchModel
|
||||||
filter: searchField.text
|
filter: searchField.text
|
||||||
property string imagePath
|
|
||||||
signal image(string path)
|
|
||||||
signal effectState(int rowIndex, bool enabled)
|
signal effectState(int rowIndex, bool enabled)
|
||||||
|
|
||||||
onImage: {
|
|
||||||
imagePath = searchModel.findImage(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
onEffectState: {
|
onEffectState: {
|
||||||
searchModel.effectStatus(rowIndex, enabled);
|
searchModel.effectStatus(rowIndex, enabled);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue