diff -r d442a66e9121 -r 7b74fa3772bf settings.cpp --- a/settings.cpp Thu Sep 22 12:14:23 2005 +0000 +++ b/settings.cpp Tue Sep 05 09:47:13 2006 +0000 @@ -1,42 +1,10 @@ #include #include #include "settings.h" +#include "file.h" using namespace std; -bool loadStringFromDisk (const QString &fname, QString &s) -{ - s=""; - QFile file ( fname); - if ( !file.open( IO_ReadOnly ) ) return false; - - QTextStream ts( &file ); - ts.setEncoding (QTextStream::UnicodeUTF8); - while ( !ts.atEnd() ) - s+=ts.readLine()+"\n"; - file.close(); - return true; -} - -bool saveStringToDisk (const QString &fname, const QString &s) -{ - QFile file( fname); - - file.setName ( fname); - if ( !file.open( IO_WriteOnly ) ) - { - file.close(); - return false; - } - - // Write it finally, and write in UTF8, no matter what - QTextStream ts( &file ); - ts.setEncoding (QTextStream::UnicodeUTF8); - ts << s; - file.close(); - return true; -} - ///////////////////////////////////////////////////////////////// // SimpleSettings /////////////////////////////////////////////////////////////////