From 073865695902f025e9e71b83b6fca7aa9e356331 Mon Sep 17 00:00:00 2001 From: Pier Luigi Fiorini Date: Sat, 19 Apr 2014 23:38:12 +0200 Subject: [PATCH] Merge look and feel with shell We want shells to be tightly integrated with components. --- src/declarative/core/packagesmodel.cpp | 3 --- src/declarative/core/packagesmodel.h | 3 +-- src/libhawaii/packages_p.cpp | 15 ----------- src/libhawaii/packages_p.h | 6 ----- src/libhawaii/pluginloader.cpp | 3 --- src/libhawaii/pluginloader.h | 9 +++---- src/libhawaiishell/HawaiiShellMacros.cmake | 7 ++---- src/libhawaiishell/mantle.cpp | 29 ---------------------- src/libhawaiishell/mantle.h | 10 -------- src/libhawaiishell/mantle_p.h | 3 --- 10 files changed, 7 insertions(+), 81 deletions(-) diff --git a/src/declarative/core/packagesmodel.cpp b/src/declarative/core/packagesmodel.cpp index 3e92d8c..446fe0f 100644 --- a/src/declarative/core/packagesmodel.cpp +++ b/src/declarative/core/packagesmodel.cpp @@ -80,9 +80,6 @@ void PackagesModelPrivate::populate() case PackagesModel::ShellPackage: pluginType = PluginLoader::ShellPlugin; break; - case PackagesModel::LookAndFeelPackage: - pluginType = PluginLoader::LookAndFeelPlugin; - break; default: return; } diff --git a/src/declarative/core/packagesmodel.h b/src/declarative/core/packagesmodel.h index b0e1272..b80996d 100644 --- a/src/declarative/core/packagesmodel.h +++ b/src/declarative/core/packagesmodel.h @@ -44,8 +44,7 @@ class PackagesModel : public QAbstractListModel BackgroundPackage, ElementPackage, ContainmentPackage, - ShellPackage, - LookAndFeelPackage + ShellPackage }; enum Roles { diff --git a/src/libhawaii/packages_p.cpp b/src/libhawaii/packages_p.cpp index 20382df..0e88876 100644 --- a/src/libhawaii/packages_p.cpp +++ b/src/libhawaii/packages_p.cpp @@ -120,21 +120,6 @@ void ShellPackage::initializePackage(Package *package) // Elements package->addFileDefinition("elementerror", QStringLiteral("element/ElementError.qml"), tr("Error message for elements that fail to load")); -} - -void LookAndFeelPackage::initializePackage(Package *package) -{ - package->setDefaultPackageRoot(QStringLiteral("hawaii/lookandfeel/")); - - // Previews - package->addDirectoryDefinition("previews", QStringLiteral("previews"), - tr("Preview images")); - package->addFileDefinition("overlaypreview", QStringLiteral("previews/overlay.png"), - tr("Preview for the overlay")); - package->addFileDefinition("authenticationpreview", QStringLiteral("previews/authentication.png"), - tr("Preview for the authentication user interface")); - package->addFileDefinition("lockscreenpreview", QStringLiteral("previews/lockscreen.png"), - tr("Preview for the Lock Screen")); // Overlay package->addDirectoryDefinition("overlayui", QStringLiteral("overlay"), diff --git a/src/libhawaii/packages_p.h b/src/libhawaii/packages_p.h index 591f408..42fe7b3 100644 --- a/src/libhawaii/packages_p.h +++ b/src/libhawaii/packages_p.h @@ -70,12 +70,6 @@ class ShellPackage : public BasePackage void initializePackage(Package *package); }; -class LookAndFeelPackage : public BasePackage -{ -public: - void initializePackage(Package *package); -}; - class PreferencesPackage : public MainScriptPackage { public: diff --git a/src/libhawaii/pluginloader.cpp b/src/libhawaii/pluginloader.cpp index d99235d..35ad840 100644 --- a/src/libhawaii/pluginloader.cpp +++ b/src/libhawaii/pluginloader.cpp @@ -92,9 +92,6 @@ Package PluginLoader::loadPackage(PluginType type) case ShellPlugin: structure = new ShellPackage(); break; - case LookAndFeelPlugin: - structure = new LookAndFeelPackage(); - break; case PreferencesPlugin: structure = new PreferencesPackage(); break; diff --git a/src/libhawaii/pluginloader.h b/src/libhawaii/pluginloader.h index 2aaf6ac..a69a5ce 100644 --- a/src/libhawaii/pluginloader.h +++ b/src/libhawaii/pluginloader.h @@ -38,11 +38,10 @@ class HAWAII_EXPORT PluginLoader public: enum PluginType { BackgroundPlugin = 0, - ElementPlugin = 1, - ContainmentPlugin = 2, - ShellPlugin = 3, - LookAndFeelPlugin = 4, - PreferencesPlugin = 5, + ElementPlugin, + ContainmentPlugin, + ShellPlugin, + PreferencesPlugin, CustomPlugin = 0x0100 }; diff --git a/src/libhawaiishell/HawaiiShellMacros.cmake b/src/libhawaiishell/HawaiiShellMacros.cmake index 040a3af..835a9ee 100644 --- a/src/libhawaiishell/HawaiiShellMacros.cmake +++ b/src/libhawaiishell/HawaiiShellMacros.cmake @@ -36,7 +36,7 @@ # Installs a Hawaii Shell package. # # \param type the package type, one of the following: background, -# element, shell, lookandfeel, containment, preferences +# element, shell, containment, preferences # \param name the package name, same as the "name" key value # from metadata.json # \param srcpath the source path to install from, it's the @@ -49,8 +49,6 @@ macro(hawaiishell_install_package type name srcpath) set(dstpath hawaii/elements) elseif("${type}" STREQUAL "shell") set(dstpath hawaii/shells) - elseif("${type}" STREQUAL "lookandfeel") - set(dstpath hawaii/lookandfeel) elseif("${type}" STREQUAL "containment") set(dstpath hawaii/containments) elseif("${type}" STREQUAL "preferences") @@ -58,8 +56,7 @@ macro(hawaiishell_install_package type name srcpath) else() message(FATAL_ERROR "Package type \"${type}\" not recognized, " "possible values: \"element\", \"shell\", " - "\"lookandfeel\", \"containment\", " - "\"preferences\".") + "\"containment\", \"preferences\".") endif() install(DIRECTORY ${srcpath}/ DESTINATION ${CMAKE_INSTALL_DATADIR}/${dstpath}/${name} diff --git a/src/libhawaiishell/mantle.cpp b/src/libhawaiishell/mantle.cpp index 867b2cf..9c98448 100644 --- a/src/libhawaiishell/mantle.cpp +++ b/src/libhawaiishell/mantle.cpp @@ -71,18 +71,6 @@ Package Mantle::shellPackage() const return d->shellPackage; } -QString Mantle::lookAndFeel() const -{ - Q_D(const Mantle); - return d->lookAndFeel; -} - -Package Mantle::lookAndFeelPackage() const -{ - Q_D(const Mantle); - return d->lookAndFeelPackage; -} - void Mantle::setShell(const QString &name) { Q_D(Mantle); @@ -100,23 +88,6 @@ void Mantle::setShellPackage(const Package &package) Q_EMIT shellPackageChanged(package); } -void Mantle::setLookAndFeel(const QString &name) -{ - Q_D(Mantle); - - if (d->lookAndFeel != name) { - d->lookAndFeel = name; - Q_EMIT lookAndFeelChanged(d->lookAndFeel); - } -} - -void Mantle::setLookAndFeelPackage(const Package &package) -{ - Q_D(Mantle); - d->lookAndFeelPackage = package; - Q_EMIT lookAndFeelPackageChanged(package); -} - } // namespace Hawaii #include "moc_mantle.cpp" diff --git a/src/libhawaiishell/mantle.h b/src/libhawaiishell/mantle.h index 11b338e..3ef2b2e 100644 --- a/src/libhawaiishell/mantle.h +++ b/src/libhawaiishell/mantle.h @@ -41,7 +41,6 @@ class HAWAIISHELL_EXPORT Mantle : public QObject { Q_OBJECT Q_PROPERTY(QString shell READ shell NOTIFY shellChanged) - Q_PROPERTY(QString lookAndFeel READ lookAndFeel NOTIFY lookAndFeelChanged) public: explicit Mantle(QObject *parent = 0); ~Mantle(); @@ -51,23 +50,14 @@ class HAWAIISHELL_EXPORT Mantle : public QObject QString shell() const; Package shellPackage() const; - QString lookAndFeel() const; - Package lookAndFeelPackage() const; - Q_SIGNALS: void shellChanged(const QString &shell); void shellPackageChanged(const Package &package); - void lookAndFeelChanged(const QString &name); - void lookAndFeelPackageChanged(const Package &package); - protected: void setShell(const QString &name); void setShellPackage(const Package &package); - void setLookAndFeel(const QString &name); - void setLookAndFeelPackage(const Package &package); - private: Q_DECLARE_PRIVATE(Mantle) MantlePrivate *const d_ptr; diff --git a/src/libhawaiishell/mantle_p.h b/src/libhawaiishell/mantle_p.h index 823fb2e..ab69a21 100644 --- a/src/libhawaiishell/mantle_p.h +++ b/src/libhawaiishell/mantle_p.h @@ -41,9 +41,6 @@ class MantlePrivate QString shell; Package shellPackage; - QString lookAndFeel; - Package lookAndFeelPackage; - protected: Q_DECLARE_PUBLIC(Mantle) Mantle *q_ptr;