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

kdf

kconftest.cpp

Go to the documentation of this file.
00001 /*
00002 **
00003 ** Copyright (C) 1999 by Michael Kropfberger
00004 **
00005 */
00006 
00007 /*
00008 ** This program is free software; you can redistribute it and/or modify
00009 ** it under the terms of the GNU General Public License as published by
00010 ** the Free Software Foundation; either version 2 of the License, or
00011 ** (at your option) any later version.
00012 **
00013 ** This program is distributed in the hope that it will be useful,
00014 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00016 ** GNU General Public License for more details.
00017 **
00018 ** You should have received a copy of the GNU General Public License
00019 ** along with this program in a file called COPYING; if not, write to
00020 ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
00021 ** MA 02110-1301, USA.
00022 */
00023 
00024 /*
00025 ** Bug reports and questions can be sent to <kde-devel@kde.org>
00026 */
00027 
00028 /* compile with
00029 * 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                
00030 */
00031 
00032 #include <iostream>
00033 
00034 #include <Qt3Support/Q3Dict>
00035 #include <kconfig.h>
00036 #include <kdebug.h>
00037 #include <kapplication.h>
00038 #include <klocale.h>
00039 #include <kcmdlineargs.h>
00040 #include <kglobal.h>
00041 
00042 static const char description[] =
00043     I18N_NOOP("A test application");
00044 
00045 static const char version[] = "v0.0.1";
00046 
00047 main(int argc, char ** argv)
00048 {
00049  KCmdLineArgs::init(argc, argv, "test", description, version);
00050  
00051  KApplication app;
00052  KSharedConfig::Ptr cfg = KGlobal::config();
00053 
00054  Q3Dict<char> dict;
00055 
00056  dict.insert("Blah", "Arse");
00057  dict.insert("Blah", "Smack");
00058  dict.insert("Blah", "Monkey");
00059 
00060  Q3DictIterator<char> it(dict);
00061 
00062  QString key = "TestConfigItem";
00063 
00064  for (; it.current(); ++it) {
00065 
00066   cerr << "Before saving: " << endl;
00067   cerr << "key : \"" << key << "\"" << endl;
00068   cerr << "val : \"" << it.current() << "\"" << endl;
00069 
00070   debug("got back [%s]",cfg->writeEntry(key, it.current()));
00071 //  debug("got back [%s]",s.data());
00072 
00073   cerr << "After saving: " << endl;
00074   cerr << "key : \"" << key << "\"" << endl;
00075   cerr << "val : \"" << it.current() << "\"" << endl;
00076 
00077   cerr << endl;
00078  }
00079 }

kdf

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

kdeutils

Skip menu "kdeutils"
  • ark
  • kcalc
  • kcharselect
  • kdessh
  • kdf
  • kfloppy
  • kgpg
  • ktimer
  • kwallet
  • okteta
  • printer-applet
  • superkaramba
  • sweeper
Generated for kdeutils by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal