Akonadi

asapcat/main.cpp
1/***************************************************************************
2 * SPDX-FileCopyrightText: 2013 Volker Krause <vkrause@kde.org> *
3 * *
4 * SPDX-License-Identifier: LGPL-2.0-or-later *
5 ***************************************************************************/
6
7#include "session.h"
8
9#include "shared/akapplication.h"
10
11#include <QCoreApplication>
12
13int main(int argc, char **argv)
14{
15 AkCoreApplication app(argc, argv);
16 app.setDescription(
17 QStringLiteral("Akonadi ASAP cat\n"
18 "This is a development tool, only use this if you know what you are doing."));
19
20 app.addPositionalCommandLineOption(QStringLiteral("input"), QStringLiteral("Input file to read commands from"));
21 app.parseCommandLine();
22
23 const QStringList args = app.commandLineArguments().positionalArguments();
24 if (args.isEmpty()) {
25 app.printUsage();
26 return -1;
27 }
28
29 Session session(args[0]);
30 QObject::connect(&session, &Session::disconnected, QCoreApplication::instance(), &QCoreApplication::quit);
31 QMetaObject::invokeMethod(&session, &Session::connectToHost, Qt::QueuedConnection);
32
33 const int result = app.exec();
34 session.printStats();
35 return result;
36}
ASAP CLI session.
QCoreApplication * instance()
bool isEmpty() const const
bool invokeMethod(QObject *context, Functor &&function, FunctorReturnType *ret)
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
QueuedConnection
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:08:30 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.