-rw-r--r-- | noncore/apps/zsafe/zsafe.cpp | 86 |
1 files changed, 85 insertions, 1 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(); +#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,5 +1475,9 @@ void ZSafe::readAllEntries() } +#ifndef NO_OPIE owarn << "ReadAllEntries(): " << oendl; +#else + qWarning ("ReadAllEntries(): "); +#endif QTextStream t(&f); @@ -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,5 +1854,7 @@ void ZSafe::readAllEntries() void ZSafe::resume(int) { +#ifndef NO_OPIE owarn << "Resume" << oendl; +#endif // hide the main window @@ -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,5 +1928,9 @@ bool ZSafe::openDocument(const char* _filename, const char* ) if (retval != PWERR_GOOD) { +#ifndef NO_OPIE owarn << "Error loading Document" << oendl; +#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,5 +2393,9 @@ bool ZSafe::saveDocument(const char* _filename, if (saveFinalize() == PWERR_DATA) { +#ifndef NO_OPIE owarn << "2: Error writing file, contents not saved" << oendl; +#else + qWarning("2: Error writing file, contents not saved"); +#endif return false; } else { @@ -2348,5 +2418,7 @@ void ZSafe::setPasswordDialogDone() void ZSafe::getDocPassword(QString title) { +#ifndef NO_OPIE owarn << "getDocPassword" << oendl; +#endif // open the 'Password' dialog PasswordForm *dialog = new PasswordForm(this, title, TRUE); @@ -2530,5 +2602,7 @@ int ZSafe::saveFinalize(void) void ZSafe::quitMe () { +#ifndef NO_OPIE owarn << "QUIT..." << oendl; +#endif if (modified) @@ -2734,5 +2808,7 @@ void ZSafe::addCategory() icon = dialog->IconField->currentText()+".png"; +#ifndef NO_OPIE owarn << category << oendl; +#endif QListViewItem *li = new ShadedListItem( 1, ListView ); @@ -3208,5 +3284,9 @@ void ZSafe::editCategory() if (cat) { +#ifndef NO_OPIE owarn << "Category found" << oendl; +#else + qWarning("Category found"); +#endif // if (!icon.isEmpty() && !icon.isNull()) @@ -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)); |