summaryrefslogtreecommitdiff
blob: 9b68e384fc80feb4d1b92ef004244f2afcb50c3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
--- ksms/messagestore.cpp.orig	2002-11-23 01:35:30.000000000 +0100
+++ ksms/messagestore.cpp	2003-08-17 21:10:36.000000000 +0200
@@ -150,20 +150,25 @@
     messages_.clear();
 
     QFile xmlFile( messagesFile_ );
-    MessageStore::ReaderProgress progress( this );
-    XmlInputSourceWithProgress source( &xmlFile, &progress );
-    QXmlSimpleReader reader;
-    MessagesParser handler( this );
-    reader.setContentHandler( &handler );
-    reader.setDTDHandler( &handler );
-    source.reset();
-    reader.parse( source );
-
-    reading_ = false;
+    if (xmlFile.exists()) {
+        MessageStore::ReaderProgress progress( this );
+        XmlInputSourceWithProgress source( &xmlFile, &progress );
+        QXmlSimpleReader reader;
+        MessagesParser handler( this );
+        reader.setContentHandler( &handler );
+        reader.setDTDHandler( &handler );
+        source.reset();
+        reader.parse( source );
+    
+        reading_ = false;
 
-    emit storeChanged();
+        emit storeChanged();
     
-    modified_ = false;
+        modified_ = false;
+    } else {
+	reading_ = false;
+	modified_ = false;
+    }
 }