From e4d66a5a4de9f748c767fd76596548ee64fb7d42 Mon Sep 17 00:00:00 2001 From: Jaison Lee Date: Sun, 1 Oct 2006 17:24:38 +0000 Subject: [PATCH] KTempFile->KTemporaryFile svn path=/trunk/KDE/kdebase/workspace/; revision=591082 --- rules.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/rules.cpp b/rules.cpp index e37b49de82..04b878fd1f 100644 --- a/rules.cpp +++ b/rules.cpp @@ -13,7 +13,7 @@ License. See the file "COPYING" for the exact licensing terms. #include #include #include -#include +#include #include #include #include @@ -68,19 +68,17 @@ Rules::Rules() Rules::Rules( const QString& str, bool temporary ) : temporary_state( temporary ? 2 : 0 ) { - KTempFile file; - QFile* f = file.file(); - if( f != NULL ) + KTemporaryFile file; + if( file.open() ) { QByteArray s = str.toUtf8(); - f->write( s.data(), s.length()); + file.write( s.data(), s.length()); } - file.close(); - KSimpleConfig cfg( file.name()); + file.flush(); + KSimpleConfig cfg( file.fileName()); readFromCfg( cfg ); if( description.isEmpty()) description = "temporary"; - file.unlink(); } #define READ_MATCH_STRING( var, func ) \