From kde-commits Thu Mar 31 21:30:00 2016 From: Friedrich W. H. Kossebau Date: Thu, 31 Mar 2016 21:30:00 +0000 To: kde-commits Subject: [krunner] /: Import runner template from KAppTemplate Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=145945981602293 Git commit 3aed2212ccc417b9c15fc91ea0dabb482cd85c32 by Friedrich W. H. Koss= ebau. 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 whic= h 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/%{APPNAME= LC}.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 =3D context.query(); + if (term.length() < 3) { + return; + } + //TODO +} + +void %{APPNAME}::run(const Plasma::RunnerContext &context, const Plasma::Q= ueryMatch &match) +{ + Q_UNUSED(context) + Q_UNUSED(match) +} + +#include "%{APPNAMELC}.moc" diff --git a/templates/runner/%{APPNAMELC}.desktop b/templates/runner/%{APP= NAMELC}.desktop new file mode 100644 index 0000000..4088a6d --- /dev/null +++ b/templates/runner/%{APPNAMELC}.desktop @@ -0,0 +1,14 @@ +[Desktop Entry] +Name=3D%{APPNAME} +Comment=3D%{APPNAME} runner +Icon=3D + +X-KDE-ServiceTypes=3DPlasma/Runner +Type=3DService +X-KDE-Library=3Dkrunner_%{APPNAMELC} +X-KDE-PluginInfo-Author=3D%{AUTHOR} +X-KDE-PluginInfo-Email=3D%{EMAIL} +X-KDE-PluginInfo-Name=3D%{APPNAMELC} +X-KDE-PluginInfo-Version=3D0.1 +X-KDE-PluginInfo-License=3DGPL +X-KDE-PluginInfo-EnabledByDefault=3Dtrue 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 + +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::QueryMatc= h &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=3DMYPREFIX .. = +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=3DC++ +Name[bs]=3DC++ +Name[ca]=3DC++ +Name[ca@valencia]=3DC++ +Name[cs]=3DC++ +Name[da]=3DC++ +Name[de]=3DC++ +Name[el]=3DC++ +Name[en_GB]=3DC++ +Name[es]=3DC++ +Name[et]=3DC++ +Name[fi]=3DC++ +Name[fr]=3DC++ +Name[ga]=3DC++ +Name[gl]=3DC++ +Name[hu]=3DC++ +Name[it]=3DC++ +Name[kk]=3DC++ +Name[ko]=3DC++ +Name[lt]=3DC++ +Name[mr]=3DC++ +Name[nb]=3DC++ +Name[nds]=3DC++ +Name[nl]=3DC++ +Name[pa]=3DC++ +Name[pl]=3DC++ +Name[pt]=3DC++ +Name[pt_BR]=3DC++ +Name[ru]=3DC++ +Name[sk]=3DC++ +Name[sl]=3DC++ +Name[sr]=3D=D0=A6++ +Name[sr@ijekavian]=3D=D0=A6++ +Name[sr@ijekavianlatin]=3DC++ +Name[sr@latin]=3DC++ +Name[sv]=3DC++ +Name[tr]=3DC++ +Name[ug]=3DC++ +Name[uk]=3DC++ +Name[x-test]=3DxxC++xx +Name[zh_CN]=3DC++ +Name[zh_TW]=3DC++ +Comment=3DPlasma Runner Template. A plasma runner template +Comment[bs]=3DPlasma Runner predlo=C5=BEak. Predlo=C5=BEak za Plasma pokre= nute programe +Comment[ca]=3DUna plantilla d'executor pel Plasma +Comment[ca@valencia]=3DUna plantilla d'executor pel Plasma +Comment[da]=3DSkabelon til Plasma-runner. En skabelon til plasma-runner +Comment[de]=3DEine Vorlage f=C3=BCr einen Plasma-Runner +Comment[el]=3DPlasma Runner Template. =CE=88=CE=BD=CE=B1 =CF=80=CF=81=CF= =8C=CF=84=CF=85=CF=80=CE=BF =CE=B5=CE=BA=CF=84=CE=B5=CE=BB=CE=B5=CF=83=CF= =84=CE=AE plasma +Comment[en_GB]=3DPlasma Runner Template. A plasma runner template +Comment[es]=3DPlantilla de lanzador para Plasma. Una plantilla de lanzador= para Plasma +Comment[et]=3DPlasma k=C3=A4ivitaja mall. Plasma k=C3=A4ivitaja mall +Comment[fi]=3DPlasma-suoritusohjelmamalli. Plasma-suoritusohjelmamalli (en= gl. Plasma Runner) +Comment[fr]=3DMod=C3=A8le de lanceur pour Plasma. Un mod=C3=A8le de lanceu= r Plasma +Comment[ga]=3DTeimpl=C3=A9ad Fheidhmitheoir Plasma. Teimpl=C3=A9ad d'fheid= hmitheoir=C3=AD Plasma +Comment[gl]=3DModelo de executor de Plasma. Un modelo de executor de Plasm= a. +Comment[hu]=3DPlasma futtat=C3=B3 sablon. Sablon Plasma futtat=C3=B3hoz +Comment[it]=3DModello di esecutore Plasma. Un modello di esecutore Plasma +Comment[kk]=3DPlasma =D0=B6=D0=B5=D0=BA=D0=BA=D1=96=D1=88 =D2=AF=D0=BB=D0= =B3=D1=96=D1=81=D1=96. Plasma-=D0=BD=D1=8B=D2=A3 =D0=B1=D1=96=D1=80 =D0=B6= =D0=B5=D0=BA=D0=BA=D1=96=D1=88 =D2=AF=D0=BB=D0=B3=D1=96=D1=81=D1=96 +Comment[ko]=3DPlasma =EC=8B=A4=ED=96=89=EA=B8=B0 =ED=85=9C=ED=94=8C=EB=A6= =BF +Comment[lt]=3DPlasma Runner =C5=A1ablonas. Plasma runner =C5=A1ablonas +Comment[nb]=3DPlasma kj=C3=B8rermal. En Plasma-kj=C3=B8rermal +Comment[nl]=3DSjabloon voor Plasma-runner. Een plasma-starter sjabloon +Comment[pa]=3D=E0=A8=AA=E0=A8=B2=E0=A8=BE=E0=A8=9C=E0=A8=BC=E0=A8=AE=E0=A8= =BE =E0=A8=B0=E0=A8=A8=E0=A8=B0 =E0=A8=9F=E0=A9=88=E0=A8=AA=E0=A8=B2=E0=A9= =87=E0=A8=9F=E0=A5=A4 =E0=A8=87=E0=A9=B1=E0=A8=95 =E0=A8=AA=E0=A8=B2=E0=A8= =BE=E0=A9=9B=E0=A8=AE=E0=A8=BE =E0=A8=B0=E0=A8=A8=E0=A8=B0 =E0=A8=9F=E0=A9= =88=E0=A8=AA=E0=A8=B2=E0=A9=87=E0=A8=9F +Comment[pl]=3DSzablon uruchamiania Plazmy. Szablon uruchamiania plazmy +Comment[pt]=3DModelo de M=C3=B3dulo de Execu=C3=A7=C3=A3o do Plasma. Um mo= delo de m=C3=B3dulos de execu=C3=A7=C3=A3o do Plasma +Comment[pt_BR]=3DModelo de m=C3=B3dulo de execu=C3=A7=C3=A3o do Plasma. Um= modelo de m=C3=B3dulos de execu=C3=A7=C3=A3o do Plasma +Comment[ru]=3D=D0=9C=D0=BE=D0=B4=D1=83=D0=BB=D1=8C =D0=B7=D0=B0=D0=BF=D1= =83=D1=81=D0=BA=D0=B0 =D0=B4=D0=BB=D1=8F Plasma. =D0=A8=D0=B0=D0=B1=D0=BB= =D0=BE=D0=BD =D0=BC=D0=BE=D0=B4=D1=83=D0=BB=D1=8F =D0=B4=D0=B8=D0=B0=D0=BB= =D0=BE=D0=B3=D0=B0 =D0=B7=D0=B0=D0=BF=D1=83=D1=81=D0=BA=D0=B0 +Comment[sk]=3D=C5=A0abl=C3=B3na Plasma Runner. =C5=A0abl=C3=B3na plasma ru= nner +Comment[sl]=3DPredloga zaganjalnika za Plasmo +Comment[sr]=3D=D0=A8=D0=B0=D0=B1=D0=BB=D0=BE=D0=BD =D0=BF=D0=BB=D0=B0=D0= =B7=D0=BC=D0=B0 =D0=B8=D0=B7=D0=B2=D0=BE=D1=92=D0=B0=D1=87=D0=B0 +Comment[sr@ijekavian]=3D=D0=A8=D0=B0=D0=B1=D0=BB=D0=BE=D0=BD =D0=BF=D0=BB= =D0=B0=D0=B7=D0=BC=D0=B0 =D0=B8=D0=B7=D0=B2=D0=BE=D1=92=D0=B0=D1=87=D0=B0 +Comment[sr@ijekavianlatin]=3D=C5=A0ablon plasma izvo=C4=91a=C4=8Da +Comment[sr@latin]=3D=C5=A0ablon plasma izvo=C4=91a=C4=8Da +Comment[sv]=3DPlasma-mall f=C3=B6r k=C3=B6rning av program. Mall f=C3=B6r = Plasma k=C3=B6rning av program +Comment[tr]=3DPlasma =C3=87al=C4=B1=C5=9Ft=C4=B1r=C4=B1c=C4=B1 =C5=9Eablon= u. Bir Plasma =C3=A7al=C4=B1=C5=9Ft=C4=B1r=C4=B1c=C4=B1 =C5=9Fablonu +Comment[uk]=3D=D0=A8=D0=B0=D0=B1=D0=BB=D0=BE=D0=BD =D0=B7=D0=B0=D1=81=D0= =BE=D0=B1=D1=83 =D0=B7=D0=B0=D0=BF=D1=83=D1=81=D0=BA=D1=83 =D0=9F=D0=BB=D0= =B0=D0=B7=D0=BC=D0=B8 +Comment[x-test]=3DxxPlasma Runner Template. A plasma runner templatexx +Comment[zh_CN]=3DPlasma =E5=90=AF=E5=8A=A8=E5=99=A8=E6=A8=A1=E6=9D=BF=E3= =80=82plasma =E5=90=AF=E5=8A=A8=E5=99=A8=E6=A8=A1=E6=9D=BF +Comment[zh_TW]=3DPlasma =E5=9F=B7=E8=A1=8C=E5=99=A8=E6=A8=A3=E6=9C=AC=E3= =80=82 +Category=3DKDE/KRunner +Icon=3Drunner.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