diff options
author | Harri Porten <porten@kde.org> | 2001-01-22 21:55:16 +0000 |
---|---|---|
committer | Aleix Pol <aleixpol@kde.org> | 2014-04-26 14:11:12 +0200 |
commit | e31185a77e50967d596511ca4fa3ad31f4bdf7f6 (patch) | |
tree | 7d47007f69068a4891cdbc1b2a6462effe1f6800 | |
parent | 39b567ee8ca178492a8bff95c9fb61a42ff50d3a (diff) | |
download | kconfig-e31185a77e50967d596511ca4fa3ad31f4bdf7f6.tar.gz kconfig-e31185a77e50967d596511ca4fa3ad31f4bdf7f6.tar.bz2 |
w/o cout from iostream.h RH really can use the latest and greatest gcc for this utility.
svn path=/trunk/kdebase/src/kreadconfig/; revision=79637
-rw-r--r-- | src/kreadconfig/kreadconfig.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/kreadconfig/kreadconfig.cpp b/src/kreadconfig/kreadconfig.cpp index 75a35e3f..c37fcc97 100644 --- a/src/kreadconfig/kreadconfig.cpp +++ b/src/kreadconfig/kreadconfig.cpp @@ -1,22 +1,22 @@ /* Read KGlobal::config() entries - for use in shell scripts. * (c) 2001 Red Hat, Inc. * Programmed by Bernhard Rosenkraenzer <bero@redhat.com> - * + * * If --type is specified as bool, the return value is 0 if the value * is set, 1 if it isn't set. There is no output. - * + * * If --type is specified as num, the return value matches the value * of the key. There is no output. - * + * * If --type is not set, the value of the key is simply printed to stdout. - * + * * Usage examples: * if kreadconfig --group KDE --key macStyle --type bool; then * echo "We're using Mac-Style menus." * else * echo "We're using normal menus." * fi - * + * * TRASH=`kreadconfig --group Paths --key Trash` * if test -n "$TRASH"; then * mv someFile "$TRASH" @@ -30,7 +30,8 @@ #include <kcmdlineargs.h> #include <klocale.h> #include <kaboutdata.h> -#include <iostream> +#include <stdio.h> + static KCmdLineOptions options[] = { { "group <group>", I18N_NOOP("Group to look in"), "KDE" }, @@ -55,7 +56,7 @@ int main(int argc, char **argv) QString key=QString::fromLatin1(args->getOption("key")); QCString dflt=args->getOption("default"); QCString type=args->getOption("type").lower(); - + KApplication app( false, false ); // no styles, no gui KConfig *konfig=KGlobal::config(); @@ -68,7 +69,7 @@ int main(int argc, char **argv) return konfig->readLongNumEntry(key, dflt.toLong()); } else { /* Assume it's a string... */ - cout << konfig->readEntry(key, dflt).latin1() << endl; + fprintf(stdout, "%s\n", konfig->readEntry(key, dflt).latin1()); return 0; } } |