summaryrefslogtreecommitdiff
path: root/noncore/apps/zsafe
authorar <ar>2004-05-31 15:26:50 (UTC)
committer ar <ar>2004-05-31 15:26:50 (UTC)
commit27dfc34d411dee76f09f5e516c60b0a64eb35948 (patch) (side-by-side diff)
treeb7f7259497630390e352a1257cac5dc59f5399a6 /noncore/apps/zsafe
parent27b09fe4f930b96e82cea9fb0eb1a9b87f7ec062 (diff)
downloadopie-27dfc34d411dee76f09f5e516c60b0a64eb35948.zip
opie-27dfc34d411dee76f09f5e516c60b0a64eb35948.tar.gz
opie-27dfc34d411dee76f09f5e516c60b0a64eb35948.tar.bz2
- convert qWarning to owarn
Diffstat (limited to 'noncore/apps/zsafe') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/zsafe/main.cpp25
-rw-r--r--noncore/apps/zsafe/zlistview.cpp11
-rw-r--r--noncore/apps/zsafe/zsafe.cpp51
3 files changed, 45 insertions, 42 deletions
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 <opie2/odebug.h>
+using namespace Opie::Core;
+
+/* QT */
#ifdef DESKTOP
#include <qapplication.h>
#else
#include <qpe/qpeapplication.h>
#endif
+
+/* STD */
#include <stdio.h>
#include <signal.h>
@@ -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 <stdio.h>
#include "zsafe.h"
+/* OPIE */
+//#include <opie2/odebug.h>
+
+/* STD */
+#include <stdio.h>
+
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"), "<br>");
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();