Akonadi

asapcat/main.cpp
1 /***************************************************************************
2  * SPDX-FileCopyrightText: 2013 Volker Krause <[email protected]> *
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 
13 int 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 }
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
ASAP CLI session.
QCoreApplication * instance()
QueuedConnection
bool isEmpty() const const
bool invokeMethod(QObject *obj, const char *member, Qt::ConnectionType type, QGenericReturnArgument ret, QGenericArgument val0, QGenericArgument val1, QGenericArgument val2, QGenericArgument val3, QGenericArgument val4, QGenericArgument val5, QGenericArgument val6, QGenericArgument val7, QGenericArgument val8, QGenericArgument val9)
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Jun 30 2022 03:51:46 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.