-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | noncore/apps/zsafe/zsafe.cpp | 59 |
2 files changed, 16 insertions, 44 deletions
@@ -2,2 +2,3 @@ | |||
2 | 2 | ||
3 | * Fixed ZSafe not starting up (Bug #1324) (mickeyl) | ||
3 | * Fixed Drawpad initialization (Bug #1314) (mickeyl) | 4 | * Fixed Drawpad initialization (Bug #1314) (mickeyl) |
diff --git a/noncore/apps/zsafe/zsafe.cpp b/noncore/apps/zsafe/zsafe.cpp index bf8f7f4..6ff05ac 100644 --- a/noncore/apps/zsafe/zsafe.cpp +++ b/noncore/apps/zsafe/zsafe.cpp | |||
@@ -489,44 +489,17 @@ ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl ) | |||
489 | #endif | 489 | #endif |
490 | // setCaption( tr( "ZSafe" ) ); | 490 | setCaption( tr( "ZSafe" ) ); |
491 | 491 | QString zsafeAppDirPath = QDir::homeDirPath() + "/Documents/application/zsafe"; | |
492 | filename = conf->readEntry(APP_KEY+"document"); | 492 | QString filename = conf->readEntry(APP_KEY+"document"); |
493 | if (filename.isEmpty() || filename.isNull()) | 493 | if (filename.isEmpty() || filename.isNull()) |
494 | { | 494 | { |
495 | 495 | if ( !QDir( zsafeAppDirPath ).exists() ) | |
496 | // check if the directory application exists, if not | ||
497 | // create it | ||
498 | // #ifndef WIN32 | ||
499 | // QString d1("Documents/application"); | ||
500 | // #else | ||
501 | QString d1(QDir::homeDirPath() + "/Documents/application"); | ||
502 | // #endif | ||
503 | QDir pd1(d1); | ||
504 | if (!pd1.exists()) | ||
505 | { | ||
506 | QDir pd1("Documents"); | ||
507 | if (!pd1.mkdir("application", FALSE)) | ||
508 | { | 496 | { |
509 | QMessageBox::critical( 0, tr("ZSafe"), | 497 | //FIXME: Pending someone to look into why QDir.mkdir does not work as expected |
510 | #ifdef JPATCH_HDE | 498 | QString cmdline = QString().sprintf( "mkdir -p %s", (const char*) zsafeAppDirPath ); |
511 | tr("Can't create directory\n.../Documents/application\n\nZSafe will now exit.")); | 499 | ::system( cmdline ); |
512 | #else | ||
513 | tr("Can't create directory\n%1\n\nZSafe will now exit.").arg(d1)); | ||
514 | #endif | ||
515 | exitZs (1); | ||
516 | } | 500 | } |
517 | } | 501 | if ( !QDir( zsafeAppDirPath ).exists() ) |
518 | QString d2(QDir::homeDirPath() + "/Documents/application/zsafe"); | ||
519 | QDir pd2(d2); | ||
520 | if (!pd2.exists()) | ||
521 | { | ||
522 | QDir pd2(QDir::homeDirPath() + "Documents/application"); | ||
523 | if (!pd2.mkdir("zsafe", FALSE)) | ||
524 | { | 502 | { |
525 | QMessageBox::critical( 0, tr("ZSafe"), | 503 | QMessageBox::critical( 0, "ZSafe", tr("Can't create application data directory.\nZSafe will now exit.")); |
526 | #ifdef JPATCH_HDE | 504 | exitZs (1); |
527 | tr("Can't create directory\n...//Documents/application/zsafe\n\nZSafe will now exit.")); | ||
528 | #else | ||
529 | tr("Can't create directory\n%1\n\nZSafe will now exit.").arg(d2)); | ||
530 | #endif | ||
531 | exitZs (1); | ||
532 | } | 505 | } |
@@ -534,5 +507,4 @@ ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl ) | |||
534 | 507 | ||
535 | |||
536 | // set the default filename | 508 | // set the default filename |
537 | filename=d2 + "/passwords.zsf"; | 509 | filename = zsafeAppDirPath + "/passwords.zsf"; |
538 | 510 | ||
@@ -541,3 +513,2 @@ ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl ) | |||
541 | saveConf(); | 513 | saveConf(); |
542 | } | ||
543 | 514 | ||
@@ -2258,3 +2229,3 @@ bool ZSafe::saveDocument(const char* _filename, | |||
2258 | if (retval == PWERR_DATA) { | 2229 | if (retval == PWERR_DATA) { |
2259 | owarn << "1: Error writing file, contents not saved" << oendl; | 2230 | owarn << "1: Error writing file, contents not saved" << oendl; |
2260 | saveFinalize(); | 2231 | saveFinalize(); |
@@ -2302,3 +2273,3 @@ bool ZSafe::saveDocument(const char* _filename, | |||
2302 | if (retval == PWERR_DATA) { | 2273 | if (retval == PWERR_DATA) { |
2303 | owarn << "1: Error writing file, contents not saved" << oendl; | 2274 | owarn << "1: Error writing file, contents not saved" << oendl; |
2304 | saveFinalize(); | 2275 | saveFinalize(); |
@@ -2311,3 +2282,3 @@ bool ZSafe::saveDocument(const char* _filename, | |||
2311 | if (saveFinalize() == PWERR_DATA) { | 2282 | if (saveFinalize() == PWERR_DATA) { |
2312 | owarn << "2: Error writing file, contents not saved" << oendl; | 2283 | owarn << "2: Error writing file, contents not saved" << oendl; |
2313 | return false; | 2284 | return false; |
@@ -3189,3 +3160,3 @@ void ZSafe::editCategory() | |||
3189 | { | 3160 | { |
3190 | owarn << "Category found" << oendl; | 3161 | owarn << "Category found" << oendl; |
3191 | 3162 | ||