check_include_files(sys/sockio.h HAVE_SYS_SOCKIO_H)
check_symbol_exists(sysinfo "sys/sysinfo.h" HAVE_SYSINFO)
-check_symbol_exists(systeminfo "sys/systeminfo.h" HAVE_SYS_SYSTEMINFO)
-check_symbol_exists(getdomainname "unistd.h" HAVE_GETDOMAINNAME)
check_function_exists(initgroups HAVE_INITGROUPS)
check_function_exists(mkstemp HAVE_MKSTEMP)
/* Define to 1 if `sin_len' is member of `struct sockaddr_in'. */
#cmakedefine HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
-/* Define if you have getdomainname */
-#cmakedefine HAVE_GETDOMAINNAME 1
-
/* Define to 1 if you have the <termio.h> header file. */
#cmakedefine HAVE_TERMIO_H 1
macro_add_file_dependencies(kdmconfig.h ${confci})
macro_add_file_dependencies(kdmconfig.cpp ${confci})
add_executable(kdm_greet ${kdm_greet_SRCS})
-target_link_libraries(kdm_greet ${KDE4_KDEUI_LIBS} ${QT_QTXML_LIBRARY} ${X11_X11_LIB})
+target_link_libraries(kdm_greet
+ ${KDE4_KDEUI_LIBS}
+ ${QT_QTXML_LIBRARY}
+ ${QT_QTNETWORK_LIBRARY}
+ ${X11_X11_LIB}
+)
if (X11_XTest_FOUND)
- target_link_libraries(kdm_greet ${X11_XTest_LIB})
+ target_link_libraries(kdm_greet ${X11_XTest_LIB})
endif (X11_XTest_FOUND)
if (WITH_KDM_XCONSOLE)
- target_link_libraries(kdm_greet ${KDE4_KPTY_LIBS})
+ target_link_libraries(kdm_greet ${KDE4_KPTY_LIBS})
endif (WITH_KDM_XCONSOLE)
add_dependencies(kdm_greet ConfigCi)
#include <QHash>
#include <QPainter>
#include <QTimer>
+#include <QHostInfo>
#include <QtGui/qx11info_x11.h>
#include <X11/Xlib.h>
#include <unistd.h>
#include <sys/utsname.h>
-#if !defined(HAVE_GETDOMAINNAME) && defined(HAVE_SYS_SYSTEMINFO)
-# include <sys/systeminfo.h>
-#endif
KdmLabel::KdmLabel(QObject *parent, const QDomNode &node)
: KdmItem(parent, node)
expandoMap['s'] = QString::fromLocal8Bit(uts.sysname);
expandoMap['r'] = QString::fromLocal8Bit(uts.release);
expandoMap['m'] = QString::fromLocal8Bit(uts.machine);
- char buf[256];
- buf[sizeof(buf) - 1] = '\0';
- expandoMap['h'] = gethostname(buf, sizeof(buf) - 1) ? "localhost" : QString::fromLocal8Bit(buf);
-#ifdef HAVE_GETDOMAINNAME
- expandoMap['o'] = getdomainname(buf, sizeof(buf) - 1) ? "localdomain" : QString::fromLocal8Bit(buf);
-#elif defined(HAVE_SYS_SYSTEMINFO)
- expandoMap['o'] = (unsigned)sysinfo(SI_SRPC_DOMAIN, buf, sizeof(buf)) > sizeof(buf) ? "localdomain" : QString::fromLocal8Bit(buf);
-#endif
+ QString hostname = QHostInfo::localHostName();
+ if (hostname.isEmpty()) {
+ hostname = QLatin1String("localhost");
+ }
+ QString domainname = QHostInfo::localDomainName();
+ if (domainname.isEmpty()) {
+ domainname = QLatin1String("localdomain");
+ }
+ expandoMap['h'] = hostname;
+ expandoMap['o'] = domainname;
}
QHash<QChar, QString>::const_iterator mi = expandoMap.constFind(chr);
if (mi != expandoMap.constEnd()) {
bool ProcessesLocal::sendSignal(long pid, int sig)
{
- if (:;kill((pid_t)pid, sig) == -1) {
+ if (::kill((pid_t)pid, sig) == -1) {
// kill failed
return false;
}
)
kde4_add_plugin(plasma_applet_launcher ${Applet_SRCS})
-target_link_libraries(plasma_applet_launcher ${KDE4_PLASMA_LIBS} ${Kickoff_LIBS} kickoff)
-install(TARGETS plasma_applet_launcher DESTINATION ${KDE4_PLUGIN_INSTALL_DIR})
-install(FILES applet/plasma-applet-launcher.desktop DESTINATION ${KDE4_SERVICES_INSTALL_DIR})
+target_link_libraries(plasma_applet_launcher
+ ${KDE4_PLASMA_LIBS}
+ ${QT_QTNETWORK_LIBRARY}
+ ${Kickoff_LIBS}
+ kickoff
+)
+install(
+ TARGETS plasma_applet_launcher
+ DESTINATION ${KDE4_PLUGIN_INSTALL_DIR}
+)
+install(
+ FILES applet/plasma-applet-launcher.desktop
+ DESTINATION ${KDE4_SERVICES_INSTALL_DIR}
+)
#######################################################################################
# Kickoff Simple KMenu Plasma Applet
simpleapplet/simpleapplet.cpp
)
kde4_add_plugin(plasma_applet_simplelauncher ${SimpleApplet_SRCS})
-target_link_libraries(plasma_applet_simplelauncher ${KDE4_KCMUTILS_LIBS} ${KDE4_PLASMA_LIBS} ${Kickoff_LIBS} kickoff)
-install(TARGETS plasma_applet_simplelauncher DESTINATION ${KDE4_PLUGIN_INSTALL_DIR})
-install(FILES simpleapplet/plasma-applet-simplelauncher.desktop DESTINATION ${KDE4_SERVICES_INSTALL_DIR})
+target_link_libraries(plasma_applet_simplelauncher
+ ${KDE4_KCMUTILS_LIBS}
+ ${KDE4_PLASMA_LIBS}
+ ${Kickoff_LIBS}
+ kickoff
+)
+install(
+ TARGETS plasma_applet_simplelauncher
+ DESTINATION ${KDE4_PLUGIN_INSTALL_DIR}
+)
+install(
+ FILES simpleapplet/plasma-applet-simplelauncher.desktop
+ DESTINATION ${KDE4_SERVICES_INSTALL_DIR}
+)
# Kickoff Standalone Test Application
#IF (CMAKE_BUILD_TYPE MATCHES Debug)
#include "ui/launcher.h"
-// System
-#include <unistd.h>
-
// Qt
#include <QApplication>
#include <QtGui/qevent.h>
#include <QTabBar>
#include <QToolButton>
#include <QVBoxLayout>
+#include <QHostInfo>
// KDE
#include <KDebug>
// Add status information footer
d->footer = new QWidget;
- char hostname[256];
- hostname[0] = '\0';
- if (!gethostname(hostname, sizeof(hostname))) {
- hostname[sizeof(hostname)-1] = '\0';
- }
+ const QString hostname = QHostInfo::localHostName();
KUser user;
QString fullName = user.property(KUser::FullName).toString();
QString labelText;