-rw-r--r-- | noncore/apps/zsafe/zsafe.cpp | 104 |
1 files changed, 94 insertions, 10 deletions
diff --git a/noncore/apps/zsafe/zsafe.cpp b/noncore/apps/zsafe/zsafe.cpp index 5cad7cb..824b841 100644 --- a/noncore/apps/zsafe/zsafe.cpp +++ b/noncore/apps/zsafe/zsafe.cpp @@ -930,5 +930,9 @@ void ZSafe::findPwd() username = dialog->UsernameField->text(); comment = dialog->CommentField->text(); - owarn << name << oendl; +#ifndef NO_OPIE + owarn << name << oendl; +#else + qWarning (name); +#endif } else @@ -976,5 +980,7 @@ void ZSafe::findPwd() i = i->nextSibling()) { +#ifndef NO_OPIE owarn << i->text(0) << oendl; +#endif i->setSelected(FALSE); @@ -990,5 +996,9 @@ void ZSafe::findPwd() si = si->nextSibling()) { +#ifndef NO_OPIE owarn << si->text(0) << oendl; +#else + qWarning (si->text(0)); +#endif if (si->isSelected()) si->setSelected(FALSE); @@ -1007,5 +1017,9 @@ void ZSafe::findPwd() if ((n && u && c ) && !found) { +#ifndef NO_OPIE owarn << "Found" << oendl; +#else + qWarning ("Found"); +#endif selectedItem = si; si->setSelected(TRUE); @@ -1277,5 +1291,9 @@ void ZSafe::removeAsciiFile() if ( !f.remove() ) { +#ifndef NO_OPIE owarn << "Could not remove file " << fn << oendl; +#else + qWarning( QString("Could not remove file %1").arg(fn),2000 ); +#endif QMessageBox::critical( 0, tr("ZSafe"), tr("Could not remove text file.") ); @@ -1326,5 +1344,9 @@ void ZSafe::writeAllEntries() QFile f( fn ); if ( !f.open( IO_WriteOnly ) ) { +#ifndef NO_OPIE owarn << "Could not write to file " << fn << oendl; +#else + qWarning( QString("Could not write to file %1").arg(fn),2000 ); +#endif QMessageBox::critical( 0, "ZSafe", QString("Could not export to text file.") ); @@ -1420,5 +1442,9 @@ void ZSafe::readAllEntries() if ( !f.open( IO_ReadOnly ) ) { +#ifndef NO_OPIE owarn << "Could not read file " << fn << oendl; +#else + qWarning( QString("Could not read file %1").arg(fn), 2000 ); +#endif QMessageBox::critical( 0, "ZSafe", QString("Could not import text file.") ); @@ -1449,6 +1475,10 @@ void ZSafe::readAllEntries() } +#ifndef NO_OPIE owarn << "ReadAllEntries(): " << oendl; - +#else + qWarning ("ReadAllEntries(): "); +#endif + QTextStream t(&f); while ( !t.eof() ) @@ -1596,9 +1626,20 @@ void ZSafe::readAllEntries() void ZSafe::writeAllEntries() { + if (filename.isEmpty()) + { + QMessageBox::critical( 0, tr("ZSafe"), + tr("<P>No document defined. You have to create a new document</P>")); + return; + } + // open the file for writing QString fn = filename + ".txt"; QFile f( fn ); if ( !f.open( IO_WriteOnly ) ) { +#ifndef NO_OPIE owarn << "Could not write to file " << fn << oendl; +#else + qWarning( QString("Could not write to file %1").arg(fn), 2000 ); +#endif QMessageBox::critical( 0, tr("ZSafe"), tr("Could not export to text file.") ); @@ -1653,5 +1694,9 @@ void ZSafe::readAllEntries() if ( !f.open( IO_ReadOnly ) ) { +#ifndef NO_OPIE owarn << "Could not read file " << fn << oendl; +#else + qWarning( QString("Could not read file %1").arg(fn), 2000 ); +#endif QMessageBox::critical( 0, tr("ZSafe"), tr("Could not import text file.") ); @@ -1682,6 +1727,9 @@ void ZSafe::readAllEntries() } +#ifndef NO_OPIE owarn << "ReadAllEntries(): " << oendl; - +#else + qWarning ("ReadAllEntries(): "); +#endif QTextStream t(&f); while ( !t.eof() ) @@ -1806,6 +1854,8 @@ void ZSafe::readAllEntries() void ZSafe::resume(int) { +#ifndef NO_OPIE owarn << "Resume" << oendl; - // hide the main window +#endif + // hide the main window if ( !showpwd ) @@ -1865,5 +1915,9 @@ bool ZSafe::openDocument(const char* _filename, const char* ) if (m_password.isEmpty() && validationFlag == 0) { +#ifndef NO_OPIE owarn << "Wrong password" << oendl; +#else + qWarning ("Wrong password"); +#endif QMessageBox::critical( 0, tr("ZSafe"), tr("Wrong password.\n\nZSafe will now exit.") ); @@ -1874,6 +1928,10 @@ bool ZSafe::openDocument(const char* _filename, const char* ) if (retval != PWERR_GOOD) { +#ifndef NO_OPIE owarn << "Error loading Document" << oendl; - return false; +#lese + qWarning ("Error loading Document"); +#endif + return false; } } @@ -2274,5 +2332,9 @@ bool ZSafe::saveDocument(const char* _filename, for (int z=0; z<i; z++) free(entry[z]); if (retval == PWERR_DATA) { +#ifndef NO_OPIE owarn << "1: Error writing file, contents not saved" << oendl; +#else + qWarning("1: Error writing file, contents not saved"); +#endif saveFinalize(); return false; @@ -2318,5 +2380,9 @@ bool ZSafe::saveDocument(const char* _filename, } if (retval == PWERR_DATA) { +#ifndef NO_OPIE owarn << "1: Error writing file, contents not saved" << oendl; +#else + qWarning("1: Error writing file, contents not saved"); +#endif saveFinalize(); return false; @@ -2327,6 +2393,10 @@ bool ZSafe::saveDocument(const char* _filename, if (saveFinalize() == PWERR_DATA) { +#ifndef NO_OPIE owarn << "2: Error writing file, contents not saved" << oendl; - return false; +#else + qWarning("2: Error writing file, contents not saved"); +#endif + return false; } else { #ifndef DESKTOP @@ -2348,6 +2418,8 @@ void ZSafe::setPasswordDialogDone() void ZSafe::getDocPassword(QString title) { +#ifndef NO_OPIE owarn << "getDocPassword" << oendl; - // open the 'Password' dialog +#endif + // open the 'Password' dialog PasswordForm *dialog = new PasswordForm(this, title, TRUE); newPwdDialog = dialog; @@ -2530,6 +2602,8 @@ int ZSafe::saveFinalize(void) void ZSafe::quitMe () { +#ifndef NO_OPIE owarn << "QUIT..." << oendl; - +#endif + if (modified) { @@ -2734,6 +2808,8 @@ void ZSafe::addCategory() icon = dialog->IconField->currentText()+".png"; +#ifndef NO_OPIE owarn << category << oendl; - +#endif + QListViewItem *li = new ShadedListItem( 1, ListView ); Category *c1 = new Category(); @@ -3208,6 +3284,10 @@ void ZSafe::editCategory() if (cat) { +#ifndef NO_OPIE owarn << "Category found" << oendl; - +#else + qWarning("Category found"); +#endif + // if (!icon.isEmpty() && !icon.isNull()) if (icon != "predefined.png") @@ -3242,5 +3322,9 @@ void ZSafe::editCategory() if (catItem) { +#ifndef NO_OPIE owarn << category << oendl; +#else + qWarning (category); +#endif catItem->setText( 0, tr( category ) ); cat->setCategoryName (tr(category)); |