summaryrefslogtreecommitdiffabout
path: root/libkcal/icalformat.cpp
Unidiff
Diffstat (limited to 'libkcal/icalformat.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/icalformat.cpp24
1 files changed, 2 insertions, 22 deletions
diff --git a/libkcal/icalformat.cpp b/libkcal/icalformat.cpp
index f2e7dfc..3a2aac6 100644
--- a/libkcal/icalformat.cpp
+++ b/libkcal/icalformat.cpp
@@ -47,15 +47,14 @@ extern "C" {
47#include "icalformatimpl.h" 47#include "icalformatimpl.h"
48 48
49#define _ICAL_VERSION "2.0" 49#define _ICAL_VERSION "2.0"
50 50
51using namespace KCal; 51using namespace KCal;
52 52
53ICalFormat::ICalFormat(bool quick ) 53ICalFormat::ICalFormat( )
54{ 54{
55 mQuicksave = false; //quick;
56 mImpl = new ICalFormatImpl( this ); 55 mImpl = new ICalFormatImpl( this );
57 tzOffsetMin = 0; 56 tzOffsetMin = 0;
58 //qDebug("new ICalFormat() "); 57 //qDebug("new ICalFormat() ");
59} 58}
60 59
61ICalFormat::~ICalFormat() 60ICalFormat::~ICalFormat()
@@ -73,22 +72,13 @@ bool ICalFormat::load( Calendar *calendar, const QString &fileName)
73 if (!file.open( IO_ReadOnly ) ) { 72 if (!file.open( IO_ReadOnly ) ) {
74 setException(new ErrorFormat(ErrorFormat::LoadError)); 73 setException(new ErrorFormat(ErrorFormat::LoadError));
75 return false; 74 return false;
76 } 75 }
77 QTextStream ts( &file ); 76 QTextStream ts( &file );
78 QString text; 77 QString text;
79#if 0 78
80 if ( !mQuicksave ) {
81 qDebug("KO: No quickload!");
82 ts.setEncoding( QTextStream::Latin1 );
83 text = ts.read();
84 } else {
85 ts.setCodec( QTextCodec::codecForName("utf8") );
86 text = ts.read();
87 }
88#endif
89 ts.setEncoding( QTextStream::Latin1 ); 79 ts.setEncoding( QTextStream::Latin1 );
90 text = ts.read(); 80 text = ts.read();
91 file.close(); 81 file.close();
92 82
93 return fromString( calendar, text ); 83 return fromString( calendar, text );
94} 84}
@@ -111,22 +101,12 @@ bool ICalFormat::save( Calendar *calendar, const QString &fileName )
111 setException(new ErrorFormat(ErrorFormat::SaveError, 101 setException(new ErrorFormat(ErrorFormat::SaveError,
112 i18n("Could not open file '%1'").arg(fileName))); 102 i18n("Could not open file '%1'").arg(fileName)));
113 return false; 103 return false;
114 } 104 }
115 QTextStream ts( &file ); 105 QTextStream ts( &file );
116 106
117// #ifdef DESKTOP_VERSION
118// mQuicksave = false;
119// #endif
120// if ( mQuicksave ) {
121// ts << text.utf8();
122// } else {
123// ts.setEncoding( QTextStream::Latin1 );
124// ts << text;
125// //ts << text.latin1();
126// }
127 ts.setEncoding( QTextStream::Latin1 ); 107 ts.setEncoding( QTextStream::Latin1 );
128 ts << text; 108 ts << text;
129 file.close(); 109 file.close();
130 //qDebug("saving file takes ms: %d ", is.elapsed() ); 110 //qDebug("saving file takes ms: %d ", is.elapsed() );
131 return true; 111 return true;
132} 112}