akonadi
20 #include "xmlwritejob.h"
22 #include <akonadi/collection.h>
23 #include <akonadi/collectionpathresolver_p.h>
26 #include <KApplication>
27 #include <KCmdLineArgs>
30 using namespace Akonadi;
32 int main(
int argc,
char *argv[] )
34 KAboutData aboutdata(
"akonadi2xml", 0,
35 ki18n(
"Akonadi To XML converter" ),
37 ki18n(
"Converts an Akonadi collection subtree into a XML file." ),
38 KAboutData::License_GPL,
39 ki18n(
"(c) 2009 Volker Krause <vkrause@kde.org>" ) );
41 KCmdLineArgs::init( argc, argv, &aboutdata );
42 KCmdLineOptions options;
43 options.add(
"c" ).add(
"collection <root>", ki18n(
"Root collection id or path" ) );
44 options.add(
"o" ).add(
"output <file>", ki18n(
"Output file" ) );
45 KCmdLineArgs::addCmdLineOptions( options );
48 const KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
51 if ( args->isSet(
"collection" ) ) {
52 const QString path = args->getOption(
"collection" );
54 if ( !resolver.exec() ) {
55 kError() << resolver.errorString();
62 XmlWriteJob writer( root, args->getOption(
"output" ) );
63 if ( !writer.exec() ) {
64 kError() << writer.exec();
Serializes a given Akonadi collection into a XML file.
Represents a collection of PIM items.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:38:02 by
doxygen 1.8.7 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.