File indexing completed on 2024-04-28 05:49:20
0001 /* 0002 SPDX-FileCopyrightText: 2005 Christoph Cullmann <cullmann@kde.org> 0003 SPDX-FileCopyrightText: 2002, 2003 Joseph Wenninger <jowenn@kde.org> 0004 0005 SPDX-License-Identifier: LGPL-2.0-or-later 0006 */ 0007 0008 #include "katewaiter.h" 0009 0010 KateWaiter::KateWaiter(const QString &service, const QStringList &tokens) 0011 : QObject(QCoreApplication::instance()) 0012 , m_tokens(tokens) 0013 , m_watcher(service, QDBusConnection::sessionBus()) 0014 { 0015 connect(&m_watcher, &QDBusServiceWatcher::serviceOwnerChanged, this, &KateWaiter::serviceOwnerChanged); 0016 } 0017 0018 void KateWaiter::exiting() 0019 { 0020 QCoreApplication::instance()->exit(); 0021 } 0022 0023 void KateWaiter::documentClosed(const QString &token) 0024 { 0025 m_tokens.removeAll(token); 0026 if (m_tokens.count() == 0) { 0027 QCoreApplication::instance()->exit(); 0028 } 0029 } 0030 0031 void KateWaiter::serviceOwnerChanged(const QString &, const QString &, const QString &) 0032 { 0033 QCoreApplication::instance()->exit(); 0034 } 0035 0036 #include "moc_katewaiter.cpp"