Commit 10fff7e1 authored by Daan De Meyer's avatar Daan De Meyer

Add source file for katewaiter.h.

parent 65ae3c28
......@@ -42,6 +42,7 @@ set (KATE_LIBRARY_SRCS
katerunninginstanceinfo.cpp
katequickopen.cpp
katewaiter.h
katewaiter.cpp
)
ki18n_wrap_ui(KATE_LIBRARY_SRCS
......
/* This file is part of the KDE project
Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
Copyright (C) 2001, 2005 Anders Lund <anders.lund@lund.tdcadsl.dk>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "katewaiter.h"
KateWaiter::KateWaiter(const QString &service, const QStringList &tokens)
: QObject(QCoreApplication::instance())
, m_tokens(tokens)
, m_watcher(service, QDBusConnection::sessionBus())
{
connect(&m_watcher, &QDBusServiceWatcher::serviceOwnerChanged, this, &KateWaiter::serviceOwnerChanged);
}
void KateWaiter::exiting()
{
QCoreApplication::instance()->quit();
}
void KateWaiter::documentClosed(const QString &token)
{
m_tokens.removeAll(token);
if (m_tokens.count() == 0) {
QCoreApplication::instance()->quit();
}
}
void KateWaiter::serviceOwnerChanged(const QString &, const QString &, const QString &)
{
QCoreApplication::instance()->quit();
}
\ No newline at end of file
......@@ -32,32 +32,14 @@ class KateWaiter : public QObject
Q_OBJECT
public:
KateWaiter(const QString &service, const QStringList &tokens)
: QObject(QCoreApplication::instance())
, m_tokens(tokens)
, m_watcher(service, QDBusConnection::sessionBus())
{
connect(&m_watcher, &QDBusServiceWatcher::serviceOwnerChanged, this, &KateWaiter::serviceOwnerChanged);
}
KateWaiter(const QString &service, const QStringList &tokens);
public Q_SLOTS:
void exiting()
{
QCoreApplication::instance()->quit();
}
void exiting();
void documentClosed(const QString &token)
{
m_tokens.removeAll(token);
if (m_tokens.count() == 0) {
QCoreApplication::instance()->quit();
}
}
void documentClosed(const QString &token);
void serviceOwnerChanged(const QString &, const QString &, const QString &)
{
QCoreApplication::instance()->quit();
}
void serviceOwnerChanged(const QString &, const QString &, const QString &);
private:
QStringList m_tokens;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment