Move settings app into own folder and make it a KDBusService

This commit is contained in:
Nicolas Fella 2020-01-17 01:31:53 +01:00
parent 894898ec0d
commit 1a2315cdf7
6 changed files with 28 additions and 12 deletions

View file

@ -105,6 +105,7 @@ if (NOT SAILFISHOS)
add_subdirectory(nautilus-extension) add_subdirectory(nautilus-extension)
add_subdirectory(fileitemactionplugin) add_subdirectory(fileitemactionplugin)
add_subdirectory(smsapp) add_subdirectory(smsapp)
add_subdirectory(settings)
if(NOT WIN32) if(NOT WIN32)
add_subdirectory(kio) add_subdirectory(kio)

View file

@ -9,10 +9,6 @@ set(kcm_SRCS
kcm.cpp kcm.cpp
) )
set(kcm_wrapper_SRCS main.cpp)
add_executable(kdeconnect-settings ${kcm_wrapper_SRCS})
target_link_libraries(kdeconnect-settings KF5::I18n KF5::KCMUtils)
ki18n_wrap_ui(kcm_SRCS kcm.ui) ki18n_wrap_ui(kcm_SRCS kcm.ui)
add_library(kcm_kdeconnect MODULE ${kcm_SRCS}) add_library(kcm_kdeconnect MODULE ${kcm_SRCS})
@ -26,7 +22,4 @@ target_link_libraries(kcm_kdeconnect
) )
install(TARGETS kcm_kdeconnect DESTINATION ${PLUGIN_INSTALL_DIR}) install(TARGETS kcm_kdeconnect DESTINATION ${PLUGIN_INSTALL_DIR})
install(TARGETS kdeconnect-settings ${INSTALL_TARGETS_DEFAULT_ARGS})
install(FILES org.kde.kdeconnect.kcm.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
install(FILES kcm_kdeconnect.desktop DESTINATION ${SERVICES_INSTALL_DIR}) install(FILES kcm_kdeconnect.desktop DESTINATION ${SERVICES_INSTALL_DIR})

9
settings/CMakeLists.txt Normal file
View file

@ -0,0 +1,9 @@
add_definitions(-DTRANSLATION_DOMAIN="kdeconnect-settings")
include_directories(${CMAKE_BINARY_DIR})
add_executable(kdeconnect-settings main.cpp)
target_link_libraries(kdeconnect-settings KF5::I18n KF5::KCMUtils KF5::DBusAddons)
install(TARGETS kdeconnect-settings ${INSTALL_TARGETS_DEFAULT_ARGS})
install(FILES org.kde.kdeconnect.settings.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})

10
settings/Messages.sh Normal file
View file

@ -0,0 +1,10 @@
#!/usr/bin/env bash
$EXTRACTRC `find -name '*.ui' -o -name '*.rc'` >> rc.cpp
$XGETTEXT rc.cpp -o $podir/kdeconnect-settings.pot
rm -f rc.cpp
#.cpp (-j passed to merge into existing file)
$XGETTEXT `find . -name '*.cpp'` -j -o $podir/kdeconnect-settings.pot

View file

@ -23,6 +23,7 @@
#include <KCMultiDialog> #include <KCMultiDialog>
#include <KAboutData> #include <KAboutData>
#include <KLocalizedString> #include <KLocalizedString>
#include <KDBusService>
#include "kdeconnect-version.h" #include "kdeconnect-version.h"
int main(int argc, char** argv) int main(int argc, char** argv)
@ -33,9 +34,11 @@ int main(int argc, char** argv)
QStringLiteral(KDECONNECT_VERSION_STRING), QStringLiteral(KDECONNECT_VERSION_STRING),
i18n("KDE Connect Settings"), i18n("KDE Connect Settings"),
KAboutLicense::GPL, KAboutLicense::GPL,
i18n("(C) 2018 Nicolas Fella")); i18n("(C) 2018-2020 Nicolas Fella"));
KAboutData::setApplicationData(about); KAboutData::setApplicationData(about);
KDBusService dbusService(KDBusService::Unique);
KCMultiDialog* dialog = new KCMultiDialog; KCMultiDialog* dialog = new KCMultiDialog;
dialog->addModule(QStringLiteral("kcm_kdeconnect")); dialog->addModule(QStringLiteral("kcm_kdeconnect"));
dialog->setAttribute(Qt::WA_DeleteOnClose); dialog->setAttribute(Qt::WA_DeleteOnClose);