From 27dfc34d411dee76f09f5e516c60b0a64eb35948 Mon Sep 17 00:00:00 2001 From: ar Date: Mon, 31 May 2004 15:26:50 +0000 Subject: - convert qWarning to owarn --- (limited to 'noncore/apps/zsafe') diff --git a/noncore/apps/zsafe/main.cpp b/noncore/apps/zsafe/main.cpp index 4fe319b..5f48f77 100644 --- a/noncore/apps/zsafe/main.cpp +++ b/noncore/apps/zsafe/main.cpp @@ -8,11 +8,19 @@ #include "zsafe.h" + +/* OPIE */ +#include +using namespace Opie::Core; + +/* QT */ #ifdef DESKTOP #include #else #include #endif + +/* STD */ #include #include @@ -58,10 +66,10 @@ int main( int argc, char ** argv ) DeskW = atoi(argv[1]); DeskH = atoi(argv[2]); #else - int w, h; - sscanf (argv[1], "%d", &w); - sscanf (argv[2], "%d", &h); - DeskW = w; + int w, h; + sscanf (argv[1], "%d", &w); + sscanf (argv[2], "%d", &h); + DeskW = w; DeskH = h; #endif } @@ -74,19 +82,16 @@ int main( int argc, char ** argv ) DeskW = a.desktop()->width(); DeskH = a.desktop()->height(); - char buf[128]; - sprintf (buf, "Width: %d Height: %d\n", DeskW, DeskH); - qWarning (buf); + owarn << "Width: " << DeskW << " Height: " << DeskH << oendl; #ifdef JPATCH_HDE // nothings #else - if (DeskW > 240) + if (DeskW > 240) { DeskW -= 20; DeskH += 25; - sprintf (buf, "Changed width: %d Height: %d\n", DeskW, DeskH); - qWarning (buf); + owarn << "Changed width: " << DeskW << " Height: " << DeskH << oendl; } #endif diff --git a/noncore/apps/zsafe/zlistview.cpp b/noncore/apps/zsafe/zlistview.cpp index ba02a15..7d0b8c2 100644 --- a/noncore/apps/zsafe/zlistview.cpp +++ b/noncore/apps/zsafe/zlistview.cpp @@ -3,9 +3,14 @@ */ #include "zlistview.h" -#include #include "zsafe.h" +/* OPIE */ +//#include + +/* STD */ +#include + ZListView::ZListView (ZSafe *zsafe, const char *id) : QListView(zsafe, id) { zs = zsafe; @@ -18,9 +23,7 @@ ZListView::~ZListView() void ZListView::keyPressEvent ( QKeyEvent *e ) { /* - char buf[64]; - sprintf (buf, "key: %d\n", e->key()); - qWarning (buf); + owarn << "key: " << e->key() << oendl; */ switch (e->key()) diff --git a/noncore/apps/zsafe/zsafe.cpp b/noncore/apps/zsafe/zsafe.cpp index 6ff05ac..ca3ff52 100644 --- a/noncore/apps/zsafe/zsafe.cpp +++ b/noncore/apps/zsafe/zsafe.cpp @@ -881,7 +881,7 @@ void ZSafe::findPwd() name = dialog->NameField->text(); username = dialog->UsernameField->text(); comment = dialog->CommentField->text(); - qWarning (name); + owarn << name << oendl; } else { @@ -927,7 +927,7 @@ void ZSafe::findPwd() i != NULL; i = i->nextSibling()) { - qWarning (i->text(0)); + owarn << i->text(0) << oendl; i->setSelected(FALSE); // step through all subitems @@ -941,7 +941,7 @@ void ZSafe::findPwd() si != NULL; si = si->nextSibling()) { - qWarning (si->text(0)); + owarn << si->text(0) << oendl; if (si->isSelected()) si->setSelected(FALSE); // ListView->repaintItem(si); @@ -958,7 +958,7 @@ void ZSafe::findPwd() if ((n && u && c ) && !found) { - qWarning ("Found"); + owarn << "Found" << oendl; selectedItem = si; si->setSelected(TRUE); ListView->setCurrentItem(si); @@ -1228,8 +1228,7 @@ void ZSafe::removeAsciiFile() QFile f( fn ); if ( !f.remove() ) { - qWarning( QString("Could not remove file %1").arg(fn), - 2000 ); + owarn << "Could not remove file " << fn << oendl; QMessageBox::critical( 0, tr("ZSafe"), tr("Could not remove text file.") ); return; @@ -1278,8 +1277,7 @@ void ZSafe::writeAllEntries() { QFile f( fn ); if ( !f.open( IO_WriteOnly ) ) { - qWarning( QString("Could not write to file %1").arg(fn), - 2000 ); + owarn << "Could not write to file " << fn << oendl; QMessageBox::critical( 0, "ZSafe", QString("Could not export to text file.") ); return; @@ -1322,10 +1320,10 @@ void ZSafe::writeAllEntries() oneEntry += "\""; oneEntry += si->text(5); oneEntry += "\""; - // qWarning (oneEntry); + // owarn << oneEntry << oendl; t << oneEntry << endl; - // qWarning (si->text(0)); + // owarn << si->text(0) << oendl; } } f.close(); @@ -1373,8 +1371,7 @@ void ZSafe::readAllEntries() QFile f( fn ); if ( !f.open( IO_ReadOnly ) ) { - qWarning( QString("Could not read file %1").arg(fn), - 2000 ); + owarn << "Could not read file " << fn << oendl; QMessageBox::critical( 0, "ZSafe", QString("Could not import text file.") ); return; @@ -1403,7 +1400,7 @@ void ZSafe::readAllEntries() } } - qWarning ("ReadAllEntries(): "); + owarn << "ReadAllEntries(): " << oendl; QTextStream t(&f); while ( !t.eof() ) @@ -1554,8 +1551,7 @@ void ZSafe::writeAllEntries() QString fn = filename + ".txt"; QFile f( fn ); if ( !f.open( IO_WriteOnly ) ) { - qWarning( QString("Could not write to file %1").arg(fn), - 2000 ); + owarn << "Could not write to file " << fn << oendl; QMessageBox::critical( 0, tr("ZSafe"), tr("Could not export to text file.") ); return; @@ -1593,10 +1589,10 @@ void ZSafe::writeAllEntries() comment.replace (QRegExp("\n"), "
"); oneEntry += comment; oneEntry += "\""; - // qWarning (oneEntry); + // owarn << oneEntry << oendl; t << oneEntry << endl; - // qWarning (si->text(0)); + // owarn << si->text(0) << oendl; } } f.close(); @@ -1608,8 +1604,7 @@ void ZSafe::readAllEntries() QFile f( fn ); if ( !f.open( IO_ReadOnly ) ) { - qWarning( QString("Could not read file %1").arg(fn), - 2000 ); + owarn << "Could not read file " << fn << oendl; QMessageBox::critical( 0, tr("ZSafe"), tr("Could not import text file.") ); return; @@ -1638,7 +1633,7 @@ void ZSafe::readAllEntries() } } - qWarning ("ReadAllEntries(): "); + owarn << "ReadAllEntries(): " << oendl; QTextStream t(&f); while ( !t.eof() ) @@ -1762,7 +1757,7 @@ void ZSafe::readAllEntries() void ZSafe::resume(int) { - qWarning ("Resume"); + owarn << "Resume" << oendl; // hide the main window infoForm->hide(); @@ -1818,7 +1813,7 @@ bool ZSafe::openDocument(const char* _filename, const char* ) getDocPassword(tr("Enter Password")); if (m_password.isEmpty() && validationFlag == 0) { - qWarning ("Wrong password"); + owarn << "Wrong password" << oendl; QMessageBox::critical( 0, tr("ZSafe"), tr("Wrong password.\n\nZSafe will now exit.") ); exitZs (1); @@ -1827,7 +1822,7 @@ bool ZSafe::openDocument(const char* _filename, const char* ) retval = loadInit(_filename, m_password); if (retval != PWERR_GOOD) { - qWarning ("Error loading Document"); + owarn << "Error loading Document" << oendl; return false; } } @@ -2301,7 +2296,7 @@ void ZSafe::setPasswordDialogDone() void ZSafe::getDocPassword(QString title) { -qWarning ("getDocPassword"); + owarn << "getDocPassword" << oendl; // open the 'Password' dialog PasswordForm *dialog = new PasswordForm(this, title, TRUE); newPwdDialog = dialog; @@ -2480,7 +2475,7 @@ int ZSafe::saveFinalize(void) void ZSafe::quitMe () { - qWarning ("QUIT..."); + owarn << "QUIT..." << oendl; if (modified) { @@ -2684,7 +2679,7 @@ void ZSafe::addCategory() category = dialog->CategoryField->currentText(); icon = dialog->IconField->currentText()+".png"; - qWarning (category); + owarn << category << oendl; QListViewItem *li = new ShadedListItem( 1, ListView ); Category *c1 = new Category(); @@ -3192,7 +3187,7 @@ void ZSafe::editCategory() QListViewItem *catItem = cat->getListItem(); if (catItem) { - qWarning (category); + owarn << category << oendl; catItem->setText( 0, tr( category ) ); cat->setCategoryName (tr(category)); @@ -3593,7 +3588,7 @@ void ZSafe::paintEvent( QPaintEvent * ) void ZSafe::resizeEvent ( QResizeEvent * ) { - // qWarning ("resizeEvent"); + // owarn << "resizeEvent" << oendl; #ifndef DESKTOP DeskW = appl->desktop()->width(); DeskH = appl->desktop()->height(); -- cgit v0.9.0.2