From eb28bc06952667eb2ccfaea1f5c9e5ca36da57da Mon Sep 17 00:00:00 2001 From: Montel Laurent Date: Fri, 14 Nov 2014 13:09:33 +0100 Subject: [PATCH] Use new connect api --- dataengines/dict/dictengine.cpp | 8 ++++---- dataengines/filebrowser/filebrowserengine.cpp | 9 +++------ dataengines/keystate/keystate.cpp | 13 ++++++------- 3 files changed, 13 insertions(+), 17 deletions(-) diff --git a/dataengines/dict/dictengine.cpp b/dataengines/dict/dictengine.cpp index 1b83cde35..f94ab8f3a 100644 --- a/dataengines/dict/dictengine.cpp +++ b/dataengines/dict/dictengine.cpp @@ -116,7 +116,7 @@ void DictEngine::getDefinition() ret += m_tcpSocket->readAll(); } - connect(m_tcpSocket, SIGNAL(disconnected()), this, SLOT(socketClosed())); + connect(m_tcpSocket, &QTcpSocket::disconnected, this, &DictEngine::socketClosed); m_tcpSocket->disconnectFromHost(); // setData(m_currentWord, m_dictName, ret); // qWarning()<abort(); - connect(m_tcpSocket, SIGNAL(disconnected()), this, SLOT(socketClosed())); + connect(m_tcpSocket, &QTcpSocket::disconnected, this, &DictEngine::socketClosed); if (m_currentWord == "list-dictionaries") { - connect(m_tcpSocket, SIGNAL(readyRead()), this, SLOT(getDicts())); + connect(m_tcpSocket, &QTcpSocket::readyRead, this, &DictEngine::getDicts); } else { - connect(m_tcpSocket, SIGNAL(readyRead()), this, SLOT(getDefinition())); + connect(m_tcpSocket, &QTcpSocket::readyRead, this, &DictEngine::getDefinition); } m_tcpSocket->connectToHost(m_serverName, 2628); diff --git a/dataengines/filebrowser/filebrowserengine.cpp b/dataengines/filebrowser/filebrowserengine.cpp index 6c04aa073..0088ea9b0 100644 --- a/dataengines/filebrowser/filebrowserengine.cpp +++ b/dataengines/filebrowser/filebrowserengine.cpp @@ -36,12 +36,9 @@ FileBrowserEngine::FileBrowserEngine(QObject* parent, const QVariantList& args) Q_UNUSED(args) m_dirWatch = new KDirWatch(this); - connect(m_dirWatch, SIGNAL(created( - const QString &)), this, SLOT(dirCreated(QString))); - connect(m_dirWatch, SIGNAL(deleted( - const QString &)), this, SLOT(dirDeleted(QString))); - connect(m_dirWatch, SIGNAL(dirty( - const QString &)), this, SLOT(dirDirty(QString))); + connect(m_dirWatch, &KDirWatch::created, this, &FileBrowserEngine::dirCreated); + connect(m_dirWatch, &KDirWatch::deleted, this, &FileBrowserEngine::dirDeleted); + connect(m_dirWatch, &KDirWatch::dirty, this, &FileBrowserEngine::dirDirty); } FileBrowserEngine::~FileBrowserEngine() diff --git a/dataengines/keystate/keystate.cpp b/dataengines/keystate/keystate.cpp index f7a5c2446..92a10321c 100644 --- a/dataengines/keystate/keystate.cpp +++ b/dataengines/keystate/keystate.cpp @@ -71,13 +71,12 @@ void KeyStatesEngine::init() setData(it2.value(), data); } - connect(&m_keyInfo, SIGNAL(keyPressed(Qt::Key,bool)), this, SLOT(keyPressed(Qt::Key,bool))); - connect(&m_keyInfo, SIGNAL(keyLatched(Qt::Key,bool)), this, SLOT(keyLatched(Qt::Key,bool))); - connect(&m_keyInfo, SIGNAL(keyLocked(Qt::Key,bool)), this, SLOT(keyLocked(Qt::Key,bool))); - connect(&m_keyInfo, SIGNAL(buttonPressed(Qt::MouseButton,bool)), - this, SLOT(mouseButtonPressed(Qt::MouseButton,bool))); - connect(&m_keyInfo, SIGNAL(keyAdded(Qt::Key)), this, SLOT(keyAdded(Qt::Key))); - connect(&m_keyInfo, SIGNAL(keyRemoved(Qt::Key)), this, SLOT(keyRemoved(Qt::Key))); + connect(&m_keyInfo, &KModifierKeyInfo::keyPressed, this, &KeyStatesEngine::keyPressed); + connect(&m_keyInfo, &KModifierKeyInfo::keyLatched, this, &KeyStatesEngine::keyLatched); + connect(&m_keyInfo, &KModifierKeyInfo::keyLocked, this, &KeyStatesEngine::keyLocked); + connect(&m_keyInfo, &KModifierKeyInfo::buttonPressed, this, &KeyStatesEngine::mouseButtonPressed); + connect(&m_keyInfo, &KModifierKeyInfo::keyAdded, this, &KeyStatesEngine::keyAdded); + connect(&m_keyInfo, &KModifierKeyInfo::keyRemoved, this, &KeyStatesEngine::keyRemoved); } Plasma::Service *KeyStatesEngine::serviceForSource(const QString &source)