summaryrefslogtreecommitdiff
path: root/noncore/apps
Side-by-side diff
Diffstat (limited to 'noncore/apps') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-write/qrichtext_p.h5
-rw-r--r--noncore/apps/tableviewer/browsekeyentry.cpp11
-rw-r--r--noncore/apps/tableviewer/db/common.cpp7
-rw-r--r--noncore/apps/tableviewer/db/datacache.cpp2
-rw-r--r--noncore/apps/tableviewer/db/datacache.h12
-rw-r--r--noncore/apps/tableviewer/ui/browsekeyentry.cpp9
-rw-r--r--noncore/apps/tableviewer/ui/filterkeyentry.cpp8
-rw-r--r--noncore/apps/tableviewer/ui/tvfilterview.cpp11
-rw-r--r--noncore/apps/tinykate/libkate/kateconfig.cpp4
-rw-r--r--noncore/apps/zsafe/main.cpp15
-rw-r--r--noncore/apps/zsafe/zlistview.cpp11
-rw-r--r--noncore/apps/zsafe/zsafe.cpp51
12 files changed, 82 insertions, 64 deletions
diff --git a/noncore/apps/opie-write/qrichtext_p.h b/noncore/apps/opie-write/qrichtext_p.h
index e368edb..3778feb 100644
--- a/noncore/apps/opie-write/qrichtext_p.h
+++ b/noncore/apps/opie-write/qrichtext_p.h
@@ -29,48 +29,51 @@
** information about Qt Commercial License Agreements.
** See http://www.trolltech.com/qpl/ for QPL licensing information.
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#ifndef QRICHTEXT_P_H
#define QRICHTEXT_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of a number of Qt sources files. This header file may change from
// version to version without notice, or even be removed.
//
// We mean it.
//
//
+#include <opie2/odebug.h>
+using namespace Opie::Core;
+
#ifndef QT_H
#include "qstring.h"
#include "qlist.h"
#include "qrect.h"
#include "qfontmetrics.h"
#include "qintdict.h"
#include "qmap.h"
#include "qstringlist.h"
#include "qfont.h"
#include "qcolor.h"
#include "qsize.h"
#include "qvaluelist.h"
#include "qvaluestack.h"
#include "qobject.h"
#include "qdict.h"
#include "qtextstream.h"
#include "qpixmap.h"
#include "qstylesheet.h"
#include "qvector.h"
#include "qpainter.h"
#include "qlayout.h"
#include "qobject.h"
#include "qcomplextext_p.h"
#include "qapplication.h"
@@ -1862,49 +1865,49 @@ inline bool QTextParagraph::hasAnySelection() const
{
return mSelections ? !selections().isEmpty() : FALSE;
}
inline void QTextParagraph::setEndState( int s )
{
if ( s == state )
return;
state = s;
}
inline int QTextParagraph::endState() const
{
return state;
}
inline void QTextParagraph::setParagId( int i )
{
id = i;
}
inline int QTextParagraph::paragId() const
{
if ( id == -1 )
- qWarning( "invalid parag id!!!!!!!! (%p)", (void*)this );
+ owarn << "invalid parag id!!!!!!!! (" << (void*)this << ")" << oendl;
return id;
}
inline bool QTextParagraph::firstPreProcess() const
{
return firstPProcess;
}
inline void QTextParagraph::setFirstPreProcess( bool b )
{
firstPProcess = b;
}
inline QMap<int, QTextLineStart*> &QTextParagraph::lineStartList()
{
return lineStarts;
}
inline QTextString *QTextParagraph::string() const
{
return str;
}
inline QTextDocument *QTextParagraph::document() const
diff --git a/noncore/apps/tableviewer/browsekeyentry.cpp b/noncore/apps/tableviewer/browsekeyentry.cpp
index 04e7902..bab9af6 100644
--- a/noncore/apps/tableviewer/browsekeyentry.cpp
+++ b/noncore/apps/tableviewer/browsekeyentry.cpp
@@ -1,57 +1,59 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
** This file is part of Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include "browsekeyentry.h"
+/* OPIE */
+#include <opie2/odebug.h>
+using namespace Opie::Core;
+
+/* QT */
#include <qtoolbutton.h>
#include <qwidgetstack.h>
#include <qlayout.h>
#include <qlineedit.h>
#include <qpushbutton.h>
#include <qpopupmenu.h>
#include <qhbox.h>
#include <qdatetime.h>
-//#include <iostream.h>
-#include <qheader.h>
-// For qWarning(const char *)
/*!
\class TVBrowseKeyEntry
\brief a Widget used enter keys into the TVBrowseViewWidget
The TVBrowseKeyEntry Widget provides the facility to enter
various key types to be search on in the table. The key can be changed
and the entry field will update to the correct sort of widget appropriately
*/
/*!
Constructs the widget
*/
TVBrowseKeyEntry::TVBrowseKeyEntry(QWidget *parent, const char *name, WFlags f)
: QWidget(parent, name, f)
{
int stack_elem = 0;
QHBoxLayout *h_layout = new QHBoxLayout(this);
textKey = new QLineEdit(this, 0);
dateKey = new QHBox(this, 0);
dayKey = new QLineEdit(dateKey, 0);
monthKey = new QLineEdit(dateKey, 0);
@@ -207,36 +209,35 @@ void TVBrowseKeyEntry::searchOnText()
return;
if(!QTime::isValid(h, m, s))
return;
sendkey = (void *) new QTime(h, m, s);
break;
}
case kt_date: {
bool ok;
int d,m,y;
d = dayKey->text().toInt(&ok);
if (!ok)
return;
m = monthKey->text().toInt(&ok);
if (!ok)
return;
y = yearKey->text().toInt(&ok);
if (!ok)
return;
if(!QDate::isValid(y, m, d))
return;
sendkey = (void *) new QDate(y, m, d);
break;
}
default:
- qWarning("TVBrowseKeyEntry::searchOnText() "
- "cannot work out data type");
+ owarn << "TVBrowseKeyEntry::searchOnText() cannot work out data type" << oendl;
return;
}
emit searchOnKey(ts->current_column, sendkey);
}
/*! \fn void TVBrowseKeyEntry::searchOnKey(int currentKeyId, void *v)
This signal indicates that a search on key index currentKeyId should be
done searching for the value v.
*/
diff --git a/noncore/apps/tableviewer/db/common.cpp b/noncore/apps/tableviewer/db/common.cpp
index b58af85..c35dbea 100644
--- a/noncore/apps/tableviewer/db/common.cpp
+++ b/noncore/apps/tableviewer/db/common.cpp
@@ -839,50 +839,49 @@ int KeyList::addKey(QString name, TVVariant example)
while(find(i) && (i > -1))
i--;
replace(i, new Key(name, example, 0));
return i;
}
int KeyList::addKey(QString name, TVVariant::KeyType type)
{
/* generate a valid type for the example? */
TVVariant e = TVVariant("0");
switch(type) {
case TVVariant::String:
return addKey(name, TVVariant("<undefined>").asString());
break;
case TVVariant::Date:
return addKey(name, TVVariant(QDate::currentDate()).asDate());
break;
case TVVariant::Time:
return addKey(name, TVVariant(QTime(0,0,0)).toTime());
break;
case TVVariant::Int:
return addKey(name, TVVariant(0).toInt());
break;
default:
- qWarning(QObject::tr("KeyList::addKey() Cannot make default "
- "value for type %1, Key not added.").arg(type));
+ owarn << "KeyList::addKey() Cannot make default value for type " << type << ", Key not added." << oendl;
break;
}
return -1;
}
void KeyList::setKeyFlags(int i, int flag)
{
if(find(i))
find(i)->setFlags(flag);
}
int KeyList::getKeyFlags(int i) const
{
if(find(i))
return find(i)->flags();
return 0;
}
bool KeyList::checkNewFlag(int i) const
{
if (find(i))
return find(i)->newFlag();
return false;
}
@@ -1187,51 +1186,49 @@ void DataElem::setField(int i, QString q)
TVVariant t = TVVariant(q);
switch(kt) {
case TVVariant::Int: {
t.asInt();
setField(i, t);
return;
}
case TVVariant::String: {
t.asString();
setField(i, t);
return;
}
case TVVariant::Date: {
t.asDate();
setField(i, t);
return;
}
case TVVariant::Time: {
t.asTime();
setField(i, t);
return;
}
default:
- qWarning(
- QObject::tr("DataElem::setField(%1, %2) No valid type found").arg(i).arg(q)
- );
+ owarn << "DataElem::setField(" << i << ", " << q << ") No valid type found" << oendl;
}
}
/*!
Sets the value of the elements field index i to the value at the pointer
value.
\param i index of the field to set
\param value a pointer to the (already allocated) value to set
*/
void DataElem::setField(int i, TVVariant value)
{
if (value.isValid()) {
values.remove(i);
values.replace(i, new TVVariant(value));
}
}
/*!
Sets the value of the elements field name qs to the value represented in
the QString q.
\param qs name of the field to set
\param q a string that can be parsed to get the value to be set
diff --git a/noncore/apps/tableviewer/db/datacache.cpp b/noncore/apps/tableviewer/db/datacache.cpp
index 6380e1b..de57961 100644
--- a/noncore/apps/tableviewer/db/datacache.cpp
+++ b/noncore/apps/tableviewer/db/datacache.cpp
@@ -135,49 +135,49 @@ bool DBStore::saveSource(QIODevice *outDev, const QString &source)
archive = new DBXml(this);
} else if (source == "text/x-xml-tableviewer") {
archive = new DBCsv(this);
} else
return false;
}
return (archive->saveSource(outDev));
}
/*!
This function is used to add new elements to the database. If the database
has already reached the maximum allowable size this function does not alter
the database.
\param delm An already allocated and initialized data element to be added
*/
void DBStore::addItem(DataElem *delem)
{
addItemInternal(delem);
}
void DBStore::addItemInternal(DataElem *delem)
{
- /* if already full, don't over fill, do a qWarning though */
+ /* if already full, don't over fill, do a owarn though */
if (full) {
owarn << "Attempted to add items to already full table" << oendl;
return;
}
master_table.insert(number_elems, delem);
current_elem = number_elems;
number_elems++;
if(number_elems >= table_size) {
/* filled current table, double if we can */
table_size = table_size << 1;
/* check that the new table size is still valid, i.e. that we didn't
just shift the 1 bit of the end of the int. */
if (!table_size) {
full = true;
/* no point in doing antying else. */
return;
}
master_table.resize(table_size);
}
}
diff --git a/noncore/apps/tableviewer/db/datacache.h b/noncore/apps/tableviewer/db/datacache.h
index c5dc637..e38050c 100644
--- a/noncore/apps/tableviewer/db/datacache.h
+++ b/noncore/apps/tableviewer/db/datacache.h
@@ -6,72 +6,78 @@
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
/*
* This file is used to load the xml files that represent the database.
* The main requirment for said file is each data entry must contain a key,
* otherwise any other data headings are allowed.
*/
#ifndef __DATACACHE_H__
#define __DATACACHE_H__
+#include "common.h"
+
+/* OPIE */
+#include <opie2/odebug.h>
+using namespace Opie::Core;
+
+/* QT */
#include <qstring.h>
#include <qvector.h>
-#include "common.h"
class DBStore;
/*! Abstract class that defines how database stuff can be accessed */
class DBAccess {
public:
// DBAccess(DBStore *d) { dstore = d; }
virtual ~DBAccess() {}
virtual QString type() {
return QString();
}
virtual bool openSource(QIODevice *) {
- qWarning("DBAccess::openSource not yet implemented");
+ owarn << "DBAccess::openSource not yet implemented" << oendl;
return false;
}
virtual bool saveSource(QIODevice *) {
- qWarning("DBAccess::saveSource(QString) not yet implemented");
+ owarn << "DBAccess::saveSource(QString) not yet implemented" << oendl;
return false;
}
protected:
DBStore *dstore;
QString source_name;
};
class DBStore {
public:
DBStore();
~DBStore();
bool openSource(QIODevice *, const QString &source);
bool saveSource(QIODevice *, const QString &source);
// Add an item
void addItem(DataElem *);
void addItemInternal(DataElem *);
void removeItem(DataElem *);
// Set the name of the database
void setName(const QString &name);
diff --git a/noncore/apps/tableviewer/ui/browsekeyentry.cpp b/noncore/apps/tableviewer/ui/browsekeyentry.cpp
index 42e24dd..6b78437 100644
--- a/noncore/apps/tableviewer/ui/browsekeyentry.cpp
+++ b/noncore/apps/tableviewer/ui/browsekeyentry.cpp
@@ -1,58 +1,58 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
** This file is part of Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include "browsekeyentry.h"
#include "commonwidgets.h"
+#include <opie2/odebug.h>
+using namespace Opie::Core;
+
#include <qtoolbutton.h>
#include <qwidgetstack.h>
#include <qlayout.h>
#include <qlineedit.h>
#include <qpushbutton.h>
#include <qpopupmenu.h>
#include <qhbox.h>
#include <qdatetime.h>
-#include <qheader.h>
-// For qWarning(const char *)
-
/*!
\class TVBrowseKeyEntry
\brief a Widget used enter keys into the TVBrowseViewWidget
The TVBrowseKeyEntry Widget provides the facility to enter
various key types to be search on in the table. The key can be changed
and the entry field will update to the correct sort of widget appropriately
*/
/*!
Constructs the widget
*/
TVBrowseKeyEntry::TVBrowseKeyEntry(QWidget *parent, const char *name, WFlags f)
: QWidget(parent, name, f)
{
QHBoxLayout *h_layout = new QHBoxLayout(this);
textKey = new QLineEdit(this, 0);
intKey = new IntEdit(this, 0);
dateKey = new DateEdit(this, 0);
timeKey = new TimeEdit(this, 0);
resetButton = new QPushButton(this, "reset");
resetButton->setMinimumSize(QSize(50, 0));
@@ -171,36 +171,35 @@ void TVBrowseKeyEntry::searchOnText()
TVVariant sendkey;
if (!ts)
return;
switch(ts->kRep->getKeyType(ts->current_column)) {
case TVVariant::String:
sendkey = TVVariant(QString(textKey->text()));
break;
case TVVariant::Int: {
sendkey = TVVariant(intKey->value());
break;
}
case TVVariant::Time: {
sendkey = TVVariant(QTime(timeKey->time()));
break;
}
case TVVariant::Date: {
sendkey = TVVariant(QDate(dateKey->date()));
break;
}
case TVVariant::Invalid:
break;
default:
- qWarning("TVBrowseKeyEntry::searchOnText() "
- "cannot work out data type");
+ owarn << "TVBrowseKeyEntry::searchOnText() cannot work out data type" << oendl;
return;
}
emit searchOnKey(ts->current_column, sendkey);
}
/*! \fn void TVBrowseKeyEntry::searchOnKey(int currentKeyId, TVVariant)
This signal indicates that a search on key index currentKeyId should be
done searching for the value v.
*/
diff --git a/noncore/apps/tableviewer/ui/filterkeyentry.cpp b/noncore/apps/tableviewer/ui/filterkeyentry.cpp
index d108fbd..4d74d6b 100644
--- a/noncore/apps/tableviewer/ui/filterkeyentry.cpp
+++ b/noncore/apps/tableviewer/ui/filterkeyentry.cpp
@@ -1,46 +1,51 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
** This file is part of Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include "filterkeyentry.h"
#include "commonwidgets.h"
+/* OPIE */
+#include <opie2/odebug.h>
+using namespace Opie::Core;
+
+/* QT */
#include <qwidgetstack.h>
#include <qcombobox.h>
#include <qlayout.h>
#include <qlineedit.h>
#include <qsizepolicy.h>
#include <qdatetime.h>
#include <qhbox.h>
TVFilterKeyEntry::TVFilterKeyEntry(QWidget *parent, const char *name, WFlags f)
: QWidget(parent, name, f)
{
int stack_elem = 0;
layout = new QHBoxLayout(this, 0);
layout->setSpacing(0);
layout->setMargin(0);
textEntry = new QHBox(this, 0);
textEntry->setSpacing(0);
textEntry->setMargin(0);
intEntry = new QHBox(this, 0);
intEntry->setSpacing(0);
intEntry->setMargin(0);
@@ -179,30 +184,29 @@ CmpType TVFilterKeyEntry::getCompareType()
/* MUST return a valid pointer */
TVVariant TVFilterKeyEntry::getCompareValue()
{
TVVariant sendkey;
int tmp;
switch(current_type) {
case TVVariant::String:
sendkey = TVVariant(QString(textKey->text()));
break;
case TVVariant::Int: {
sendkey = TVVariant(intKey->value());
break;
}
case TVVariant::Time: {
sendkey = TVVariant(QTime(timeKey->time()));
break;
}
case TVVariant::Date: {
sendkey = TVVariant(QDate(dateKey->date()));
break;
}
default: {
sendkey = TVVariant(0);
- qWarning("TVFilterKeyEntry::getCompareValue() "
- "cannot work out data type");
+ owarn << "TVFilterKeyEntry::getCompareValue() cannot work out data type" << oendl;
}
}
return sendkey;
}
diff --git a/noncore/apps/tableviewer/ui/tvfilterview.cpp b/noncore/apps/tableviewer/ui/tvfilterview.cpp
index 22f1fb7..198c8b5 100644
--- a/noncore/apps/tableviewer/ui/tvfilterview.cpp
+++ b/noncore/apps/tableviewer/ui/tvfilterview.cpp
@@ -1,53 +1,59 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
** This file is part of Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include "tvfilterview.h"
+
+/* OPIE */
+#include <opie2/odebug.h>
+#include <qpe/qpeapplication.h>
+using namespace Opie::Core;
+
+/* QT */
#include <qtoolbutton.h>
#include <qcombobox.h>
#include <qlistview.h>
#include <qlayout.h>
#include <qheader.h>
#include <qpushbutton.h>
#include <qlabel.h>
-#include <qpe/qpeapplication.h>
TVFilterView::TVFilterView(TableState *t, QWidget* parent,
const char *name, WFlags fl ) : QDialog(parent, name, TRUE, fl)
{
if ( !name )
setName( "Filter View" );
QVBoxLayout *vlayout = new QVBoxLayout(this);
display = new QListView(this, "display");
display->addColumn("Key");
display->addColumn("Constraint");
display->addColumn("Value");
display->header()->setClickEnabled(FALSE);
display->header()->setResizeEnabled(FALSE);
vlayout->addWidget(display);
QHBoxLayout *hlayout = new QHBoxLayout;
hlayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum));
newFilterButton = new QPushButton(this, "new Filter");
newFilterButton->setMaximumSize(QSize(50, 32767));
newFilterButton->setText("New");
@@ -154,50 +160,49 @@ bool TVFilterView::passesFilter(DataElem *d) {
if (!d->lessThan(t->keyIndex, t->value))
return false;
break;
case ct_more:
if (!d->moreThan(t->keyIndex, t->value))
return false;
break;
case ct_equal:
if (!d->equalTo(t->keyIndex, t->value))
return false;
break;
case ct_contains:
if (!d->contains(t->keyIndex, t->value))
return false;
break;
case ct_startswith:
if (!d->startsWith(t->keyIndex, t->value))
return false;
break;
case ct_endswith:
if (!d->endsWith(t->keyIndex, t->value))
return false;
break;
default:
- qWarning("TVFilterView::passesFilter() "
- "unrecognized filter type");
+ owarn << "TVFilterView::passesFilter() unrecognized filter type" << oendl;
return false;
}
}
return true;
}
bool TVFilterView::filterActive() const
{
/* when button operated, also check the do_filter value
return do_filter;
*/
if (terms.isEmpty())
return false;
return true;
}
/* SLOTS */
void TVFilterView::newTerm()
{
if (!ts) return;
FilterTerm *term = new FilterTerm;
current = term;
diff --git a/noncore/apps/tinykate/libkate/kateconfig.cpp b/noncore/apps/tinykate/libkate/kateconfig.cpp
index 782b629..4b8ce78 100644
--- a/noncore/apps/tinykate/libkate/kateconfig.cpp
+++ b/noncore/apps/tinykate/libkate/kateconfig.cpp
@@ -3,48 +3,49 @@
**
** This file is part of Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#define QTOPIA_INTERNAL_LANGLIST
#include "kateconfig.h"
/* OPIE */
#include <opie2/odebug.h>
#include <qpe/global.h>
+using namespace Opie::Core;
/* QT */
#include <qdir.h>
#include <qmessagebox.h>
#if QT_VERSION <= 230 && defined(QT_NO_CODECS)
#include <qtextcodec.h>
#endif
#include <qtextstream.h>
/* STD */
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
/*!
\internal
*/
QString KateConfig::configFilename(const QString& name, Domain d)
{
switch (d) {
case File:
@@ -535,50 +536,49 @@ void KateConfig::write( const QString &fn )
QCString cstr;
QMap< QString, KateConfigGroup >::Iterator g_it = groups.begin();
for ( ; g_it != groups.end(); ++g_it ) {
str += "[" + g_it.key() + "]\n";
KateConfigGroup::Iterator e_it = ( *g_it ).begin();
for ( ; e_it != ( *g_it ).end(); ++e_it )
str += e_it.key() + " = " + *e_it + "\n";
}
cstr = str.utf8();
int total_length;
total_length = f.writeBlock( cstr.data(), cstr.length() );
if ( total_length != int(cstr.length()) ) {
QMessageBox::critical( 0, QObject::tr("Out of Space"),
QObject::tr("There was a problem creating\nKateConfiguration Information \nfor this program.\n\nPlease free up some space and\ntry again.") );
f.close();
QFile::remove( strNewFile );
return;
}
f.close();
// now rename the file...
if ( rename( strNewFile, filename ) < 0 ) {
- qWarning( "problem renaming the file %s to %s", strNewFile.latin1(),
- filename.latin1() );
+ owarn << "problem renaming the file " << strNewFile.latin1() << " to " << filename.latin1() << oendl;
QFile::remove( strNewFile );
}
}
/*!
Returns whether the KateConfig is in a valid state.
*/
bool KateConfig::isValid() const
{
return groups.end() != git;
}
/*!
\internal
*/
void KateConfig::read()
{
changed = FALSE;
if ( !QFileInfo( filename ).exists() ) {
git = groups.end();
return;
}
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
@@ -1,39 +1,47 @@
/*
** Author: Carsten Schneider <CarstenSchneider@t-online.de>
**
** $Id$
**
** Homepage: http://home.t-online.de/home/CarstenSchneider/zsafe/index.html
*/
#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>
ZSafe *zs;
#ifdef DESKTOP
QApplication *appl;
#else
QPEApplication *appl;
#endif
int DeskW;
int DeskH;
void suspend (int signum)
{
printf ("Suspend signal %d received\n", signum);
}
void resume (int signum)
{
printf ("Resume signal %d received\n", signum);
zs->resume(signum);
}
@@ -53,59 +61,56 @@ int main( int argc, char ** argv )
#ifdef DESKTOP
if (argc >= 3)
{
#ifndef WIN32
DeskW = atoi(argv[1]);
DeskH = atoi(argv[2]);
#else
int w, h;
sscanf (argv[1], "%d", &w);
sscanf (argv[2], "%d", &h);
DeskW = w;
DeskH = h;
#endif
}
else
{
DeskW = 600;
DeskH = 400;
}
#else
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)
{
DeskW -= 20;
DeskH += 25;
- sprintf (buf, "Changed width: %d Height: %d\n", DeskW, DeskH);
- qWarning (buf);
+ owarn << "Changed width: " << DeskW << " Height: " << DeskH << oendl;
}
#endif
#endif
ZSafe mw;
zs = &mw;
#ifndef WIN32
signal (SIGCONT, resume);
#endif
#ifdef DESKTOP
a.setMainWidget(&mw);
mw.show();
#else
// a.showMainWidget( &mw );
a.showMainDocumentWidget( &mw );
#endif
int ret = a.exec();
return ret;
}
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
@@ -1,36 +1,39 @@
/*
** $Id$
*/
#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;
}
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())
{
case 32: // middle cursor key pressed
zs->showInfo (zs->selectedItem);
break;
default:
QListView::keyPressEvent( e );
}
}
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
@@ -860,126 +860,126 @@ void ZSafe::findPwd()
dialog->NameField->setText(lastSearchedName);
else
dialog->NameField->setText("");
if (lastSearchedUsername)
dialog->UsernameField->setText(lastSearchedUsername);
else
dialog->UsernameField->setText("");
if (lastSearchedComment)
dialog->CommentField->setText(lastSearchedComment);
else
dialog->CommentField->setText("");
DialogCode result = (DialogCode) dialog->exec();
#ifdef DESKTOP
result = Accepted;
#endif
QString name;
QString username;
QString comment;
if (result == Accepted)
{
name = dialog->NameField->text();
username = dialog->UsernameField->text();
comment = dialog->CommentField->text();
- qWarning (name);
+ owarn << name << oendl;
}
else
{
delete dialog;
return;
}
if (!name.isEmpty() && name != lastSearchedName ||
lastSearchedName.isEmpty() && !name.isEmpty())
{
// set search at the beginning if a new name is given
lastSearchedCategory = NULL;
lastSearchedItem = NULL;
}
lastSearchedName = name;
if (!username.isEmpty() && username != lastSearchedUsername ||
lastSearchedUsername.isEmpty() && !username.isEmpty())
{
// set search at the beginning if a new name is given
lastSearchedCategory = NULL;
lastSearchedItem = NULL;
}
lastSearchedUsername = username;
if (!comment.isEmpty() && comment != lastSearchedComment ||
lastSearchedComment.isEmpty() && !comment.isEmpty())
{
// set search at the beginning if a new name is given
lastSearchedCategory = NULL;
lastSearchedItem = NULL;
}
lastSearchedComment = comment;
ListView->clearSelection();
bool found=FALSE;
// step through all categories
QListViewItem *i;
if (lastSearchedCategory)
i = lastSearchedCategory;
else
i = ListView->firstChild();
for (;
i != NULL;
i = i->nextSibling())
{
- qWarning (i->text(0));
+ owarn << i->text(0) << oendl;
i->setSelected(FALSE);
// step through all subitems
QListViewItem *si;
if (lastSearchedItem)
si = lastSearchedItem;
else
si = i->firstChild();
// for (si = i->firstChild();
for (;
si != NULL;
si = si->nextSibling())
{
- qWarning (si->text(0));
+ owarn << si->text(0) << oendl;
if (si->isSelected())
si->setSelected(FALSE);
// ListView->repaintItem(si);
bool n=TRUE;
bool u=TRUE;
bool c=TRUE;
if (!name.isEmpty())
n = (si->text(0)).contains (name, FALSE);
if (!username.isEmpty())
u = (si->text(1)).contains (username, FALSE);
if (!comment.isEmpty())
c = (si->text(3)).contains (comment, FALSE);
if ((n && u && c ) && !found)
{
- qWarning ("Found");
+ owarn << "Found" << oendl;
selectedItem = si;
si->setSelected(TRUE);
ListView->setCurrentItem(si);
ListView->ensureItemVisible(si);
ListView->triggerUpdate();
lastSearchedCategory = i;
// set to the next item
lastSearchedItem = si->nextSibling();
if (!lastSearchedItem)
{
// no next item within category -> set next category
lastSearchedCategory = i->nextSibling();
if (!lastSearchedCategory)
lastSearchedItem = NULL; // END
}
found = TRUE;
delete dialog;
update();
return;
}
}
lastSearchedCategory = i->nextSibling();
@@ -1207,224 +1207,221 @@ void ZSafe::removeAsciiFile()
QString::null,
mimeTypes,
this,
tr ("Remove text file"));
#else
QString fn = ScQtFileEdit::getOpenFileName(this,
tr ("Remove text file"),
QDir::homeDirPath() + "/Documents/application/zsafe",
"*.txt");
#endif
#else
QString fn = QFileDialog::getOpenFileName(
QDir::homeDirPath() + "/Documents/application/zsafe",
"ZSafe (*.txt)",
this,
"ZSafe File Dialog"
"Choose a text file" );
#endif
if (fn && fn.length() > 0 )
{
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;
}
}
}
void ZSafe::writeAllEntries()
{
if (filename.isEmpty())
{
QMessageBox::critical( 0, tr("ZSafe"),
tr("No document defined.\nYou have to create a new document"));
return;
}
// open the file dialog
#ifndef DESKTOP
#ifndef NO_OPIE
QMap<QString, QStringList> mimeTypes;
mimeTypes.insert(tr("All"), QStringList() );
mimeTypes.insert(tr("Text"), "text/*" );
QString fn = OFileDialog::getSaveFileName( OFileSelector::EXTENDED_ALL,
QDir::homeDirPath() + "/Documents/application/zsafe",
QString::null,
mimeTypes,
this,
tr ("Export text file"));
#else
QString fn = ScQtFileEdit::getSaveAsFileName(this,
tr ("Export text file"),
QDir::homeDirPath() + "/Documents/application/zsafe",
"*.txt");
#endif
#else
QString fn = QFileDialog::getSaveFileName(
QDir::homeDirPath() + "/Documents/application/zsafe",
"ZSafe (*.txt)",
this,
"ZSafe File Dialog"
"Choose a text file" );
#endif
// open the new document
if (fn && fn.length() > 0 )
{
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;
}
QTextStream t( &f );
QListViewItem *i;
// step through all categories
for (i = ListView->firstChild();
i != NULL;
i = i->nextSibling())
{
// step through all subitems
QListViewItem *si;
for (si = i->firstChild();
si != NULL;
si = si->nextSibling())
{
QString oneEntry;
oneEntry += "\"";
oneEntry += i->text(0);
oneEntry += "\";";
oneEntry += "\"";
oneEntry += si->text(0);
oneEntry += "\";";
oneEntry += "\"";
oneEntry += si->text(1);
oneEntry += "\";";
oneEntry += "\"";
oneEntry += si->text(2);
oneEntry += "\";";
oneEntry += "\"";
QString comment = si->text(3);
comment.replace (QRegExp("\n"), "<br>");
oneEntry += comment;
oneEntry += "\";";
oneEntry += "\"";
oneEntry += si->text(4);
oneEntry += "\";";
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();
}
}
void ZSafe::readAllEntries()
{
if (filename.isEmpty())
{
QMessageBox::critical( 0, tr("ZSafe"),
tr("No document defined.\nYou have to create a new document"));
return;
}
// open the file dialog
#ifndef DESKTOP
#ifndef NO_OPIE
QMap<QString, QStringList> mimeTypes;
mimeTypes.insert(tr("All"), QStringList() );
mimeTypes.insert(tr("Text"), "text/*" );
QString fn = OFileDialog::getOpenFileName( OFileSelector::EXTENDED_ALL,
QDir::homeDirPath() + "/Documents/application/zsafe",
QString::null,
mimeTypes,
this,
tr ("Import text file"));
#else
QString fn = ScQtFileEdit::getOpenFileName(this,
tr ("Import text file"),
QDir::homeDirPath() + "/Documents/application/zsafe",
"*.txt");
#endif
#else
QString fn = QFileDialog::getOpenFileName(
QDir::homeDirPath() + "/Documents/application/zsafe",
"ZSafe (*.txt)",
this,
"ZSafe File Dialog"
"Choose a text file" );
#endif
if (fn && fn.length() > 0 )
{
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;
}
modified = true;
// clear the password list
selectedItem = NULL;
QListViewItem *i;
// step through all categories
for (i = ListView->firstChild();
i != NULL;
i = i->nextSibling())
{
// step through all subitems
QListViewItem *si;
for (si = i->firstChild();
si != NULL; )
// si = si->nextSibling())
{
QListViewItem *_si = si;
si = si->nextSibling();
i->takeItem(_si); // remove from view list
if (_si) delete _si;
}
}
- qWarning ("ReadAllEntries(): ");
+ owarn << "ReadAllEntries(): " << oendl;
QTextStream t(&f);
while ( !t.eof() )
{
QString s = t.readLine();
s.replace (QRegExp("\";\""), "\"|\"");
// char buffer[1024];
#ifndef WIN32
char buffer[s.length()+1];
#else
char buffer[4048];
#endif
/* modify QString -> QCString::utf8 */
strcpy (buffer, s.utf8());
QString name;
QString user;
QString password;
QString comment;
QString field5="";
QString field6="";
@@ -1533,133 +1530,131 @@ void ZSafe::readAllEntries()
c1->setIcon (*getPredefinedIcon(category));
}
c1->setListItem (catI);
c1->initListItem();
categories.insert (c1->getCategoryName(), c1);
}
}
f.close();
}
else
{
}
}
#ifdef UNUSED
void ZSafe::writeAllEntries()
{
// open the file for writing
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;
}
QTextStream t( &f );
QListViewItem *i;
// step through all categories
for (i = ListView->firstChild();
i != NULL;
i = i->nextSibling())
{
// step through all subitems
QListViewItem *si;
for (si = i->firstChild();
si != NULL;
si = si->nextSibling())
{
QString oneEntry;
oneEntry += "\"";
oneEntry += i->text(0);
oneEntry += "\";";
oneEntry += "\"";
oneEntry += si->text(0);
oneEntry += "\";";
oneEntry += "\"";
oneEntry += si->text(1);
oneEntry += "\";";
oneEntry += "\"";
oneEntry += si->text(2);
oneEntry += "\";";
oneEntry += "\"";
// oneEntry += si->text(3);
QString comment = si->text(3);
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();
}
void ZSafe::readAllEntries()
{
QString fn = filename + ".txt";
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;
}
modified = true;
// clear the password list
selectedItem = NULL;
QListViewItem *i;
// step through all categories
for (i = ListView->firstChild();
i != NULL;
i = i->nextSibling())
{
// step through all subitems
QListViewItem *si;
for (si = i->firstChild();
si != NULL; )
// si = si->nextSibling())
{
QListViewItem *_si = si;
si = si->nextSibling();
i->takeItem(_si); // remove from view list
if (_si) delete _si;
}
}
- qWarning ("ReadAllEntries(): ");
+ owarn << "ReadAllEntries(): " << oendl;
QTextStream t(&f);
while ( !t.eof() )
{
QString s = t.readLine();
s.replace (QRegExp("\";\""), "\"|\"");
// char buffer[1024];
int len=s.length()+1;
#ifdef WIN32
char buffer[512];
#else
char buffer[len];
#endif
strcpy (buffer, s);
QString name;
QString user;
QString password;
QString comment;
// separete the entries
char *i = strtok (buffer, "|");
QString category(&i[1]);
category.truncate(category.length() -1);
@@ -1741,49 +1736,49 @@ void ZSafe::readAllEntries()
QImage img = pix->convertToImage();
pix->convertFromImage(img.smoothScale(14,14));
c1->setIconName (icon);
c1->setIcon (*pix);
isIconAv = true;
}
}
if (!isIconAv)
{
c1->setIcon (*getPredefinedIcon(category));
}
c1->setListItem (catI);
c1->initListItem();
categories.insert (c1->getCategoryName(), c1);
}
}
f.close();
}
#endif // UNUSED
void ZSafe::resume(int)
{
- qWarning ("Resume");
+ owarn << "Resume" << oendl;
// hide the main window
infoForm->hide();
// open zsafe again
m_password = "";
selectedItem = NULL;
// clear the password list
QListViewItem *i;
// step through all categories
for (i = ListView->firstChild();
i != NULL;
i = i->nextSibling())
{
// step through all subitems
QListViewItem *si;
for (si = i->firstChild();
si != NULL; )
{
QListViewItem *_si = si;
si = si->nextSibling();
i->takeItem(_si); // remove from view list
if (_si) delete _si;
}
@@ -1797,58 +1792,58 @@ void ZSafe::resume(int)
bool ZSafe::openDocument(const char* _filename, const char* )
{
int retval;
char* entry[FIELD_SIZE];
// #ifndef WIN32
int validationFlag = conf->readNumEntry(APP_KEY+"valzsafe", 1);
// #else
// int validationFlag = 1;
// #endif
int pwdOk = 0;
int numberOfTries = 3;
for (int i=0; i < numberOfTries; i++)
{
QFile f(_filename);
if (f.exists())
{
// ask with a dialog for the password
if (m_password.isEmpty())
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);
}
retval = loadInit(_filename, m_password);
if (retval != PWERR_GOOD)
{
- qWarning ("Error loading Document");
+ owarn << "Error loading Document" << oendl;
return false;
}
}
else
{
#ifdef WIN32
this->setCaption("Qt ZSafe");
#else
this->setCaption("ZSafe");
#endif
filename = "";
return false;
}
// load the validation entry
if (validationFlag == 0)
{
pwdOk = 1;
break;
}
retval = loadEntry(entry);
if (retval == 1 &&
@@ -2280,49 +2275,49 @@ bool ZSafe::saveDocument(const char* _filename,
}
if (saveFinalize() == PWERR_DATA) {
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;
void ZSafe::setPasswordDialogDone()
{
newPwdDialogResult = true;
newPwdDialog->close();
}
void ZSafe::getDocPassword(QString title)
{
-qWarning ("getDocPassword");
+ owarn << "getDocPassword" << oendl;
// open the 'Password' dialog
PasswordForm *dialog = new PasswordForm(this, title, TRUE);
newPwdDialog = dialog;
newPwdDialogResult = false;
connect( dialog->PasswordField, SIGNAL( returnPressed() ),
this, SLOT( setPasswordDialogDone() ) );
// CS: !!!
// int pos = filename.findRev ('/');
QString ti = filename.right (filename.length() - filename.findRev ('/') - 1);
#ifdef WIN32
dialog->setCaption("Qt " + ti);
#else
dialog->setCaption(ti);
#endif
// dialog->setCaption(title);
dialog->PasswordField->setFocus();
DialogCode result = (DialogCode) dialog->exec();
#ifdef DESKTOP
result = Accepted;
#endif
@@ -2459,49 +2454,49 @@ int ZSafe::saveFinalize(void)
* over, leaving us 3 short, so we fill it in with 3's.
*
* If we come out even, we fill it with 8 8s
*
* um, except that in this instance we are using 4 shorts instead of 8 bytes.
* so, half everything
*/
for (count1 = bufferIndex; count1 < 4; count1++) {
plaintext[count1] = (4 - bufferIndex);
}
krc2->rc2_encrypt (plaintext);
for (count1 = 0; count1 < 4; count1++) {
ciphertext[count1] = iv[count1] ^ plaintext[count1];
if (putc ((unsigned char) (ciphertext[count1] >> 8), fd) == EOF) retval = PWERR_DATA;
if (putc ((unsigned char) (ciphertext[count1] & 0xff), fd) == EOF) retval = PWERR_DATA;
}
fclose (fd);
free(buffer);
return retval;
}
void ZSafe::quitMe ()
{
- qWarning ("QUIT...");
+ owarn << "QUIT..." << oendl;
if (modified)
{
switch( QMessageBox::information( this, tr("ZSafe"),
tr("Do you want to save\nbefore exiting?"),
tr("&Save"),
tr("S&ave with\nnew\npassword"),
tr("&Don't Save"),
0 // Enter == button 0
) )
{ // Escape == button 2
case 0: // Save clicked, Alt-S or Enter pressed.
// save
modified = false;
saveDocument(filename, FALSE);
exitZs (1);
break;
case 1: //
// Save with new password
modified = false;
saveDocument(filename, TRUE);
exitZs (1);
break;
case 2: // Don't Save clicked or Alt-D pressed
@@ -2663,49 +2658,49 @@ void ZSafe::addCategory()
waitDialog.hide();
}
#ifndef WIN32
dialog->show();
#endif
#ifndef DESKTOP
// dialog->move (20, 100);
#endif
DialogCode result = (DialogCode) dialog->exec();
#ifdef DESKTOP
result = Accepted;
#endif
QString category;
QString icon;
QString fullIconPath;
QPixmap *pix;
if (result == Accepted)
{
modified = true;
category = dialog->CategoryField->currentText();
icon = dialog->IconField->currentText()+".png";
- qWarning (category);
+ owarn << category << oendl;
QListViewItem *li = new ShadedListItem( 1, ListView );
Category *c1 = new Category();
c1->setCategoryName(category);
// if (!icon.isEmpty() && !icon.isNull())
if (icon != "predefined.png")
{
// build the full path
fullIconPath = iconPath + icon;
pix = new QPixmap (fullIconPath);
// pix->resize(14, 14);
if (pix)
{
// save the full pixmap name into the config file
// #ifndef WIN32
conf->writeEntry(APP_KEY+category, icon);
// #endif
saveConf();
QImage img = pix->convertToImage();
pix->convertFromImage(img.smoothScale(14,14));
c1->setIcon (*pix);
c1->setIconName(icon);
}
@@ -3171,49 +3166,49 @@ void ZSafe::editCategory()
// save the full pixmap name into the config file
// #ifndef WIN32
conf->writeEntry(APP_KEY+category, icon);
// #endif
saveConf();
QImage img = pix->convertToImage();
pix->convertFromImage(img.smoothScale(14,14));
cat->setIconName (icon);
cat->setIcon (*pix);
}
}
else
{
// #ifndef WIN32
conf->removeEntry (category);
// #endif
saveConf();
cat->setIcon (*getPredefinedIcon(category));
}
// change the category name of the selected category
QListViewItem *catItem = cat->getListItem();
if (catItem)
{
- qWarning (category);
+ owarn << category << oendl;
catItem->setText( 0, tr( category ) );
cat->setCategoryName (tr(category));
cat->initListItem();
categories.insert (category, cat);
}
}
saveCategoryDialogFields(dialog);
}
else
{
// delete dialog;
dialog->hide();
return;
}
}
}
void ZSafe::cutItem()
{
if (!selectedItem)
return;
if (!isCategory(selectedItem))
@@ -3572,49 +3567,49 @@ void ZSafe::setExpandFlag()
file->setItemChecked('o', expandTree);
#ifndef DESKTOP
conf->setGroup ("zsafePrefs");
#endif
// #ifndef WIN32
conf->writeEntry (APP_KEY+"expandTree", expandTree);
// #endif
saveConf();
}
void ZSafe::paintEvent( QPaintEvent * )
{
if (raiseFlag)
{
raiseFlag = false;
raiseTimer.start (1, true);
if (infoForm->isVisible())
infoForm->raise();
}
}
void ZSafe::resizeEvent ( QResizeEvent * )
{
- // qWarning ("resizeEvent");
+ // owarn << "resizeEvent" << oendl;
#ifndef DESKTOP
DeskW = appl->desktop()->width();
DeskH = appl->desktop()->height();
#else
DeskW = this->width();
DeskH = this->height();
#endif
if (New)
New->setGeometry ( QRect( DeskW-84, 2, 20, 20 ) );
if (Edit)
Edit->setGeometry ( QRect( DeskW-64, 2, 20, 20 ) );
if (Delete)
Delete->setGeometry( QRect( DeskW-44, 2, 20, 20 ) );
if (Find)
Find->setGeometry ( QRect( DeskW-24, 2, 20, 20 ) );
}
void ZSafe::slotRaiseTimer()
{
if (infoForm->isVisible())
infoForm->raise();
raiseFlag = true;
}