summaryrefslogtreecommitdiff
path: root/noncore/apps/zsafe/zsafe.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/zsafe/zsafe.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/zsafe/zsafe.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/noncore/apps/zsafe/zsafe.cpp b/noncore/apps/zsafe/zsafe.cpp
index 3df55eb..bf8f7f4 100644
--- a/noncore/apps/zsafe/zsafe.cpp
+++ b/noncore/apps/zsafe/zsafe.cpp
@@ -20,35 +20,34 @@
#include "zsafe.h"
#include "newdialog.h"
#include "searchdialog.h"
#include "categorydialog.h"
#include "passworddialog.h"
#include "infoform.h"
#include "zlistview.h"
#include "shadedlistitem.h"
#ifndef DESKTOP
#ifndef NO_OPIE
#include <opie2/ofiledialog.h>
-
+#include <opie2/odebug.h>
+using namespace Opie::Core;
using namespace Opie::Ui;
#else
#include "scqtfileedit.h"
#endif
#endif
#include <qclipboard.h>
-#include <stdio.h>
-
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdlib.h>
#ifndef WIN32
#include <unistd.h>
#endif
#include <string.h>
#include <errno.h>
#include <qmenubar.h>
#include <qpopupmenu.h>
@@ -2060,45 +2059,43 @@ int ZSafe::loadInit(const char* _filename, const char *password)
return PWERR_OPEN;
buffer = (char *)malloc(load_buffer_length);
for (j = 0; password[j] != '\0'; j++) {
key[j] = password[j];
}
keylength = j;
krc2->rc2_expandkey (key, keylength, 128);
#ifndef WIN32
size = read(fileno (fd), (unsigned char *) (charbuf + count), 8);
#else
- printf ("LoadInit() read1");
size = fread ((unsigned char *) (charbuf + count), sizeof(unsigned char), 8, fd);
#endif
if (size < 8)
return PWERR_DATA;
for (count = 0; count < 4; count++) {
count2 = count << 1;
iv[count] = charbuf[count2] << 8;
iv[count] += charbuf[count2 + 1];
}
size = 0;
bufferIndex = 0;
#ifndef WIN32
while ((count = read (fileno (fd), (unsigned char *) charbuf, 8)) > 0) {
while (count < 8) {
count2 = read (fileno (fd), (unsigned char *) (charbuf + count), 8);
#else
- printf ("LoadInit() read2");
while ((count = fread ((unsigned char *) (charbuf), sizeof(unsigned char), 8, fd)) > 0) {
while (count < 8) {
count2 = fread ((unsigned char *) (charbuf + count), sizeof(unsigned char), 8, fd);
#endif
if (count2 == 0) {
return PWERR_DATA;
}
count += count2;
} /* while (count < 8) */
size += 8;
for (count2 = 0; count2 < 8; count2 += 2) {
@@ -2250,25 +2247,25 @@ bool ZSafe::saveDocument(const char* _filename,
strcpy(entry[i++], "password");
entry[i] = (char*)malloc(strlen("comment")+1);
strcpy(entry[i++], "comment");
entry[i] = (char*)malloc(strlen("field5")+1);
strcpy(entry[i++], "field5");
entry[i] = (char*)malloc(strlen("field6")+1);
strcpy(entry[i++], "field6");
retval = saveEntry(entry);
for (int z=0; z<i; z++) free(entry[z]);
if (retval == PWERR_DATA) {
- qWarning("1: Error writing file, contents not saved");
+ owarn << "1: Error writing file, contents not saved" << oendl;
saveFinalize();
return false;
}
// #ifndef WIN32
conf->writeEntry(APP_KEY+"valzsafe", 1);
// #endif
saveConf();
}
QListViewItem *i;
// step through all categories
for (i = ListView->firstChild();
@@ -2294,34 +2291,34 @@ bool ZSafe::saveDocument(const char* _filename,
strcpy(entry[j++], si->text(3).utf8());
entry[j] = (char*)malloc(strlen(si->text(4).utf8())+1);
strcpy(entry[j++], si->text(4).utf8());
entry[j] = (char*)malloc(strlen(si->text(5).utf8())+1);
strcpy(entry[j++], si->text(5).utf8());
retval = saveEntry(entry);
for (int z=0; z<j; z++)
{
free(entry[z]);
}
if (retval == PWERR_DATA) {
- qWarning("1: Error writing file, contents not saved");
+ owarn << "1: Error writing file, contents not saved" << oendl;
saveFinalize();
return false;
}
}
}
if (saveFinalize() == PWERR_DATA) {
- qWarning("2: Error writing file, contents not saved");
+ owarn << "2: Error writing file, contents not saved" << oendl;
return false;
} else {
#ifndef DESKTOP
Global::statusMessage (tr("Password file saved."));
#endif
modified = false;
return true;
}
}
PasswordForm *newPwdDialog;
bool newPwdDialogResult = false;
@@ -3181,25 +3178,25 @@ void ZSafe::editCategory()
categories.remove (category);
// #ifndef WIN32
conf->removeEntry(category);
// #endif
saveConf();
}
category = dialog->CategoryField->currentText();
icon = dialog->IconField->currentText()+".png";
if (cat)
{
- qWarning("Category found");
+ owarn << "Category found" << oendl;
// if (!icon.isEmpty() && !icon.isNull())
if (icon != "predefined.png")
{
// build the full path
fullIconPath = iconPath + icon;
pix = new QPixmap (fullIconPath);
if (pix)
{
// save the full pixmap name into the config file
// #ifndef WIN32
conf->writeEntry(APP_KEY+category, icon);