OSDN Git Service

kdeplasma-addons: proper fix for the inter-depency of kcm_krunner_charrunner and...
authorIvailo Monev <xakepa10@gmail.com>
Tue, 27 Sep 2022 16:39:37 +0000 (19:39 +0300)
committerIvailo Monev <xakepa10@gmail.com>
Tue, 27 Sep 2022 16:40:58 +0000 (19:40 +0300)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
kdeplasma-addons/runners/characters/CMakeLists.txt
kdeplasma-addons/runners/characters/charrunner.cpp
kdeplasma-addons/runners/characters/charrunner.h
kdeplasma-addons/runners/characters/charrunner_config.h
kdeplasma-addons/runners/characters/charrunnerdefs.h [new file with mode: 0644]

index 8a389b2..39e6275 100644 (file)
@@ -1,15 +1,11 @@
 project(CharacterRunner)
 
-# avoid putting the generated files in target specific
-# directory which is the case when automated
-set(CMAKE_AUTOUIC OFF)
-
 # We add our source code here
 set(krunner_charrunner_SRCS charrunner.cpp)
 set(kcm_krunner_charrunner_SRCS
     charrunner_config.cpp
 )
-qt4_wrap_ui(kcm_krunner_charrunner_SRCS charrunner_config.ui)
+
 kde4_add_plugin(kcm_krunner_charrunner ${kcm_krunner_charrunner_SRCS})
 target_link_libraries(kcm_krunner_charrunner
     ${KDE4_KDECORE_LIBS}
@@ -22,8 +18,16 @@ target_link_libraries(kcm_krunner_charrunner
 # Now make sure all files get to the right place
 kde4_add_plugin(krunner_charrunner ${krunner_charrunner_SRCS})
 target_link_libraries(krunner_charrunner ${KDE4_PLASMA_LIBS} ${KDE4_KIO_LIBS})
-add_dependencies(krunner_charrunner kcm_krunner_charrunner)
 
 # Install the library and .desktop file
-install(TARGETS krunner_charrunner kcm_krunner_charrunner DESTINATION ${KDE4_PLUGIN_INSTALL_DIR})
-install(FILES CharacterRunner.desktop CharRunner_config.desktop DESTINATION ${KDE4_SERVICES_INSTALL_DIR}) 
+install(
+    TARGETS krunner_charrunner kcm_krunner_charrunner
+    DESTINATION ${KDE4_PLUGIN_INSTALL_DIR}
+)
+
+install(
+    FILES
+    CharacterRunner.desktop
+    CharRunner_config.desktop
+    DESTINATION ${KDE4_SERVICES_INSTALL_DIR}
+) 
index db07630..4218b4b 100644 (file)
@@ -18,6 +18,7 @@
  */
 
 #include "charrunner.h"
+#include "charrunnerdefs.h"
 
 #include <KIcon>
 
index 17061fb..ea69d7d 100644 (file)
@@ -21,7 +21,6 @@
 #define CHARRUNNER_H
 
 #include <Plasma/AbstractRunner>
-#include "charrunner_config.h"
 
 class CharacterRunner : public Plasma::AbstractRunner
 {
@@ -32,7 +31,7 @@ class CharacterRunner : public Plasma::AbstractRunner
     ~CharacterRunner();
     void match(Plasma::RunnerContext &context);
     void reloadConfiguration();
-       
+
   private:
     //config-variables
     QString m_triggerWord;
@@ -42,4 +41,4 @@ class CharacterRunner : public Plasma::AbstractRunner
 
 K_EXPORT_PLASMA_RUNNER(charrunner, CharacterRunner)
 
-#endif
+#endif // CHARRUNNER_H
index 29f9372..c70ffb7 100644 (file)
@@ -55,4 +55,5 @@ class CharacterRunnerConfig : public KCModule
   private:
     CharacterRunnerConfigForm* m_ui;
 };
-#endif
+
+#endif // CHARRUNNERCONFIG_H
diff --git a/kdeplasma-addons/runners/characters/charrunnerdefs.h b/kdeplasma-addons/runners/characters/charrunnerdefs.h
new file mode 100644 (file)
index 0000000..c99a0dd
--- /dev/null
@@ -0,0 +1,28 @@
+/* Copyright 2010  Anton Kreuzkamp <akreuzkamp@web.de>
+ *
+ * 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 CHARRUNNERDEFS_H
+#define CHARRUNNERDEFS_H
+
+//Names of config-entries
+static const char CONFIG_TRIGGERWORD[] = "triggerWord";
+static const char CONFIG_ALIASES[] = "aliases";
+static const char CONFIG_CODES[] = "codes";
+
+#endif // CHARRUNNERDEFS_H