summaryrefslogtreecommitdiff
path: root/libopie
authorzecke <zecke>2003-02-22 16:12:49 (UTC)
committer zecke <zecke>2003-02-22 16:12:49 (UTC)
commit66b00525256255290dfcd9d48ebe1539f15b8dce (patch) (side-by-side diff)
treee0857ba9251d6ebcd7df5d23b9269c69d6edd944 /libopie
parent397a7b1635488deda02b36df70692e27f59bb3e0 (diff)
downloadopie-66b00525256255290dfcd9d48ebe1539f15b8dce.zip
opie-66b00525256255290dfcd9d48ebe1539f15b8dce.tar.gz
opie-66b00525256255290dfcd9d48ebe1539f15b8dce.tar.bz2
Remove some testing code
Diffstat (limited to 'libopie') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/odatebookaccessbackend_xml.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/libopie/pim/odatebookaccessbackend_xml.cpp b/libopie/pim/odatebookaccessbackend_xml.cpp
index 5239d84..bc51996 100644
--- a/libopie/pim/odatebookaccessbackend_xml.cpp
+++ b/libopie/pim/odatebookaccessbackend_xml.cpp
@@ -142,26 +142,25 @@ ODateBookAccessBackend_XML::ODateBookAccessBackend_XML( const QString& ,
m_changed = false;
}
ODateBookAccessBackend_XML::~ODateBookAccessBackend_XML() {
}
bool ODateBookAccessBackend_XML::load() {
return loadFile();
}
bool ODateBookAccessBackend_XML::reload() {
clear();
return load();
}
bool ODateBookAccessBackend_XML::save() {
- qWarning("going to save now");
-// if (!m_changed) return true;
+ if (!m_changed) return true;
int total_written;
QString strFileNew = m_name + ".new";
QFile f( strFileNew );
if (!f.open( IO_WriteOnly | IO_Raw ) ) return false;
QString buf( "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" );
buf += "<!DOCTYPE DATEBOOK><DATEBOOK>\n";
buf += "<events>\n";
QCString str = buf.utf8();
total_written = f.writeBlock( str.data(), str.length() );
@@ -183,25 +182,24 @@ bool ODateBookAccessBackend_XML::save() {
}
buf = "</events>\n</DATEBOOK>\n";
str = buf.utf8();
total_written = f.writeBlock( str.data(), str.length() );
if ( total_written != int(str.length() ) ) {
f.close();
QFile::remove( strFileNew );
return false;
}
f.close();
- exit(0);
if ( ::rename( strFileNew, m_name ) < 0 ) {
QFile::remove( strFileNew );
return false;
}
m_changed = false;
return true;
}
QArray<int> ODateBookAccessBackend_XML::allRecords()const {
QArray<int> ints( m_raw.count()+ m_rep.count() );
uint i = 0;
QMap<int, OEvent>::ConstIterator it;