summaryrefslogtreecommitdiffabout
path: root/pwmanager
Unidiff
Diffstat (limited to 'pwmanager') (more/less context) (ignore whitespace changes)
-rw-r--r--pwmanager/pwmanager/main.cpp1
-rw-r--r--pwmanager/pwmanager/pwm.cpp12
-rw-r--r--pwmanager/pwmanager/pwm.h8
-rw-r--r--pwmanager/pwmanager/pwmanager.pro33
-rw-r--r--pwmanager/pwmanager/pwmdoc.cpp8
-rw-r--r--pwmanager/pwmanager/pwminit.cpp16
-rw-r--r--pwmanager/pwmanager/serializer.cpp6
7 files changed, 52 insertions, 32 deletions
diff --git a/pwmanager/pwmanager/main.cpp b/pwmanager/pwmanager/main.cpp
index 3f2d055..9d1d863 100644
--- a/pwmanager/pwmanager/main.cpp
+++ b/pwmanager/pwmanager/main.cpp
@@ -194,20 +194,21 @@ int main(int argc, char *argv[])
194 //US KAddressBookMain m ; 194 //US KAddressBookMain m ;
195 195
196 //US QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); 196 //US QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
197 /*US 197 /*US
198#ifndef DESKTOP_VERSION 198#ifndef DESKTOP_VERSION
199 a.showMainWidget( &m ); 199 a.showMainWidget( &m );
200#else 200#else
201 a.setMainWidget( &m ); 201 a.setMainWidget( &m );
202 m.resize (640, 480 ); 202 m.resize (640, 480 );
203 m.show(); 203 m.show();
204#endif 204#endif
205 */ 205 */
206 qDebug("exec ");
206 a.exec(); 207 a.exec();
207 208
208 } 209 }
209 qDebug("PWMPI: Bye! "); 210 qDebug("PWMPI: Bye! ");
210 211
211#endif 212#endif
212 213
213} 214}
diff --git a/pwmanager/pwmanager/pwm.cpp b/pwmanager/pwmanager/pwm.cpp
index 26a44b1..c511661 100644
--- a/pwmanager/pwmanager/pwm.cpp
+++ b/pwmanager/pwmanager/pwm.cpp
@@ -577,28 +577,28 @@ void PwM::saveAs_slot()
577bool PwM::saveAs() 577bool PwM::saveAs()
578{ 578{
579 if (!curDoc()->saveAsDocUi(curDoc())) 579 if (!curDoc()->saveAsDocUi(curDoc()))
580 return false; 580 return false;
581 showStatMsg(i18n("Successfully saved data.")); 581 showStatMsg(i18n("Successfully saved data."));
582 updateCaption(); 582 updateCaption();
583 return true; 583 return true;
584} 584}
585 585
586//US ENH : changed code to run with older MOC 586//US ENH : changed code to run with older MOC
587void PwM::addPwd_slot() 587void PwM::addPwd_slot()
588{ 588{
589 addPwd_slot(0, 0); 589 addPwd_slot1(0, 0);
590} 590}
591 591
592void PwM::addPwd_slot(QString *pw, PwMDoc *_doc) 592void PwM::addPwd_slot1(QString *pw, PwMDoc *_doc)
593{ 593{
594 PwMDoc *doc; 594 PwMDoc *doc;
595 if (_doc) { 595 if (_doc) {
596 doc = _doc; 596 doc = _doc;
597 } else { 597 } else {
598 doc = curDoc(); 598 doc = curDoc();
599 } 599 }
600 PWM_ASSERT(doc); 600 PWM_ASSERT(doc);
601 doc->timer()->getLock(DocTimer::id_autoLockTimer); 601 doc->timer()->getLock(DocTimer::id_autoLockTimer);
602#ifndef PWM_EMBEDDED 602#ifndef PWM_EMBEDDED
603 AddEntryWndImpl w; 603 AddEntryWndImpl w;
604#else 604#else
@@ -646,33 +646,33 @@ void PwM::addPwd_slot(QString *pw, PwMDoc *_doc)
646 i18n("maximum number of entries")); 646 i18n("maximum number of entries"));
647 doc->timer()->putLock(DocTimer::id_autoLockTimer); 647 doc->timer()->putLock(DocTimer::id_autoLockTimer);
648 return; 648 return;
649 } 649 }
650 } 650 }
651 setVirgin(false); 651 setVirgin(false);
652 doc->timer()->putLock(DocTimer::id_autoLockTimer); 652 doc->timer()->putLock(DocTimer::id_autoLockTimer);
653} 653}
654 654
655//US ENH : changed code to run with older MOC 655//US ENH : changed code to run with older MOC
656void PwM::editPwd_slot() 656void PwM::editPwd_slot()
657{ 657{
658 editPwd_slot(0,0,0); 658 editPwd_slot3(0,0,0);
659} 659}
660 660
661void PwM::editPwd_slot(const QString *category) 661void PwM::editPwd_slot1(const QString *category)
662{ 662{
663 editPwd_slot(category, 0, 0); 663 editPwd_slot3(category, 0, 0);
664} 664}
665 665
666void PwM::editPwd_slot(const QString *category, const int *index, 666void PwM::editPwd_slot3(const QString *category, const int *index,
667 PwMDoc *_doc) 667 PwMDoc *_doc)
668{ 668{
669 PwMDoc *doc; 669 PwMDoc *doc;
670 if (_doc) { 670 if (_doc) {
671 doc = _doc; 671 doc = _doc;
672 } else { 672 } else {
673 doc = curDoc(); 673 doc = curDoc();
674 } 674 }
675 PWM_ASSERT(doc); 675 PWM_ASSERT(doc);
676 if (doc->isDocEmpty()) 676 if (doc->isDocEmpty())
677 return; 677 return;
678 if (doc->isDeepLocked()) 678 if (doc->isDeepLocked())
diff --git a/pwmanager/pwmanager/pwm.h b/pwmanager/pwmanager/pwm.h
index fe1f7a1..116bc66 100644
--- a/pwmanager/pwmanager/pwm.h
+++ b/pwmanager/pwmanager/pwm.h
@@ -125,32 +125,34 @@ public slots:
125 /** file/export/kwallet triggered */ 125 /** file/export/kwallet triggered */
126 void exportToKWallet(); 126 void exportToKWallet();
127 /** file/import/text triggered */ 127 /** file/import/text triggered */
128 bool importFromText(); 128 bool importFromText();
129 /** file/import/gpasman triggered */ 129 /** file/import/gpasman triggered */
130 bool importFromGpasman(); 130 bool importFromGpasman();
131 /** file/import/kwallet triggered */ 131 /** file/import/kwallet triggered */
132 bool importKWallet(); 132 bool importKWallet();
133 /** file/print triggered */ 133 /** file/print triggered */
134 void print_slot(); 134 void print_slot();
135 /** manage/add triggered */ 135 /** manage/add triggered */
136 //US ENH : changed code to run with older MOC 136 //US ENH : changed code to run with older MOC
137
137 void addPwd_slot(); 138 void addPwd_slot();
138 void addPwd_slot(QString *pw, PwMDoc *_doc); 139 void addPwd_slot1(QString *pw, PwMDoc *_doc);
139 /** manage/edit triggered */ 140 /** manage/edit triggered */
140 //US ENH : changed code to run with older MOC 141 //US ENH : changed code to run with older MOC
141 void editPwd_slot(); 142 void editPwd_slot();
142 void editPwd_slot(const QString *category); 143 void editPwd_slot1(const QString *category);
143 void editPwd_slot(const QString *category = 0, const int *index = 0, 144 void editPwd_slot3(const QString *category = 0, const int *index = 0,
144 PwMDoc *_doc = 0); 145 PwMDoc *_doc = 0);
146
145 /** manage/delete triggered */ 147 /** manage/delete triggered */
146 void deletePwd_slot(); 148 void deletePwd_slot();
147 /** execute the "Launcher" entry */ 149 /** execute the "Launcher" entry */
148 void execLauncher_slot(); 150 void execLauncher_slot();
149 /** open browser with URL entry */ 151 /** open browser with URL entry */
150 void goToURL_slot(); 152 void goToURL_slot();
151 /** manage/changeMasterPwd triggered */ 153 /** manage/changeMasterPwd triggered */
152 void changeMasterPwd_slot(); 154 void changeMasterPwd_slot();
153 /** lock current document */ 155 /** lock current document */
154 void lockWnd_slot(); 156 void lockWnd_slot();
155 /** deeplock current document */ 157 /** deeplock current document */
156 void deepLockWnd_slot(); 158 void deepLockWnd_slot();
diff --git a/pwmanager/pwmanager/pwmanager.pro b/pwmanager/pwmanager/pwmanager.pro
index 34f7403..7f39c76 100644
--- a/pwmanager/pwmanager/pwmanager.pro
+++ b/pwmanager/pwmanager/pwmanager.pro
@@ -1,42 +1,47 @@
1 TEMPLATE= app 1 TEMPLATE= app
2 CONFIG += qt warn_on 2 CONFIG += qt warn_on
3 3DESTDIR= ../../bin
4
5 TARGET = pwmpi 4 TARGET = pwmpi
6OBJECTS_DIR = obj/$(PLATFORM) 5include( ../../variables.pri )
7MOC_DIR = moc/$(PLATFORM)
8DESTDIR=$(QPEDIR)/bin
9 6
10INCLUDEPATH += . ../../ ../../qtcompat ../../qtcompat/xml ../../libkdepim ../../microkde ../../microkde/kdecore ../../microkde/kdeui ../../microkde/kutils $(QPEDIR)/include 7INCLUDEPATH += . ../../ ../../libkdepim ../../microkde ../../microkde/kdecore ../../microkde/kdeui ../../microkde/kutils
11DEFINES += PWM_EMBEDDED CONFIG_PWMANAGER_GCRY DESKTOP_VERSION 8DEFINES += PWM_EMBEDDED CONFIG_PWMANAGER_GCRY DESKTOP_VERSION
12 9
13#enable this setting if you want debugoutput for pwmanager 10#enable this setting if you want debugoutput for pwmanager
14#DEFINES += CONFIG_DEBUG 11#DEFINES += CONFIG_DEBUG
15LIBS += -L../libcrypt/$(PLATFORM) 12LIBS += -L../libcrypt/
13LIBS += -L../../bin/
16LIBS += -lmicrokde 14LIBS += -lmicrokde
17LIBS += -lmicroqtcompat
18LIBS += -lmicrokdepim 15LIBS += -lmicrokdepim
19LIBS += -L$(QPEDIR)/lib
20LIBS += -lqpe
21LIBS += -lzlib 16LIBS += -lzlib
22#LIBS += -lbz2
23#LIBS += -lkpmicrogcrypt
24LIBS += -ljpeg
25LIBS += $(QTOPIALIB)
26LIBS += -lkpmicrocipher 17LIBS += -lkpmicrocipher
27LIBS += -lkpmicroerror 18LIBS += -lkpmicroerror
28LIBS += -lkpmicrompi 19LIBS += -lkpmicrompi
29LIBS += -lstdc++ 20LIBS += -lstdc++
30 21
22unix:{
23OBJECTS_DIR = obj/unix
24MOC_DIR = moc/unix
25
26}
27win32:{
28
29DEFINES += _WIN32_
30OBJECTS_DIR = obj/win
31MOC_DIR = moc/win
32QMAKE_LINK += /NODEFAULTLIB:LIBC
33
34}
35
31#INTERFACES = \ 36#INTERFACES = \
32#addentrywnd.ui \ 37#addentrywnd.ui \
33#configwnd.ui \ 38#configwnd.ui \
34#findwnd.ui \ 39#findwnd.ui \
35#getmasterpwwnd.ui \ 40#getmasterpwwnd.ui \
36#pwgenwnd.ui \ 41#pwgenwnd.ui \
37#setmasterpwwnd.ui \ 42#setmasterpwwnd.ui \
38#subtbledit.ui 43#subtbledit.ui
39 44
40#INTERFACES = \ 45#INTERFACES = \
41#subtbledit.ui \ 46#subtbledit.ui \
42 47
diff --git a/pwmanager/pwmanager/pwmdoc.cpp b/pwmanager/pwmanager/pwmdoc.cpp
index e29e3d1..8869f3a 100644
--- a/pwmanager/pwmanager/pwmdoc.cpp
+++ b/pwmanager/pwmanager/pwmdoc.cpp
@@ -2320,26 +2320,26 @@ PwMerror PwMDoc::exportToText(const QString *file)
2320 QDate currDate = QDate::currentDate(); 2320 QDate currDate = QDate::currentDate();
2321 QTime currTime = QTime::currentTime(); 2321 QTime currTime = QTime::currentTime();
2322 2322
2323#ifndef PWM_EMBEDDED 2323#ifndef PWM_EMBEDDED
2324 header += currDate.toString("ddd MMMM d ").latin1(); 2324 header += currDate.toString("ddd MMMM d ").latin1();
2325 header += currTime.toString("hh:mm:ss ").latin1(); 2325 header += currTime.toString("hh:mm:ss ").latin1();
2326#else 2326#else
2327 QString dfs = KGlobal::locale()->dateFormatShort(); 2327 QString dfs = KGlobal::locale()->dateFormatShort();
2328 bool ampm = KGlobal::locale()->use12Clock(); 2328 bool ampm = KGlobal::locale()->use12Clock();
2329 KGlobal::locale()->setDateFormatShort("%A %B %d"); 2329 KGlobal::locale()->setDateFormatShort("%A %B %d");
2330 KGlobal::locale()->setHore24Format(true); 2330 KGlobal::locale()->setHore24Format(true);
2331 2331
2332 header += KGlobal::locale()->formatDate(currDate, true, KLocale::Userdefined); 2332 header += KGlobal::locale()->formatDate(currDate, true, KLocale::Userdefined).latin1();
2333 header += KGlobal::locale()->formatTime(currTime, true); 2333 header += KGlobal::locale()->formatTime(currTime, true).latin1();
2334 KGlobal::locale()->setDateFormatShort(dfs); 2334 KGlobal::locale()->setDateFormatShort(dfs);
2335 KGlobal::locale()->setHore24Format(!ampm); 2335 KGlobal::locale()->setHore24Format(!ampm);
2336 2336
2337#endif 2337#endif
2338 header += tostr(currDate.year()); 2338 header += tostr(currDate.year());
2339 header += "\n==============================\n\n"; 2339 header += "\n==============================\n\n";
2340 2340
2341 2341
2342#ifndef PWM_EMBEDDED 2342#ifndef PWM_EMBEDDED
2343 if (f.writeBlock(header.c_str(), header.length()) != (Q_LONG)header.length()) { 2343 if (f.writeBlock(header.c_str(), header.length()) != (Q_LONG)header.length()) {
2344 unlockAll_tempoary(true); 2344 unlockAll_tempoary(true);
2345 f.close(); 2345 f.close();
@@ -3009,45 +3009,45 @@ PwMerror PwMDoc::syncronize(KSyncManager* manager, PwMDoc* syncLocal , PwMDoc* s
3009 bool fullDateRange = false; 3009 bool fullDateRange = false;
3010 int take; 3010 int take;
3011 // local->resetTempSyncStat(); 3011 // local->resetTempSyncStat();
3012 QDateTime mLastSync = QDateTime::currentDateTime(); 3012 QDateTime mLastSync = QDateTime::currentDateTime();
3013 QDateTime modifiedSync = mLastSync; 3013 QDateTime modifiedSync = mLastSync;
3014 3014
3015 unsigned int index; 3015 unsigned int index;
3016 //Step 1. Find syncinfo in Local file and create if not existent. 3016 //Step 1. Find syncinfo in Local file and create if not existent.
3017 bool found = syncLocal->findSyncData(mCurrentSyncDevice, &index); 3017 bool found = syncLocal->findSyncData(mCurrentSyncDevice, &index);
3018 if (found == false) 3018 if (found == false)
3019 { 3019 {
3020 PwMSyncItem newSyncItemLocal; 3020 PwMSyncItem newSyncItemLocal;
3021 newSyncItemLocal.syncName = mCurrentSyncDevice; 3021 newSyncItemLocal.syncName = mCurrentSyncDevice.latin1();
3022 newSyncItemLocal.lastSyncDate = mLastSync; 3022 newSyncItemLocal.lastSyncDate = mLastSync;
3023 syncLocal->addSyncDataEntry(&newSyncItemLocal, true); 3023 syncLocal->addSyncDataEntry(&newSyncItemLocal, true);
3024 found = syncLocal->findSyncData(mCurrentSyncDevice, &index); 3024 found = syncLocal->findSyncData(mCurrentSyncDevice, &index);
3025 if (found == false) { 3025 if (found == false) {
3026 qDebug("PwMDoc::syncronize : newly created local sync data could not be found"); 3026 qDebug("PwMDoc::syncronize : newly created local sync data could not be found");
3027 return e_syncError; 3027 return e_syncError;
3028 } 3028 }
3029 } 3029 }
3030 3030
3031 syncItemLocal = syncLocal->getSyncDataEntry(index); 3031 syncItemLocal = syncLocal->getSyncDataEntry(index);
3032 qDebug("Last Sync Local %s ", syncItemLocal->lastSyncDate.toString().latin1()); 3032 qDebug("Last Sync Local %s ", syncItemLocal->lastSyncDate.toString().latin1());
3033 3033
3034 //Step 2. Find syncinfo in remote file and create if not existent. 3034 //Step 2. Find syncinfo in remote file and create if not existent.
3035 found = syncRemote->findSyncData(mCurrentSyncName, &index); 3035 found = syncRemote->findSyncData(mCurrentSyncName, &index);
3036 if (found == false) 3036 if (found == false)
3037 { 3037 {
3038 qDebug("FULLDATE 1"); 3038 qDebug("FULLDATE 1");
3039 fullDateRange = true; 3039 fullDateRange = true;
3040 PwMSyncItem newSyncItemRemote; 3040 PwMSyncItem newSyncItemRemote;
3041 newSyncItemRemote.syncName = mCurrentSyncName; 3041 newSyncItemRemote.syncName = mCurrentSyncName.latin1();
3042 newSyncItemRemote.lastSyncDate = mLastSync; 3042 newSyncItemRemote.lastSyncDate = mLastSync;
3043 syncRemote->addSyncDataEntry(&newSyncItemRemote, true); 3043 syncRemote->addSyncDataEntry(&newSyncItemRemote, true);
3044 found = syncRemote->findSyncData(mCurrentSyncName, &index); 3044 found = syncRemote->findSyncData(mCurrentSyncName, &index);
3045 if (found == false) { 3045 if (found == false) {
3046 qDebug("PwMDoc::syncronize : newly created remote sync data could not be found"); 3046 qDebug("PwMDoc::syncronize : newly created remote sync data could not be found");
3047 return e_syncError; 3047 return e_syncError;
3048 } 3048 }
3049 } 3049 }
3050 3050
3051 syncItemRemote = syncRemote->getSyncDataEntry(index); 3051 syncItemRemote = syncRemote->getSyncDataEntry(index);
3052 qDebug("Last Sync Remote %s ", syncItemRemote->lastSyncDate.toString().latin1()); 3052 qDebug("Last Sync Remote %s ", syncItemRemote->lastSyncDate.toString().latin1());
3053 //and remove the found entry here. We will reenter it later again. 3053 //and remove the found entry here. We will reenter it later again.
diff --git a/pwmanager/pwmanager/pwminit.cpp b/pwmanager/pwmanager/pwminit.cpp
index 8946443..ea9e330 100644
--- a/pwmanager/pwmanager/pwminit.cpp
+++ b/pwmanager/pwmanager/pwminit.cpp
@@ -10,24 +10,25 @@
10 ***************************************************************************/ 10 ***************************************************************************/
11 11
12/*************************************************************************** 12/***************************************************************************
13 * copyright (C) 2004 by Ulf Schenk 13 * copyright (C) 2004 by Ulf Schenk
14 * This file is originaly based on version 1.0.1 of pwmanager 14 * This file is originaly based on version 1.0.1 of pwmanager
15 * and was modified to run on embedded devices that run microkde 15 * and was modified to run on embedded devices that run microkde
16 * 16 *
17 * $Id$ 17 * $Id$
18 **************************************************************************/ 18 **************************************************************************/
19 19
20#include "pwminit.h" 20#include "pwminit.h"
21#include "randomizer.h" 21#include "randomizer.h"
22#include <qdir.h>
22 23
23#ifndef PWM_EMBEDDED 24#ifndef PWM_EMBEDDED
24#include "selftest.h" 25#include "selftest.h"
25#include "configuration.h" 26#include "configuration.h"
26#else 27#else
27#include "pwmprefs.h" 28#include "pwmprefs.h"
28#endif 29#endif
29 30
30#include "pwm.h" 31#include "pwm.h"
31#include "pwmexception.h" 32#include "pwmexception.h"
32#include "pwmtray.h" 33#include "pwmtray.h"
33#include "pwmdoc.h" 34#include "pwmdoc.h"
@@ -119,60 +120,65 @@ PwMInit::~PwMInit()
119 delete_ifnot_null(_keycard); 120 delete_ifnot_null(_keycard);
120#endif // CONFIG_KEYCARD 121#endif // CONFIG_KEYCARD
121 delete_ifnot_null(_tray); 122 delete_ifnot_null(_tray);
122 123
123 Randomizer::cleanup(); 124 Randomizer::cleanup();
124#ifndef PWM_EMBEDDED 125#ifndef PWM_EMBEDDED
125 Configuration::cleanup(); 126 Configuration::cleanup();
126#endif 127#endif
127} 128}
128 129
129void PwMInit::initializeApp() 130void PwMInit::initializeApp()
130{ 131{
132 qDebug("PwMInit::initializeApp() ");
131 PWM_ASSERT(runStatus == unknown); 133 PWM_ASSERT(runStatus == unknown);
132 runStatus = init; 134 runStatus = init;
133 initPosixSignalHandler(); 135 initPosixSignalHandler();
134 Randomizer::init(); 136 Randomizer::init();
135#ifndef PWM_EMBEDDED 137#ifndef PWM_EMBEDDED
136 Configuration::init(); 138 Configuration::init();
137#endif 139#endif
138 initDCOP(); 140 initDCOP();
139 initKWalletEmu(); 141 initKWalletEmu();
140 initKeycard(); 142 initKeycard();
141 initTray(); 143 initTray();
142 handleCmdLineArgs(); 144 handleCmdLineArgs();
143 145 qDebug("handle ");
144 bool openDeeplocked = false; 146 bool openDeeplocked = false;
145 if (conf()->confGlobAutostartDeepLocked() || 147 if (conf()->confGlobAutostartDeepLocked() ||
146 savedCmd.open_deeplocked) 148 savedCmd.open_deeplocked)
147 openDeeplocked = true; 149 openDeeplocked = true;
148 if (conf()->confWndAutoMinimizeOnStart() || 150 if ( false ){
149 savedCmd.minToTray) { 151 // LR is not working
152 //if (conf()->confWndAutoMinimizeOnStart() ||
153 // savedCmd.minToTray) {
150 PwMDoc *newDoc = createDoc(); 154 PwMDoc *newDoc = createDoc();
155 qDebug(" createDoc()");
151 if (!newDoc->openDocUi(newDoc, 156 if (!newDoc->openDocUi(newDoc,
152 conf()->confGlobAutoStart(), 157 conf()->confGlobAutoStart(),
153 openDeeplocked)) { 158 openDeeplocked)) {
154 delete newDoc; 159 delete newDoc;
160 }
155 161
156 //US ENH for embedded devices: in the case of failure, open a document the default way 162 //US ENH for embedded devices: in the case of failure, open a document the default way
157 createMainWnd(conf()->confGlobAutoStart(), 163 createMainWnd(conf()->confGlobAutoStart(),
158 openDeeplocked, 164 openDeeplocked,
159 true, 165 true,
160 0, 166 0,
161 savedCmd.minimized); 167 savedCmd.minimized);
162 168
163 169
164 170
165 171
166 } 172 //}
167 } else { 173 } else {
168 createMainWnd(conf()->confGlobAutoStart(), 174 createMainWnd(conf()->confGlobAutoStart(),
169 openDeeplocked, 175 openDeeplocked,
170 true, 176 true,
171 0, 177 0,
172 savedCmd.minimized); 178 savedCmd.minimized);
173 } 179 }
174 180
175 runStatus = running; 181 runStatus = running;
176} 182}
177 183
178void PwMInit::shutdownApp(int exitStatus) 184void PwMInit::shutdownApp(int exitStatus)
@@ -277,24 +283,25 @@ void PwMInit::removeTrayAndQuit()
277{ 283{
278 PWM_ASSERT(_tray); 284 PWM_ASSERT(_tray);
279 // _tray is deleted in ~PwMInit 285 // _tray is deleted in ~PwMInit
280 shutdownApp(0); 286 shutdownApp(0);
281} 287}
282 288
283PwM * PwMInit::createMainWnd(const QString &loadFile, 289PwM * PwMInit::createMainWnd(const QString &loadFile,
284 bool loadFileDeepLocked, 290 bool loadFileDeepLocked,
285 bool virginity, 291 bool virginity,
286 PwMDoc *doc, 292 PwMDoc *doc,
287 bool minimized) 293 bool minimized)
288{ 294{
295 qDebug("PwMInit::createMainWnd ");
289 PwM *newWnd; 296 PwM *newWnd;
290 if (!doc) 297 if (!doc)
291 doc = createDoc(); 298 doc = createDoc();
292 newWnd = new PwM(this, doc, virginity); 299 newWnd = new PwM(this, doc, virginity);
293#ifndef PWM_EMBEDDED 300#ifndef PWM_EMBEDDED
294 _mainWndList.push_back(newWnd); 301 _mainWndList.push_back(newWnd);
295#else 302#else
296 _mainWndList.append(newWnd); 303 _mainWndList.append(newWnd);
297#endif 304#endif
298 connect(newWnd, SIGNAL(closed(PwM *)), 305 connect(newWnd, SIGNAL(closed(PwM *)),
299 this, SLOT(mainWndClosed(PwM *))); 306 this, SLOT(mainWndClosed(PwM *)));
300 connect(newWnd, SIGNAL(gotFocus(PwM *)), 307 connect(newWnd, SIGNAL(gotFocus(PwM *)),
@@ -308,24 +315,25 @@ PwM * PwMInit::createMainWnd(const QString &loadFile,
308 newWnd->showMinimized(); 315 newWnd->showMinimized();
309 else 316 else
310 newWnd->show(); 317 newWnd->show();
311 318
312#else //PWM_EMBEDDED 319#else //PWM_EMBEDDED
313 320
314#ifndef DESKTOP_VERSION 321#ifndef DESKTOP_VERSION
315 app->showMainWidget( newWnd ); 322 app->showMainWidget( newWnd );
316#else //DESKTOP_VERSION 323#else //DESKTOP_VERSION
317 app->setMainWidget( newWnd ); 324 app->setMainWidget( newWnd );
318 newWnd->resize (640, 480 ); 325 newWnd->resize (640, 480 );
319 newWnd->show(); 326 newWnd->show();
327 qDebug("show ");
320#endif //DESKTOP_VERSION 328#endif //DESKTOP_VERSION
321 329
322#endif //PWM_EMBEDDED 330#endif //PWM_EMBEDDED
323 331
324 if (loadFile != QString::null && 332 if (loadFile != QString::null &&
325 loadFile != "") { 333 loadFile != "") {
326 newWnd->openDoc(loadFile, loadFileDeepLocked); 334 newWnd->openDoc(loadFile, loadFileDeepLocked);
327 } 335 }
328 return newWnd; 336 return newWnd;
329} 337}
330 338
331PwMDoc * PwMInit::createDoc() 339PwMDoc * PwMInit::createDoc()
diff --git a/pwmanager/pwmanager/serializer.cpp b/pwmanager/pwmanager/serializer.cpp
index 2d6498e..ed0f754 100644
--- a/pwmanager/pwmanager/serializer.cpp
+++ b/pwmanager/pwmanager/serializer.cpp
@@ -161,25 +161,29 @@ void Serializer::clear()
161{ 161{
162 delete_ifnot_null(domDoc); 162 delete_ifnot_null(domDoc);
163 domDoc = new QDomDocument; 163 domDoc = new QDomDocument;
164} 164}
165 165
166bool Serializer::parseXml(const QCString &buffer) 166bool Serializer::parseXml(const QCString &buffer)
167{ 167{
168 PWM_ASSERT(domDoc); 168 PWM_ASSERT(domDoc);
169#ifndef PWM_EMBEDDED 169#ifndef PWM_EMBEDDED
170 if (!domDoc->setContent(buffer, true)) 170 if (!domDoc->setContent(buffer, true))
171 return false; 171 return false;
172#else 172#else
173#ifdef DESKTOP_VERSION
174 if (!domDoc->setContent(buffer, true))
175#else
173 if (!domDoc->setContent(buffer)) 176 if (!domDoc->setContent(buffer))
177#endif
174 return false; 178 return false;
175#endif 179#endif
176 if (!checkValid()) 180 if (!checkValid())
177 return false; 181 return false;
178 return true; 182 return true;
179} 183}
180 184
181QCString Serializer::getXml() 185QCString Serializer::getXml()
182{ 186{
183 PWM_ASSERT(domDoc); 187 PWM_ASSERT(domDoc);
184 188
185#ifndef PWM_EMBEDDED 189#ifndef PWM_EMBEDDED
@@ -723,25 +727,25 @@ bool Serializer::readSyncData(const QDomNode &n, vector<PwMSyncItem> *dta)
723 } 727 }
724 for (i = 0; i < numSync; ++i) { 728 for (i = 0; i < numSync; ++i) {
725 cur = nl.item(i); 729 cur = nl.item(i);
726 if (cur.nodeName().left(1) == SYNC_TARGET_PREFIX) { 730 if (cur.nodeName().left(1) == SYNC_TARGET_PREFIX) {
727 devicename = cur.toElement().attribute(SYNC_TARGET_NAME); 731 devicename = cur.toElement().attribute(SYNC_TARGET_NAME);
728 val = cur.toElement().text(); 732 val = cur.toElement().text();
729 733
730 if ((val == "") || (devicename == QString::null)) { 734 if ((val == "") || (devicename == QString::null)) {
731 printDebug("Serializer::readSyncData(): empty synctarget name or syncdate"); 735 printDebug("Serializer::readSyncData(): empty synctarget name or syncdate");
732 continue; 736 continue;
733 } 737 }
734 738
735 curSync.syncName = devicename; 739 curSync.syncName = devicename.latin1();
736#ifndef PWM_EMBEDDED 740#ifndef PWM_EMBEDDED
737 curSync.lastSyncDate = QDateTime::fromString(val, Qt::ISODate); 741 curSync.lastSyncDate = QDateTime::fromString(val, Qt::ISODate);
738#else 742#else
739 curSync.lastSyncDate = KGlobal::locale()->readDateTime(val, KLocale::ISODate, &ok); 743 curSync.lastSyncDate = KGlobal::locale()->readDateTime(val, KLocale::ISODate, &ok);
740 if (ok == false) 744 if (ok == false)
741 qDebug("Serializer::readSyncData(): could not parse syncdate:%s",val.latin1()); 745 qDebug("Serializer::readSyncData(): could not parse syncdate:%s",val.latin1());
742 746
743#endif 747#endif
744 dta->push_back(curSync); 748 dta->push_back(curSync);
745 } 749 }
746 } 750 }
747 return true; 751 return true;