author | zecke <zecke> | 2002-04-25 16:11:10 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-04-25 16:11:10 (UTC) |
commit | e944a214e0efeccd2eb9cc479ad8893427c6b81d (patch) (unidiff) | |
tree | 263f754a34d23738dac6c3dea9dbcb0ce8b6bb3e /libopie | |
parent | 48dbc8fb69a5d19f466ea757207e42c3861b4dee (diff) | |
download | opie-e944a214e0efeccd2eb9cc479ad8893427c6b81d.zip opie-e944a214e0efeccd2eb9cc479ad8893427c6b81d.tar.gz opie-e944a214e0efeccd2eb9cc479ad8893427c6b81d.tar.bz2 |
This should fix the Umlaut problem
-rw-r--r-- | libopie/tododb.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libopie/tododb.cpp b/libopie/tododb.cpp index c486723..33fa177 100644 --- a/libopie/tododb.cpp +++ b/libopie/tododb.cpp | |||
@@ -24,48 +24,49 @@ public: | |||
24 | QArray<int> arrat = (*it).categories(); | 24 | QArray<int> arrat = (*it).categories(); |
25 | QString attr; | 25 | QString attr; |
26 | for(uint i=0; i < arrat.count(); i++ ){ | 26 | for(uint i=0; i < arrat.count(); i++ ){ |
27 | attr.append(QString::number(arrat[i])+";" ); | 27 | attr.append(QString::number(arrat[i])+";" ); |
28 | } | 28 | } |
29 | if(!attr.isEmpty() ) // remove the last ; | 29 | if(!attr.isEmpty() ) // remove the last ; |
30 | attr.remove(attr.length()-1, 1 ); | 30 | attr.remove(attr.length()-1, 1 ); |
31 | map.insert( "Categories", attr ); | 31 | map.insert( "Categories", attr ); |
32 | //else | 32 | //else |
33 | //map.insert( "Categories", QString::null ); | 33 | //map.insert( "Categories", QString::null ); |
34 | map.insert( "Description", (*it).description() ); | 34 | map.insert( "Description", (*it).description() ); |
35 | if( (*it).hasDate() ){ | 35 | if( (*it).hasDate() ){ |
36 | map.insert("DateYear", QString::number( (*it).date().year() ) ); | 36 | map.insert("DateYear", QString::number( (*it).date().year() ) ); |
37 | map.insert("DateMonth", QString::number( (*it).date().month() ) ); | 37 | map.insert("DateMonth", QString::number( (*it).date().month() ) ); |
38 | map.insert("DateDay", QString::number( (*it).date().day() ) ); | 38 | map.insert("DateDay", QString::number( (*it).date().day() ) ); |
39 | } | 39 | } |
40 | map.insert("Uid", QString::number( (*it).uid() ) ); | 40 | map.insert("Uid", QString::number( (*it).uid() ) ); |
41 | task->setTagName("Task" ); | 41 | task->setTagName("Task" ); |
42 | task->setAttributes( map ); | 42 | task->setAttributes( map ); |
43 | tasks->appendChild(task); | 43 | tasks->appendChild(task); |
44 | } | 44 | } |
45 | QFile file( name); | 45 | QFile file( name); |
46 | if( file.open(IO_WriteOnly ) ){ | 46 | if( file.open(IO_WriteOnly ) ){ |
47 | QTextStream stream(&file ); | 47 | QTextStream stream(&file ); |
48 | stream.setEncoding( QTextStream::UnicodeUTF8 ); | ||
48 | stream << "<!DOCTYPE Tasks>" << endl; | 49 | stream << "<!DOCTYPE Tasks>" << endl; |
49 | tasks->save(stream ); | 50 | tasks->save(stream ); |
50 | delete tasks; | 51 | delete tasks; |
51 | stream << "</Tasks>" << endl; | 52 | stream << "</Tasks>" << endl; |
52 | file.close(); | 53 | file.close(); |
53 | return true; | 54 | return true; |
54 | } | 55 | } |
55 | return false; | 56 | return false; |
56 | } | 57 | } |
57 | QValueList<ToDoEvent> load( const QString &name ){ | 58 | QValueList<ToDoEvent> load( const QString &name ){ |
58 | qWarning("loading tododb" ); | 59 | qWarning("loading tododb" ); |
59 | QValueList<ToDoEvent> m_todos; | 60 | QValueList<ToDoEvent> m_todos; |
60 | XMLElement *root = XMLElement::load( name ); | 61 | XMLElement *root = XMLElement::load( name ); |
61 | if(root != 0l ){ // start parsing | 62 | if(root != 0l ){ // start parsing |
62 | qWarning("ToDoDB::load tagName(): %s", root->tagName().latin1() ); | 63 | qWarning("ToDoDB::load tagName(): %s", root->tagName().latin1() ); |
63 | //if( root->tagName() == QString::fromLatin1("Tasks" ) ){// Start | 64 | //if( root->tagName() == QString::fromLatin1("Tasks" ) ){// Start |
64 | XMLElement *element = root->firstChild(); | 65 | XMLElement *element = root->firstChild(); |
65 | element = element->firstChild(); | 66 | element = element->firstChild(); |
66 | while( element ){ | 67 | while( element ){ |
67 | if( element->tagName() != QString::fromLatin1("Task") ){ | 68 | if( element->tagName() != QString::fromLatin1("Task") ){ |
68 | element = element->nextChild(); | 69 | element = element->nextChild(); |
69 | continue; | 70 | continue; |
70 | } | 71 | } |
71 | qWarning("ToDoDB::load element tagName() : %s", element->tagName().latin1() ); | 72 | qWarning("ToDoDB::load element tagName() : %s", element->tagName().latin1() ); |