[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [krunner] /: Import runner template from KAppTemplate
From:       Friedrich W. H. Kossebau <kossebau () kde ! org>
Date:       2016-03-31 21:30:00
Message-ID: E1alkAC-0007RM-Iy () scm ! kde ! org
[Download RAW message or body]

Git commit 3aed2212ccc417b9c15fc91ea0dabb482cd85c32 by Friedrich W. H. Kossebau.
Committed on 31/03/2016 at 21:24.
Pushed by kossebau into branch 'master'.

Import runner template from KAppTemplate

M  +2    -0    CMakeLists.txt
A  +5    -0    templates/CMakeLists.txt
A  +32   -0    templates/runner/%{APPNAMELC}.cpp     [License: UNKNOWN]  *
A  +14   -0    templates/runner/%{APPNAMELC}.desktop
A  +19   -0    templates/runner/%{APPNAMELC}.h     [License: UNKNOWN]  *
A  +31   -0    templates/runner/CMakeLists.txt
A  +25   -0    templates/runner/README
A  +84   -0    templates/runner/runner.kdevtemplate
A  +-    --    templates/runner/runner.png

The files marked with a * at the end have a non valid license. Please read: \
http://techbase.kde.org/Policies/Licensing_Policy and use the headers which are \
listed at that page.


http://commits.kde.org/krunner/3aed2212ccc417b9c15fc91ea0dabb482cd85c32

diff --git a/CMakeLists.txt b/CMakeLists.txt
index c9cffa3..4cd61bc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,6 +18,7 @@ include(ECMPackageConfigHelpers)
 include(KDEInstallDirs)
 include(KDECompilerSettings NO_POLICY_SCOPE)
 include(KDECMakeSettings)
+include(KDEPackageAppTemplates)
 
 set(KF5_VERSION "5.21.0") # handled by release scripts
 set(KF5_DEP_VERSION "5.20.0") # handled by release scripts
@@ -46,6 +47,7 @@ find_package(KF5ThreadWeaver ${KF5_DEP_VERSION} REQUIRED)
 add_subdirectory(src)
 add_subdirectory(autotests)
 add_subdirectory(tests)
+add_subdirectory(templates)
 
 # Create a Config.cmake and a ConfigVersion.cmake file and install them
 set(CMAKECONFIG_INSTALL_DIR "${CMAKECONFIG_INSTALL_PREFIX}/KF5Runner")
diff --git a/templates/CMakeLists.txt b/templates/CMakeLists.txt
new file mode 100644
index 0000000..f4dcc89
--- /dev/null
+++ b/templates/CMakeLists.txt
@@ -0,0 +1,5 @@
+set(apptemplate_DIRS
+    runner
+)
+
+kde_package_app_templates(TEMPLATES ${apptemplate_DIRS} INSTALL_DIR \
                ${KDE_INSTALL_KTEMPLATESDIR})
diff --git a/templates/runner/%{APPNAMELC}.cpp b/templates/runner/%{APPNAMELC}.cpp
new file mode 100644
index 0000000..6091eb7
--- /dev/null
+++ b/templates/runner/%{APPNAMELC}.cpp
@@ -0,0 +1,32 @@
+#include "%{APPNAMELC}.h"
+
+K_EXPORT_PLASMA_RUNNER(%{APPNAMELC}, %{APPNAME})
+
+%{APPNAME}::%{APPNAME}(QObject *parent, const QVariantList &args)
+    : Plasma::AbstractRunner(parent, args)
+{
+    setObjectName("%{APPNAME}");
+}
+
+%{APPNAME}::~%{APPNAME}()
+{
+}
+
+
+void %{APPNAME}::match(Plasma::RunnerContext &context)
+{
+
+    const QString term = context.query();
+    if (term.length() < 3) {
+        return;
+    }
+    //TODO
+}
+
+void %{APPNAME}::run(const Plasma::RunnerContext &context, const Plasma::QueryMatch \
&match) +{
+    Q_UNUSED(context)
+    Q_UNUSED(match)
+}
+
+#include "%{APPNAMELC}.moc"
diff --git a/templates/runner/%{APPNAMELC}.desktop \
b/templates/runner/%{APPNAMELC}.desktop new file mode 100644
index 0000000..4088a6d
--- /dev/null
+++ b/templates/runner/%{APPNAMELC}.desktop
@@ -0,0 +1,14 @@
+[Desktop Entry]
+Name=%{APPNAME}
+Comment=%{APPNAME} runner
+Icon=
+
+X-KDE-ServiceTypes=Plasma/Runner
+Type=Service
+X-KDE-Library=krunner_%{APPNAMELC}
+X-KDE-PluginInfo-Author=%{AUTHOR}
+X-KDE-PluginInfo-Email=%{EMAIL}
+X-KDE-PluginInfo-Name=%{APPNAMELC}
+X-KDE-PluginInfo-Version=0.1
+X-KDE-PluginInfo-License=GPL
+X-KDE-PluginInfo-EnabledByDefault=true
diff --git a/templates/runner/%{APPNAMELC}.h b/templates/runner/%{APPNAMELC}.h
new file mode 100644
index 0000000..9e904d6
--- /dev/null
+++ b/templates/runner/%{APPNAMELC}.h
@@ -0,0 +1,19 @@
+#ifndef %{APPNAMEUC}_H
+#define %{APPNAMEUC}_H
+
+#include <krunner/abstractrunner.h>
+
+class %{APPNAME} : public Plasma::AbstractRunner
+{
+    Q_OBJECT
+
+public:
+    %{APPNAME}(QObject *parent, const QVariantList &args);
+    ~%{APPNAME}();
+
+public: // Plasma::AbstractRunner API
+    void match(Plasma::RunnerContext &context) override;
+    void run(const Plasma::RunnerContext &context, const Plasma::QueryMatch &match) \
override; +};
+
+#endif
diff --git a/templates/runner/CMakeLists.txt b/templates/runner/CMakeLists.txt
new file mode 100644
index 0000000..877bed5
--- /dev/null
+++ b/templates/runner/CMakeLists.txt
@@ -0,0 +1,31 @@
+project(plasma-%{APPNAMELC})
+
+cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
+
+set(QT_MIN_VERSION "5.4.0")
+set(KF5_MIN_VERSION "5.14.0")
+set(INSTALL_SDDM_THEME TRUE)
+find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Widgets )
+find_package(ECM 1.8.0 REQUIRED NO_MODULE)
+set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
+find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Runner)
+
+include(KDEInstallDirs)
+include(KDECMakeSettings)
+include(KDECompilerSettings NO_POLICY_SCOPE)
+include(ECMPackageConfigHelpers)
+include(ECMMarkNonGuiExecutable)
+include(CMakePackageConfigHelpers)
+include(WriteBasicConfigVersionFile)
+include(CheckIncludeFiles)
+include(FeatureSummary)
+include(ECMOptionalAddSubdirectory)
+
+set(%{APPNAMELC}_SRCS %{APPNAMELC}.cpp)
+
+add_library(krunner_%{APPNAMELC} MODULE ${%{APPNAMELC}_SRCS})
+target_link_libraries(krunner_%{APPNAMELC} KF5::Runner)
+
+install(TARGETS krunner_%{APPNAMELC} DESTINATION ${KDE_INSTALL_PLUGINDIR})
+
+install(FILES %{APPNAMELC}.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR})
diff --git a/templates/runner/README b/templates/runner/README
new file mode 100644
index 0000000..f115523
--- /dev/null
+++ b/templates/runner/README
@@ -0,0 +1,25 @@
+Runner Template
+----------------------
+
+-- Build instructions --
+
+cd /where/your/runner/is/installed
+mkdir build
+cd build
+cmake -DCMAKE_INSTALL_PREFIX=MYPREFIX .. 
+make 
+make install
+
+(MYPREFIX is where you install your Plasma setup, replace it accordingly)
+
+Restart krunner to load the runner
+(in a terminal type: 
+kquitapp krunner 
+and then
+krunner)
+
+After this you should see your runner in the system settings:
+
+systemsettings5 (Head to "Search")
+
+You can also launch KRunner via Alt-F2 and you will find your runner.
diff --git a/templates/runner/runner.kdevtemplate \
b/templates/runner/runner.kdevtemplate new file mode 100644
index 0000000..cd687dc
--- /dev/null
+++ b/templates/runner/runner.kdevtemplate
@@ -0,0 +1,84 @@
+# KDE Config File
+[General]
+Name=C++
+Name[bs]=C++
+Name[ca]=C++
+Name[ca@valencia]=C++
+Name[cs]=C++
+Name[da]=C++
+Name[de]=C++
+Name[el]=C++
+Name[en_GB]=C++
+Name[es]=C++
+Name[et]=C++
+Name[fi]=C++
+Name[fr]=C++
+Name[ga]=C++
+Name[gl]=C++
+Name[hu]=C++
+Name[it]=C++
+Name[kk]=C++
+Name[ko]=C++
+Name[lt]=C++
+Name[mr]=C++
+Name[nb]=C++
+Name[nds]=C++
+Name[nl]=C++
+Name[pa]=C++
+Name[pl]=C++
+Name[pt]=C++
+Name[pt_BR]=C++
+Name[ru]=C++
+Name[sk]=C++
+Name[sl]=C++
+Name[sr]=Ц++
+Name[sr@ijekavian]=Ц++
+Name[sr@ijekavianlatin]=C++
+Name[sr@latin]=C++
+Name[sv]=C++
+Name[tr]=C++
+Name[ug]=C++
+Name[uk]=C++
+Name[x-test]=xxC++xx
+Name[zh_CN]=C++
+Name[zh_TW]=C++
+Comment=Plasma Runner Template. A plasma runner template
+Comment[bs]=Plasma Runner predložak. Predložak za Plasma pokrenute programe
+Comment[ca]=Una plantilla d'executor pel Plasma
+Comment[ca@valencia]=Una plantilla d'executor pel Plasma
+Comment[da]=Skabelon til Plasma-runner. En skabelon til plasma-runner
+Comment[de]=Eine Vorlage für einen Plasma-Runner
+Comment[el]=Plasma Runner Template. Ένα πρότυπο εκτελεστή plasma
+Comment[en_GB]=Plasma Runner Template. A plasma runner template
+Comment[es]=Plantilla de lanzador para Plasma. Una plantilla de lanzador para Plasma
+Comment[et]=Plasma käivitaja mall. Plasma käivitaja mall
+Comment[fi]=Plasma-suoritusohjelmamalli. Plasma-suoritusohjelmamalli (engl. Plasma \
Runner) +Comment[fr]=Modèle de lanceur pour Plasma. Un modèle de lanceur Plasma
+Comment[ga]=Teimpléad Fheidhmitheoir Plasma. Teimpléad d'fheidhmitheoirí Plasma
+Comment[gl]=Modelo de executor de Plasma. Un modelo de executor de Plasma.
+Comment[hu]=Plasma futtató sablon. Sablon Plasma futtatóhoz
+Comment[it]=Modello di esecutore Plasma. Un modello di esecutore Plasma
+Comment[kk]=Plasma жеккіш үлгісі. Plasma-ның бір жеккіш \
үлгісі +Comment[ko]=Plasma 실행기 템플릿
+Comment[lt]=Plasma Runner šablonas. Plasma runner šablonas
+Comment[nb]=Plasma kjørermal. En Plasma-kjørermal
+Comment[nl]=Sjabloon voor Plasma-runner. Een plasma-starter sjabloon
+Comment[pa]=ਪਲਾਜ਼ਮਾ ਰਨਰ ਟੈਪਲੇਟ। ਇੱਕ \
ਪਲਾਜ਼ਮਾ ਰਨਰ ਟੈਪਲੇਟ +Comment[pl]=Szablon uruchamiania \
Plazmy. Szablon uruchamiania plazmy +Comment[pt]=Modelo de Módulo de Execução do \
Plasma. Um modelo de módulos de execução do Plasma +Comment[pt_BR]=Modelo de \
módulo de execução do Plasma. Um modelo de módulos de execução do Plasma \
+Comment[ru]=Модуль запуска для Plasma. Шаблон модуля \
диалога запуска +Comment[sk]= ablóna Plasma Runner.  ablóna plasma \
runner +Comment[sl]=Predloga zaganjalnika za Plasmo
+Comment[sr]=Шаблон плазма извођача
+Comment[sr@ijekavian]=Шаблон плазма извођача
+Comment[sr@ijekavianlatin]= ablon plasma izvođača
+Comment[sr@latin]= ablon plasma izvođača
+Comment[sv]=Plasma-mall för körning av program. Mall för Plasma körning av \
program +Comment[tr]=Plasma Çalıştırıcı Şablonu. Bir Plasma çalıştırıcı \
şablonu +Comment[uk]=Шаблон засобу запуску Плазми
+Comment[x-test]=xxPlasma Runner Template. A plasma runner templatexx
+Comment[zh_CN]=Plasma 启动器模板。plasma 启动器模板
+Comment[zh_TW]=Plasma 執行器樣本。
+Category=KDE/KRunner
+Icon=runner.png
diff --git a/templates/runner/runner.png b/templates/runner/runner.png
new file mode 100644
index 0000000..ba1c4d3
Binary files /dev/null and b/templates/runner/runner.png differ


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic