add more spacing
[personal-kdebase.git] / runtime / kwalletd / tests / kwalletsync.cpp
blobef993a1b8d7282769528e50b9caffbf59da32bf1
1 #include <QtCore/QTextStream>
2 #include <QtGui/QApplication>
3 #include <QtCore/QTimer>
5 #include <kaboutdata.h>
6 #include <kcomponentdata.h>
7 #include <kcmdlineargs.h>
8 #include <kdebug.h>
9 #include <kglobal.h>
10 #include <kstandarddirs.h>
11 #include <kwallet.h>
12 #include <QtDBus/QDBusConnectionInterface>
13 #include <QtDBus/QDBusConnection>
14 #include <QtDBus/QDBusReply>
16 static QTextStream _out( stdout, QIODevice::WriteOnly );
18 void openWallet()
20 _out << "About to ask for wallet sync" << endl;
22 KWallet::Wallet *w = KWallet::Wallet::openWallet( KWallet::Wallet::NetworkWallet(), 0, KWallet::Wallet::Synchronous );
24 _out << "Got sync wallet: " << (w != 0) << endl;
27 int main( int argc, char *argv[] )
29 KAboutData aboutData("kwalletsync", 0, ki18n("kwalletsync"), "version");
30 KComponentData componentData(&aboutData);
31 QApplication app( argc, argv );
33 // force name with D-BUS
34 QDBusReply<QDBusConnectionInterface::RegisterServiceReply> reply
35 = QDBusConnection::sessionBus().interface()->registerService( "org.kde.kwalletsync",
36 QDBusConnectionInterface::ReplaceExistingService );
38 if ( !reply.isValid() )
40 _out << "D-BUS name request returned " << reply.error().name() << endl;
43 openWallet();
45 return 0;
48 // vim: set noet ts=4 sts=4 sw=4: