Diffstat (limited to 'libopie2/opiepim/backend/otodoaccessxml.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opiepim/backend/otodoaccessxml.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libopie2/opiepim/backend/otodoaccessxml.cpp b/libopie2/opiepim/backend/otodoaccessxml.cpp index 31822d4..80b8599 100644 --- a/libopie2/opiepim/backend/otodoaccessxml.cpp +++ b/libopie2/opiepim/backend/otodoaccessxml.cpp | |||
@@ -98,48 +98,49 @@ bool OTodoAccessXML::load() { | |||
98 | i = j + 1; | 98 | i = j + 1; |
99 | continue; | 99 | continue; |
100 | } | 100 | } |
101 | 101 | ||
102 | QCString value( dt+i, j-i+1 ); | 102 | QCString value( dt+i, j-i+1 ); |
103 | i = j + 1; | 103 | i = j + 1; |
104 | 104 | ||
105 | QString str = (haveUtf ? QString::fromUtf8( value ) | 105 | QString str = (haveUtf ? QString::fromUtf8( value ) |
106 | : QString::fromLatin1( value ) ); | 106 | : QString::fromLatin1( value ) ); |
107 | if ( haveEnt ) | 107 | if ( haveEnt ) |
108 | str = Qtopia::plainString( str ); | 108 | str = Qtopia::plainString( str ); |
109 | 109 | ||
110 | /* | 110 | /* |
111 | * add key + value | 111 | * add key + value |
112 | */ | 112 | */ |
113 | todo( &dict, ev, attr, str ); | 113 | todo( &dict, ev, attr, str ); |
114 | 114 | ||
115 | } | 115 | } |
116 | /* | 116 | /* |
117 | * now add it | 117 | * now add it |
118 | */ | 118 | */ |
119 | m_events.insert(ev.uid(), ev ); | 119 | m_events.insert(ev.uid(), ev ); |
120 | } | 120 | } |
121 | 121 | ||
122 | qWarning("counts %d", m_events.count() ); | ||
122 | return true; | 123 | return true; |
123 | } | 124 | } |
124 | bool OTodoAccessXML::reload() { | 125 | bool OTodoAccessXML::reload() { |
125 | return load(); | 126 | return load(); |
126 | } | 127 | } |
127 | bool OTodoAccessXML::save() { | 128 | bool OTodoAccessXML::save() { |
128 | // qWarning("saving"); | 129 | // qWarning("saving"); |
129 | if (!m_opened || !m_changed ) { | 130 | if (!m_opened || !m_changed ) { |
130 | // qWarning("not saving"); | 131 | // qWarning("not saving"); |
131 | return true; | 132 | return true; |
132 | } | 133 | } |
133 | QString strNewFile = m_file + ".new"; | 134 | QString strNewFile = m_file + ".new"; |
134 | QFile f( strNewFile ); | 135 | QFile f( strNewFile ); |
135 | if (!f.open( IO_WriteOnly|IO_Raw ) ) | 136 | if (!f.open( IO_WriteOnly|IO_Raw ) ) |
136 | return false; | 137 | return false; |
137 | 138 | ||
138 | int written; | 139 | int written; |
139 | QString out; | 140 | QString out; |
140 | out = "<!DOCTYPE Tasks>\n<Tasks>\n"; | 141 | out = "<!DOCTYPE Tasks>\n<Tasks>\n"; |
141 | 142 | ||
142 | // for all todos | 143 | // for all todos |
143 | QMap<int, OTodo>::Iterator it; | 144 | QMap<int, OTodo>::Iterator it; |
144 | for (it = m_events.begin(); it != m_events.end(); ++it ) { | 145 | for (it = m_events.begin(); it != m_events.end(); ++it ) { |
145 | out+= "<Task " + toString( (*it) ) + " />\n"; | 146 | out+= "<Task " + toString( (*it) ) + " />\n"; |