Warning: That file was not part of the compilation database. It may have many parsing errors.

1/*
2**
3** Copyright (C) 1999 by Michael Kropfberger <michael.kropfberger@gmx.net>
4**
5*/
6
7/*
8** This program is free software; you can redistribute it and/or modify
9** it under the terms of the GNU General Public License as published by
10** the Free Software Foundation; either version 2 of the License, or
11** (at your option) any later version.
12**
13** This program is distributed in the hope that it will be useful,
14** but WITHOUT ANY WARRANTY; without even the implied warranty of
15** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16** GNU General Public License for more details.
17**
18** You should have received a copy of the GNU General Public License
19** along with this program in a file called COPYING; if not, write to
20** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
21** MA 02110-1301, USA.
22*/
23
24/*
25** Bug reports and questions can be sent to <kde-devel@kde.org>
26*/
27
28/* compile with
29* gcc -I$QTDIR/include -I$KDEDIR/include -L/opt/kde/lib -L/usr/X11R6/lib -lkfm -lkdeui -lkdecore -lqt -lX11 -lXext -fno-rtti kconftest.cpp
30*/
31
32#include <iostream>
33
34#include <Qt3Support/Q3Dict>
35#include <kconfig.h>
36#include <kdebug.h>
37#include <kapplication.h>
38#include <klocale.h>
39#include <kcmdlineargs.h>
40#include <kglobal.h>
41
42static const char description[] =
43 I18N_NOOP("A test application");
44
45static const char version[] = "v0.0.1";
46
47main(int argc, char ** argv)
48{
49 KCmdLineArgs::init(argc, argv, "test", description, version);
50
51 KApplication app;
52 KSharedConfig::Ptr cfg = KGlobal::config();
53
54 Q3Dict<char> dict;
55
56 dict.insert("Blah", "Arse");
57 dict.insert("Blah", "Smack");
58 dict.insert("Blah", "Monkey");
59
60 Q3DictIterator<char> it(dict);
61
62 QString key = "TestConfigItem";
63
64 for (; it.current(); ++it)
65 {
66
67 cerr << "Before saving: " << endl;
68 cerr << "key : \"" << key << "\"" << endl;
69 cerr << "val : \"" << it.current() << "\"" << endl;
70
71 debug("got back [%s]",cfg->writeEntry(key, it.current()));
72 // debug("got back [%s]",s.data());
73
74 cerr << "After saving: " << endl;
75 cerr << "key : \"" << key << "\"" << endl;
76 cerr << "val : \"" << it.current() << "\"" << endl;
77
78 cerr << endl;
79 }
80}
81
82

Warning: That file was not part of the compilation database. It may have many parsing errors.