summaryrefslogtreecommitdiff
path: root/noncore
authormickeyl <mickeyl>2004-05-26 16:17:16 (UTC)
committer mickeyl <mickeyl>2004-05-26 16:17:16 (UTC)
commit9a79c3bb271234396696dc54ee52f2a0c2a461d6 (patch) (side-by-side diff)
treefeedc8e51e45f24fbfe376dd18523c14a1c30433 /noncore
parent2b7ebd326a7e6456471bb973b14b4ad7affb9a9d (diff)
downloadopie-9a79c3bb271234396696dc54ee52f2a0c2a461d6.zip
opie-9a79c3bb271234396696dc54ee52f2a0c2a461d6.tar.gz
opie-9a79c3bb271234396696dc54ee52f2a0c2a461d6.tar.bz2
BUGFIX: Fixed ZSafe not starting up (Bug #1324)
Diffstat (limited to 'noncore') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/zsafe/zsafe.cpp59
1 files changed, 15 insertions, 44 deletions
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 )
#endif
- // setCaption( tr( "ZSafe" ) );
-
- filename = conf->readEntry(APP_KEY+"document");
+ setCaption( tr( "ZSafe" ) );
+ QString zsafeAppDirPath = QDir::homeDirPath() + "/Documents/application/zsafe";
+ QString filename = conf->readEntry(APP_KEY+"document");
if (filename.isEmpty() || filename.isNull())
{
-
- // check if the directory application exists, if not
- // create it
-// #ifndef WIN32
- // QString d1("Documents/application");
-// #else
- QString d1(QDir::homeDirPath() + "/Documents/application");
-// #endif
- QDir pd1(d1);
- if (!pd1.exists())
- {
- QDir pd1("Documents");
- if (!pd1.mkdir("application", FALSE))
+ if ( !QDir( zsafeAppDirPath ).exists() )
{
- QMessageBox::critical( 0, tr("ZSafe"),
-#ifdef JPATCH_HDE
- tr("Can't create directory\n.../Documents/application\n\nZSafe will now exit."));
-#else
- tr("Can't create directory\n%1\n\nZSafe will now exit.").arg(d1));
-#endif
- exitZs (1);
+ //FIXME: Pending someone to look into why QDir.mkdir does not work as expected
+ QString cmdline = QString().sprintf( "mkdir -p %s", (const char*) zsafeAppDirPath );
+ ::system( cmdline );
}
- }
- QString d2(QDir::homeDirPath() + "/Documents/application/zsafe");
- QDir pd2(d2);
- if (!pd2.exists())
- {
- QDir pd2(QDir::homeDirPath() + "Documents/application");
- if (!pd2.mkdir("zsafe", FALSE))
+ if ( !QDir( zsafeAppDirPath ).exists() )
{
- QMessageBox::critical( 0, tr("ZSafe"),
-#ifdef JPATCH_HDE
- tr("Can't create directory\n...//Documents/application/zsafe\n\nZSafe will now exit."));
-#else
- tr("Can't create directory\n%1\n\nZSafe will now exit.").arg(d2));
-#endif
- exitZs (1);
+ QMessageBox::critical( 0, "ZSafe", tr("Can't create application data directory.\nZSafe will now exit."));
+ exitZs (1);
}
@@ -534,5 +507,4 @@ ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl )
-
// set the default filename
- filename=d2 + "/passwords.zsf";
+ filename = zsafeAppDirPath + "/passwords.zsf";
@@ -541,3 +513,2 @@ ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl )
saveConf();
- }
@@ -2258,3 +2229,3 @@ bool ZSafe::saveDocument(const char* _filename,
if (retval == PWERR_DATA) {
- owarn << "1: Error writing file, contents not saved" << oendl;
+ owarn << "1: Error writing file, contents not saved" << oendl;
saveFinalize();
@@ -2302,3 +2273,3 @@ bool ZSafe::saveDocument(const char* _filename,
if (retval == PWERR_DATA) {
- owarn << "1: Error writing file, contents not saved" << oendl;
+ owarn << "1: Error writing file, contents not saved" << oendl;
saveFinalize();
@@ -2311,3 +2282,3 @@ bool ZSafe::saveDocument(const char* _filename,
if (saveFinalize() == PWERR_DATA) {
- owarn << "2: Error writing file, contents not saved" << oendl;
+ owarn << "2: Error writing file, contents not saved" << oendl;
return false;
@@ -3189,3 +3160,3 @@ void ZSafe::editCategory()
{
- owarn << "Category found" << oendl;
+ owarn << "Category found" << oendl;