Introduced basic export to Open Document format
authorinsilmaril
Tue Jan 24 15:09:48 2006 +0000 (2006-01-24)
changeset 18890969608255c
parent 187 2658871fdda4
child 189 ca30b203fb73
Introduced basic export to Open Document format
settings.cpp
settings.h
     1.1 --- a/settings.cpp	Tue Jan 24 15:09:48 2006 +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  /////////////////////////////////////////////////////////////////
     2.1 --- a/settings.h	Tue Jan 24 15:09:48 2006 +0000
     2.2 +++ b/settings.h	Tue Jan 24 15:09:48 2006 +0000
     2.3 @@ -9,8 +9,6 @@
     2.4  
     2.5  // Some helper functions and simplified settings class
     2.6  // to read and parse settings e.g.  in undo/redo directories
     2.7 -bool loadStringFromDisk (const QString &, QString &);
     2.8 -bool saveStringToDisk (const QString &, const QString &s);
     2.9  
    2.10  class SimpleSettings
    2.11  {