From e2f7324f6551ef90ccf75d0e709a01218c652955 Mon Sep 17 00:00:00 2001 From: Giorgos Tsiapaliokas Date: Tue, 3 Sep 2013 13:17:40 +0300 Subject: [PATCH] move shellpluginloader back to shell Conflicts: src/plasmaview/CMakeLists.txt src/shell/shellpluginloader.cpp --- CMakeLists.txt | 1 + shellpluginloader.cpp | 49 +++++++++++++++++++++++++++++++++++++++++++ shellpluginloader.h | 35 +++++++++++++++++++++++++++++++ 3 files changed, 85 insertions(+) create mode 100644 shellpluginloader.cpp create mode 100644 shellpluginloader.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 0187dded0..e33d05698 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,6 +61,7 @@ add_executable(plasma-shell panelview.cpp lookandfeelpackage.cpp panelconfigview.cpp + shellpluginloader.cpp ${scripting_SRC} ${widgetexplorer_SRC} ) diff --git a/shellpluginloader.cpp b/shellpluginloader.cpp new file mode 100644 index 000000000..f5114d44a --- /dev/null +++ b/shellpluginloader.cpp @@ -0,0 +1,49 @@ +/* + * Copyright 2013 Marco Martin + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program 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 General Public License for more details + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "shellpluginloader.h" +#include "shellpackage_p.h" + + +ShellPluginLoader::ShellPluginLoader() + : Plasma::PluginLoader() +{ +} + +ShellPluginLoader::~ShellPluginLoader() +{ +} + +Plasma::Package ShellPluginLoader::internalLoadPackage(const QString &packageFormat, const QString &specialization) +{ + Q_UNUSED(specialization) + + if (packageFormat.endsWith("/Shell")) { + Plasma::PackageStructure *structure = new ShellPackageStructure(); + return Plasma::Package(structure); + } else { + return Plasma::Package(); + } +} + +void ShellPluginLoader::init() +{ + Plasma::PluginLoader::setPluginLoader(new ShellPluginLoader); +} + diff --git a/shellpluginloader.h b/shellpluginloader.h new file mode 100644 index 000000000..720b401be --- /dev/null +++ b/shellpluginloader.h @@ -0,0 +1,35 @@ +/* + * Copyright 2013 Marco Martin + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program 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 General Public License for more details + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef SHELLPLUGINLOADER_H +#define SHELLPLUGINLOADER_H + +#include + +class ShellPluginLoader : public Plasma::PluginLoader +{ +public: + ShellPluginLoader(); + ~ShellPluginLoader(); + +protected: + Plasma::Package internalLoadPackage(const QString &packageFormat, const QString &specialization); +}; + +#endif