Commit e3274dba authored by Mikhail Zolotukhin's avatar Mikhail Zolotukhin Committed by Nate Graham
Browse files

Remove unneeded options in GTK KCM

Summary:
Since font, icons, cursor theme, toolbar style, icons in menus and buttons settings are now in sync with corresponding plasma settings, they shouldn't be in GTK KCM anymore.

Depends on D24743

BUG: 406740

BUG: 401008

BUG: 401123

FIXED-IN: 5.18.0

Test Plan:
Check if nothing breaks in GTK KCM functionality, that is left.

{F7617327}

{F7693105}

Reviewers: #vdg, #plasma, ngraham, nicolasfella

Reviewed By: #vdg, ngraham, nicolasfella

Subscribers: apol, ngraham, broulik, filipf, GB_2, plasma-devel

Tags: #plasma, #vdg

Maniphest Tasks: T10611

Differential Revision: https://phabricator.kde.org/D24744
parent 8808df33
......@@ -34,8 +34,6 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY
add_definitions(-DTRANSLATION_DOMAIN=\"kde-gtk-config\")
set(kcm_SRCS
src/iconthemesmodel.cpp
src/cursorthemesmodel.cpp
src/appearancegtk3.cpp
src/appearancegtk2.cpp
src/appearencegtk.cpp
......@@ -45,7 +43,6 @@ set(kcm_SRCS
src/gtkconfigkcmodule.cpp
src/dialog_installer.cpp
src/dialog_uninstaller.cpp
src/fontshelpers.cpp
)
ki18n_wrap_ui(kcm_SRCS
......
......@@ -31,25 +31,11 @@ static bool isTrue(const QString& value)
//SETTERS
void AbstractAppearance::setTheme(const QString& name) { m_settings["theme"] = name;}
void AbstractAppearance::setCursor(const QString& cur) { m_settings["cursor"] = cur;}
void AbstractAppearance::setIcon(const QString& ic) { m_settings["icon"] = ic;}
void AbstractAppearance::setIconFallback(const QString& fall) { m_settings["icon_fallback"] = fall; }
void AbstractAppearance::setFont(const QString& fo) { m_settings["font"] = fo;}
void AbstractAppearance::setShowIconsInButtons(bool show) { m_settings["show_icons_buttons"] = show ? "1" : "0"; }
void AbstractAppearance::setShowIconsInMenus(bool show) { m_settings["show_icons_menus"] = show ? "1" : "0"; }
void AbstractAppearance::setPrimaryButtonWarpsSlider(bool enabled) { m_settings["primary_button_warps_slider"] = enabled ? "1" : "0"; }
void AbstractAppearance::setToolbarStyle(const QString& toolbar_style) { m_settings["toolbar_style"] = toolbar_style; }
// GETTERS
QString AbstractAppearance::getTheme() const { return m_settings["theme"];}
QString AbstractAppearance::getCursor() const { return m_settings["cursor"];}
QString AbstractAppearance::getIcon() const { return m_settings["icon"];}
QString AbstractAppearance::getIconFallback() const { return m_settings["icon_fallback"]; }
QString AbstractAppearance::getFont() const { return m_settings["font"]; }
QString AbstractAppearance::getThemeGtk3() const { return m_settings["themegtk3"]; }
QString AbstractAppearance::getToolbarStyle() const { return m_settings["toolbar_style"]; }
bool AbstractAppearance::getShowIconsInButtons() const { return isTrue(m_settings["show_icons_buttons"]); }
bool AbstractAppearance::getShowIconsInMenus() const { return isTrue(m_settings["show_icons_menus"]); }
bool AbstractAppearance::getPrimaryButtonWarpsSlider() const { return isTrue(m_settings["primary_button_warps_slider"]); }
QRegExp valueRx(" *([a-zA-Z\\-_]+) *= *\"?([^\"\\n]+)\"?", Qt::CaseSensitive, QRegExp::RegExp2);
......
......@@ -39,24 +39,10 @@ class AbstractAppearance
virtual QStringList installedThemes() const = 0;
void setTheme(const QString& name);
void setCursor(const QString& name);
void setIcon(const QString& name);
void setIconFallback(const QString& name);
void setFont(const QString& font);
void setShowIconsInMenus(bool show);
void setShowIconsInButtons(bool show);
void setPrimaryButtonWarpsSlider(bool enabled);
void setToolbarStyle(const QString& style);
QString getTheme() const;
QString getCursor() const;
QString getIcon() const;
QString getIconFallback() const;
QString getFont() const;
QString getThemeGtk3() const;
QString getToolbarStyle() const;
bool getShowIconsInButtons() const;
bool getShowIconsInMenus() const;
bool getPrimaryButtonWarpsSlider() const;
QStringList installedThemesNames() const;
......
......@@ -43,24 +43,8 @@ bool AppearanceGTK2::loadSettingsPrivate(const QString& path)
for(auto it = foundSettings.constBegin(), itEnd = foundSettings.constEnd(); it!=itEnd; ++it) {
if (it.key() == "gtk-theme-name")
m_settings["theme"] = *it;
else if (it.key() == "gtk-icon-theme-name")
m_settings["icon"] = *it;
else if (it.key() == "gtk-fallback-icon-theme")
m_settings["icon_fallback"] = *it;
else if (it.key() == "gtk-cursor-theme-name")
m_settings["cursor"] = *it;
else if (it.key() == "gtk-font-name")
m_settings["font"] = *it;
else if (it.key() == "gtk-toolbar-style")
m_settings["toolbar_style"] = *it;
else if (it.key() == "gtk-button-images")
m_settings["show_icons_buttons"] = *it;
else if(it.key() == "gtk-menu-images")
m_settings["show_icons_menus"] = *it;
else if (it.key() == "gtk-primary-button-warps-slider")
m_settings["primary_button_warps_slider"] = *it;
else
qWarning() << "unknown field" << it.key();
}
return true;
}
......@@ -109,14 +93,7 @@ bool AppearanceGTK2::saveSettingsPrivate(const QString& gtkrcFile) const
void AppearanceGTK2::modifyGtkrcContents(QString& fileContents) const
{
modifyGtkrcProperty("gtk-font-name", m_settings["font"], fileContents);
modifyGtkrcProperty("gtk-theme-name", m_settings["theme"], fileContents);
modifyGtkrcProperty("gtk-icon-theme-name", m_settings["icon"], fileContents);
modifyGtkrcProperty("gtk-fallback-icon-theme", m_settings["icon_fallback"], fileContents);
modifyGtkrcProperty("gtk-cursor-theme-name", m_settings["cursor"], fileContents);
modifyGtkrcProperty("gtk-toolbar-style", m_settings["toolbar_style"], fileContents);
modifyGtkrcProperty("gtk-menu-images", m_settings["show_icons_menus"], fileContents);
modifyGtkrcProperty("gtk-button-images", m_settings["show_icons_buttons"], fileContents);
modifyGtkrcProperty("gtk-primary-button-warps-slider", m_settings["primary_button_warps_slider"], fileContents);
removeGtkrcLegacyContents(fileContents);
}
......
......@@ -63,14 +63,7 @@ bool AppearanceGTK3::saveSettings(const KSharedConfig::Ptr& file) const
{
KConfigGroup group(file, "Settings");
group.writeEntry("gtk-font-name", m_settings["font"]);
group.writeEntry("gtk-theme-name", m_settings["theme"]);
group.writeEntry("gtk-icon-theme-name", m_settings["icon"]);
group.writeEntry("gtk-fallback-icon-theme", m_settings["icon_fallback"]);
group.writeEntry("gtk-cursor-theme-name", m_settings["cursor"]);
group.writeEntry("gtk-toolbar-style", m_settings["toolbar_style"]);
group.writeEntry("gtk-menu-images", m_settings["show_icons_menus"]);
group.writeEntry("gtk-button-images", m_settings["show_icons_buttons"]);
group.writeEntry("gtk-primary-button-warps-slider", m_settings["primary_button_warps_slider"]);
group.writeEntry("gtk-application-prefer-dark-theme", m_settings["application_prefer_dark_theme"]);
......@@ -89,21 +82,11 @@ bool AppearanceGTK3::loadSettings(const KSharedConfig::Ptr& file)
}
m_settings = QMap<QString, QString> {
{"toolbar_style", "GTK_TOOLBAR_ICONS"},
{"show_icons_buttons", "0"},
{"show_icons_menus", "0"},
{"primary_button_warps_slider", "false"},
{"application_prefer_dark_theme", "false"}
};
m_settings["theme"] = group.readEntry("gtk-theme-name");
m_settings["icon"] = group.readEntry("gtk-icon-theme-name");
m_settings["icon_fallback"] = group.readEntry("gtk-fallback-icon-theme");
m_settings["cursor"] = group.readEntry("gtk-cursor-theme-name");
m_settings["font"] = group.readEntry("gtk-font-name");
m_settings["toolbar_style"] = group.readEntry("gtk-toolbar-style");
m_settings["show_icons_buttons"] = group.readEntry("gtk-button-images");
m_settings["show_icons_menus"] = group.readEntry("gtk-menu-images");
m_settings["primary_button_warps_slider"] = group.readEntry("gtk-primary-button-warps-slider");
m_settings["application_prefer_dark_theme"] = group.readEntry("gtk-application-prefer-dark-theme");
for(auto it = m_settings.begin(); it != m_settings.end(); ) {
......@@ -167,22 +150,6 @@ bool AppearanceGTK3::saveSettings() const
g_autoptr(GSettings) gsettings = g_settings_new("org.gnome.desktop.interface");
g_settings_set_string(gsettings, "gtk-theme", m_settings["theme"].toUtf8().constData());
g_settings_set_string(gsettings, "icon-theme", m_settings["icon"].toUtf8().constData());
g_settings_set_string(gsettings, "cursor-theme", m_settings["cursor"].toUtf8().constData());
g_settings_set_string(gsettings, "font-name", m_settings["font"].toUtf8().constData());
QString toolbarStyle;
if (m_settings["toolbar_style"] == QStringLiteral("GTK_TOOLBAR_ICONS")) {
toolbarStyle = QStringLiteral("icons");
} else if (m_settings["toolbar_style"] == QStringLiteral("GTK_TOOLBAR_TEXT")) {
toolbarStyle = QStringLiteral("text");
} else if (m_settings["toolbar_style"] == QStringLiteral("GTK_TOOLBAR_BOTH")) {
toolbarStyle = QStringLiteral("both");
} else if (m_settings["toolbar_style"] == QStringLiteral("GTK_TOOLBAR_BOTH_HORIZ")) {
toolbarStyle = QStringLiteral("both-horiz");
}
g_settings_set_string(gsettings, "toolbar-style", toolbarStyle.toUtf8().constData());
g_object_set(gtk_settings_get_default(), "gtk-application-prefer-dark-theme", getApplicationPreferDarkTheme(), nullptr);
......
......@@ -41,13 +41,6 @@ AppearenceGTK::~AppearenceGTK()
void AppearenceGTK::set##name(const type& a) { foreach(AbstractAppearance* app, m_app) app->set##name(a); }\
type AppearenceGTK::get##name() const { foreach(AbstractAppearance* app, m_app) { if(app->hasProperty(propname)) return app->get##name(); } /*Q_ASSERT(false);*/ return type (); }
PROPERTY_IMPLEMENTATION(QString, Cursor, "cursor")
PROPERTY_IMPLEMENTATION(QString, Icon, "icon")
PROPERTY_IMPLEMENTATION(QString, IconFallback, "icon_fallback")
PROPERTY_IMPLEMENTATION(QString, Font, "font")
PROPERTY_IMPLEMENTATION(QString, ToolbarStyle, "toolbar_style")
PROPERTY_IMPLEMENTATION(bool, ShowIconsInButtons, "show_icons_buttons")
PROPERTY_IMPLEMENTATION(bool, ShowIconsInMenus, "show_icons_menus")
PROPERTY_IMPLEMENTATION(bool, PrimaryButtonWarpsSlider, "primary_button_warps_slider")
QString AppearenceGTK::getTheme() const { return gtk2Appearance()->getTheme(); }
......
/* KDE GTK Configuration Module
*
* Copyright 2016 Jason A. Donenfeld <Jason@zx2c4.com>
* Copyright 2016 Andrey Bondrov <andrey.bondrov@rosalab.ru>
* Copyright 2011 Aleix Pol Gonzalez <aleixpol@blue-systems.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) version 3, or any
* later version accepted by the membership of KDE e.V. (or its
* successor approved by the membership of KDE e.V.), which shall
* act as a proxy defined in Section 6 of version 3 of the license.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include "cursorthemesmodel.h"
#include <QDir>
#include <QDirIterator>
#include <QSet>
#include <QStandardPaths>
#include <KIconTheme>
#include <KShell>
#include <X11/Xcursor/Xcursor.h>
CursorThemesModel::CursorThemesModel(QObject* parent)
: IconThemesModel(parent)
{
reload();
}
QList<QDir> CursorThemesModel::installedThemesPaths()
{
QList<QDir> availableIcons;
QStringList dirs(QString(XcursorLibraryPath()).split(':', QString::SkipEmptyParts));
std::transform(dirs.begin(), dirs.end(), dirs.begin(), KShell::tildeExpand);
dirs.removeDuplicates();
foreach(const QString& dir, dirs) {
QDir userIconsDir(dir);
QDirIterator it(userIconsDir.path(), QDir::NoDotAndDotDot|QDir::AllDirs|QDir::NoSymLinks);
while(it.hasNext()) {
QString currentPath = it.next();
QDir dir(currentPath);
if(dir.exists() && dir.exists("cursors"))
availableIcons << dir;
}
}
return availableIcons;
}
void CursorThemesModel::fillItem(const QDir& dir, QStandardItem* item)
{
KIconTheme theme(dir.dirName());
if(!theme.name().isEmpty())
item->setText(theme.name());
else
item->setText(dir.dirName());
item->setToolTip(theme.description());
item->setData(theme.inherits(), CursorThemesModel::InheritsRole);
}
void CursorThemesModel::reload()
{
clear();
QList<QDir> paths = installedThemesPaths();
Q_FOREACH(const QDir& dir, paths) {
QStandardItem* themeit = new QStandardItem(dir.dirName());
themeit->setData(dir.path(), PathRole);
themeit->setData(dir.dirName(), DirNameRole);
fillItem(dir, themeit);
appendRow(themeit);
}
}
/* KDE GTK Configuration Module
*
* Copyright 2016 Andrey Bondrov <andrey.bondrov@rosalab.ru>
* Copyright 2011 Aleix Pol Gonzalez <aleixpol@blue-systems.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) version 3, or any
* later version accepted by the membership of KDE e.V. (or its
* successor approved by the membership of KDE e.V.), which shall
* act as a proxy defined in Section 6 of version 3 of the license.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CURSORTHEMESMODEL_H
#define CURSORTHEMESMODEL_H
#include "iconthemesmodel.h"
class QDir;
class CursorThemesModel : public IconThemesModel
{
public:
explicit CursorThemesModel(QObject* parent = 0);
void reload() override;
private:
static void fillItem(const QDir& dir, QStandardItem* item);
QList<QDir> installedThemesPaths();
};
#endif // CURSORTHEMESMODEL_H
......@@ -46,44 +46,30 @@ DialogInstaller::DialogInstaller(QWidget *parent)
//TODO: make sure it's a good idea to have the threads always instanciated
threadForTheme = new Thread("theme");
threadForIcon = new Thread("icon");
threadAnalisysTheme = new ThreadAnalisysTheme;
threadAnalisysThemeIcon = new ThreadAnalisysThemeIcon;
//installation ui
connect(ui->theme_file, &KUrlRequester::textChanged, this, &DialogInstaller::themeAnalisys);
connect(ui->icon_file, &KUrlRequester::textChanged, this, &DialogInstaller::themeIconAnalisys);
connect(ui->but_icon_install, &QAbstractButton::clicked, this, &DialogInstaller::installThemeIcon);
connect(ui->but_theme_install, &QAbstractButton::clicked, this, &DialogInstaller::installTheme);
connect(threadAnalisysTheme, &KJob::finished, this, &DialogInstaller::checkThemeAnalisys);
connect(threadAnalisysThemeIcon, &KJob::finished, this, &DialogInstaller::checkThemeIconAnalisys);
connect(threadForTheme, &Thread::started, this, &DialogInstaller::disableGUIThemeInstaller);
connect(threadForIcon, &Thread::started, this, &DialogInstaller::disableGUIThemeIconInstaller);
connect(threadForTheme, &KJob::finished, this, &DialogInstaller::enableGUIThemeInstaller);
connect(threadForIcon, &KJob::finished, this, &DialogInstaller::enableGUIThemeIconInstaller);
//ui refresh
connect(threadForTheme, &KJob::finished, this, &DialogInstaller::refreshGUITheme);
connect(threadForIcon, &KJob::finished, this, &DialogInstaller::refreshGUIIconTheme);
}
DialogInstaller::~DialogInstaller()
{
disconnect(threadAnalisysTheme, nullptr, this, nullptr);
disconnect(threadAnalisysThemeIcon, nullptr, this, nullptr);
disconnect(threadForTheme, nullptr, this, nullptr);
disconnect(threadForIcon, nullptr, this, nullptr);
disconnect(threadForTheme, nullptr, this, nullptr);
disconnect(threadForIcon, nullptr, this, nullptr);
delete threadAnalisysTheme;
delete threadAnalisysThemeIcon;
delete threadForIcon;
delete threadForTheme;
delete ui;
}
......@@ -102,26 +88,11 @@ void DialogInstaller::installTheme()
threadForTheme->start();
}
void DialogInstaller::installThemeIcon()
{
QString file = ui->icon_file->text();
// qDebug()<< "File to install" << file;
if(!fileIsTar(file)) {
KMessageBox::error(this, i18n("Could not install the %1 theme.", file), i18n("Cannot install theme"));
return;
}
threadForIcon->setUrlPackage(file);
threadForIcon->start();
}
void DialogInstaller::themeAnalisys()
{
ui->lb_theme_notice->setText(i18n("Parsing theme..."));
ui->theme_file->setEnabled(false);
ui->but_icon_install->setEnabled(false);
QString archivo = ui->theme_file->text();
threadAnalisysTheme->setPackageTheme(archivo);
......@@ -142,69 +113,19 @@ void DialogInstaller::checkThemeAnalisys()
}
void DialogInstaller::themeIconAnalisys()
{
ui->lb_icon_notice->setText(i18n("Parsing theme..."));
ui->icon_file->setEnabled(false);
ui->but_icon_install->setEnabled(false);
QString archivo = ui->icon_file->text();
threadAnalisysThemeIcon->setPackageTheme(archivo);
threadAnalisysThemeIcon->start();
}
void DialogInstaller::checkThemeIconAnalisys()
{
ui->icon_file->setEnabled(true);
if(threadAnalisysThemeIcon->isSuccess()) {
ui->lb_icon_notice->setText(i18n("This icons theme can be installed"));
ui->but_icon_install->setEnabled(true);
} else {
ui->lb_icon_notice->setText(i18n("This icons theme cannot be installed"));
ui->but_icon_install->setEnabled(false);
}
}
void DialogInstaller::enableGUIThemeInstaller()
{
ui->but_theme_install->setEnabled(true);
ui->theme_file->setEnabled(true);
}
void DialogInstaller::enableGUIThemeIconInstaller()
{
ui->but_icon_install->setEnabled(true);
ui->icon_file->setEnabled(true);
ui->buttonBox->button(QDialogButtonBox::Close)->setEnabled(true);
}
void DialogInstaller::disableGUIThemeInstaller()
{
ui->lb_theme_notice->setText(i18n("Installing GTK theme..."));
ui->but_theme_install->setEnabled(false);
ui->theme_file->setEnabled(false);
}
void DialogInstaller::disableGUIThemeIconInstaller()
{
ui->lb_icon_notice->setText(i18n("Installing icons..."));
ui->but_icon_install->setEnabled(false);
ui->icon_file->setEnabled(false);
ui->buttonBox->button(QDialogButtonBox::Close)->setEnabled(false);
}
void DialogInstaller::refreshGUIIconTheme()
{
if(threadForIcon->isSuccess()) {
ui->lb_icon_notice->setText(i18n("Icons Successfully Installed"));
ui->icon_file->clear();
emit themeInstalled();
} else {
ui->lb_icon_notice->setText(i18n("The icons theme cannot be installed"));
ui->icon_file->clear();
}
}
// Esto se ejecuta cuando un tema es tratado a instalar
void DialogInstaller::refreshGUITheme()
......
......@@ -47,11 +47,6 @@ signals:
void themeInstalled();
private slots:
/**
Instala el tema de icono a traves del objeto Installer
Para ello lanza un hilo para que no se bloqué la GUI
*/
void installThemeIcon();
/**
Instala el tema de icono a traves del objeto Installer
Para ello lanza un hilo para que no se bloqué la GUI
......@@ -65,22 +60,13 @@ private slots:
///executed after analyzing theme
void checkThemeAnalisys();
void enableGUIThemeIconInstaller();
void disableGUIThemeIconInstaller();
void refreshGUIIconTheme();
void themeIconAnalisys();
void checkThemeIconAnalisys();
private:
Ui::dialog_installer *ui;
//PROPIEDADES PARA EL AREA DE INSTALADOR
Thread *threadForTheme; //Hilo que instala el tema gtk
Thread *threadForIcon; //Hilo que instala el tema de iconos
ThreadAnalisysTheme *threadAnalisysTheme; //hilo para analizar los temas a instalar
ThreadAnalisysThemeIcon *threadAnalisysThemeIcon; //hilo para analizar los temas a instalar
};
......
......@@ -22,7 +22,6 @@
#include "dialog_uninstaller.h"
#include "abstractappearance.h"
#include "iconthemesmodel.h"
#include "ui_dialog_uninstaller.h"
#include "thread.h"
#include "appearencegtk.h"
......@@ -40,7 +39,6 @@ DialogUninstaller::DialogUninstaller(QWidget* parent, AppearenceGTK *app)
refreshListsForUninstall();
connect(ui->but_uninstall_theme, &QAbstractButton::clicked, this, &DialogUninstaller::uninstallTheme);
connect(ui->but_uninstall_icon, &QAbstractButton::clicked, this, &DialogUninstaller::uninstallIcon);
}
DialogUninstaller::~DialogUninstaller()
......@@ -50,7 +48,6 @@ DialogUninstaller::~DialogUninstaller()
void DialogUninstaller::refreshListsForUninstall()
{
ui->lb_notice_uninstall_icon->clear();
ui->lb_notice_uninstall_theme->clear();
QStringList themes = appareance->gtk2Appearance()->installedThemes();
......@@ -62,8 +59,6 @@ void DialogUninstaller::refreshListsForUninstall()
ui->cb_uninstall_theme->clear();
ui->cb_uninstall_theme->addItems(themes);
ui->cb_uninstall_icon->setModel(new IconThemesModel(true));
}
void DialogUninstaller::uninstallTheme()
......@@ -89,26 +84,6 @@ void DialogUninstaller::uninstallTheme()
threadEraseTheme->start();
}
void DialogUninstaller::uninstallIcon()
{
int themeIndex = ui->cb_uninstall_icon->currentIndex();
if(themeIndex<0)
return;
QAbstractItemModel* model = ui->cb_uninstall_icon->model();
QString theme = model->data(model->index(themeIndex, 0), IconThemesModel::PathRole).toString();
ui->cb_uninstall_icon->setEnabled(false);
ui->but_uninstall_icon->setEnabled(false);
ui->lb_notice_uninstall_icon->setText(i18n("Uninstalling icons..."));
ThreadErase* threadEraseIcon = new ThreadErase;
threadEraseIcon->setThemeForErase(theme);
connect(threadEraseIcon, &KJob::finished, this, &DialogUninstaller::threadUninstalledThemeIconFinished);
threadEraseIcon->start();
}
void DialogUninstaller::threadUninstalledThemeFinished(KJob* job)
{
if(job->error()==0) {
......@@ -123,18 +98,3 @@ void DialogUninstaller::threadUninstalledThemeFinished(KJob* job)
refreshListsForUninstall();
}
void DialogUninstaller::threadUninstalledThemeIconFinished(KJob* job)
{
if(job->error()==0) {
ui->lb_notice_uninstall_icon->setText(i18n("Icons successfully uninstalled."));
emit(themeUninstalled());
} else {
ui->lb_notice_uninstall_icon->setText(i18n("Could not uninstall the icon theme."));
}
ui->cb_uninstall_icon->setEnabled(true);
ui->but_uninstall_icon->setEnabled(true);
refreshListsForUninstall();
}
......@@ -47,9 +47,7 @@ signals:
public slots:
void refreshListsForUninstall();
void uninstallTheme();
void uninstallIcon();
void threadUninstalledThemeFinished(KJob* job);
void threadUninstalledThemeIconFinished(KJob* job);
private:
Ui::dialog_uninstaller *ui;
......
/* KDE GTK Configuration Module
*
* Copyright 2011 Aleix Pol Gonzalez <aleixpol@blue-systems.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) version 3, or any
* later version accepted by the membership of KDE e.V. (or its
* successor approved by the membership of KDE e.V.), which shall
* act as a proxy defined in Section 6 of version 3 of the license.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*