[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [plasma-workspace] ksmserver: Port to new connect api
From:       Montel Laurent <montel () kde ! org>
Date:       2014-10-31 22:05:55
Message-ID: E1XkKKR-000300-B3 () scm ! kde ! org
[Download RAW message or body]

Git commit ced76f603801a910f5746b03017f9d1cee2c745a by Montel Laurent.
Committed on 31/10/2014 at 22:04.
Pushed by mlaurent into branch 'master'.

Port to new connect api

M  +3    -5    ksmserver/screenlocker/greeter/greeterapp.cpp
M  +0    -1    ksmserver/screenlocker/greeter/sessions.cpp
M  +3    -4    ksmserver/screenlocker/interface.cpp
M  +1    -2    ksmserver/screenlocker/ksldapp.cpp
M  +14   -14   ksmserver/server.cpp
M  +0    -1    ksmserver/shutdowndlg.cpp

http://commits.kde.org/plasma-workspace/ced76f603801a910f5746b03017f9d1cee2c745a

diff --git a/ksmserver/screenlocker/greeter/greeterapp.cpp \
b/ksmserver/screenlocker/greeter/greeterapp.cpp index fd1d20b..a32f1ef 100644
--- a/ksmserver/screenlocker/greeter/greeterapp.cpp
+++ b/ksmserver/screenlocker/greeter/greeterapp.cpp
@@ -75,7 +75,7 @@ UnlockApp::UnlockApp(int &argc, char **argv)
 {
     connect(m_authenticator, &Authenticator::succeeded, this, \
&QCoreApplication::quit);  initialize();
-    connect(this, SIGNAL(screenAdded(QScreen*)), SLOT(desktopResized()));
+    connect(this, &UnlockApp::screenAdded, this, &UnlockApp::desktopResized);
 }
 
 UnlockApp::~UnlockApp()
@@ -95,7 +95,7 @@ void UnlockApp::initialize()
     // are not processed in quick (and confusing) succession)
     m_resetRequestIgnoreTimer->setSingleShot(true);
     m_resetRequestIgnoreTimer->setInterval(2000);
-    connect(m_resetRequestIgnoreTimer, SIGNAL(timeout()), this, \
SLOT(resetRequestIgnore())); +    connect(m_resetRequestIgnoreTimer, \
&QTimer::timeout, this, &UnlockApp::resetRequestIgnore);  
     // disable DrKonqi as the crash dialog blocks the restart of the locker
     KCrash::setDrKonqiEnabled(false);
@@ -146,8 +146,7 @@ void UnlockApp::desktopResized()
         connect(QGuiApplication::screens()[i], SIGNAL(destroyed(QObject*)), \
SLOT(desktopResized()));  // create the view
         QQuickView *view = new QQuickView();
-        connect(view, SIGNAL(statusChanged(QQuickView::Status)),
-                this, SLOT(viewStatusChanged(QQuickView::Status)));
+        connect(view, &QQuickView::statusChanged, this, \
&UnlockApp::viewStatusChanged);  
         if (!m_testing) {
             view->setFlags(Qt::X11BypassWindowManagerHint);
@@ -416,4 +415,3 @@ void UnlockApp::setNoLock(bool noLock)
 
 } // namespace
 
-#include "greeterapp.moc"
diff --git a/ksmserver/screenlocker/greeter/sessions.cpp \
b/ksmserver/screenlocker/greeter/sessions.cpp index 8aaf09d..5f831d5 100644
--- a/ksmserver/screenlocker/greeter/sessions.cpp
+++ b/ksmserver/screenlocker/greeter/sessions.cpp
@@ -159,4 +159,3 @@ void SessionSwitching::activateSession(int index)
 
 }
 
-#include "sessions.moc"
diff --git a/ksmserver/screenlocker/interface.cpp \
b/ksmserver/screenlocker/interface.cpp index d8c20f1..3ee3f01 100644
--- a/ksmserver/screenlocker/interface.cpp
+++ b/ksmserver/screenlocker/interface.cpp
@@ -48,12 +48,12 @@ Interface::Interface(KSldApp *parent)
     QDBusConnection::sessionBus().registerService(QLatin1String("org.kde.screensaver"));
                
     QDBusConnection::sessionBus().registerObject(QLatin1String("/ScreenSaver"), \
                this);
     QDBusConnection::sessionBus().registerObject(QLatin1String("/org/freedesktop/ScreenSaver"), \
                this);
