From 2eceb5f064cd6719d5439eeb2bb3613607aeae9e Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sun, 27 Sep 2015 01:19:30 +0000 Subject: [PATCH] generic: misc cleanups --- kdecore/kernel/ktoolinvocation.cpp | 5 ++ kdecore/util/klauncher_iface.h | 3 +- kded/kbuildsycoca.cpp | 7 +-- kded/kded.cpp | 6 -- kded/kded.h | 4 +- kded/kdedadaptor.h | 3 +- kdeui/widgets/kmainwindow.cpp | 1 + kdeui/windowmanagement/kwindowinfo_x11.cpp | 1 - kdeui/windowmanagement/kwindowsystem_x11.cpp | 2 +- kdeui/xmlgui/kmainwindowiface_p.h | 2 +- kdeui/xmlgui/kxmlguiwindow.cpp | 6 +- kinit/CMakeLists.txt | 61 ++++++++++---------- kinit/autostart.cpp | 10 ++-- kinit/klauncher.h | 3 +- 14 files changed, 56 insertions(+), 58 deletions(-) diff --git a/kdecore/kernel/ktoolinvocation.cpp b/kdecore/kernel/ktoolinvocation.cpp index f954c502..518f9403 100644 --- a/kdecore/kernel/ktoolinvocation.cpp +++ b/kdecore/kernel/ktoolinvocation.cpp @@ -32,6 +32,11 @@ #include +#include +#include +#include +#include +#include KToolInvocation *KToolInvocation::self() { diff --git a/kdecore/util/klauncher_iface.h b/kdecore/util/klauncher_iface.h index 3b7efb8c..fc843d29 100644 --- a/kdecore/util/klauncher_iface.h +++ b/kdecore/util/klauncher_iface.h @@ -29,7 +29,8 @@ #include #include #include -#include +#include +#include /* * Proxy class for interface org.kde.KLauncher diff --git a/kded/kbuildsycoca.cpp b/kded/kbuildsycoca.cpp index 65ac47e2..1b2c2cca 100644 --- a/kded/kbuildsycoca.cpp +++ b/kded/kbuildsycoca.cpp @@ -35,12 +35,9 @@ #include "kbuildprotocolinfofactory.h" #include "kctimefactory.h" #include -#include #include -#include -#include -#include -#include +#include +#include #include #include diff --git a/kded/kded.cpp b/kded/kded.cpp index 9ceb47c3..2cd1b6f2 100644 --- a/kded/kded.cpp +++ b/kded/kded.cpp @@ -30,12 +30,6 @@ #include #include -#include -#include -#include - -#include - #include #include #include diff --git a/kded/kded.h b/kded/kded.h index f09348dc..be8a90cb 100644 --- a/kded/kded.h +++ b/kded/kded.h @@ -25,8 +25,8 @@ #include #include #include - -#include +#include +#include #include #include diff --git a/kded/kdedadaptor.h b/kded/kdedadaptor.h index 4e1696ba..f18b4687 100644 --- a/kded/kdedadaptor.h +++ b/kded/kdedadaptor.h @@ -21,7 +21,8 @@ #ifndef KDED_KDEDADAPTOR_H #define KDED_KDEDADAPTOR_H -#include +#include +#include class KdedAdaptor: public QDBusAbstractAdaptor { diff --git a/kdeui/widgets/kmainwindow.cpp b/kdeui/widgets/kmainwindow.cpp index 9e4af67a..4f5b1628 100644 --- a/kdeui/widgets/kmainwindow.cpp +++ b/kdeui/widgets/kmainwindow.cpp @@ -43,6 +43,7 @@ #include #include #include +#include #include #include diff --git a/kdeui/windowmanagement/kwindowinfo_x11.cpp b/kdeui/windowmanagement/kwindowinfo_x11.cpp index 5133b814..265a88f0 100644 --- a/kdeui/windowmanagement/kwindowinfo_x11.cpp +++ b/kdeui/windowmanagement/kwindowinfo_x11.cpp @@ -30,7 +30,6 @@ #include #include #include -#include #include #include diff --git a/kdeui/windowmanagement/kwindowsystem_x11.cpp b/kdeui/windowmanagement/kwindowsystem_x11.cpp index 3106fe5e..dd6a8130 100644 --- a/kdeui/windowmanagement/kwindowsystem_x11.cpp +++ b/kdeui/windowmanagement/kwindowsystem_x11.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include diff --git a/kdeui/xmlgui/kmainwindowiface_p.h b/kdeui/xmlgui/kmainwindowiface_p.h index b59b2b1c..bd4bb3bb 100644 --- a/kdeui/xmlgui/kmainwindowiface_p.h +++ b/kdeui/xmlgui/kmainwindowiface_p.h @@ -22,7 +22,7 @@ #define KMAINWINDOWIFACE_P_H #include -#include +#include #include class KXmlGuiWindow; diff --git a/kdeui/xmlgui/kxmlguiwindow.cpp b/kdeui/xmlgui/kxmlguiwindow.cpp index 2f85d996..e1dcc78f 100644 --- a/kdeui/xmlgui/kxmlguiwindow.cpp +++ b/kdeui/xmlgui/kxmlguiwindow.cpp @@ -36,17 +36,15 @@ #include -#include #include #include #include +#include #include -#include #include #include -#include #include -#include +#include #include #include #include diff --git a/kinit/CMakeLists.txt b/kinit/CMakeLists.txt index ac408bf1..cce70820 100644 --- a/kinit/CMakeLists.txt +++ b/kinit/CMakeLists.txt @@ -4,7 +4,7 @@ if(ENABLE_TESTING) add_subdirectory(tests) endif() -include_directories( ${KDE4_KPARTS_INCLUDES} ) +include_directories(${KDE4_KPARTS_INCLUDES}) ########### Configuring (mainly for proctitle) ########### @@ -22,35 +22,34 @@ check_function_exists(setproctitle HAVE_SETPROCTITLE) # used by 4 executables in this file if(HAVE_SOCKET_LIBRARY) - set(KINIT_SOCKET_LIBRARY socket) + set(KINIT_SOCKET_LIBRARY socket) else(HAVE_SOCKET_LIBRARY) - set(KINIT_SOCKET_LIBRARY) + set(KINIT_SOCKET_LIBRARY) endif(HAVE_SOCKET_LIBRARY) ########### kdeinit4 ############### -set(kdeinit_SRCS kinit.cpp proctitle.cpp klauncher_cmds.cpp ) -set(kdeinit_LIBS "") +set(kdeinit_SRCS kinit.cpp proctitle.cpp klauncher_cmds.cpp) add_executable(kdeinit4 ${kdeinit_SRCS}) -target_link_libraries(kdeinit4 ${KDE4_KDEUI_LIBS} ${kdeinit_LIBS} ${KINIT_SOCKET_LIBRARY} ) +target_link_libraries(kdeinit4 ${KDE4_KDEUI_LIBS} ${KINIT_SOCKET_LIBRARY}) if (Q_WS_X11) - target_link_libraries(kdeinit4 ${X11_X11_LIB}) + target_link_libraries(kdeinit4 ${X11_X11_LIB}) endif(Q_WS_X11) -install(TARGETS kdeinit4 ${INSTALL_TARGETS_DEFAULT_ARGS} ) +install(TARGETS kdeinit4 ${INSTALL_TARGETS_DEFAULT_ARGS}) ########### kwrapper4 ############### -set(kwrapper_SRCS kwrapper.c ) +set(kwrapper_SRCS kwrapper.c) add_executable(kwrapper4 ${kwrapper_SRCS}) target_link_libraries(kwrapper4 ${KINIT_SOCKET_LIBRARY}) -install(TARGETS kwrapper4 ${INSTALL_TARGETS_DEFAULT_ARGS} ) +install(TARGETS kwrapper4 ${INSTALL_TARGETS_DEFAULT_ARGS}) ########### kdeinit4_wrapper ############### @@ -62,7 +61,7 @@ if (NOT Q_WS_X11 AND NOT Q_WS_QWS) add_definitions(-DNO_DISPLAY) endif (NOT Q_WS_X11 AND NOT Q_WS_QWS) -install(TARGETS kdeinit4_wrapper ${INSTALL_TARGETS_DEFAULT_ARGS} ) +install(TARGETS kdeinit4_wrapper ${INSTALL_TARGETS_DEFAULT_ARGS}) install(TARGETS kdeinit4_wrapper ${INSTALL_TARGETS_DEFAULT_ARGS} RENAME kdeinit4_shutdown) ########### kshell4 ############### @@ -71,17 +70,17 @@ add_executable(kshell4 shell.c) target_link_libraries(kshell4 ${KINIT_SOCKET_LIBRARY}) -install(TARGETS kshell4 ${INSTALL_TARGETS_DEFAULT_ARGS} ) +install(TARGETS kshell4 ${INSTALL_TARGETS_DEFAULT_ARGS}) ########### lnusertemp ############### -set(lnusertemp_SRCS lnusertemp.c ) +set(lnusertemp_SRCS lnusertemp.c) add_executable(lnusertemp ${lnusertemp_SRCS}) target_link_libraries(lnusertemp kdefakes) -install(TARGETS lnusertemp DESTINATION ${LIBEXEC_INSTALL_DIR} ) +install(TARGETS lnusertemp DESTINATION ${LIBEXEC_INSTALL_DIR}) ########### kioslave ############### @@ -90,35 +89,39 @@ set(kioslave_SRCS kioslave.cpp) add_executable(kioslave ${kioslave_SRCS}) -target_link_libraries(kioslave ${KDE4_KIO_LIBS} ) +target_link_libraries(kioslave ${KDE4_KIO_LIBS}) -install(TARGETS kioslave DESTINATION ${LIBEXEC_INSTALL_DIR} ) +install(TARGETS kioslave DESTINATION ${LIBEXEC_INSTALL_DIR}) ########### klauncher ############### set(klauncher_SRCS - klauncher.cpp - klauncher_main.cpp - klauncher_adaptor.cpp - autostart.cpp - klauncher_cmds.cpp - ${CMAKE_CURRENT_BINARY_DIR}/org.kde.KLauncher.xml # just so that it gets generated - ) + klauncher.cpp + klauncher_main.cpp + klauncher_adaptor.cpp + autostart.cpp + klauncher_cmds.cpp + # just so that it gets generated + ${CMAKE_CURRENT_BINARY_DIR}/org.kde.KLauncher.xml +) # The adaptor is manually edited, generate the xml from it. qt4_generate_dbus_interface(klauncher_adaptor.h org.kde.KLauncher.xml) -add_executable( klauncher ${klauncher_SRCS}) +add_executable(klauncher ${klauncher_SRCS}) + set_target_properties(klauncher PROPERTIES DEFINE_SYMBOL MAKE_KLAUNCHER) -target_link_libraries(klauncher ${KDE4_KIO_LIBS} ${X11_LIBRARIES}) +target_link_libraries(klauncher ${KDE4_KIO_LIBS} ${X11_LIBRARIES}) -install(TARGETS klauncher DESTINATION ${LIBEXEC_INSTALL_DIR} ) +install(TARGETS klauncher DESTINATION ${LIBEXEC_INSTALL_DIR}) ########### install files ############### -install( FILES ${CMAKE_CURRENT_BINARY_DIR}/org.kde.KLauncher.xml DESTINATION ${DBUS_INTERFACES_INSTALL_DIR} ) +install( + FILES ${CMAKE_CURRENT_BINARY_DIR}/org.kde.KLauncher.xml + DESTINATION ${DBUS_INTERFACES_INSTALL_DIR} +) ########### config-kdeinit.h ############ -configure_file(config-kdeinit.h.cmake - ${CMAKE_CURRENT_BINARY_DIR}/config-kdeinit.h ) +configure_file(config-kdeinit.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kdeinit.h) diff --git a/kinit/autostart.cpp b/kinit/autostart.cpp index 818d4363..1aa3e36a 100644 --- a/kinit/autostart.cpp +++ b/kinit/autostart.cpp @@ -82,17 +82,15 @@ AutoStart::loadAutoStartList() QString::fromLatin1("*.desktop"), KStandardDirs::NoDuplicates); - for(QStringList::ConstIterator it = files.begin(); - it != files.end(); - ++it) + foreach(const QString it, files) { - KAutostart config(*it); + KAutostart config(it); if( !config.autostarts(QString::fromLatin1("KDE"), KAutostart::CheckAll)) continue; AutoStartItem *item = new AutoStartItem; - item->name = extractName(*it); - item->service = *it; + item->name = extractName(it); + item->service = it; item->startAfter = config.startAfter(); item->phase = config.startPhase(); if (item->phase < 0) diff --git a/kinit/klauncher.h b/kinit/klauncher.h index 0b273935..f9863d2b 100644 --- a/kinit/klauncher.h +++ b/kinit/klauncher.h @@ -37,7 +37,8 @@ #include #include #include -#include +#include +#include #include #include