File: kwalletpath.cpp

package info (click to toggle)
kde-runtime 4%3A17.08.3-2.1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 25,204 kB
  • sloc: cpp: 111,675; ansic: 5,030; perl: 1,579; xml: 793; sh: 407; makefile: 42; python: 28
file content (43 lines) | stat: -rw-r--r-- 940 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <QtCore/QTextStream>
#include <QtCore/QTimer>

#include <kaboutdata.h>
#include <kapplication.h>
#include <kcmdlineargs.h>
#include <kdebug.h>
#include <kglobal.h>
#include <kstandarddirs.h>
#include <kwallet.h>
#include <QtDBus/QDBusConnectionInterface>
#include <QtDBus/QDBusConnection>
#include <QtDBus/QDBusReply>
#include <klocale.h>

static QTextStream _out(stdout, QIODevice::WriteOnly);

void openWallet()
{
	_out << "About to ask for wallet /tmp/test.kwl sync" << endl;

	KWallet::Wallet *wallet = KWallet::Wallet::openWallet("/tmp/test.kwl", 0, KWallet::Wallet::Path);

	_out << "Got path wallet: " << (wallet != 0) << endl;
	
	if (wallet) {
		_out << "Closing wallet" << endl;
		delete wallet;
	}
	
	kapp->exit(0);
}

int main(int argc, char *argv[])
{
	KAboutData aboutData("kwalletpath", 0, ki18n("kwalletpath"), "version");
	KCmdLineArgs::init(argc, argv, &aboutData);
	KApplication app;

	openWallet();

	exit(0);
}