-    connect(m_daemon, SIGNAL(locked()), SLOT(slotLocked()));
-    connect(m_daemon, SIGNAL(unlocked()), SLOT(slotUnlocked()));
+    connect(m_daemon, &KSldApp::locked, this, &Interface::slotLocked);
+    connect(m_daemon, &KSldApp::unlocked, this, &Interface::slotUnlocked);
 
     m_serviceWatcher->setConnection(QDBusConnection::sessionBus());
     m_serviceWatcher->setWatchMode(QDBusServiceWatcher::WatchForUnregistration);
-    connect(m_serviceWatcher, SIGNAL(serviceUnregistered(QString)), \
SLOT(serviceUnregistered(QString))); +    connect(m_serviceWatcher, \
&QDBusServiceWatcher::serviceUnregistered, this, &Interface::serviceUnregistered);  
     // Also receive updates triggered through the DBus (from powerdevil) see Bug \
#177123  QStringList modules;
@@ -212,4 +212,3 @@ void Interface::sendLockReplies()
 
 } // namespace
 
-#include "interface.moc"
diff --git a/ksmserver/screenlocker/ksldapp.cpp b/ksmserver/screenlocker/ksldapp.cpp
index 04c7db3..22698ce 100644
--- a/ksmserver/screenlocker/ksldapp.cpp
+++ b/ksmserver/screenlocker/ksldapp.cpp
@@ -208,7 +208,7 @@ void KSldApp::initialize()
 
 void KSldApp::configure()
 {
-    KScreenSaverSettings::self()->readConfig();
+    KScreenSaverSettings::self()->load();
     // idle support
     if (m_idleId) {
         KIdleTime::instance()->removeIdleTimeout(m_idleId);
@@ -422,4 +422,3 @@ void KSldApp::uninhibit()
 }
 
 } // namespace
-#include "ksldapp.moc"
diff --git a/ksmserver/server.cpp b/ksmserver/server.cpp
index 5bdb7fd..d4fc6b5 100644
--- a/ksmserver/server.cpp
+++ b/ksmserver/server.cpp
@@ -71,6 +71,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE \
SOFTWARE.  #include <QStandardPaths>
 #include <QDebug>
 #include <QAction>
+#include <QApplication>
 
 #include <kactioncollection.h>
 #include <kauthorized.h>
@@ -82,7 +83,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE \
SOFTWARE.  #include <kprocess.h>
 #include <kshell.h>
 
-#include "server.moc"
 
 // must go after #include <config-ksmserver.h>
 #ifdef COMPILE_SCREEN_LOCKER
