settings.cpp
changeset 188 90969608255c
parent 164 d442a66e9121
child 366 e95081c21da2
     1.1 --- a/settings.cpp	Thu Sep 22 12:14:23 2005 +0000
     1.2 +++ b/settings.cpp	Tue Jan 24 15:09:48 2006 +0000
     1.3 @@ -1,42 +1,10 @@
     1.4  #include <iostream>
     1.5  #include <qregexp.h>
     1.6  #include "settings.h"
     1.7 +#include "file.h"
     1.8  
     1.9  using namespace std;
    1.10  
    1.11 -bool loadStringFromDisk (const QString &fname, QString &s)
    1.12 -{
    1.13 -	s="";
    1.14 -	QFile file ( fname);
    1.15 -	if ( !file.open( IO_ReadOnly ) ) return false;
    1.16 -
    1.17 -	QTextStream ts( &file );
    1.18 -	ts.setEncoding (QTextStream::UnicodeUTF8);
    1.19 -	while ( !ts.atEnd() ) 
    1.20 -		s+=ts.readLine()+"\n"; 
    1.21 -	file.close();
    1.22 -	return true;
    1.23 -}
    1.24 -
    1.25 -bool saveStringToDisk (const QString &fname, const QString &s)
    1.26 -{
    1.27 -	QFile file( fname);
    1.28 -
    1.29 -	file.setName ( fname);
    1.30 -	if ( !file.open( IO_WriteOnly ) ) 
    1.31 -	{
    1.32 -		file.close();
    1.33 -		return false;
    1.34 -	}	
    1.35 -
    1.36 -	// Write it finally, and write in UTF8, no matter what 
    1.37 -	QTextStream ts( &file );
    1.38 -	ts.setEncoding (QTextStream::UnicodeUTF8);
    1.39 -	ts << s;
    1.40 -	file.close();
    1.41 -	return true;
    1.42 -}
    1.43 -
    1.44  /////////////////////////////////////////////////////////////////
    1.45  // SimpleSettings
    1.46  /////////////////////////////////////////////////////////////////