author | zautrix <zautrix> | 2005-03-03 15:08:34 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-03 15:08:34 (UTC) |
commit | 9a36b5727a918b73b96fa285c3cff393ec5f43ed (patch) (unidiff) | |
tree | e8740230f22c8a469070c086902c8dc62de1f4c7 | |
parent | a4ea625087ea7213419828e8decdff48ae231968 (diff) | |
download | kdepimpi-9a36b5727a918b73b96fa285c3cff393ec5f43ed.zip kdepimpi-9a36b5727a918b73b96fa285c3cff393ec5f43ed.tar.gz kdepimpi-9a36b5727a918b73b96fa285c3cff393ec5f43ed.tar.bz2 |
nochn fix
-rw-r--r-- | bin/kdepim/pwmanager/germantranslation.txt | 4 | ||||
-rw-r--r-- | pwmanager/pwmanager/pwmdoc.cpp | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/bin/kdepim/pwmanager/germantranslation.txt b/bin/kdepim/pwmanager/germantranslation.txt index ccc9d83..2650e28 100644 --- a/bin/kdepim/pwmanager/germantranslation.txt +++ b/bin/kdepim/pwmanager/germantranslation.txt | |||
@@ -257,100 +257,104 @@ | |||
257 | { "To unlock click the icon on the left.","Zum Entsperren auf linkes Icon klicken." }, | 257 | { "To unlock click the icon on the left.","Zum Entsperren auf linkes Icon klicken." }, |
258 | { "PwManager","PwManager" }, | 258 | { "PwManager","PwManager" }, |
259 | { "Window-style:","Window-Stil:" }, | 259 | { "Window-style:","Window-Stil:" }, |
260 | { "Category on top","Kategorien oben" }, | 260 | { "Category on top","Kategorien oben" }, |
261 | { "Category-list left/top","Kategorien links oben" }, | 261 | { "Category-list left/top","Kategorien links oben" }, |
262 | { "Font for Password entries:","Schrift für Passwort Einträge:" }, | 262 | { "Font for Password entries:","Schrift für Passwort Einträge:" }, |
263 | { "Font for Password summary:","Schrift für Passwort Übersicht:" }, | 263 | { "Font for Password summary:","Schrift für Passwort Übersicht:" }, |
264 | { "Font:","Schriftart:" }, | 264 | { "Font:","Schriftart:" }, |
265 | { "Summary","Übersicht" }, | 265 | { "Summary","Übersicht" }, |
266 | { "Compression:","Kompression:" }, | 266 | { "Compression:","Kompression:" }, |
267 | { "gzip","gzip" }, | 267 | { "gzip","gzip" }, |
268 | { "Encryption:","Verschlüsselung:" }, | 268 | { "Encryption:","Verschlüsselung:" }, |
269 | { "Blowfish (128 bit)","Blowfish (128 bit)" }, | 269 | { "Blowfish (128 bit)","Blowfish (128 bit)" }, |
270 | { "AES-128, Rijndael (128 bit)","AES-128, Rijndael (128 bit)" }, | 270 | { "AES-128, Rijndael (128 bit)","AES-128, Rijndael (128 bit)" }, |
271 | { "AES-192, Rijndael (192 bit)","AES-192, Rijndael (192 bit)" }, | 271 | { "AES-192, Rijndael (192 bit)","AES-192, Rijndael (192 bit)" }, |
272 | { "AES-256, Rijndael (256 bit)","AES-256, Rijndael (256 bit)" }, | 272 | { "AES-256, Rijndael (256 bit)","AES-256, Rijndael (256 bit)" }, |
273 | { "Triple-DES (168 bit)","Triple-DES (168 bit)" }, | 273 | { "Triple-DES (168 bit)","Triple-DES (168 bit)" }, |
274 | { "Twofish (256 bit)","Twofish (256 bit)" }, | 274 | { "Twofish (256 bit)","Twofish (256 bit)" }, |
275 | { "Twofish-128 (128 bit)","Twofish-128 (128 bit)" }, | 275 | { "Twofish-128 (128 bit)","Twofish-128 (128 bit)" }, |
276 | { "Hashing:","Hashing:" }, | 276 | { "Hashing:","Hashing:" }, |
277 | { "SHA-160, SHA1 (160 bit)","SHA-160, SHA1 (160 bit)" }, | 277 | { "SHA-160, SHA1 (160 bit)","SHA-160, SHA1 (160 bit)" }, |
278 | { "SHA-256 (256 bit)","SHA-256 (256 bit)" }, | 278 | { "SHA-256 (256 bit)","SHA-256 (256 bit)" }, |
279 | { "SHA-384 (384 bit)","SHA-384 (384 bit)" }, | 279 | { "SHA-384 (384 bit)","SHA-384 (384 bit)" }, |
280 | { "SHA-512 (512 bit)","SHA-512 (512 bit)" }, | 280 | { "SHA-512 (512 bit)","SHA-512 (512 bit)" }, |
281 | { "MD5 (128 bit)","MD5 (128 bit)" }, | 281 | { "MD5 (128 bit)","MD5 (128 bit)" }, |
282 | { "RIPE-MD-160 (160 bit)","RIPE-MD-160 (160 bit)" }, | 282 | { "RIPE-MD-160 (160 bit)","RIPE-MD-160 (160 bit)" }, |
283 | { "Tiger (192 bit)","Tiger (192 bit)" }, | 283 | { "Tiger (192 bit)","Tiger (192 bit)" }, |
284 | { "Permissions:","Zugriffsrechte:" }, | 284 | { "Permissions:","Zugriffsrechte:" }, |
285 | { "Make backup before saving","Mache Backup vor dem Speichern" }, | 285 | { "Make backup before saving","Mache Backup vor dem Speichern" }, |
286 | { "Password timeout\n(timeout to hold password in\nmemory,so you don't have to\nre-enter it,if you\nalready have entered it)\n[set to 0 to disable]:","Passwort Timeout\n(Timeout um das Passwort\nim Speicher zu halten,\nso dass es nicht noch mal\neingegeben werden muß.)\n[Setze auf 0 zum deaktivieren]:" }, | 286 | { "Password timeout\n(timeout to hold password in\nmemory,so you don't have to\nre-enter it,if you\nalready have entered it)\n[set to 0 to disable]:","Passwort Timeout\n(Timeout um das Passwort\nim Speicher zu halten,\nso dass es nicht noch mal\neingegeben werden muß.)\n[Setze auf 0 zum deaktivieren]:" }, |
287 | { "Auto-lock timeout\n(auto lock document after this\namount of seconds)\n[set to 0 to disable]:","(Total-)Sperr-Timeout\n(Sperre Dokument total nach\ndieser Anzahl Sekunden)\n[Setze auf 0 zum deaktivieren]:" }, | 287 | { "Auto-lock timeout\n(auto lock document after this\namount of seconds)\n[set to 0 to disable]:","(Total-)Sperr-Timeout\n(Sperre Dokument total nach\ndieser Anzahl Sekunden)\n[Setze auf 0 zum deaktivieren]:" }, |
288 | { "deep-lock on autolock","Sperre total beim Sperr-Timeout" }, | 288 | { "deep-lock on autolock","Sperre total beim Sperr-Timeout" }, |
289 | { "open deeplocked","Öffne total gesperrt" }, | 289 | { "open deeplocked","Öffne total gesperrt" }, |
290 | { "Favourite browser:","Bevorzugter Browser:" }, | 290 | { "Favourite browser:","Bevorzugter Browser:" }, |
291 | { "Favourite x-terminal:","Bevorzugtes x-terminal:" }, | 291 | { "Favourite x-terminal:","Bevorzugtes x-terminal:" }, |
292 | { "Open document with passwords unlocked","Öffne Dokument mit Passwort ungesperrt" }, | 292 | { "Open document with passwords unlocked","Öffne Dokument mit Passwort ungesperrt" }, |
293 | { "Look && feel","Aussehen" }, | 293 | { "Look && feel","Aussehen" }, |
294 | { "File","Datei" }, | 294 | { "File","Datei" }, |
295 | { "Timeout","Timeout" }, | 295 | { "Timeout","Timeout" }, |
296 | { "Autostart","Autostart" }, | 296 | { "Autostart","Autostart" }, |
297 | { "External apps","Externe Applik." }, | 297 | { "External apps","Externe Applik." }, |
298 | { "Miscellaneous","Verschiedenes" }, | 298 | { "Miscellaneous","Verschiedenes" }, |
299 | { "+01:00 Europe/Oslo(CET)","+01:00 Europe/Oslo(CET)" }, | 299 | { "+01:00 Europe/Oslo(CET)","+01:00 Europe/Oslo(CET)" }, |
300 | { "edit category descriptions","Ändere Label für Kategorie" }, | 300 | { "edit category descriptions","Ändere Label für Kategorie" }, |
301 | { "Close","Schließen" }, | 301 | { "Close","Schließen" }, |
302 | { "Category:","Category:" }, | 302 | { "Category:","Category:" }, |
303 | { "Text1 (Description):","Text1 (Beschreibung):" }, | 303 | { "Text1 (Description):","Text1 (Beschreibung):" }, |
304 | { "Text2 (Username):","Text2 (Benutzername):" }, | 304 | { "Text2 (Username):","Text2 (Benutzername):" }, |
305 | { "Text3 (Password):","Text3 (Passwort):" }, | 305 | { "Text3 (Password):","Text3 (Passwort):" }, |
306 | { "edit/add a password entry","Ändere/hinzufüge Passwort Eintrag" }, | 306 | { "edit/add a password entry","Ändere/hinzufüge Passwort Eintrag" }, |
307 | { "Description:","Beschreibung:" }, | 307 | { "Description:","Beschreibung:" }, |
308 | { "Username:","Benutzername:" }, | 308 | { "Username:","Benutzername:" }, |
309 | { "Password:","Passwort:" }, | 309 | { "Password:","Passwort:" }, |
310 | { "&Reveal","&Offen zeigen" }, | 310 | { "&Reveal","&Offen zeigen" }, |
311 | { "&Generate","&Generiere" }, | 311 | { "&Generate","&Generiere" }, |
312 | { "&Password","&Passwort" }, | 312 | { "&Password","&Passwort" }, |
313 | { "&Comments","Kommentar" }, | 313 | { "&Comments","Kommentar" }, |
314 | { "Launcher:","Launcher:" }, | 314 | { "Launcher:","Launcher:" }, |
315 | { "$d = Description","$d = Beschreibung" }, | 315 | { "$d = Description","$d = Beschreibung" }, |
316 | { "$n = Username","$n = Benutzername" }, | 316 | { "$n = Username","$n = Benutzername" }, |
317 | { "$c = Comment","$c = Kommentar" }, | 317 | { "$c = Comment","$c = Kommentar" }, |
318 | { "$u = URL","$u = URL" }, | 318 | { "$u = URL","$u = URL" }, |
319 | { "$p = Password","$p = Passwort" }, | 319 | { "$p = Password","$p = Passwort" }, |
320 | { "&Launcher","&Launcher" }, | 320 | { "&Launcher","&Launcher" }, |
321 | { "Password generator","Passwort Generator" }, | 321 | { "Password generator","Passwort Generator" }, |
322 | { "Character set:","Buchstaben Set:" }, | 322 | { "Character set:","Buchstaben Set:" }, |
323 | { "Lowercase (abc)","Klein (abc)" }, | 323 | { "Lowercase (abc)","Klein (abc)" }, |
324 | { "Uppercase (ABC)","Groß (ABC)" }, | 324 | { "Uppercase (ABC)","Groß (ABC)" }, |
325 | { "Numbers (123)","Nummmern (123)" }, | 325 | { "Numbers (123)","Nummmern (123)" }, |
326 | { "Special characters:","Spezielle Buchstaben:" }, | 326 | { "Special characters:","Spezielle Buchstaben:" }, |
327 | { "Spaces (blank characters)","Leerzeichen" }, | 327 | { "Spaces (blank characters)","Leerzeichen" }, |
328 | { "User defined:","Benutzer definiert:" }, | 328 | { "User defined:","Benutzer definiert:" }, |
329 | { "Password Length:","Passwort Länge:" }, | 329 | { "Password Length:","Passwort Länge:" }, |
330 | { "Enable Filtering to get better passwords","Enable Filtering to get better passwords" }, | 330 | { "Enable Filtering to get better passwords","Enable Filtering to get better passwords" }, |
331 | { "no password","Kein Passwort" }, | 331 | { "no password","Kein Passwort" }, |
332 | { "Sorry, you haven't set a password.","Sorry, Sie haben kein Passwort angegeben." }, | 332 | { "Sorry, you haven't set a password.","Sorry, Sie haben kein Passwort angegeben." }, |
333 | { "not saved, yet","not saved, yet" }, | 333 | { "not saved, yet","not saved, yet" }, |
334 | { "Can't deep-lock, because the document\nhasn't been saved, yet. Please save\nto a file and try again.","Kann nicht tiefsperren, weil das\nDokument noch nicht gespeichert wurde.\nBitte speichern und noch einmal versuchen." }, | 334 | { "Can't deep-lock, because the document\nhasn't been saved, yet. Please save\nto a file and try again.","Kann nicht tiefsperren, weil das\nDokument noch nicht gespeichert wurde.\nBitte speichern und noch einmal versuchen." }, |
335 | { "Find","Finde" }, | 335 | { "Find","Finde" }, |
336 | { "&Exact match","Genaue Übereinstimmung" }, | 336 | { "&Exact match","Genaue Übereinstimmung" }, |
337 | { "&Case sensitive","Großschrift abhängig" }, | 337 | { "&Case sensitive","Großschrift abhängig" }, |
338 | { "Search in Column","Suche in Spalten" }, | 338 | { "Search in Column","Suche in Spalten" }, |
339 | { "&Description","Beschreibung" }, | 339 | { "&Description","Beschreibung" }, |
340 | { "C&omment","Kommentar" }, | 340 | { "C&omment","Kommentar" }, |
341 | { "&Username","Benutzername" }, | 341 | { "&Username","Benutzername" }, |
342 | { "U&RL","URL" }, | 342 | { "U&RL","URL" }, |
343 | { "delete?","Löschen?" }, | 343 | { "delete?","Löschen?" }, |
344 | { "Do you really want to delete\nthe selected entry","Wollen Sie wirklich\nden Eintrag löschen:" }, | 344 | { "Do you really want to delete\nthe selected entry","Wollen Sie wirklich\nden Eintrag löschen:" }, |
345 | { "Save?","Speichern?" }, | 345 | { "Save?","Speichern?" }, |
346 | { ""\nhas been modified.\nDo you want to save it?",""\nwurde geändert.\nMöchten Sie speichern?" }, | 346 | { ""\nhas been modified.\nDo you want to save it?",""\nwurde geändert.\nMöchten Sie speichern?" }, |
347 | { "The list\n "","Die Liste\n "" }, | 347 | { "The list\n "","Die Liste\n "" }, |
348 | { "nothing to do","Nichts zu tun" }, | 348 | { "nothing to do","Nichts zu tun" }, |
349 | { "Sorry, there's nothing to save.\nPlease first add some passwords.","Sorry, es gibt nichts zu speichern.\nBitte erst Passwörter hinzufügen." }, | 349 | { "Sorry, there's nothing to save.\nPlease first add some passwords.","Sorry, es gibt nichts zu speichern.\nBitte erst Passwörter hinzufügen." }, |
350 | { "Add new password","Passwort hinzufügen" }, | 350 | { "Add new password","Passwort hinzufügen" }, |
351 | { "Successfully saved data.","Datei gespeichert." }, | 351 | { "Successfully saved data.","Datei gespeichert." }, |
352 | { "Category:","Kategorie:" }, | 352 | { "Category:","Kategorie:" }, |
353 | { "LOCKED","GESPERRT" }, | ||
354 | { "","" }, | ||
355 | { "","" }, | ||
356 | { "","" }, | ||
353 | { "","" }, | 357 | { "","" }, |
354 | { "","" }, | 358 | { "","" }, |
355 | { "","" }, | 359 | { "","" }, |
356 | 360 | ||
diff --git a/pwmanager/pwmanager/pwmdoc.cpp b/pwmanager/pwmanager/pwmdoc.cpp index 6fbe110..61f2616 100644 --- a/pwmanager/pwmanager/pwmdoc.cpp +++ b/pwmanager/pwmanager/pwmdoc.cpp | |||
@@ -1197,193 +1197,193 @@ bool PwMDoc::deSerializeDta(const string *d, bool entriesLocked) | |||
1197 | return false; | 1197 | return false; |
1198 | #endif | 1198 | #endif |
1199 | 1199 | ||
1200 | emitDataChanged(this); | 1200 | emitDataChanged(this); |
1201 | return true; | 1201 | return true; |
1202 | } | 1202 | } |
1203 | 1203 | ||
1204 | bool PwMDoc::getEntry(const QString &category, unsigned int index, | 1204 | bool PwMDoc::getEntry(const QString &category, unsigned int index, |
1205 | PwMDataItem * d, bool unlockIfLocked) | 1205 | PwMDataItem * d, bool unlockIfLocked) |
1206 | { | 1206 | { |
1207 | PWM_ASSERT(d); | 1207 | PWM_ASSERT(d); |
1208 | unsigned int cat = 0; | 1208 | unsigned int cat = 0; |
1209 | 1209 | ||
1210 | if (!findCategory(category, &cat)) { | 1210 | if (!findCategory(category, &cat)) { |
1211 | BUG(); | 1211 | BUG(); |
1212 | return false; | 1212 | return false; |
1213 | } | 1213 | } |
1214 | 1214 | ||
1215 | return getEntry(cat, index, d, unlockIfLocked); | 1215 | return getEntry(cat, index, d, unlockIfLocked); |
1216 | } | 1216 | } |
1217 | 1217 | ||
1218 | bool PwMDoc::getEntry(unsigned int category, unsigned int index, | 1218 | bool PwMDoc::getEntry(unsigned int category, unsigned int index, |
1219 | PwMDataItem *d, bool unlockIfLocked) | 1219 | PwMDataItem *d, bool unlockIfLocked) |
1220 | { | 1220 | { |
1221 | if (index > dti.dta[category].d.size() - 1) | 1221 | if (index > dti.dta[category].d.size() - 1) |
1222 | return false; | 1222 | return false; |
1223 | 1223 | ||
1224 | bool locked = isLocked(category, index); | 1224 | bool locked = isLocked(category, index); |
1225 | if (locked) { | 1225 | if (locked) { |
1226 | /* this entry is locked. We don't return a password, | 1226 | /* this entry is locked. We don't return a password, |
1227 | * until it's unlocked by the user by inserting | 1227 | * until it's unlocked by the user by inserting |
1228 | * chipcard or entering the mpw | 1228 | * chipcard or entering the mpw |
1229 | */ | 1229 | */ |
1230 | if (unlockIfLocked) { | 1230 | if (unlockIfLocked) { |
1231 | if (!lockAt(category, index, false)) { | 1231 | if (!lockAt(category, index, false)) { |
1232 | return false; | 1232 | return false; |
1233 | } | 1233 | } |
1234 | locked = false; | 1234 | locked = false; |
1235 | } | 1235 | } |
1236 | } | 1236 | } |
1237 | 1237 | ||
1238 | *d = dti.dta[category].d[index]; | 1238 | *d = dti.dta[category].d[index]; |
1239 | if (locked) | 1239 | if (locked) |
1240 | d->pw = LOCKED_STRING.latin1(); | 1240 | d->pw = LOCKED_STRING.latin1(); |
1241 | 1241 | ||
1242 | return true; | 1242 | return true; |
1243 | } | 1243 | } |
1244 | PwMerror PwMDoc::getCommentByLvp(const QString &category, int listViewPos, | 1244 | PwMerror PwMDoc::getCommentByLvp(const QString &category, int listViewPos, |
1245 | string *foundComment) | 1245 | string *foundComment) |
1246 | { | 1246 | { |
1247 | PWM_ASSERT(foundComment); | 1247 | PWM_ASSERT(foundComment); |
1248 | unsigned int cat = 0; | 1248 | unsigned int cat = 0; |
1249 | 1249 | ||
1250 | if (!findCategory(category, &cat)) | 1250 | if (!findCategory(category, &cat)) |
1251 | return e_invalidArg; | 1251 | return e_invalidArg; |
1252 | 1252 | ||
1253 | unsigned int i, entries = numEntries(cat); | 1253 | unsigned int i, entries = numEntries(cat); |
1254 | for (i = 0; i < entries; ++i) { | 1254 | for (i = 0; i < entries; ++i) { |
1255 | if (dti.dta[cat].d[i].listViewPos == listViewPos) { | 1255 | if (dti.dta[cat].d[i].listViewPos == listViewPos) { |
1256 | *foundComment = dti.dta[cat].d[i].comment; | 1256 | *foundComment = dti.dta[cat].d[i].comment; |
1257 | if (dti.dta[cat].d[i].binary) | 1257 | if (dti.dta[cat].d[i].binary) |
1258 | return e_binEntry; | 1258 | return e_binEntry; |
1259 | return e_normalEntry; | 1259 | return e_normalEntry; |
1260 | } | 1260 | } |
1261 | } | 1261 | } |
1262 | BUG(); | 1262 | BUG(); |
1263 | return e_generic; | 1263 | return e_generic; |
1264 | } | 1264 | } |
1265 | 1265 | ||
1266 | PwMerror PwMDoc::getCommentByLvp_long(const QString &category, int listViewPos, | 1266 | PwMerror PwMDoc::getCommentByLvp_long(const QString &category, int listViewPos, |
1267 | string *foundComment) | 1267 | string *foundComment) |
1268 | { | 1268 | { |
1269 | PWM_ASSERT(foundComment); | 1269 | PWM_ASSERT(foundComment); |
1270 | unsigned int cat = 0; | 1270 | unsigned int cat = 0; |
1271 | 1271 | ||
1272 | if (!findCategory(category, &cat)) | 1272 | if (!findCategory(category, &cat)) |
1273 | return e_invalidArg; | 1273 | return e_invalidArg; |
1274 | 1274 | ||
1275 | unsigned int i, entries = numEntries(cat); | 1275 | unsigned int i, entries = numEntries(cat); |
1276 | for (i = 0; i < entries; ++i) { | 1276 | for (i = 0; i < entries; ++i) { |
1277 | if (dti.dta[cat].d[i].listViewPos == listViewPos) { | 1277 | if (dti.dta[cat].d[i].listViewPos == listViewPos) { |
1278 | if (dti.dta[cat].d[i].binary) | 1278 | if (dti.dta[cat].d[i].binary) |
1279 | return e_binEntry; | 1279 | return e_binEntry; |
1280 | PwMCategoryItem* catItem = getCategoryEntry(cat); | 1280 | PwMCategoryItem* catItem = getCategoryEntry(cat); |
1281 | QString retval; | 1281 | QString retval; |
1282 | QString tempval = QString (dti.dta[cat].d[i].desc.c_str()); | 1282 | QString tempval = QString (dti.dta[cat].d[i].desc.c_str()); |
1283 | if ( !tempval.isEmpty() ) { | 1283 | if ( !tempval.isEmpty() ) { |
1284 | retval += "<b>" +QString ( catItem->desc_text.c_str() )+ ":</b> "+ tempval+"<br>" ; | 1284 | retval += "<b>" +QString ( catItem->desc_text.c_str() )+ ":</b> "+ tempval+"<br>" ; |
1285 | } | 1285 | } |
1286 | tempval = QString (dti.dta[cat].d[i].name.c_str()); | 1286 | tempval = QString (dti.dta[cat].d[i].name.c_str()); |
1287 | if ( !tempval.isEmpty() ) { | 1287 | if ( !tempval.isEmpty() ) { |
1288 | retval += "<b>" +QString ( catItem->name_text.c_str() ) + ":</b> "+ tempval+"<br>" ; | 1288 | retval += "<b>" +QString ( catItem->name_text.c_str() ) + ":</b> "+ tempval+"<br>" ; |
1289 | } | 1289 | } |
1290 | tempval = QString (dti.dta[cat].d[i].pw.c_str()); | 1290 | tempval = QString (dti.dta[cat].d[i].pw.c_str()); |
1291 | if ( !tempval.isEmpty() ) { | 1291 | if ( !tempval.isEmpty() ) { |
1292 | if ( dti.dta[cat].d[i].lockStat ) | 1292 | if ( dti.dta[cat].d[i].lockStat ) |
1293 | retval += "<b>" +QString ( catItem->pw_text.c_str() )+ ":</b> " + i18n("<LOCKED>") +"<br>" ; | 1293 | retval += "<b>" +QString ( catItem->pw_text.c_str() )+ ": " + i18n("LOCKED") +"</b><br>" ; |
1294 | else | 1294 | else |
1295 | retval += "<b>" +QString ( catItem->pw_text.c_str() )+ ":</b> " + tempval+"<br>" ; | 1295 | retval += "<b>" +QString ( catItem->pw_text.c_str() )+ ":</b> " + tempval+"<br>" ; |
1296 | } | 1296 | } |
1297 | tempval = QString (dti.dta[cat].d[i].url.c_str()); | 1297 | tempval = QString (dti.dta[cat].d[i].url.c_str()); |
1298 | if ( !tempval.isEmpty() ) { | 1298 | if ( !tempval.isEmpty() ) { |
1299 | retval += "<b>" +i18n("URL:")+ "</b> " + tempval+"<br>" ; | 1299 | retval += "<b>" +i18n("URL:")+ "</b> " + tempval+"<br>" ; |
1300 | } | 1300 | } |
1301 | tempval = QString (dti.dta[cat].d[i].launcher.c_str()); | 1301 | tempval = QString (dti.dta[cat].d[i].launcher.c_str()); |
1302 | if ( !tempval.isEmpty() ) { | 1302 | if ( !tempval.isEmpty() ) { |
1303 | retval += "<b>" +i18n("Launcher:")+ "</b> " + tempval+"<br>" ; | 1303 | retval += "<b>" +i18n("Launcher:")+ "</b> " + tempval+"<br>" ; |
1304 | } | 1304 | } |
1305 | tempval = QString (dti.dta[cat].d[i].comment.c_str()); | 1305 | tempval = QString (dti.dta[cat].d[i].comment.c_str()); |
1306 | if ( !tempval.isEmpty() ) { | 1306 | if ( !tempval.isEmpty() ) { |
1307 | tempval.replace(QRegExp ( "\n" ), "<br>" ); | 1307 | tempval.replace(QRegExp ( "\n" ), "<br>" ); |
1308 | retval += "<b>" +i18n("Comment:")+ "</b><br>" + tempval+"<br>" ; | 1308 | retval += "<b>" +i18n("Comment:")+ "</b><br>" + tempval+"<br>" ; |
1309 | } | 1309 | } |
1310 | 1310 | ||
1311 | string ret ( retval.latin1() ); | 1311 | string ret ( retval.latin1() ); |
1312 | 1312 | ||
1313 | 1313 | ||
1314 | // *foundComment = dti.dta[cat].d[i].comment; | 1314 | // *foundComment = dti.dta[cat].d[i].comment; |
1315 | *foundComment = ret; | 1315 | *foundComment = ret; |
1316 | return e_normalEntry; | 1316 | return e_normalEntry; |
1317 | } | 1317 | } |
1318 | } | 1318 | } |
1319 | BUG(); | 1319 | BUG(); |
1320 | return e_generic; | 1320 | return e_generic; |
1321 | } | 1321 | } |
1322 | 1322 | ||
1323 | bool PwMDoc::compressDta(string *d, char algo) | 1323 | bool PwMDoc::compressDta(string *d, char algo) |
1324 | { | 1324 | { |
1325 | PWM_ASSERT(d); | 1325 | PWM_ASSERT(d); |
1326 | switch (algo) { | 1326 | switch (algo) { |
1327 | case PWM_COMPRESS_GZIP: { | 1327 | case PWM_COMPRESS_GZIP: { |
1328 | CompressGzip comp; | 1328 | CompressGzip comp; |
1329 | return comp.compress(d); | 1329 | return comp.compress(d); |
1330 | } | 1330 | } |
1331 | #ifndef PWM_EMBEDDED | 1331 | #ifndef PWM_EMBEDDED |
1332 | case PWM_COMPRESS_BZIP2: { | 1332 | case PWM_COMPRESS_BZIP2: { |
1333 | CompressBzip2 comp; | 1333 | CompressBzip2 comp; |
1334 | return comp.compress(d); | 1334 | return comp.compress(d); |
1335 | } | 1335 | } |
1336 | #endif | 1336 | #endif |
1337 | case PWM_COMPRESS_NONE: { | 1337 | case PWM_COMPRESS_NONE: { |
1338 | return true; | 1338 | return true; |
1339 | } default: { | 1339 | } default: { |
1340 | BUG(); | 1340 | BUG(); |
1341 | } | 1341 | } |
1342 | } | 1342 | } |
1343 | return false; | 1343 | return false; |
1344 | } | 1344 | } |
1345 | 1345 | ||
1346 | bool PwMDoc::decompressDta(string *d, char algo) | 1346 | bool PwMDoc::decompressDta(string *d, char algo) |
1347 | { | 1347 | { |
1348 | PWM_ASSERT(d); | 1348 | PWM_ASSERT(d); |
1349 | switch (algo) { | 1349 | switch (algo) { |
1350 | case PWM_COMPRESS_GZIP: { | 1350 | case PWM_COMPRESS_GZIP: { |
1351 | CompressGzip comp; | 1351 | CompressGzip comp; |
1352 | return comp.decompress(d); | 1352 | return comp.decompress(d); |
1353 | } | 1353 | } |
1354 | #ifndef PWM_EMBEDDED | 1354 | #ifndef PWM_EMBEDDED |
1355 | case PWM_COMPRESS_BZIP2: { | 1355 | case PWM_COMPRESS_BZIP2: { |
1356 | CompressBzip2 comp; | 1356 | CompressBzip2 comp; |
1357 | return comp.decompress(d); | 1357 | return comp.decompress(d); |
1358 | } | 1358 | } |
1359 | #endif | 1359 | #endif |
1360 | case PWM_COMPRESS_NONE: { | 1360 | case PWM_COMPRESS_NONE: { |
1361 | return true; | 1361 | return true; |
1362 | } | 1362 | } |
1363 | } | 1363 | } |
1364 | return false; | 1364 | return false; |
1365 | } | 1365 | } |
1366 | 1366 | ||
1367 | PwMerror PwMDoc::encrypt(string *d, const QString *pw, QFile *f, char algo, | 1367 | PwMerror PwMDoc::encrypt(string *d, const QString *pw, QFile *f, char algo, |
1368 | char hashalgo //US BUG: pass _hashalgo because we need it in hashPassphrase | 1368 | char hashalgo //US BUG: pass _hashalgo because we need it in hashPassphrase |
1369 | ) | 1369 | ) |
1370 | { | 1370 | { |
1371 | PWM_ASSERT(d); | 1371 | PWM_ASSERT(d); |
1372 | PWM_ASSERT(pw); | 1372 | PWM_ASSERT(pw); |
1373 | PWM_ASSERT(f); | 1373 | PWM_ASSERT(f); |
1374 | 1374 | ||
1375 | size_t encSize; | 1375 | size_t encSize; |
1376 | byte *encrypted = 0; | 1376 | byte *encrypted = 0; |
1377 | 1377 | ||
1378 | switch (algo) { | 1378 | switch (algo) { |
1379 | case PWM_CRYPT_BLOWFISH: { | 1379 | case PWM_CRYPT_BLOWFISH: { |
1380 | Blowfish::padNull(d); | 1380 | Blowfish::padNull(d); |
1381 | encSize = d->length(); | 1381 | encSize = d->length(); |
1382 | encrypted = new byte[encSize]; | 1382 | encrypted = new byte[encSize]; |
1383 | Blowfish bf; | 1383 | Blowfish bf; |
1384 | if (bf.bf_setkey((byte *) pw->latin1(), pw->length())) { | 1384 | if (bf.bf_setkey((byte *) pw->latin1(), pw->length())) { |
1385 | delete [] encrypted; | 1385 | delete [] encrypted; |
1386 | return e_weakPw; | 1386 | return e_weakPw; |
1387 | } | 1387 | } |
1388 | bf.bf_encrypt((byte *) encrypted, (byte *) d->c_str(), encSize); | 1388 | bf.bf_encrypt((byte *) encrypted, (byte *) d->c_str(), encSize); |
1389 | break; | 1389 | break; |