author | zautrix <zautrix> | 2004-10-19 23:38:16 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-19 23:38:16 (UTC) |
commit | f013ff3c0108100c6dbf037a05502ed493361fbf (patch) (side-by-side diff) | |
tree | bf274ac58b55cea0e2f609db8ae5f27f4418a2df /pwmanager | |
parent | f605b2d40ff0f90b132ca880afa83ac751162a2e (diff) | |
download | kdepimpi-f013ff3c0108100c6dbf037a05502ed493361fbf.zip kdepimpi-f013ff3c0108100c6dbf037a05502ed493361fbf.tar.gz kdepimpi-f013ff3c0108100c6dbf037a05502ed493361fbf.tar.bz2 |
desktop fixes
-rw-r--r-- | pwmanager/pwmanager/main.cpp | 1 | ||||
-rw-r--r-- | pwmanager/pwmanager/pwm.cpp | 12 | ||||
-rw-r--r-- | pwmanager/pwmanager/pwm.h | 8 | ||||
-rw-r--r-- | pwmanager/pwmanager/pwmanager.pro | 33 | ||||
-rw-r--r-- | pwmanager/pwmanager/pwmdoc.cpp | 8 | ||||
-rw-r--r-- | pwmanager/pwmanager/pwminit.cpp | 16 | ||||
-rw-r--r-- | pwmanager/pwmanager/serializer.cpp | 6 |
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[]) //US KAddressBookMain m ; //US QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); /*US #ifndef DESKTOP_VERSION a.showMainWidget( &m ); #else a.setMainWidget( &m ); m.resize (640, 480 ); m.show(); #endif */ + qDebug("exec "); a.exec(); } qDebug("PWMPI: Bye! "); #endif } 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() bool PwM::saveAs() { if (!curDoc()->saveAsDocUi(curDoc())) return false; showStatMsg(i18n("Successfully saved data.")); updateCaption(); return true; } //US ENH : changed code to run with older MOC void PwM::addPwd_slot() { - addPwd_slot(0, 0); + addPwd_slot1(0, 0); } -void PwM::addPwd_slot(QString *pw, PwMDoc *_doc) +void PwM::addPwd_slot1(QString *pw, PwMDoc *_doc) { PwMDoc *doc; if (_doc) { doc = _doc; } else { doc = curDoc(); } PWM_ASSERT(doc); doc->timer()->getLock(DocTimer::id_autoLockTimer); #ifndef PWM_EMBEDDED AddEntryWndImpl w; #else @@ -646,33 +646,33 @@ void PwM::addPwd_slot(QString *pw, PwMDoc *_doc) i18n("maximum number of entries")); doc->timer()->putLock(DocTimer::id_autoLockTimer); return; } } setVirgin(false); doc->timer()->putLock(DocTimer::id_autoLockTimer); } //US ENH : changed code to run with older MOC void PwM::editPwd_slot() { - editPwd_slot(0,0,0); + editPwd_slot3(0,0,0); } -void PwM::editPwd_slot(const QString *category) +void PwM::editPwd_slot1(const QString *category) { - editPwd_slot(category, 0, 0); + editPwd_slot3(category, 0, 0); } -void PwM::editPwd_slot(const QString *category, const int *index, +void PwM::editPwd_slot3(const QString *category, const int *index, PwMDoc *_doc) { PwMDoc *doc; if (_doc) { doc = _doc; } else { doc = curDoc(); } PWM_ASSERT(doc); if (doc->isDocEmpty()) return; 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: /** file/export/kwallet triggered */ void exportToKWallet(); /** file/import/text triggered */ bool importFromText(); /** file/import/gpasman triggered */ bool importFromGpasman(); /** file/import/kwallet triggered */ bool importKWallet(); /** file/print triggered */ void print_slot(); /** manage/add triggered */ //US ENH : changed code to run with older MOC + void addPwd_slot(); - void addPwd_slot(QString *pw, PwMDoc *_doc); + void addPwd_slot1(QString *pw, PwMDoc *_doc); /** manage/edit triggered */ //US ENH : changed code to run with older MOC void editPwd_slot(); - void editPwd_slot(const QString *category); - void editPwd_slot(const QString *category = 0, const int *index = 0, + void editPwd_slot1(const QString *category); + void editPwd_slot3(const QString *category = 0, const int *index = 0, PwMDoc *_doc = 0); + /** manage/delete triggered */ void deletePwd_slot(); /** execute the "Launcher" entry */ void execLauncher_slot(); /** open browser with URL entry */ void goToURL_slot(); /** manage/changeMasterPwd triggered */ void changeMasterPwd_slot(); /** lock current document */ void lockWnd_slot(); /** deeplock current document */ 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 @@ TEMPLATE = app CONFIG += qt warn_on - - +DESTDIR= ../../bin TARGET = pwmpi -OBJECTS_DIR = obj/$(PLATFORM) -MOC_DIR = moc/$(PLATFORM) -DESTDIR=$(QPEDIR)/bin +include( ../../variables.pri ) -INCLUDEPATH += . ../../ ../../qtcompat ../../qtcompat/xml ../../libkdepim ../../microkde ../../microkde/kdecore ../../microkde/kdeui ../../microkde/kutils $(QPEDIR)/include +INCLUDEPATH += . ../../ ../../libkdepim ../../microkde ../../microkde/kdecore ../../microkde/kdeui ../../microkde/kutils DEFINES += PWM_EMBEDDED CONFIG_PWMANAGER_GCRY DESKTOP_VERSION #enable this setting if you want debugoutput for pwmanager #DEFINES += CONFIG_DEBUG -LIBS += -L../libcrypt/$(PLATFORM) +LIBS += -L../libcrypt/ +LIBS += -L../../bin/ LIBS += -lmicrokde -LIBS += -lmicroqtcompat LIBS += -lmicrokdepim -LIBS += -L$(QPEDIR)/lib -LIBS += -lqpe LIBS += -lzlib -#LIBS += -lbz2 -#LIBS += -lkpmicrogcrypt -LIBS += -ljpeg -LIBS += $(QTOPIALIB) LIBS += -lkpmicrocipher LIBS += -lkpmicroerror LIBS += -lkpmicrompi LIBS += -lstdc++ +unix:{ +OBJECTS_DIR = obj/unix +MOC_DIR = moc/unix + +} +win32:{ + +DEFINES += _WIN32_ +OBJECTS_DIR = obj/win +MOC_DIR = moc/win +QMAKE_LINK += /NODEFAULTLIB:LIBC + +} + #INTERFACES = \ #addentrywnd.ui \ #configwnd.ui \ #findwnd.ui \ #getmasterpwwnd.ui \ #pwgenwnd.ui \ #setmasterpwwnd.ui \ #subtbledit.ui #INTERFACES = \ #subtbledit.ui \ 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) QDate currDate = QDate::currentDate(); QTime currTime = QTime::currentTime(); #ifndef PWM_EMBEDDED header += currDate.toString("ddd MMMM d ").latin1(); header += currTime.toString("hh:mm:ss ").latin1(); #else QString dfs = KGlobal::locale()->dateFormatShort(); bool ampm = KGlobal::locale()->use12Clock(); KGlobal::locale()->setDateFormatShort("%A %B %d"); KGlobal::locale()->setHore24Format(true); - header += KGlobal::locale()->formatDate(currDate, true, KLocale::Userdefined); - header += KGlobal::locale()->formatTime(currTime, true); + header += KGlobal::locale()->formatDate(currDate, true, KLocale::Userdefined).latin1(); + header += KGlobal::locale()->formatTime(currTime, true).latin1(); KGlobal::locale()->setDateFormatShort(dfs); KGlobal::locale()->setHore24Format(!ampm); #endif header += tostr(currDate.year()); header += "\n==============================\n\n"; #ifndef PWM_EMBEDDED if (f.writeBlock(header.c_str(), header.length()) != (Q_LONG)header.length()) { unlockAll_tempoary(true); f.close(); @@ -3009,45 +3009,45 @@ PwMerror PwMDoc::syncronize(KSyncManager* manager, PwMDoc* syncLocal , PwMDoc* s bool fullDateRange = false; int take; // local->resetTempSyncStat(); QDateTime mLastSync = QDateTime::currentDateTime(); QDateTime modifiedSync = mLastSync; unsigned int index; //Step 1. Find syncinfo in Local file and create if not existent. bool found = syncLocal->findSyncData(mCurrentSyncDevice, &index); if (found == false) { PwMSyncItem newSyncItemLocal; - newSyncItemLocal.syncName = mCurrentSyncDevice; + newSyncItemLocal.syncName = mCurrentSyncDevice.latin1(); newSyncItemLocal.lastSyncDate = mLastSync; syncLocal->addSyncDataEntry(&newSyncItemLocal, true); found = syncLocal->findSyncData(mCurrentSyncDevice, &index); if (found == false) { qDebug("PwMDoc::syncronize : newly created local sync data could not be found"); return e_syncError; } } syncItemLocal = syncLocal->getSyncDataEntry(index); qDebug("Last Sync Local %s ", syncItemLocal->lastSyncDate.toString().latin1()); //Step 2. Find syncinfo in remote file and create if not existent. found = syncRemote->findSyncData(mCurrentSyncName, &index); if (found == false) { qDebug("FULLDATE 1"); fullDateRange = true; PwMSyncItem newSyncItemRemote; - newSyncItemRemote.syncName = mCurrentSyncName; + newSyncItemRemote.syncName = mCurrentSyncName.latin1(); newSyncItemRemote.lastSyncDate = mLastSync; syncRemote->addSyncDataEntry(&newSyncItemRemote, true); found = syncRemote->findSyncData(mCurrentSyncName, &index); if (found == false) { qDebug("PwMDoc::syncronize : newly created remote sync data could not be found"); return e_syncError; } } syncItemRemote = syncRemote->getSyncDataEntry(index); qDebug("Last Sync Remote %s ", syncItemRemote->lastSyncDate.toString().latin1()); //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 @@ ***************************************************************************/ /*************************************************************************** * copyright (C) 2004 by Ulf Schenk * This file is originaly based on version 1.0.1 of pwmanager * and was modified to run on embedded devices that run microkde * * $Id$ **************************************************************************/ #include "pwminit.h" #include "randomizer.h" +#include <qdir.h> #ifndef PWM_EMBEDDED #include "selftest.h" #include "configuration.h" #else #include "pwmprefs.h" #endif #include "pwm.h" #include "pwmexception.h" #include "pwmtray.h" #include "pwmdoc.h" @@ -119,60 +120,65 @@ PwMInit::~PwMInit() delete_ifnot_null(_keycard); #endif // CONFIG_KEYCARD delete_ifnot_null(_tray); Randomizer::cleanup(); #ifndef PWM_EMBEDDED Configuration::cleanup(); #endif } void PwMInit::initializeApp() { + qDebug("PwMInit::initializeApp() "); PWM_ASSERT(runStatus == unknown); runStatus = init; initPosixSignalHandler(); Randomizer::init(); #ifndef PWM_EMBEDDED Configuration::init(); #endif initDCOP(); initKWalletEmu(); initKeycard(); initTray(); handleCmdLineArgs(); - + qDebug("handle "); bool openDeeplocked = false; if (conf()->confGlobAutostartDeepLocked() || savedCmd.open_deeplocked) openDeeplocked = true; - if (conf()->confWndAutoMinimizeOnStart() || - savedCmd.minToTray) { + if ( false ){ + // LR is not working + //if (conf()->confWndAutoMinimizeOnStart() || + // savedCmd.minToTray) { PwMDoc *newDoc = createDoc(); + qDebug(" createDoc()"); if (!newDoc->openDocUi(newDoc, conf()->confGlobAutoStart(), openDeeplocked)) { delete newDoc; + } //US ENH for embedded devices: in the case of failure, open a document the default way createMainWnd(conf()->confGlobAutoStart(), openDeeplocked, true, 0, savedCmd.minimized); - } + // } } else { createMainWnd(conf()->confGlobAutoStart(), openDeeplocked, true, 0, savedCmd.minimized); } runStatus = running; } void PwMInit::shutdownApp(int exitStatus) @@ -277,24 +283,25 @@ void PwMInit::removeTrayAndQuit() { PWM_ASSERT(_tray); // _tray is deleted in ~PwMInit shutdownApp(0); } PwM * PwMInit::createMainWnd(const QString &loadFile, bool loadFileDeepLocked, bool virginity, PwMDoc *doc, bool minimized) { + qDebug("PwMInit::createMainWnd "); PwM *newWnd; if (!doc) doc = createDoc(); newWnd = new PwM(this, doc, virginity); #ifndef PWM_EMBEDDED _mainWndList.push_back(newWnd); #else _mainWndList.append(newWnd); #endif connect(newWnd, SIGNAL(closed(PwM *)), this, SLOT(mainWndClosed(PwM *))); connect(newWnd, SIGNAL(gotFocus(PwM *)), @@ -308,24 +315,25 @@ PwM * PwMInit::createMainWnd(const QString &loadFile, newWnd->showMinimized(); else newWnd->show(); #else //PWM_EMBEDDED #ifndef DESKTOP_VERSION app->showMainWidget( newWnd ); #else //DESKTOP_VERSION app->setMainWidget( newWnd ); newWnd->resize (640, 480 ); newWnd->show(); + qDebug("show "); #endif //DESKTOP_VERSION #endif //PWM_EMBEDDED if (loadFile != QString::null && loadFile != "") { newWnd->openDoc(loadFile, loadFileDeepLocked); } return newWnd; } PwMDoc * 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() { delete_ifnot_null(domDoc); domDoc = new QDomDocument; } bool Serializer::parseXml(const QCString &buffer) { PWM_ASSERT(domDoc); #ifndef PWM_EMBEDDED if (!domDoc->setContent(buffer, true)) return false; #else +#ifdef DESKTOP_VERSION + if (!domDoc->setContent(buffer, true)) +#else if (!domDoc->setContent(buffer)) +#endif return false; #endif if (!checkValid()) return false; return true; } QCString Serializer::getXml() { PWM_ASSERT(domDoc); #ifndef PWM_EMBEDDED @@ -723,25 +727,25 @@ bool Serializer::readSyncData(const QDomNode &n, vector<PwMSyncItem> *dta) } for (i = 0; i < numSync; ++i) { cur = nl.item(i); if (cur.nodeName().left(1) == SYNC_TARGET_PREFIX) { devicename = cur.toElement().attribute(SYNC_TARGET_NAME); val = cur.toElement().text(); if ((val == "") || (devicename == QString::null)) { printDebug("Serializer::readSyncData(): empty synctarget name or syncdate"); continue; } - curSync.syncName = devicename; + curSync.syncName = devicename.latin1(); #ifndef PWM_EMBEDDED curSync.lastSyncDate = QDateTime::fromString(val, Qt::ISODate); #else curSync.lastSyncDate = KGlobal::locale()->readDateTime(val, KLocale::ISODate, &ok); if (ok == false) qDebug("Serializer::readSyncData(): could not parse syncdate:%s",val.latin1()); #endif dta->push_back(curSync); } } return true; |