File indexing completed on 2024-05-19 05:39:09

0001 /*
0002     SPDX-FileCopyrightText: 2017 Valerio Pilo <vpilo@coldshock.net>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-only
0005 */
0006 
0007 #pragma once
0008 
0009 #include <QCoreApplication>
0010 #include <QString>
0011 #include <QTimer>
0012 
0013 class Waiter : public QCoreApplication
0014 {
0015     Q_OBJECT
0016 
0017 public:
0018     Waiter(int argc, char **argv);
0019     bool waitForService();
0020 
0021 private Q_SLOTS:
0022     void registered();
0023     void timeout();
0024 
0025 private:
0026     constexpr static const int dbusTimeoutSec = 60;
0027 
0028     QString mService = QStringLiteral("org.freedesktop.Notifications");
0029     QTimer mTimeoutTimer;
0030 };