summaryrefslogtreecommitdiff
path: root/noncore/apps
authorzecke <zecke>2004-11-15 17:08:58 (UTC)
committer zecke <zecke>2004-11-15 17:08:58 (UTC)
commit6d7b1a9a5f32a0b69c5ee9cc963e8a43a76327cf (patch) (unidiff)
tree45e30376ec8035174fc5fd9154ed35b4d405d5ed /noncore/apps
parent97fb9b69240d0daa5222fa9264587cde8b25c117 (diff)
downloadopie-6d7b1a9a5f32a0b69c5ee9cc963e8a43a76327cf.zip
opie-6d7b1a9a5f32a0b69c5ee9cc963e8a43a76327cf.tar.gz
opie-6d7b1a9a5f32a0b69c5ee9cc963e8a43a76327cf.tar.bz2
Remove many many many #ifdefs
"I always knew it would come like this" -Make it a QWidget instead of a QDialog -Introduce appName
Diffstat (limited to 'noncore/apps') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/zsafe/zsafe.cpp691
-rw-r--r--noncore/apps/zsafe/zsafe.h10
2 files changed, 72 insertions, 629 deletions
diff --git a/noncore/apps/zsafe/zsafe.cpp b/noncore/apps/zsafe/zsafe.cpp
index 1ae3b15..2b182f9 100644
--- a/noncore/apps/zsafe/zsafe.cpp
+++ b/noncore/apps/zsafe/zsafe.cpp
@@ -10,9 +10,2 @@
10** 10**
11** Compile Flags:
12** Zaurus arm : -DNO_OPIE
13** Zaurus Opie arm: none
14** Linux Desktop : -DDESKTOP -DNO_OPIE
15** Windows Desktop: -DDESKTOP -DNO_OPIE
16** use qmake
17** for japanese version additional use: -DJPATCH_HDE
18** 11**
@@ -28,4 +21,2 @@
28 21
29#ifndef DESKTOP
30#ifndef NO_OPIE
31#include <opie2/ofiledialog.h> 22#include <opie2/ofiledialog.h>
@@ -34,6 +25,2 @@ using namespace Opie::Core;
34using namespace Opie::Ui; 25using namespace Opie::Ui;
35#else
36#include "scqtfileedit.h"
37#endif
38#endif
39 26
@@ -45,5 +32,3 @@ using namespace Opie::Ui;
45#include <stdlib.h> 32#include <stdlib.h>
46#ifndef Q_WS_WIN
47#include <unistd.h> 33#include <unistd.h>
48#endif
49#include <string.h> 34#include <string.h>
@@ -54,12 +39,2 @@ using namespace Opie::Ui;
54 39
55#ifdef DESKTOP
56#include <qfiledialog.h>
57#include <qdragobject.h>
58#ifndef Q_WS_WIN
59#include <qsettings.h>
60#else
61#include "qsettings.h"
62#endif
63#include <qapplication.h>
64#else
65#include <qfile.h> 40#include <qfile.h>
@@ -70,3 +45,2 @@ using namespace Opie::Ui;
70#include <qpe/config.h> 45#include <qpe/config.h>
71#endif
72 46
@@ -97,23 +71,7 @@ using namespace Opie::Ui;
97 71
98extern int DeskW, DeskH; 72int DeskW, DeskH;
99#ifdef DESKTOP 73QApplication *appl;
100extern QApplication *appl; 74ZSafe *zs;
101#else
102extern QPEApplication *appl;
103#endif
104
105#ifdef JPATCH_HDE
106#define tr(arg) arg
107#endif
108
109 75
110#ifdef DESKTOP 76const QString APP_KEY = "";
111#ifndef Q_WS_WIN
112const QString APP_KEY="/.zsafe/";
113#else
114const QString APP_KEY="";
115#endif
116#else
117const QString APP_KEY="";
118#endif
119 77
@@ -366,14 +324,4 @@ static const char* const general_data[] = {
366 324
367#ifdef DESKTOP 325 conf = new Config ("zsafe");
368#ifndef Q_WS_WIN 326 conf->setGroup ("zsafe");
369 conf = new QSettings();
370 conf->insertSearchPath (QSettings::Unix, QDir::homeDirPath());
371#else
372 conf = new QSettings (cfgFile);
373 conf->insertSearchPath (QSettings::Unix, cfgFile);
374#endif
375#else
376 conf = new Config (cfgFile, Config::File);
377 conf->setGroup ("zsafePrefs");
378#endif
379 } 327 }
@@ -389,6 +337,11 @@ static const char* const general_data[] = {
389 */ 337 */
390ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl ) 338ZSafe::ZSafe( QWidget* parent, const char* name, WFlags fl )
391 : QDialog( parent, name, modal, fl ), 339 : QWidget( parent, name, fl),
392 Edit(0l), Delete(0l), Find(0l), New(0l), ListView(0l) 340 Edit(0l), Delete(0l), Find(0l), New(0l), ListView(0l)
393{ 341{
342 zs = this;
343 appl = qApp;
344 DeskW = qApp->desktop()->width();
345 DeskH = qApp->desktop()->height();
346
394 IsCut = false; 347 IsCut = false;
@@ -402,40 +355,10 @@ ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl )
402 // set the icon path 355 // set the icon path
403#ifdef NO_OPIE
404 QString qpedir ((const char *)getenv("QPEDIR"));
405#else
406 QString qpedir ((const char *)getenv("OPIEDIR"));
407#endif
408 356
409#ifdef DESKTOP 357 QString qpeDir = QPEApplication::qpeDir();
410 iconPath = QDir::homeDirPath() + "/pics/";
411#else
412 if (qpedir.isEmpty())
413 iconPath = "/home/QtPalmtop/pics/";
414 else
415 iconPath = qpedir + "/pics/";
416#endif
417 358
418 // create a zsafe configuration object 359 conf = new Config ("zsafe");
419#ifdef DESKTOP
420#ifndef Q_WS_WIN
421 conf = new QSettings ();
422 conf->insertSearchPath (QSettings::Unix, QDir::homeDirPath());
423#else
424 conf = new QSettings (cfgFile);
425 conf->insertSearchPath (QSettings::Unix, cfgFile);
426#endif
427#else
428 conf = new Config (cfgFile, Config::File);
429 conf->setGroup ("zsafePrefs"); 360 conf->setGroup ("zsafePrefs");
430#endif 361
431#ifdef DESKTOP
432// #ifndef Q_WS_WIN
433 expandTree = conf->readBoolEntry(APP_KEY+"expandTree", false);
434// #endif
435#else
436 expandTree = conf->readNumEntry(APP_KEY+"expandTree", 0); 362 expandTree = conf->readNumEntry(APP_KEY+"expandTree", 0);
437#endif
438#ifndef DESKTOP
439 conf->setGroup ("zsafe"); 363 conf->setGroup ("zsafe");
440#endif
441 364
@@ -462,34 +385,9 @@ ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl )
462 QPixmap image0( ( const char** ) zsafe_xpm ); 385 QPixmap image0( ( const char** ) zsafe_xpm );
463 if ( !name )
464 setName( "ZSafe" );
465
466#ifdef DESKTOP
467#ifdef Q_WS_WIN
468 setGeometry(100, 150, DeskW, DeskH-30 );
469#else
470 resize( DeskW, DeskH-30 );
471#endif
472
473#else
474 386
475#ifdef JPATCH_HDE 387 if ( !name )
476 int DeskS; 388 setName( "ZSafe" );
477 if(DeskW > DeskH)
478 {
479 DeskS = DeskW;
480 }
481 else
482 {
483 DeskS = DeskH;
484 }
485 resize( DeskW, DeskH );
486 setMinimumSize( QSize( DeskS, DeskS ) );
487 setMaximumSize( QSize( DeskS, DeskS ) );
488#else
489 resize( DeskW, DeskH-30 );
490#endif
491 389
492#endif
493 setCaption( tr( "ZSafe" ) ); 390 setCaption( tr( "ZSafe" ) );
494 QString zsafeAppDirPath = QDir::homeDirPath() + "/Documents/application/zsafe"; 391 QString zsafeAppDirPath = QDir::homeDirPath() + "/Documents/application/zsafe";
392
495 filename = conf->readEntry(APP_KEY+"document"); 393 filename = conf->readEntry(APP_KEY+"document");
@@ -499,7 +397,3 @@ ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl )
499 // create it 397 // create it
500// #ifndef Q_WS_WIN
501 // QString d1("Documents/application");
502// #else
503 QString d1(QDir::homeDirPath() + "/Documents/application"); 398 QString d1(QDir::homeDirPath() + "/Documents/application");
504// #endif
505 QDir pd1(d1); 399 QDir pd1(d1);
@@ -513,3 +407,3 @@ ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl )
513 } 407 }
514 408
515 if (!pd2.mkdir("application", FALSE)) 409 if (!pd2.mkdir("application", FALSE))
@@ -517,7 +411,3 @@ ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl )
517 QMessageBox::critical( 0, tr("ZSafe"), 411 QMessageBox::critical( 0, tr("ZSafe"),
518#ifdef JPATCH_HDE
519 tr("<P>Can't create directory ..."+d1+"</P><P>ZSafe will now exit.</P>"));
520#else
521 tr("<P>Can't create directory %1</P><P>ZSafe will now exit.</P>").arg(d1)); 412 tr("<P>Can't create directory %1</P><P>ZSafe will now exit.</P>").arg(d1));
522#endif
523 exitZs (1); 413 exitZs (1);
@@ -525,7 +415,3 @@ ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl )
525 } 415 }
526// #ifndef Q_WS_WIN
527 // QString d2("Documents/application/zsafe");
528// #else
529 QString d2(QDir::homeDirPath() + "/Documents/application/zsafe"); 416 QString d2(QDir::homeDirPath() + "/Documents/application/zsafe");
530// #endif
531 QDir pd2(d2); 417 QDir pd2(d2);
@@ -536,7 +422,3 @@ ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl )
536 QMessageBox::critical( 0, tr("ZSafe"), 422 QMessageBox::critical( 0, tr("ZSafe"),
537#ifdef JPATCH_HDE
538 tr("<P>Can't create directory ...//Documents/application/zsafe</P><P>ZSafe will now exit.</P"));
539#else
540 tr("<P>Can't create directory %1</P><P>ZSafe will now exit.</P>").arg(d2)); 423 tr("<P>Can't create directory %1</P><P>ZSafe will now exit.</P>").arg(d2));
541#endif
542 exitZs (1); 424 exitZs (1);
@@ -544,3 +426,3 @@ ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl )
544 } 426 }
545 427
546 filename = zsafeAppDirPath + "/passwords.zsf"; 428 filename = zsafeAppDirPath + "/passwords.zsf";
@@ -555,7 +437,3 @@ ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl )
555 QString ti = filename.right (filename.length() - filename.findRev ('/') - 1); 437 QString ti = filename.right (filename.length() - filename.findRev ('/') - 1);
556#ifdef Q_WS_WIN 438 this->setCaption(tr("ZSafe: ") + ti);
557 this->setCaption("Qt ZSafe: " + ti);
558#else
559 this->setCaption("ZSafe: " + ti);
560#endif
561 439
@@ -579,3 +457,2 @@ ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl )
579 457
580// #ifdef DESKTOP
581 file->insertItem( new_img, tr("&New document"), this, SLOT(newDocument()) ); 458 file->insertItem( new_img, tr("&New document"), this, SLOT(newDocument()) );
@@ -584,3 +461,2 @@ ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl )
584 file->insertSeparator(); 461 file->insertSeparator();
585// #endif
586 462
@@ -667,6 +543,2 @@ ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl )
667 543
668#ifdef DESKTOP
669 // ListView->setResizePolicy(QScrollView::AutoOneFit);
670 // ListView->setGeometry( QRect( 0, 22, this->width(), this->height() - 30 ) );
671#else
672 ListView->setResizePolicy(QScrollView::AutoOneFit); 544 ListView->setResizePolicy(QScrollView::AutoOneFit);
@@ -675,3 +547,2 @@ ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl )
675 // ListView->setMaximumSize( QSize( 440, 290 ) ); 547 // ListView->setMaximumSize( QSize( 440, 290 ) );
676#endif
677 // ListView->setVScrollBarMode( QListView::Auto ); 548 // ListView->setVScrollBarMode( QListView::Auto );
@@ -682,3 +553,2 @@ ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl )
682 553
683#ifndef DESKTOP
684 // start a timer (100 ms) to load the default document 554 // start a timer (100 ms) to load the default document
@@ -688,6 +558,2 @@ ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl )
688 connect( &raiseTimer, SIGNAL(timeout()), SLOT( slotRaiseTimer() ) ); 558 connect( &raiseTimer, SIGNAL(timeout()), SLOT( slotRaiseTimer() ) );
689#else
690 // open the default document
691 openDocument(filename);
692#endif
693 559
@@ -706,5 +572,3 @@ ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl )
706 572
707 #ifndef DESKTOP 573 QPEApplication::setStylusOperation( ListView->viewport(),QPEApplication::RightOnHold);
708 QPEApplication::setStylusOperation( ListView->viewport(),QPEApplication::RightOnHold);
709#endif
710 connect( ListView, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), 574 connect( ListView, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)),
@@ -712,7 +576,3 @@ ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl )
712 576
713 this->setIcon( image0); 577 this->setIcon( image0);
714#ifdef Q_WS_WIN
715 ListView->setSelected( ListView->firstChild() , true);
716 ListView->setSelected( ListView->firstChild() , false);
717#endif
718} 578}
@@ -774,6 +634,2 @@ void ZSafe::editPwd()
774 NewDialog *dialog = new NewDialog(this, "edit_entry", TRUE); 634 NewDialog *dialog = new NewDialog(this, "edit_entry", TRUE);
775#ifdef Q_WS_WIN
776 dialog->setCaption ("Qt " + tr("Edit Entry"));
777 dialog->setGeometry(200, 250, 220, 310 );
778#endif
779 635
@@ -798,18 +654,4 @@ void ZSafe::editPwd()
798 654
799#ifdef Q_WS_QWS 655 QDialog::DialogCode result = (QDialog::DialogCode) QPEApplication::execDialog( dialog );
800 DialogCode result = (DialogCode) QPEApplication::execDialog( dialog ); 656 if (result == QDialog::Accepted)
801#endif
802
803#ifdef DESKTOP
804#ifndef Q_QW_QWIN
805 dialog->show();
806#endif
807#else
808 dialog->showMaximized();
809#endif
810#ifdef DESKTOP
811 int result = dialog->exec();
812 result = QDialog::Accepted;
813#endif
814 if (result == Accepted)
815 { 657 {
@@ -854,6 +696,2 @@ void ZSafe::newPwd()
854 NewDialog *dialog = new NewDialog(this, "new_entry", TRUE); 696 NewDialog *dialog = new NewDialog(this, "new_entry", TRUE);
855#ifdef Q_WS_WIN
856 dialog->setCaption ("Qt " + tr("New Entry"));
857 dialog->setGeometry(200, 250, 220, 310 );
858#endif
859 // set the labels 697 // set the labels
@@ -868,18 +706,5 @@ retype:
868#ifdef Q_WS_QWS 706#ifdef Q_WS_QWS
869 DialogCode result = (DialogCode) QPEApplication::execDialog( dialog ); 707 QDialog::DialogCode result = (QDialog::DialogCode) QPEApplication::execDialog( dialog );
870#endif
871
872#ifdef DESKTOP
873#ifndef Q_QW_QWIN
874 dialog->show();
875#endif
876#else
877 dialog->showMaximized();
878#endif
879#ifdef DESKTOP
880 int result = dialog->exec();
881 result = QDialog::Accepted;
882#endif 708#endif
883 709 if (result == QDialog::Accepted)
884 if (result == Accepted)
885 { 710 {
@@ -922,8 +747,3 @@ void ZSafe::findPwd()
922 SearchDialog *dialog = new SearchDialog(this, tr("Search"), TRUE); 747 SearchDialog *dialog = new SearchDialog(this, tr("Search"), TRUE);
923#ifdef Q_WS_WIN
924 dialog->setCaption ("Qt " + tr("Search"));
925#endif
926 748
927#ifdef DESKTOP
928#endif
929 if (lastSearchedName) 749 if (lastSearchedName)
@@ -940,6 +760,3 @@ void ZSafe::findPwd()
940 dialog->CommentField->setText(""); 760 dialog->CommentField->setText("");
941 DialogCode result = (DialogCode) dialog->exec(); 761 QDialog::DialogCode result = (QDialog::DialogCode) dialog->exec();
942#ifdef DESKTOP
943 result = Accepted;
944#endif
945 762
@@ -948,3 +765,3 @@ void ZSafe::findPwd()
948 QString comment; 765 QString comment;
949 if (result == Accepted) 766 if (result == QDialog::Accepted)
950 { 767 {
@@ -953,7 +770,2 @@ void ZSafe::findPwd()
953 comment = dialog->CommentField->text(); 770 comment = dialog->CommentField->text();
954#ifndef NO_OPIE
955 owarn << name << oendl;
956#else
957 qWarning (name);
958#endif
959 } 771 }
@@ -1003,5 +815,2 @@ void ZSafe::findPwd()
1003 { 815 {
1004#ifndef NO_OPIE
1005 owarn << i->text(0) << oendl;
1006#endif
1007 i->setSelected(FALSE); 816 i->setSelected(FALSE);
@@ -1019,7 +828,2 @@ void ZSafe::findPwd()
1019 { 828 {
1020#ifndef NO_OPIE
1021 owarn << si->text(0) << oendl;
1022#else
1023 qWarning (si->text(0));
1024#endif
1025 if (si->isSelected()) 829 if (si->isSelected())
@@ -1040,7 +844,2 @@ void ZSafe::findPwd()
1040 { 844 {
1041#ifndef NO_OPIE
1042 owarn << "Found" << oendl;
1043#else
1044 qWarning ("Found");
1045#endif
1046 selectedItem = si; 845 selectedItem = si;
@@ -1101,20 +900,6 @@ QString ZSafe::getFieldLabel (QListViewItem *_item, QString field, QString def)
1101 QString app_key = APP_KEY; 900 QString app_key = APP_KEY;
1102#ifndef DESKTOP
1103#ifndef Q_WS_WIN
1104 conf->setGroup ("fieldDefs");
1105#endif
1106#else
1107#ifndef Q_WS_WIN
1108 app_key += "/fieldDefs/";
1109#endif
1110#endif
1111// #ifndef Q_WS_WIN
1112 QString label = conf->readEntry(app_key+category+"-field"+field,def);
1113// #else
1114// QString label(def);
1115// #endif
1116 901
1117#ifndef DESKTOP 902 conf->setGroup( "fieldDefs" );
903 QString label = conf->readEntry(app_key+category+"-field"+field,def);
1118 conf->setGroup ("zsafe"); 904 conf->setGroup ("zsafe");
1119#endif
1120 return label; 905 return label;
@@ -1125,10 +910,4 @@ QString ZSafe::getFieldLabel (QString category, QString field, QString def)
1125 QString app_key = APP_KEY; 910 QString app_key = APP_KEY;
1126#ifndef DESKTOP
1127 conf->setGroup ("fieldDefs");
1128#else
1129#ifndef Q_WS_WIN
1130 app_key += "/fieldDefs/";
1131#endif
1132#endif
1133// #ifndef Q_WS_WIN 911// #ifndef Q_WS_WIN
912 conf->setGroup( "fieldDefs" );
1134 QString label = conf->readEntry(app_key+category+"-field"+field, 913 QString label = conf->readEntry(app_key+category+"-field"+field,
@@ -1138,5 +917,3 @@ QString ZSafe::getFieldLabel (QString category, QString field, QString def)
1138// #endif 917// #endif
1139#ifndef DESKTOP
1140 conf->setGroup ("zsafe"); 918 conf->setGroup ("zsafe");
1141#endif
1142 return label; 919 return label;
@@ -1237,5 +1014,2 @@ void ZSafe::showInfo( QListViewItem *_item)
1237 1014
1238#ifdef DESKTOP
1239 infoForm->show();
1240 #endif
1241 } 1015 }
@@ -1252,12 +1026,2 @@ void ZSafe::listViewSelected( QListViewItem *_item)
1252 1026
1253#ifndef DESKTOP
1254 // set the column text dependent on the selected item
1255 ListView->setColumnText(0, getFieldLabel (selectedItem, "1", tr("Name")));
1256 ListView->setColumnText(1, getFieldLabel (selectedItem, "2", tr("Field 2")));
1257 ListView->setColumnText(2, getFieldLabel (selectedItem, "3", tr("Field 3")));
1258 ListView->setColumnText(3, getFieldLabel (selectedItem, "4", tr("Comment")));
1259 ListView->setColumnText(4, getFieldLabel (selectedItem, "5", tr("Field 4")));
1260 ListView->setColumnText(5, getFieldLabel (selectedItem, "6", tr("Field 5")));
1261#endif
1262#ifdef Q_WS_WIN
1263 // set the column text dependent on the selected item 1027 // set the column text dependent on the selected item
@@ -1269,4 +1033,2 @@ void ZSafe::listViewSelected( QListViewItem *_item)
1269 ListView->setColumnText(5, getFieldLabel (selectedItem, "6", tr("Field 5"))); 1033 ListView->setColumnText(5, getFieldLabel (selectedItem, "6", tr("Field 5")));
1270#endif
1271
1272} 1034}
@@ -1289,4 +1051,2 @@ void ZSafe::removeAsciiFile()
1289 // open the file dialog 1051 // open the file dialog
1290#ifndef DESKTOP
1291#ifndef NO_OPIE
1292 QMap<QString, QStringList> mimeTypes; 1052 QMap<QString, QStringList> mimeTypes;
@@ -1300,16 +1060,2 @@ void ZSafe::removeAsciiFile()
1300 tr ("Remove text file")); 1060 tr ("Remove text file"));
1301#else
1302 QString fn = ScQtFileEdit::getOpenFileName(this,
1303 tr ("Remove text file"),
1304 QDir::homeDirPath() + "/Documents/application/zsafe",
1305 "*.txt");
1306#endif
1307#else
1308 QString fn = QFileDialog::getOpenFileName(
1309 QDir::homeDirPath() + "/Documents/application/zsafe",
1310 "ZSafe (*.txt)",
1311 this,
1312 "ZSafe File Dialog"
1313 "Choose a text file" );
1314#endif
1315 1061
@@ -1320,7 +1066,2 @@ void ZSafe::removeAsciiFile()
1320 { 1066 {
1321#ifndef NO_OPIE
1322 owarn << "Could not remove file " << fn << oendl;
1323#else
1324 qWarning( QString("Could not remove file %1").arg(fn),2000 );
1325#endif
1326 QMessageBox::critical( 0, tr("ZSafe"), 1067 QMessageBox::critical( 0, tr("ZSafe"),
@@ -1348,7 +1089,2 @@ void ZSafe::writeAllEntries()
1348 if ( !f.open( IO_WriteOnly ) ) { 1089 if ( !f.open( IO_WriteOnly ) ) {
1349#ifndef NO_OPIE
1350 owarn << "Could not write to file " << fn << oendl;
1351#else
1352 qWarning( QString("Could not write to file %1").arg(fn),2000 );
1353#endif
1354 QMessageBox::critical( 0, "ZSafe", 1090 QMessageBox::critical( 0, "ZSafe",
@@ -1415,4 +1151,2 @@ void ZSafe::readAllEntries()
1415 // open the file dialog 1151 // open the file dialog
1416#ifndef DESKTOP
1417#ifndef NO_OPIE
1418 QMap<QString, QStringList> mimeTypes; 1152 QMap<QString, QStringList> mimeTypes;
@@ -1426,16 +1160,2 @@ void ZSafe::readAllEntries()
1426 tr ("Import text file")); 1160 tr ("Import text file"));
1427#else
1428 QString fn = ScQtFileEdit::getOpenFileName(this,
1429 tr ("Import text file"),
1430 QDir::homeDirPath() + "/Documents/application/zsafe",
1431 "*.txt");
1432#endif
1433#else
1434 QString fn = QFileDialog::getOpenFileName(
1435 QDir::homeDirPath() + "/Documents/application/zsafe",
1436 "ZSafe (*.txt)",
1437 this,
1438 "ZSafe File Dialog"
1439 "Choose a text file" );
1440#endif
1441 1161
@@ -1446,7 +1166,2 @@ void ZSafe::readAllEntries()
1446 { 1166 {
1447#ifndef NO_OPIE
1448 owarn << "Could not read file " << fn << oendl;
1449#else
1450 qWarning( QString("Could not read file %1").arg(fn), 2000 );
1451#endif
1452 QMessageBox::critical( 0, "ZSafe", 1167 QMessageBox::critical( 0, "ZSafe",
@@ -1479,8 +1194,2 @@ void ZSafe::readAllEntries()
1479 1194
1480#ifndef NO_OPIE
1481 owarn << "ReadAllEntries(): " << oendl;
1482#else
1483 qWarning ("ReadAllEntries(): ");
1484#endif
1485
1486 QTextStream t(&f); 1195 QTextStream t(&f);
@@ -1491,7 +1200,3 @@ void ZSafe::readAllEntries()
1491 // char buffer[1024]; 1200 // char buffer[1024];
1492#ifndef Q_WS_WIN
1493 char buffer[s.length()+1]; 1201 char buffer[s.length()+1];
1494#else
1495 char buffer[4048];
1496#endif
1497 1202
@@ -1641,7 +1346,2 @@ void ZSafe::writeAllEntries()
1641 if ( !f.open( IO_WriteOnly ) ) { 1346 if ( !f.open( IO_WriteOnly ) ) {
1642#ifndef NO_OPIE
1643 owarn << "Could not write to file " << fn << oendl;
1644#else
1645 qWarning( QString("Could not write to file %1").arg(fn), 2000 );
1646#endif
1647 QMessageBox::critical( 0, tr("ZSafe"), 1347 QMessageBox::critical( 0, tr("ZSafe"),
@@ -1698,7 +1398,2 @@ void ZSafe::readAllEntries()
1698 { 1398 {
1699#ifndef NO_OPIE
1700 owarn << "Could not read file " << fn << oendl;
1701#else
1702 qWarning( QString("Could not read file %1").arg(fn), 2000 );
1703#endif
1704 QMessageBox::critical( 0, tr("ZSafe"), 1399 QMessageBox::critical( 0, tr("ZSafe"),
@@ -1731,7 +1426,2 @@ void ZSafe::readAllEntries()
1731 1426
1732#ifndef NO_OPIE
1733 owarn << "ReadAllEntries(): " << oendl;
1734#else
1735 qWarning ("ReadAllEntries(): ");
1736#endif
1737 QTextStream t(&f); 1427 QTextStream t(&f);
@@ -1743,7 +1433,3 @@ void ZSafe::readAllEntries()
1743 int len=s.length()+1; 1433 int len=s.length()+1;
1744#ifdef Q_WS_WIN
1745 char buffer[512];
1746#else
1747 char buffer[len]; 1434 char buffer[len];
1748#endif
1749 strcpy (buffer, s); 1435 strcpy (buffer, s);
@@ -1858,5 +1544,2 @@ void ZSafe::resume(int)
1858{ 1544{
1859#ifndef NO_OPIE
1860 owarn << "Resume" << oendl;
1861#endif
1862 // hide the main window 1545 // hide the main window
@@ -1921,7 +1604,2 @@ bool ZSafe::openDocument(const char* _filename, const char* )
1921 { 1604 {
1922#ifndef NO_OPIE
1923 owarn << "Wrong password" << oendl;
1924#else
1925 qWarning ("Wrong password");
1926#endif
1927 QMessageBox::critical( 0, tr("ZSafe"), 1605 QMessageBox::critical( 0, tr("ZSafe"),
@@ -1934,7 +1612,2 @@ bool ZSafe::openDocument(const char* _filename, const char* )
1934 { 1612 {
1935#ifndef NO_OPIE
1936 owarn << "Error loading Document" << oendl;
1937#else
1938 qWarning ("Error loading Document");
1939#endif
1940 return false; 1613 return false;
@@ -1944,7 +1617,3 @@ bool ZSafe::openDocument(const char* _filename, const char* )
1944 { 1617 {
1945#ifdef Q_WS_WIN 1618 this->setCaption(tr("ZSafe"));
1946 this->setCaption("Qt ZSafe");
1947#else
1948 this->setCaption("ZSafe");
1949#endif
1950 filename = ""; 1619 filename = "";
@@ -1964,3 +1633,3 @@ bool ZSafe::openDocument(const char* _filename, const char* )
1964 } 1633 }
1965 1634
1966 } 1635 }
@@ -2438,5 +2107,2 @@ void ZSafe::getDocPassword(QString title)
2438{ 2107{
2439#ifndef NO_OPIE
2440 owarn << "getDocPassword" << oendl;
2441#endif
2442 // open the 'Password' dialog 2108 // open the 'Password' dialog
@@ -2455,7 +2121,3 @@ void ZSafe::getDocPassword(QString title)
2455 QString ti = filename.right (filename.length() - filename.findRev ('/') - 1); 2121 QString ti = filename.right (filename.length() - filename.findRev ('/') - 1);
2456#ifdef Q_WS_WIN
2457 dialog->setCaption("Qt " + ti);
2458#else
2459 dialog->setCaption(ti); 2122 dialog->setCaption(ti);
2460#endif
2461 // dialog->setCaption(title); 2123 // dialog->setCaption(title);
@@ -2463,9 +2125,6 @@ void ZSafe::getDocPassword(QString title)
2463 dialog->PasswordField->setFocus(); 2125 dialog->PasswordField->setFocus();
2464 DialogCode result = (DialogCode) dialog->exec(); 2126 QDialog::DialogCode result = (QDialog::DialogCode) dialog->exec();
2465#ifdef DESKTOP
2466 result = Accepted;
2467#endif
2468 2127
2469 QString password; 2128 QString password;
2470 if (result == Accepted || newPwdDialogResult) 2129 if (result == QDialog::Accepted || newPwdDialogResult)
2471 { 2130 {
@@ -2622,6 +2281,2 @@ void ZSafe::quitMe ()
2622{ 2281{
2623#ifndef NO_OPIE
2624 owarn << "QUIT..." << oendl;
2625#endif
2626
2627 if (modified) 2282 if (modified)
@@ -2685,5 +2340,2 @@ void ZSafe::addCategory()
2685 categoryDialog = new CategoryDialog(this, tr("Category"), TRUE); 2340 categoryDialog = new CategoryDialog(this, tr("Category"), TRUE);
2686#ifdef Q_WS_WIN
2687 categoryDialog->setCaption ("Qt " + tr("Category"));
2688#endif
2689 dialog = categoryDialog; 2341 dialog = categoryDialog;
@@ -2695,6 +2347,2 @@ void ZSafe::addCategory()
2695 2347
2696#ifdef DESKTOP
2697#ifndef Q_WS_WIN
2698 QStringList list = conf->entryList( APP_KEY+"/fieldDefs" );
2699#else
2700 // read all categories from the config file and store 2348 // read all categories from the config file and store
@@ -2706,3 +2354,2 @@ void ZSafe::addCategory()
2706 QString s; 2354 QString s;
2707 int n = 1;
2708 while ( !t.eof() ) { // until end of file... 2355 while ( !t.eof() ) { // until end of file...
@@ -2713,18 +2360,2 @@ void ZSafe::addCategory()
2713 } 2360 }
2714#endif
2715#else
2716 // read all categories from the config file and store
2717 // into a list
2718 QFile f (cfgFile);
2719 QStringList list;
2720 if ( f.open(IO_ReadOnly) ) { // file opened successfully
2721 QTextStream t( &f ); // use a text stream
2722 QString s;
2723 while ( !t.eof() ) { // until end of file...
2724 s = t.readLine(); // line of text excluding '\n'
2725 list.append(s);
2726 }
2727 f.close();
2728 }
2729#endif
2730 QStringList::Iterator it = list.begin(); 2361 QStringList::Iterator it = list.begin();
@@ -2738,10 +2369,2 @@ void ZSafe::addCategory()
2738 { 2369 {
2739#ifdef DESKTOP
2740#ifndef Q_WS_WIN
2741 categ = cat->section ("-field1", 0, 0);
2742#else
2743 int pos = cat->find ("-field1");
2744 categ = cat->left (pos);
2745#endif
2746#else
2747 int pos = cat->find ("-field1"); 2370 int pos = cat->find ("-field1");
@@ -2749,3 +2372,2 @@ void ZSafe::addCategory()
2749 categ = *cat; 2372 categ = *cat;
2750#endif
2751 if (!categ.isEmpty()) 2373 if (!categ.isEmpty())
@@ -2775,7 +2397,3 @@ void ZSafe::addCategory()
2775 2397
2776#ifdef DESKTOP
2777 QDir d(iconPath);
2778#else
2779 QDir d(QPEApplication::qpeDir() + "pics/"); 2398 QDir d(QPEApplication::qpeDir() + "pics/");
2780#endif
2781 d.setFilter( QDir::Files); 2399 d.setFilter( QDir::Files);
@@ -2791,8 +2409,3 @@ void ZSafe::addCategory()
2791 fileName = fileName.mid(0,fileName.length()-4); 2409 fileName = fileName.mid(0,fileName.length()-4);
2792#ifdef DESKTOP
2793 QPixmap imageOfFile;
2794 imageOfFile.load(iconPath + fi->fileName());
2795#else
2796 QPixmap imageOfFile(Resource::loadPixmap(fileName)); 2410 QPixmap imageOfFile(Resource::loadPixmap(fileName));
2797#endif
2798 QImage foo = imageOfFile.convertToImage(); 2411 QImage foo = imageOfFile.convertToImage();
@@ -2807,13 +2420,3 @@ void ZSafe::addCategory()
2807 2420
2808#ifndef Q_WS_WIN 2421 QDialog::DialogCode result = (QDialog::DialogCode) dialog->exec();
2809 dialog->show();
2810#endif
2811#ifndef DESKTOP
2812 // dialog->move (20, 100);
2813#endif
2814 DialogCode result = (DialogCode) dialog->exec();
2815#ifdef DESKTOP
2816 result = Accepted;
2817#endif
2818
2819 QString category; 2422 QString category;
@@ -2822,3 +2425,3 @@ void ZSafe::addCategory()
2822 QPixmap *pix; 2425 QPixmap *pix;
2823 if (result == Accepted) 2426 if (result == QDialog::Accepted)
2824 { 2427 {
@@ -2828,6 +2431,2 @@ void ZSafe::addCategory()
2828 2431
2829#ifndef NO_OPIE
2830 owarn << category << oendl;
2831#endif
2832
2833 QListViewItem *li = new ShadedListItem( 1, ListView ); 2432 QListViewItem *li = new ShadedListItem( 1, ListView );
@@ -2959,7 +2558,3 @@ void ZSafe::setCategoryDialogFields(CategoryDialog *dialog)
2959 2558
2960#ifdef DESKTOP
2961 QDir d(iconPath);
2962#else
2963 QDir d(QPEApplication::qpeDir() + "pics/"); 2559 QDir d(QPEApplication::qpeDir() + "pics/");
2964#endif
2965 d.setFilter( QDir::Files); 2560 d.setFilter( QDir::Files);
@@ -3016,7 +2611,3 @@ void ZSafe::setCategoryDialogFields(CategoryDialog *dialog, QString category)
3016 2611
3017#ifdef DESKTOP
3018 QDir d(iconPath);
3019#else
3020 QDir d(QPEApplication::qpeDir() + "pics/"); 2612 QDir d(QPEApplication::qpeDir() + "pics/");
3021#endif
3022 d.setFilter( QDir::Files); 2613 d.setFilter( QDir::Files);
@@ -3055,9 +2646,3 @@ void ZSafe::saveCategoryDialogFields(CategoryDialog *dialog)
3055 QString app_key = APP_KEY; 2646 QString app_key = APP_KEY;
3056#ifndef DESKTOP 2647 conf->setGroup( "fieldDefs" );
3057 conf->setGroup ("fieldDefs");
3058#else
3059#ifndef Q_WS_WIN
3060 app_key += "/fieldDefs/";
3061#endif
3062#endif
3063 QString category = dialog->CategoryField->currentText(); 2648 QString category = dialog->CategoryField->currentText();
@@ -3072,5 +2657,3 @@ void ZSafe::saveCategoryDialogFields(CategoryDialog *dialog)
3072 saveConf(); 2657 saveConf();
3073#ifndef DESKTOP
3074 conf->setGroup ("zsafe"); 2658 conf->setGroup ("zsafe");
3075#endif
3076} 2659}
@@ -3094,5 +2677,2 @@ void ZSafe::editCategory()
3094 categoryDialog = new CategoryDialog(this, tr("Category"), TRUE); 2677 categoryDialog = new CategoryDialog(this, tr("Category"), TRUE);
3095#ifdef Q_WS_WIN
3096 categoryDialog->setCaption ("Qt " + tr("Category"));
3097#endif
3098 dialog = categoryDialog; 2678 dialog = categoryDialog;
@@ -3105,22 +2685,2 @@ void ZSafe::editCategory()
3105 2685
3106#ifdef DESKTOP
3107#ifndef Q_WS_WIN
3108 QStringList list = conf->entryList( APP_KEY+"/fieldDefs" );
3109#else
3110 // read all categories from the config file and store
3111 // into a list
3112 QFile f (cfgFile);
3113 QStringList list;
3114 if ( f.open(IO_ReadOnly) ) { // file opened successfully
3115 QTextStream t( &f ); // use a text stream
3116 QString s;
3117 int n = 1;
3118 while ( !t.eof() ) { // until end of file...
3119 s = t.readLine(); // line of text excluding '\n'
3120 list.append(s);
3121 }
3122 f.close();
3123 }
3124#endif
3125#else
3126 // read all categories from the config file and store 2686 // read all categories from the config file and store
@@ -3138,3 +2698,2 @@ void ZSafe::editCategory()
3138 } 2698 }
3139#endif
3140 QStringList::Iterator it = list.begin(); 2699 QStringList::Iterator it = list.begin();
@@ -3149,10 +2708,2 @@ void ZSafe::editCategory()
3149 { 2708 {
3150#ifdef DESKTOP
3151#ifndef Q_WS_WIN
3152 categ = cat->section ("-field1", 0, 0);
3153#else
3154 int pos = cat->find ("-field1");
3155 categ = cat->left (pos);
3156#endif
3157#else
3158 int pos = cat->find ("-field1"); 2709 int pos = cat->find ("-field1");
@@ -3160,3 +2711,2 @@ void ZSafe::editCategory()
3160 categ = *cat; 2711 categ = *cat;
3161#endif
3162 if (!categ.isEmpty()) 2712 if (!categ.isEmpty())
@@ -3195,7 +2745,3 @@ void ZSafe::editCategory()
3195 2745
3196#ifdef DESKTOP
3197 QDir d(iconPath);
3198#else
3199 QDir d(QPEApplication::qpeDir() + "pics/"); 2746 QDir d(QPEApplication::qpeDir() + "pics/");
3200#endif
3201 d.setFilter( QDir::Files); 2747 d.setFilter( QDir::Files);
@@ -3217,8 +2763,3 @@ void ZSafe::editCategory()
3217 fileName = fileName.mid(0,fileName.length()-4); 2763 fileName = fileName.mid(0,fileName.length()-4);
3218#ifdef DESKTOP
3219 QPixmap imageOfFile;
3220 imageOfFile.load(iconPath + fi->fileName());
3221#else
3222 QPixmap imageOfFile(Resource::loadPixmap(fileName)); 2764 QPixmap imageOfFile(Resource::loadPixmap(fileName));
3223#endif
3224 QImage foo = imageOfFile.convertToImage(); 2765 QImage foo = imageOfFile.convertToImage();
@@ -3237,8 +2778,3 @@ void ZSafe::editCategory()
3237 { 2778 {
3238#ifdef DESKTOP
3239 // QDir d(QDir::homeDirPath() + "/pics/");
3240 QDir d(iconPath);
3241#else
3242 QDir d(QPEApplication::qpeDir() + "pics/"); 2779 QDir d(QPEApplication::qpeDir() + "pics/");
3243#endif
3244 d.setFilter( QDir::Files); 2780 d.setFilter( QDir::Files);
@@ -3277,9 +2813,3 @@ void ZSafe::editCategory()
3277 // dialog->show(); 2813 // dialog->show();
3278#ifndef DESKTOP 2814 QDialog::DialogCode result = (QDialog::DialogCode) dialog->exec();
3279 // dialog->move (20, 100);
3280#endif
3281 DialogCode result = (DialogCode) dialog->exec();
3282#ifdef DESKTOP
3283 result = Accepted;
3284#endif
3285 2815
@@ -3287,3 +2817,3 @@ void ZSafe::editCategory()
3287 QPixmap *pix; 2817 QPixmap *pix;
3288 if (result == Accepted) 2818 if (result == QDialog::Accepted)
3289 { 2819 {
@@ -3304,8 +2834,2 @@ void ZSafe::editCategory()
3304 { 2834 {
3305#ifndef NO_OPIE
3306 owarn << "Category found" << oendl;
3307#else
3308 qWarning("Category found");
3309#endif
3310
3311 // if (!icon.isEmpty() && !icon.isNull()) 2835 // if (!icon.isEmpty() && !icon.isNull())
@@ -3342,7 +2866,2 @@ void ZSafe::editCategory()
3342 { 2866 {
3343#ifndef NO_OPIE
3344 owarn << category << oendl;
3345#else
3346 qWarning (category);
3347#endif
3348 catItem->setText( 0, tr( category ) ); 2867 catItem->setText( 0, tr( category ) );
@@ -3483,2 +3002,3 @@ void ZSafe::newDocument()
3483 // save the current filename to the config file 3002 // save the current filename to the config file
3003 conf->setGroup("zsafe");
3484 conf->writeEntry(APP_KEY+"document", filename); 3004 conf->writeEntry(APP_KEY+"document", filename);
@@ -3486,7 +3006,3 @@ void ZSafe::newDocument()
3486 QString ti = filename.right (filename.length() - filename.findRev ('/') - 1); 3006 QString ti = filename.right (filename.length() - filename.findRev ('/') - 1);
3487#ifdef Q_WS_WIN 3007 this->setCaption(tr("ZSafe: ") + ti);
3488 this->setCaption("Qt ZSafe: " + ti);
3489#else
3490 this->setCaption("ZSafe: " + ti);
3491#endif
3492 3008
@@ -3505,4 +3021,2 @@ void ZSafe::loadDocument()
3505 // open the file dialog 3021 // open the file dialog
3506#ifndef DESKTOP
3507#ifndef NO_OPIE
3508 QMap<QString, QStringList> mimeTypes; 3022 QMap<QString, QStringList> mimeTypes;
@@ -3516,16 +3030,2 @@ void ZSafe::loadDocument()
3516 tr ("Open ZSafe document")); 3030 tr ("Open ZSafe document"));
3517#else
3518 QString newFile = ScQtFileEdit::getOpenFileName(this,
3519 tr ("Open ZSafe document"),
3520 QDir::homeDirPath() + "/Documents/application/zsafe",
3521 "*.zsf");
3522#endif
3523#else
3524 QString newFile = QFileDialog::getOpenFileName(
3525 QDir::homeDirPath() + "/Documents/application/zsafe",
3526 "ZSafe (*.zsf)",
3527 this,
3528 "ZSafe File Dialog"
3529 "Choose a ZSafe file" );
3530#endif
3531 3031
@@ -3567,2 +3067,3 @@ void ZSafe::loadDocument()
3567 // save the current filename to the config file 3067 // save the current filename to the config file
3068 conf->setGroup("zsafe");
3568 conf->writeEntry(APP_KEY+"document", filename); 3069 conf->writeEntry(APP_KEY+"document", filename);
@@ -3570,7 +3071,3 @@ void ZSafe::loadDocument()
3570 QString ti = filename.right (filename.length() - filename.findRev ('/') - 1); 3071 QString ti = filename.right (filename.length() - filename.findRev ('/') - 1);
3571#ifdef Q_WS_WIN 3072 this->setCaption(tr("ZSafe: ") + ti);
3572 this->setCaption("Qt ZSafe: " + ti);
3573#else
3574 this->setCaption("ZSafe: " + ti);
3575#endif
3576 3073
@@ -3595,2 +3092,3 @@ QString newFile = zsaveDialog();
3595 // save the current filename to the config file 3092 // save the current filename to the config file
3093 conf->setGroup("zsafe");
3596 conf->writeEntry(APP_KEY+"document", filename); 3094 conf->writeEntry(APP_KEY+"document", filename);
@@ -3598,7 +3096,3 @@ QString newFile = zsaveDialog();
3598 QString ti = filename.right (filename.length() - filename.findRev ('/') - 1); 3096 QString ti = filename.right (filename.length() - filename.findRev ('/') - 1);
3599#ifdef Q_WS_WIN 3097 this->setCaption(tr("ZSafe: ") + ti);
3600 this->setCaption("Qt ZSafe: " + ti);
3601#else
3602 this->setCaption("ZSafe: " + ti);
3603#endif
3604 3098
@@ -3624,37 +3118,15 @@ void ZSafe::about()
3624 QString info; 3118 QString info;
3625#ifdef JPATCH_HDE 3119 info = tr("<html><body><div align=""center"">"
3626 info = "<html><body><div align=""center"">"; 3120 "<b>"
3627 info += "<b>"; 3121 "Zaurus Password Manager<br>"
3628 info += tr("Zaurus Password Manager<br>"); 3122 "ZSafe version 2.1.2<br>"
3629 info += tr("ZSafe version 2.1.2-jv01b<br>"); 3123 "</b>"
3630 info += "</b>"; 3124 "by Carsten Schneider<br>"
3631 info += tr("by Carsten Schneider<br>"); 3125 "zcarsten@gmx.net<br>"
3632 info += "zcarsten@gmx.net<br>"; 3126 "http://z-soft.z-portal.info/zsafe"
3633 info += "http://z-soft.z-portal.info/zsafe"; 3127 "<br>"
3634 info += "<br>"; 3128 "Translations by Robert Ernst<br>"
3635 info += tr("Translations by Robert Ernst<br>"); 3129 "robert.ernst@linux-solutions.at<br>"
3636 info += "robert.ernst@linux-solutions.at<br>"; 3130 "<br></div>"
3637 3131 "</body></html>");
3638 info += "<br><br>";
3639 info += QString::fromUtf8("æ~W¥æ~\\¬èª~^/VGA Zaurus対å¿~\\ã~C~Qã~C~Cã~C~Aä½~\\æ ~H~P<br>");
3640 info += "HADECO R&D<br>";
3641 info += "r&d@hadeco.co.jp<br>";
3642 info += "http://www.hadeco.co.jp/r&d/<br>";
3643 info += "<br></div>";
3644 info += "</body></html>";
3645#else
3646 info = "<html><body><div align=""center"">";
3647 info += "<b>";
3648 info += tr("Zaurus Password Manager<br>");
3649 info += tr("ZSafe version 2.1.2<br>");
3650 info += "</b>";
3651 info += tr("by Carsten Schneider<br>");
3652 info += "zcarsten@gmx.net<br>";
3653 info += "http://z-soft.z-portal.info/zsafe";
3654 info += "<br>";
3655 info += tr("Translations by Robert Ernst<br>");
3656 info += "robert.ernst@linux-solutions.at<br>";
3657 info += "<br></div>";
3658 info += "</body></html>";
3659#endif
3660 3132
@@ -3674,5 +3146,3 @@ void ZSafe::setExpandFlag()
3674 file->setItemChecked('o', expandTree); 3146 file->setItemChecked('o', expandTree);
3675#ifndef DESKTOP
3676 conf->setGroup ("zsafePrefs"); 3147 conf->setGroup ("zsafePrefs");
3677#endif
3678// #ifndef Q_WS_WIN 3148// #ifndef Q_WS_WIN
@@ -3698,9 +3168,4 @@ void ZSafe::resizeEvent ( QResizeEvent * )
3698 // owarn << "resizeEvent" << oendl; 3168 // owarn << "resizeEvent" << oendl;
3699#ifndef DESKTOP
3700 DeskW = appl->desktop()->width(); 3169 DeskW = appl->desktop()->width();
3701 DeskH = appl->desktop()->height(); 3170 DeskH = appl->desktop()->height();
3702#else
3703 DeskW = this->width();
3704 DeskH = this->height();
3705#endif
3706 3171
@@ -3741,3 +3206,2 @@ void ZSafe::setDocument(const QString& fileref)
3741{ 3206{
3742#ifndef DESKTOP
3743 // stop the timer to prevent loading of the default document 3207 // stop the timer to prevent loading of the default document
@@ -3759,2 +3223,3 @@ void ZSafe::setDocument(const QString& fileref)
3759 // save the current filename to the config file 3223 // save the current filename to the config file
3224 conf->setGroup("zsafe");
3760 conf->writeEntry(APP_KEY+"document", filename); 3225 conf->writeEntry(APP_KEY+"document", filename);
@@ -3762,7 +3227,3 @@ void ZSafe::setDocument(const QString& fileref)
3762 QString ti = filename.right (filename.length() - filename.findRev ('/') - 1); 3227 QString ti = filename.right (filename.length() - filename.findRev ('/') - 1);
3763#ifdef Q_WS_WIN 3228 this->setCaption(tr("ZSafe: ") + ti);
3764 this->setCaption("Qt ZSafe: " + ti);
3765#else
3766 this->setCaption("ZSafe: " + ti);
3767#endif
3768 3229
@@ -3797,5 +3258,2 @@ void ZSafe::setDocument(const QString& fileref)
3797 openDocument(filename); 3258 openDocument(filename);
3798#else
3799Q_UNUSED(fileref);
3800#endif
3801} 3259}
@@ -3807,8 +3265,2 @@ void ZSafe::ListPressed(int mouse, QListViewItem *item, const QPoint&, int colum
3807 case 1: 3265 case 1:
3808 {
3809#ifdef DESKTOP
3810 QDragObject *d = new QTextDrag( item->text(column) , this );
3811 d->dragCopy();
3812#endif
3813 }
3814 break; 3266 break;
@@ -3853,4 +3305,2 @@ QString ZSafe::zsaveDialog() {
3853 QString fn; 3305 QString fn;
3854#ifndef DESKTOP
3855#ifndef NO_OPIE
3856 QMap<QString, QStringList> mimeTypes; 3306 QMap<QString, QStringList> mimeTypes;
@@ -3864,16 +3314,3 @@ QString ZSafe::zsaveDialog() {
3864 tr ("Export text file")); 3314 tr ("Export text file"));
3865#else 3315 return fn;
3866 fn = ScQtFileEdit::getSaveAsFileName(this,
3867 tr ("Export text file"),
3868 QDir::homeDirPath() + "/Documents/application/zsafe",
3869 "*.txt");
3870#endif
3871#else
3872 fn = QFileDialog::getSaveFileName(
3873 QDir::homeDirPath() + "/Documents/application/zsafe",
3874 "ZSafe (*.txt)",
3875 this,
3876 "ZSafe");
3877#endif
3878 return fn;
3879} 3316}
diff --git a/noncore/apps/zsafe/zsafe.h b/noncore/apps/zsafe/zsafe.h
index 7419797..3d812f8 100644
--- a/noncore/apps/zsafe/zsafe.h
+++ b/noncore/apps/zsafe/zsafe.h
@@ -48,3 +48,3 @@ class QPixmap;
48 48
49class ZSafe : public QDialog 49class ZSafe : public QWidget
50{ 50{
@@ -60,4 +60,5 @@ protected:
60public: 60public:
61 ZSafe( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = WDestructiveClose ); 61 ZSafe( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
62 ~ZSafe(); 62 ~ZSafe();
63 static QString appName() { return QString::fromLatin1( QUICKAPP_NAME ); }
63 64
@@ -197,2 +198,7 @@ private slots:
197 198
199
200extern ZSafe *zs;
201extern QApplication *appl;
202extern int DeskW;
203extern int DeskH;
198#endif // ZSAFE_H 204#endif // ZSAFE_H