File indexing completed on 2024-11-24 04:39:16

0001 /*
0002    SPDX-FileCopyrightText: 2023-2024 Laurent Montel <montel.org>
0003 
0004    SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #include "notificationobject.h"
0008 #include <QApplication>
0009 #include <QCommandLineParser>
0010 #include <QStandardPaths>
0011 #include <QTimer>
0012 
0013 int main(int argc, char **argv)
0014 {
0015     QApplication app(argc, argv);
0016     QStandardPaths::setTestModeEnabled(true);
0017     QCommandLineParser parser;
0018     parser.addVersionOption();
0019     parser.addHelpOption();
0020     parser.process(app);
0021 
0022     NotificationObject *obj = new NotificationObject;
0023     obj->sendNotification(QStringLiteral("ff"), QStringLiteral("ddsdfsf"));
0024     QTimer *timer = new QTimer;
0025     timer->setInterval(5000);
0026     QObject::connect(timer, &QTimer::timeout, obj, [obj, timer]() {
0027         static int value = 0;
0028         obj->sendNotification(QStringLiteral("title %1").arg(value), QStringLiteral("message %1").arg(value));
0029         timer->start();
0030         value++;
0031     });
0032     timer->start();
0033 
0034     // TODO
0035     return app.exec();
0036 }