Package: kshutdown Version: 2.0beta12-3 Severity: serious Tags: patch Justification: fails to build from source (but built successfully in the past)
Hi, kshutdown 2.0beta12 fails to build on the Debian non-linux architectures (kfreebsd and hurd); even the DefineForKfreebsd.patch does not help (and it is not correct anyway). The attached patch fixes the following issues: - src/main.cpp: instead of restrict the gtk+ style on linux, make it valid on any X11-based platform - src/triggers/processmonitor.h: enable the process handling for kfreebsd (note: it is not Q_OS_FREEBSD, which indicates proper freebsd) and hurd - src/triggers/processmonitor.cpp: tweak the "ps" command invocation to work on both linux (tested on current testing/wheezy) and hurd. Note this patch replaces completely the current DefineForKfreebsd.patch. Can you please review and report to upstream? Thanks, -- Pino
--- a/src/main.cpp +++ b/src/main.cpp @@ -18,9 +18,9 @@ #ifdef KS_PURE_QT #include <QApplication> #include <QLocale> - #ifdef Q_OS_LINUX + #ifdef Q_WS_X11 #include <QStyleFactory> - #endif // Q_OS_LINUX + #endif // Q_WS_X11 #include <QTranslator> #else #include <KAboutData> @@ -112,13 +112,13 @@ QApplication::setApplicationName("KShutdown"); KShutdownApplication program(argc, argv); - #ifdef Q_OS_LINUX + #ifdef Q_WS_X11 if (Utils::isGNOME() || Utils::isXfce()) { QStyle *gtkStyle = QStyleFactory::create("gtk+"); if (gtkStyle) QApplication::setStyle(gtkStyle); } - #endif // Q_OS_LINUX + #endif //WS_X111 // init i18n QString lang = QLocale::system().name(); --- a/src/triggers/processmonitor.cpp +++ b/src/triggers/processmonitor.cpp @@ -182,11 +182,9 @@ // show all processes args << "-A"; // order: user pid command - args << "-o" << "user="; - args << "-o" << "pid="; - args << "-o" << "comm="; + args << "-o" << "user=,pid=command="; // sort by command - args << "--sort" << "comm"; + args << "--sort" << "command"; // start process m_refreshProcess->start("ps", args); --- a/src/triggers/processmonitor.h +++ b/src/triggers/processmonitor.h @@ -18,7 +18,7 @@ #ifndef KSHUTDOWN_PROCESSMONITOR_H #define KSHUTDOWN_PROCESSMONITOR_H -#ifdef Q_OS_LINUX +#if defined(Q_OS_LINUX) || defined(__FreeBSD_kernel__) || defined(Q_OS_HURD) #define KS_TRIGGER_PROCESS_MONITOR #endif // Q_OS_LINUX