From e31185a77e50967d596511ca4fa3ad31f4bdf7f6 Mon Sep 17 00:00:00 2001 From: Harri Porten Date: Mon, 22 Jan 2001 21:55:16 +0000 Subject: 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 --- src/kreadconfig/kreadconfig.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src') 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 - * + * * 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 #include #include -#include +#include + static KCmdLineOptions options[] = { { "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; } } -- cgit v1.2.1