From 4abe1ff3840eb8b491646adb7cfec619733867a4 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Fri, 1 Apr 2022 18:44:39 +0300 Subject: [PATCH] generic: remove unused and fix some configuration checks Signed-off-by: Ivailo Monev --- ConfigureChecks.cmake | 5 --- config-unix.h.cmake | 21 ++++++++-- config-workspace.h.cmake | 33 ---------------- kioslave/floppy/kio_floppy.cpp | 2 +- ksmserver/client.cpp | 2 +- ksmserver/curtaineffect.cpp | 1 - ksmserver/legacy.cpp | 6 +-- ksmserver/main.cpp | 6 +-- .../screenlocker/greeter/screensaverwindow.cpp | 8 +++- ksmserver/shutdown.cpp | 3 +- ksmserver/shutdowndlg.cpp | 10 ++--- ksmserver/startup.cpp | 11 +++--- ksplash/ksplashx/splash.cpp | 3 +- kwin/main.cpp | 46 +++++++++++----------- libs/kworkspace/kworkspace.cpp | 25 ++++++------ 15 files changed, 76 insertions(+), 106 deletions(-) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 212307ee..dba14eca 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -28,11 +28,9 @@ set(XLIBDIR "${xrootdir}/lib/X11") set(XKBDIR "${xrootdir}/share/X11") check_function_exists(getpassphrase HAVE_GETPASSPHRASE) -check_function_exists(vsyslog HAVE_VSYSLOG) check_function_exists(nice HAVE_NICE) check_include_files(string.h HAVE_STRING_H) -check_include_files(sys/select.h HAVE_SYS_SELECT_H) check_include_files(limits.h HAVE_LIMITS_H) check_include_files(sys/time.h HAVE_SYS_TIME_H) # ksmserver, ksplashml, sftp check_include_files(stdint.h HAVE_STDINT_H) # kcontrol/kfontinst @@ -86,8 +84,5 @@ macro(define_library LIB FN) endmacro(define_library) # for Solaris -define_library(s authenticate) -define_library(posix4 sched_yield) define_library(socket connect) -define_library(resolv dn_expand) define_library(nsl gethostbyname) diff --git a/config-unix.h.cmake b/config-unix.h.cmake index c721db41..6f415981 100644 --- a/config-unix.h.cmake +++ b/config-unix.h.cmake @@ -22,8 +22,23 @@ /* Define to 1 if you have the `getpassphrase' function. */ #cmakedefine HAVE_GETPASSPHRASE 1 -/* Define to 1 if you have the `vsyslog' function. */ -#cmakedefine HAVE_VSYSLOG 1 - /* Define to 1 if you have the header file. */ #cmakedefine HAVE_LIMITS_H 1 + +/* Define to 1 if you have the `nice' function. */ +#cmakedefine HAVE_NICE 1 + +/* Define to 1 if you have the `setpriority' function. */ +#cmakedefine HAVE_SETPRIORITY 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_UNISTD_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_MALLOC_H 1 diff --git a/config-workspace.h.cmake b/config-workspace.h.cmake index ac621105..68b7eb9c 100644 --- a/config-workspace.h.cmake +++ b/config-workspace.h.cmake @@ -15,39 +15,6 @@ /* Defines if your system has the freetype library */ #cmakedefine HAVE_FREETYPE 1 -/* Define to 1 if you have the `nice' function. */ -#cmakedefine HAVE_NICE 1 - -/* Define to 1 if you have the `getpassphrase' function. */ -#cmakedefine HAVE_GETPASSPHRASE 1 - -/* Define to 1 if you have the `vsyslog' function. */ -#cmakedefine HAVE_VSYSLOG 1 - -/* Define to 1 if you have the `setpriority' function. */ -#cmakedefine HAVE_SETPRIORITY 1 - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_STRING_H 1 - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_SYS_SELECT_H 1 - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_SYS_TIME_H 1 - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_UNISTD_H 1 - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_STDINT_H 1 - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_LIMITS_H 1 - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_MALLOC_H 1 - /* KDE's default home directory */ #cmakedefine KDE_DEFAULT_HOME "${KDE_DEFAULT_HOME}" diff --git a/kioslave/floppy/kio_floppy.cpp b/kioslave/floppy/kio_floppy.cpp index 09f4bd79..5b74d49c 100644 --- a/kioslave/floppy/kio_floppy.cpp +++ b/kioslave/floppy/kio_floppy.cpp @@ -20,7 +20,7 @@ #include "kio_floppy.h" -#include +#include "config-unix.h" #ifdef HAVE_STRING_H #include diff --git a/ksmserver/client.cpp b/ksmserver/client.cpp index 76de37ad..093d8914 100644 --- a/ksmserver/client.cpp +++ b/ksmserver/client.cpp @@ -29,7 +29,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ******************************************************************/ -#include +#include "config-unix.h" #include "client.h" diff --git a/ksmserver/curtaineffect.cpp b/ksmserver/curtaineffect.cpp index 2a6db5bf..698f7022 100644 --- a/ksmserver/curtaineffect.cpp +++ b/ksmserver/curtaineffect.cpp @@ -29,7 +29,6 @@ #include #include #include -#include "config-workspace.h" CurtainEffect::CurtainEffect(QWidget *parent, QPixmap *pixmap) : LogoutEffect(parent, pixmap) diff --git a/ksmserver/legacy.cpp b/ksmserver/legacy.cpp index 2e2cfe1b..d3bf6d6c 100644 --- a/ksmserver/legacy.cpp +++ b/ksmserver/legacy.cpp @@ -29,16 +29,14 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ******************************************************************/ -#include +#include "config-unix.h" #ifdef HAVE_SYS_TIME_H #include #endif - -#include "server.h" - #include +#include "server.h" #include #include diff --git a/ksmserver/main.cpp b/ksmserver/main.cpp index d81d9440..110ad692 100644 --- a/ksmserver/main.cpp +++ b/ksmserver/main.cpp @@ -22,9 +22,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ******************************************************************/ +#include "config-ksmserver.h" +#include "server.h" + #include -#include -#include #include #include #include @@ -44,7 +45,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include #include #include -#include "server.h" #include #include diff --git a/ksmserver/screenlocker/greeter/screensaverwindow.cpp b/ksmserver/screenlocker/greeter/screensaverwindow.cpp index 03bd824d..8d58d839 100644 --- a/ksmserver/screenlocker/greeter/screensaverwindow.cpp +++ b/ksmserver/screenlocker/greeter/screensaverwindow.cpp @@ -19,12 +19,16 @@ */ +#include "config-unix.h" #include "screensaverwindow.h" #include "kscreensaversettings.h" +#ifdef HAVE_SETPRIORITY +# include +#endif + #include #include -#include #include #include #include @@ -187,7 +191,7 @@ bool ScreenSaverWindow::startXScreenSaver() m_ScreenSaverProcess.start(saverProgram, saverArgs); if (m_ScreenSaverProcess.waitForStarted()) { #ifdef HAVE_SETPRIORITY - setpriority(PRIO_PROCESS, m_ScreenSaverProcess.pid(), mPriority); + setpriority(PRIO_PROCESS, m_ScreenSaverProcess.pid(), 10); #endif return true; } diff --git a/ksmserver/shutdown.cpp b/ksmserver/shutdown.cpp index 7f38f5fa..109233b5 100644 --- a/ksmserver/shutdown.cpp +++ b/ksmserver/shutdown.cpp @@ -28,8 +28,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ******************************************************************/ -#include -#include // HAVE_LIMITS_H +#include // HAVE_SYS_TIME_H, HAVE_LIMITS_H #include #include diff --git a/ksmserver/shutdowndlg.cpp b/ksmserver/shutdowndlg.cpp index f5700048..5fca30cf 100644 --- a/ksmserver/shutdowndlg.cpp +++ b/ksmserver/shutdowndlg.cpp @@ -23,10 +23,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ******************************************************************/ +#include "config-workspace.h" #include "shutdowndlg.h" #include "plasma/framesvg.h" #include "plasma/theme.h" +#include + #include #include #include @@ -43,24 +46,19 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include #include #include +#include #include #include #include #include #include - -#include #include #include -#include - #include "logouteffect.h" #include "moc_shutdowndlg.cpp" -#include - #define FONTCOLOR "#bfbfbf" KSMShutdownFeedback * KSMShutdownFeedback::s_pSelf = 0L; diff --git a/ksmserver/startup.cpp b/ksmserver/startup.cpp index 4b50361f..9751a47e 100644 --- a/ksmserver/startup.cpp +++ b/ksmserver/startup.cpp @@ -29,11 +29,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ******************************************************************/ -#include -#include -#include -#include -#include // HAVE_LIMITS_H +#include "config-unix.h" // HAVE_SYS_TIME_H, HAVE_LIMITS_H #include #include @@ -59,8 +55,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include #include +#include #include +#include +#include #include #include #include @@ -69,11 +68,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include #include #include +#include #include "global.h" #include "server.h" #include "client.h" -#include #include diff --git a/ksplash/ksplashx/splash.cpp b/ksplash/ksplashx/splash.cpp index de4a078a..c1698622 100644 --- a/ksplash/ksplashx/splash.cpp +++ b/ksplash/ksplashx/splash.cpp @@ -32,7 +32,8 @@ const int LAST_STATE = 5; extern int screen_number; -#include +#include "config-unix.h" +#include "config-workspace.h" #include "splash.h" #include "qcolor.h" diff --git a/kwin/main.cpp b/kwin/main.cpp index b4ed561a..0d2a66e8 100644 --- a/kwin/main.cpp +++ b/kwin/main.cpp @@ -19,44 +19,42 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . *********************************************************************/ +#include "config-unix.h" #include "main.h" -//#define QT_CLEAN_NAMESPACE -#include - -#include -#include -#include -#include -#include -#include #include #include -#include #include -#include -#include +#include + +#ifdef HAVE_UNISTD_H +#include +#endif // HAVE_UNISTD_H + +#ifdef HAVE_MALLOC_H +#include +#endif // HAVE_MALLOC_H + #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include #include -#include #include -#include - -#include "config-workspace.h" - -#ifdef HAVE_UNISTD_H -#include -#endif // HAVE_UNISTD_H - -#ifdef HAVE_MALLOC_H -#include -#endif // HAVE_MALLOC_H +#include +#include #include diff --git a/libs/kworkspace/kworkspace.cpp b/libs/kworkspace/kworkspace.cpp index 510abb9f..7021be34 100644 --- a/libs/kworkspace/kworkspace.cpp +++ b/libs/kworkspace/kworkspace.cpp @@ -18,19 +18,25 @@ */ #include "kworkspace.h" + #include #include -#include #include #include #include -#include #include -#include +#include #include -#include // getenv() + +#include +#include +#include #include -#include + +#include // geteuid() +#include // getenv() +#include +#include #ifdef Q_WS_X11 #include @@ -46,15 +52,6 @@ #define DISPLAY "QWS_DISPLAY" #endif -#include "config-workspace.h" - -#ifdef HAVE_UNISTD_H -#include -#endif // HAVE_UNISTD_H - -#include -#include - #include "kworkspace_p.h" namespace KWorkSpace -- 2.11.0