diff --git a/ksmserver/client.cpp b/ksmserver/client.cpp --- a/ksmserver/client.cpp +++ b/ksmserver/client.cpp @@ -89,7 +89,7 @@ char* ret = NULL; if (!ret) { if (my_addr->isEmpty()) { -// qWarning("Can't get own host name. Your system is severely misconfigured\n"); +// qCWarning(KSMSERVER, "Can't get own host name. Your system is severely misconfigured\n"); /* Faking our IP address, the 0 below is "unknown" address format (1 would be IP, 2 would be DEC-NET format) */ diff --git a/ksmserver/logout-greeter/CMakeLists.txt b/ksmserver/logout-greeter/CMakeLists.txt --- a/ksmserver/logout-greeter/CMakeLists.txt +++ b/ksmserver/logout-greeter/CMakeLists.txt @@ -1,4 +1,4 @@ -set(KSMSERVER_LOGOUT_GREETER_SRCS main.cpp ../shutdowndlg.cpp) +set(KSMSERVER_LOGOUT_GREETER_SRCS main.cpp ../shutdowndlg.cpp ../ksmserver_debug.cpp) add_executable(ksmserver-logout-greeter ${KSMSERVER_LOGOUT_GREETER_SRCS}) target_link_libraries(ksmserver-logout-greeter PW::KWorkspace diff --git a/ksmserver/main.cpp b/ksmserver/main.cpp --- a/ksmserver/main.cpp +++ b/ksmserver/main.cpp @@ -40,6 +40,7 @@ #include #include #include +#include #include "server.h" #include @@ -89,7 +90,7 @@ dpy = XOpenDisplay(0); // open default display if (!dpy) { - qCritical() << "Cannot connect to the X server"; + qCCritical(KSMSERVER) << "Cannot connect to the X server"; return; } @@ -288,7 +289,7 @@ // registerService( QStringLiteral( "org.kde.ksmserver" ), // QDBusConnectionInterface::DontQueueService ) ) // { -// qWarning("Could not register with D-BUS. Aborting."); +// qCWarning(KSMSERVER, "Could not register with D-BUS. Aborting."); // return 1; // } @@ -301,7 +302,7 @@ * does nothing on this platform, as here the default is reversed) */ if (!only_local) { - qWarning("--nolocal is not supported on your platform. Sorry."); + qCWarning(KSMSERVER, "--nolocal is not supported on your platform. Sorry."); } only_local = false; #endif diff --git a/ksmserver/server.cpp b/ksmserver/server.cpp --- a/ksmserver/server.cpp +++ b/ksmserver/server.cpp @@ -457,7 +457,7 @@ QString iceAuth = QStandardPaths::findExecutable(QStringLiteral("iceauth")); if (iceAuth.isEmpty()) { - qWarning("KSMServer: could not find iceauth"); + qCWarning(KSMSERVER, "KSMServer: could not find iceauth"); return 0; } @@ -487,7 +487,7 @@ QString iceAuth = QStandardPaths::findExecutable(QStringLiteral("iceauth")); if (iceAuth.isEmpty()) { - qWarning("KSMServer: could not find iceauth"); + qCWarning(KSMSERVER, "KSMServer: could not find iceauth"); return; } @@ -504,7 +504,7 @@ static int Xio_ErrorHandler( Display * ) { - qWarning("ksmserver: Fatal IO error: client killed"); + qCWarning(KSMSERVER, "ksmserver: Fatal IO error: client killed"); // Don't do anything that might require the X connection if (the_server) @@ -650,14 +650,14 @@ (SmPointer) this, HostBasedAuthProc, 256, errormsg ) ) { - qWarning("KSMServer: could not register XSM protocol"); + qCWarning(KSMSERVER, "KSMServer: could not register XSM protocol"); } if (!IceListenForConnections (&numTransports, &listenObjs, 256, errormsg)) { - qWarning("KSMServer: Error listening for connections: %s", errormsg); - qWarning("KSMServer: Aborting."); + qCWarning(KSMSERVER, "KSMServer: Error listening for connections: %s", errormsg); + qCWarning(KSMSERVER, "KSMServer: Aborting."); exit(1); } @@ -681,8 +681,8 @@ f = ::fopen(fName.data(), "w+"); if (!f) { - qWarning("KSMServer: cannot open %s: %s", fName.data(), strerror(errno)); - qWarning("KSMServer: Aborting."); + qCWarning(KSMSERVER, "KSMServer: cannot open %s: %s", fName.data(), strerror(errno)); + qCWarning(KSMSERVER, "KSMServer: Aborting."); exit(1); } char* session_manager = IceComposeNetworkIdList(numTransports, listenObjs); diff --git a/ksmserver/shutdown.cpp b/ksmserver/shutdown.cpp --- a/ksmserver/shutdown.cpp +++ b/ksmserver/shutdown.cpp @@ -129,7 +129,7 @@ void KSMServer::shutdown( KWorkSpace::ShutdownConfirm confirm, KWorkSpace::ShutdownType sdtype, KWorkSpace::ShutdownMode sdmode ) { - qDebug() << "Shutdown called with confirm " << confirm + qCDebug(KSMSERVER) << "Shutdown called with confirm " << confirm << " type " << sdtype << " and mode " << sdmode; pendingShutdown.stop(); if( dialogActive ) @@ -176,7 +176,7 @@ if (sdmode == KWorkSpace::ShutdownModeDefault) sdmode = KWorkSpace::ShutdownModeInteractive; - qDebug() << "After modifications confirm is " << confirm + qCDebug(KSMSERVER) << "After modifications confirm is " << confirm << " type is " << sdtype << " and mode " << sdmode; QString bopt; if ( !logoutConfirmed ) { @@ -270,7 +270,7 @@ QStringLiteral( "restorePreviousLogout" ) ) == QStringLiteral( "restorePreviousLogout" ) ); - qDebug() << "saveSession is " << saveSession; + qCDebug(KSMSERVER) << "saveSession is " << saveSession; if ( saveSession ) sessionGroup = QStringLiteral( "Session: " ) + QString::fromLocal8Bit( SESSION_PREVIOUS_LOGOUT ); @@ -317,7 +317,7 @@ SmsSaveYourself( c->connection(), saveType, true, SmInteractStyleAny, false ); } - qDebug() << "clients should be empty, " << clients.isEmpty(); + qCDebug(KSMSERVER) << "clients should be empty, " << clients.isEmpty(); if ( clients.isEmpty() ) completeShutdownOrCheckpoint(); dialogActive = false; @@ -532,7 +532,7 @@ void KSMServer::completeShutdownOrCheckpoint() { - qDebug() << "completeShutdownOrCheckpoint called"; + qCDebug(KSMSERVER) << "completeShutdownOrCheckpoint called"; if ( state != Shutdown && state != Checkpoint && state != ClosingSubSession ) return; @@ -564,7 +564,7 @@ else discardSession(); - qDebug() << "state is " << state; + qCDebug(KSMSERVER) << "state is " << state; if ( state == Shutdown ) { KNotification *n = KNotification::event(QStringLiteral("exitkde"), QString(), QPixmap(), 0l, KNotification::DefaultEvent); // Plasma says good bye connect(n, &KNotification::closed, this, &KSMServer::startKilling); @@ -605,7 +605,7 @@ foreach( KSMClient* c, clients ) { if( isWM( c )) // kill the WM as the last one in order to reduce flicker continue; - qCDebug(KSMSERVER) << "completeShutdown: client " << c->program() << "(" << c->clientId() << ")"; + qCDebug(KSMSERVER) << "startKilling: client " << c->program() << "(" << c->clientId() << ")"; SmsDie( c->connection() ); } @@ -675,15 +675,15 @@ void KSMServer::timeoutQuit() { foreach( KSMClient* c, clients ) { - qWarning() << "SmsDie timeout, client " << c->program() << "(" << c->clientId() << ")" ; + qCWarning(KSMSERVER) << "SmsDie timeout, client " << c->program() << "(" << c->clientId() << ")" ; } killWM(); } void KSMServer::timeoutWMQuit() { if( state == KillingWM ) { - qWarning() << "SmsDie WM timeout" ; + qCWarning(KSMSERVER) << "SmsDie WM timeout" ; } killingCompleted(); } diff --git a/ksmserver/shutdowndlg.cpp b/ksmserver/shutdowndlg.cpp --- a/ksmserver/shutdowndlg.cpp +++ b/ksmserver/shutdowndlg.cpp @@ -24,7 +24,7 @@ ******************************************************************/ #include "shutdowndlg.h" -//include +#include "ksmserver_debug.h" #include #include @@ -172,12 +172,12 @@ //qCDebug(KSMSERVER) << "Using QML theme" << fileName; setSource(QUrl::fromLocalFile(fileName)); } else { - qWarning() << "Couldn't find a theme for the Shutdown dialog" << fileName; + qCWarning(KSMSERVER) << "Couldn't find a theme for the Shutdown dialog" << fileName; return; } if(!errors().isEmpty()) { - qWarning() << errors(); + qCWarning(KSMSERVER) << errors(); } connect(rootObject(), SIGNAL(logoutRequested()), SLOT(slotLogout())); diff --git a/ksmserver/startup.cpp b/ksmserver/startup.cpp --- a/ksmserver/startup.cpp +++ b/ksmserver/startup.cpp @@ -110,16 +110,16 @@ QString soundFilename = notifyConfig.readEntry(QStringLiteral("Sound")); if (soundFilename.isEmpty()) { - qWarning() << "Audio notification requested, but no sound file provided in notifyrc file, aborting audio notification"; + qCWarning(KSMSERVER) << "Audio notification requested, but no sound file provided in notifyrc file, aborting audio notification"; return; } QUrl soundURL = QUrl(soundFilename); // this CTOR accepts both absolute paths (/usr/share/sounds/blabla.ogg and blabla.ogg) w/o screwing the scheme if (soundURL.isRelative() && !soundURL.toString().startsWith('/')) { // QUrl considers url.scheme.isEmpty() == url.isRelative() soundURL = QUrl::fromLocalFile(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("sounds/") + soundFilename)); if (soundURL.isEmpty()) { - qWarning() << "Audio notification requested, but sound file from notifyrc file was not found, aborting audio notification"; + qCWarning(KSMSERVER) << "Audio notification requested, but sound file from notifyrc file was not found, aborting audio notification"; return; } } @@ -222,7 +222,7 @@ } if( wmProcess->state() == QProcess::NotRunning ) { // wm failed to launch for some reason, go with kwin instead - qWarning() << "Window manager" << wm << "failed to launch"; + qCWarning(KSMSERVER) << "Window manager" << wm << "failed to launch"; if( wm == QStringLiteral( KWIN_BIN ) ) return; // uhoh, kwin itself failed qCDebug(KSMSERVER) << "Launching KWin"; @@ -265,7 +265,7 @@ QStringLiteral( "org.kde.KCMInit" ), QDBusConnection::sessionBus(), this ); if( !kcminitSignals->isValid()) { - qWarning() << "kcminit not running? If we are running with mobile profile or in another platform other than X11 this is normal."; + qCWarning(KSMSERVER) << "kcminit not running? If we are running with mobile profile or in another platform other than X11 this is normal."; delete kcminitSignals; kcminitSignals = 0; QTimer::singleShot(0, this, &KSMServer::kcmPhase1Done); @@ -611,7 +611,7 @@ autoStart2(); break; default: - qWarning() << "Unknown resume startup state" ; + qCWarning(KSMSERVER) << "Unknown resume startup state" ; break; } } diff --git a/ksmserver/switchuserdialog.cpp b/ksmserver/switchuserdialog.cpp --- a/ksmserver/switchuserdialog.cpp +++ b/ksmserver/switchuserdialog.cpp @@ -21,6 +21,7 @@ #include "switchuserdialog.h" #include +#include #include #include @@ -91,15 +92,15 @@ if (QFile::exists(fileName)) { setSource(QUrl::fromLocalFile(fileName)); } else { - qWarning() << "Couldn't find a theme for the Switch User dialog" << fileName; + qCWarning(KSMSERVER) << "Couldn't find a theme for the Switch User dialog" << fileName; return; } setPosition(screen()->virtualGeometry().center().x() - width() / 2, screen()->virtualGeometry().center().y() - height() / 2); if (!errors().isEmpty()) { - qWarning() << errors(); + qCWarning(KSMSERVER) << errors(); } connect(rootObject(), SIGNAL(dismissed()), this, SIGNAL(dismissed()));