• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeutils API Reference
  • KDE Home
  • Contact Us
 

kdf

  • sources
  • kde-4.14
  • kdeutils
  • kdf
kconftest.cpp
Go to the documentation of this file.
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 
42 static const char description[] =
43  I18N_NOOP("A test application");
44 
45 static const char version[] = "v0.0.1";
46 
47 main(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 
version
static const char version[]
Definition: kconftest.cpp:45
main
main(int argc, char **argv)
Definition: kconftest.cpp:47
Q3DictIterator
Q3Dict::insert
void insert(const QString &key, const type *item)
Q3Dict
QString
description
static const char description[]
Definition: kconftest.cpp:42
Q3DictIterator::current
type * current() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:42:23 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kdf

Skip menu "kdf"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdeutils API Reference

Skip menu "kdeutils API Reference"
  • ark
  • filelight
  • kcalc
  • kcharselect
  • kdf
  • kfloppy
  • kgpg
  • ktimer
  • kwallet
  • sweeper

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal