KTempFile->KTemporaryFile
svn path=/trunk/KDE/kdebase/workspace/; revision=591082
This commit is contained in:
parent
d65ebbcb5f
commit
e4d66a5a4d
1 changed files with 6 additions and 8 deletions
14
rules.cpp
14
rules.cpp
|
@ -13,7 +13,7 @@ License. See the file "COPYING" for the exact licensing terms.
|
||||||
#include <fixx11h.h>
|
#include <fixx11h.h>
|
||||||
#include <kconfig.h>
|
#include <kconfig.h>
|
||||||
#include <QRegExp>
|
#include <QRegExp>
|
||||||
#include <ktempfile.h>
|
#include <ktemporaryfile.h>
|
||||||
#include <ksimpleconfig.h>
|
#include <ksimpleconfig.h>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <ktoolinvocation.h>
|
#include <ktoolinvocation.h>
|
||||||
|
@ -68,19 +68,17 @@ Rules::Rules()
|
||||||
Rules::Rules( const QString& str, bool temporary )
|
Rules::Rules( const QString& str, bool temporary )
|
||||||
: temporary_state( temporary ? 2 : 0 )
|
: temporary_state( temporary ? 2 : 0 )
|
||||||
{
|
{
|
||||||
KTempFile file;
|
KTemporaryFile file;
|
||||||
QFile* f = file.file();
|
if( file.open() )
|
||||||
if( f != NULL )
|
|
||||||
{
|
{
|
||||||
QByteArray s = str.toUtf8();
|
QByteArray s = str.toUtf8();
|
||||||
f->write( s.data(), s.length());
|
file.write( s.data(), s.length());
|
||||||
}
|
}
|
||||||
file.close();
|
file.flush();
|
||||||
KSimpleConfig cfg( file.name());
|
KSimpleConfig cfg( file.fileName());
|
||||||
readFromCfg( cfg );
|
readFromCfg( cfg );
|
||||||
if( description.isEmpty())
|
if( description.isEmpty())
|
||||||
description = "temporary";
|
description = "temporary";
|
||||||
file.unlink();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define READ_MATCH_STRING( var, func ) \
|
#define READ_MATCH_STRING( var, func ) \
|
||||||
|
|
Loading…
Reference in a new issue