@@ -133,8 +133,8 @@ KProcess* KSMServer::startApplication( const QStringList& cmd, \
const QString& cl  KProcess* process = new KProcess( this );
         *process << command;
         // make it auto-delete
-        connect( process, SIGNAL(error(QProcess::ProcessError)), process, \
                SLOT(deleteLater()));
-        connect( process, SIGNAL(finished(int,QProcess::ExitStatus)), process, \
SLOT(deleteLater())); +        connect(process, static_cast<void \
(KProcess::*)(QProcess::ProcessError)>(&KProcess::error), process, \
&KProcess::deleteLater); +        connect(process, static_cast<void \
(KProcess::*)(int, QProcess::ExitStatus)>(&KProcess::finished), process, \
&KProcess::deleteLater);  process->start();
         return process;
     } else {
@@ -641,8 +641,8 @@ KSMServer::KSMServer( const QString& windowManager, bool \
                _only_local, bool locks
     //KGlobal::dirs()->addResourceType( "windowmanagers", "data", \
"ksmserver/windowmanagers" );  selectWm( windowManager );
 
-    connect( &startupSuspendTimeoutTimer, SIGNAL(timeout()), \
                SLOT(startupSuspendTimeout()));
-    connect( &pendingShutdown, SIGNAL(timeout()), SLOT(pendingShutdownTimeout()));
+    connect(&startupSuspendTimeoutTimer, &QTimer::timeout, this, \
&KSMServer::startupSuspendTimeout); +    connect(&pendingShutdown, &QTimer::timeout, \
this, &KSMServer::pendingShutdownTimeout);  
     only_local = _only_local;
 #ifdef HAVE__ICETRANSNOLISTEN
@@ -720,7 +720,7 @@ KSMServer::KSMServer( const QString& windowManager, bool \
                _only_local, bool locks
         fcntl( IceGetListenConnectionNumber( listenObjs[i] ), F_SETFD, FD_CLOEXEC );
         con = new KSMListener( listenObjs[i] );
         listener.append( con );
-        connect( con, SIGNAL(activated(int)), this, SLOT(newConnection(int)) );
+        connect(con, &KSMListener::activated, this, &KSMServer::newConnection);
     }
 
     signal(SIGHUP, sighandler);
@@ -728,9 +728,9 @@ KSMServer::KSMServer( const QString& windowManager, bool \
_only_local, bool locks  signal(SIGINT, sighandler);
     signal(SIGPIPE, SIG_IGN);
 
-    connect( &protectionTimer, SIGNAL(timeout()), this, SLOT(protectionTimeout()) );
-    connect( &restoreTimer, SIGNAL(timeout()), this, SLOT(tryRestoreNext()) );
-    connect( qApp, SIGNAL(aboutToQuit()), this, SLOT(cleanUp()) );
+    connect(&protectionTimer, &QTimer::timeout, this, \
&KSMServer::protectionTimeout); +    connect(&restoreTimer, &QTimer::timeout, this, \
&KSMServer::tryRestoreNext); +    connect(qApp, &QApplication::aboutToQuit, this, \
&KSMServer::cleanUp);  }
 
 KSMServer::~KSMServer()
@@ -771,7 +771,7 @@ void KSMServer::cleanUp()
 void* KSMServer::watchConnection( IceConn iceConn )
 {
     KSMConnection* conn = new KSMConnection( iceConn );
-    connect( conn, SIGNAL(activated(int)), this, SLOT(processData(int)) );
+    connect(conn, &KSMConnection::activated, this, &KSMServer::processData);
     return (void*) conn;
 }
 
@@ -1048,22 +1048,22 @@ void KSMServer::setupShortcuts()
         a = actionCollection->addAction(QStringLiteral("Log Out"));
         a->setText(i18n("Log Out"));
         KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << \
                Qt::ALT+Qt::CTRL+Qt::Key_Delete);
-        connect(a, SIGNAL(triggered(bool)), SLOT(defaultLogout()));
+        connect(a, &QAction::triggered, this, &KSMServer::defaultLogout);
 
         a = actionCollection->addAction(QStringLiteral("Log Out Without \
Confirmation"));  a->setText(i18n("Log Out Without Confirmation"));
         KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << \
                Qt::ALT+Qt::CTRL+Qt::SHIFT+Qt::Key_Delete);
-        connect(a, SIGNAL(triggered(bool)), SLOT(logoutWithoutConfirmation()));
+        connect(a, &QAction::triggered, this, \
&KSMServer::logoutWithoutConfirmation);  
         a = actionCollection->addAction(QStringLiteral("Halt Without \
Confirmation"));  a->setText(i18n("Halt Without Confirmation"));
         KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << \
                Qt::ALT+Qt::CTRL+Qt::SHIFT+Qt::Key_PageDown);
-        connect(a, SIGNAL(triggered(bool)), SLOT(haltWithoutConfirmation()));
+        connect(a, &QAction::triggered, this, &KSMServer::haltWithoutConfirmation);
 
         a = actionCollection->addAction(QStringLiteral("Reboot Without \
Confirmation"));  a->setText(i18n("Reboot Without Confirmation"));
         KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << \
                Qt::ALT+Qt::CTRL+Qt::SHIFT+Qt::Key_PageUp);
-        connect(a, SIGNAL(triggered(bool)), SLOT(rebootWithoutConfirmation()));
+        connect(a, &QAction::triggered, this, \
&KSMServer::rebootWithoutConfirmation);  }
 }
 
diff --git a/ksmserver/shutdowndlg.cpp b/ksmserver/shutdowndlg.cpp
index 73f345e..d4cedcb 100644
--- a/ksmserver/shutdowndlg.cpp
+++ b/ksmserver/shutdowndlg.cpp
@@ -62,7 +62,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE \
SOFTWARE.  #include <config-workspace.h>
 
 //#include "logouteffect.h"
-#include "shutdowndlg.moc"
 
 #include <kjob.h>
 #include <qstandardpaths.h>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic