summaryrefslogtreecommitdiffabout
path: root/pwmanager
Unidiff
Diffstat (limited to 'pwmanager') (more/less context) (ignore whitespace changes)
-rw-r--r--pwmanager/pwmanager/main.cpp2
-rw-r--r--pwmanager/pwmanager/pwminit.cpp5
2 files changed, 5 insertions, 2 deletions
diff --git a/pwmanager/pwmanager/main.cpp b/pwmanager/pwmanager/main.cpp
index 70df15d..6e449c6 100644
--- a/pwmanager/pwmanager/main.cpp
+++ b/pwmanager/pwmanager/main.cpp
@@ -9,48 +9,49 @@
9 * * 9 * *
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#ifndef PWM_EMBEDDED 20#ifndef PWM_EMBEDDED
21#include <kcmdlineargs.h> 21#include <kcmdlineargs.h>
22#include <kaboutdata.h> 22#include <kaboutdata.h>
23#else 23#else
24#include <qdir.h> 24#include <qdir.h>
25#include <kpimglobalprefs.h> 25#include <kpimglobalprefs.h>
26#endif 26#endif
27 27
28#include <klocale.h> 28#include <klocale.h>
29#include <kstandarddirs.h> 29#include <kstandarddirs.h>
30 30
31#include "pwmexception.h" 31#include "pwmexception.h"
32#include "pwminit.h" 32#include "pwminit.h"
33void dumpMissing();
33 34
34 #define LICENSE_FILE(::locate("data", "pwmanager/pwmanager_license_text")) 35 #define LICENSE_FILE(::locate("data", "pwmanager/pwmanager_license_text"))
35 36
36int PwMApplication::newInstance() 37int PwMApplication::newInstance()
37{ 38{
38 static bool initial = true; 39 static bool initial = true;
39 if (initial) { 40 if (initial) {
40 initial = false; 41 initial = false;
41 init = new PwMInit(this); 42 init = new PwMInit(this);
42 init->initializeApp(); 43 init->initializeApp();
43 } else { 44 } else {
44 BUG_ON(!init); 45 BUG_ON(!init);
45 printInfo("passing parameters to old instance."); 46 printInfo("passing parameters to old instance.");
46 init->handleCmdLineArgs(false); 47 init->handleCmdLineArgs(false);
47 } 48 }
48 return EXIT_SUCCESS; 49 return EXIT_SUCCESS;
49} 50}
50 51
51 52
52static const char *description = I18N_NOOP("PwManager\n" 53static const char *description = I18N_NOOP("PwManager\n"
53 "The convenient way of managing passwords"); 54 "The convenient way of managing passwords");
54 55
55#ifndef PWM_EMBEDDED 56#ifndef PWM_EMBEDDED
56static KCmdLineOptions options[] = 57static KCmdLineOptions options[] =
@@ -190,31 +191,32 @@ int main(int argc, char *argv[])
190 fileName = qApp->applicationDirPath () + "/kdepim/pwmanager/icons22/"; 191 fileName = qApp->applicationDirPath () + "/kdepim/pwmanager/icons22/";
191 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); 192 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName));
192 QApplication::addLibraryPath ( qApp->applicationDirPath () ); 193 QApplication::addLibraryPath ( qApp->applicationDirPath () );
193 194
194#endif 195#endif
195 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "pwmanager"))); 196 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "pwmanager")));
196 KPimGlobalPrefs::instance()->setGlobalConfig(); 197 KPimGlobalPrefs::instance()->setGlobalConfig();
197 198
198 a.newInstance(); 199 a.newInstance();
199 200
200 //US KAddressBookMain m ; 201 //US KAddressBookMain m ;
201 202
202 //US QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); 203 //US QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
203 /*US 204 /*US
204#ifndef DESKTOP_VERSION 205#ifndef DESKTOP_VERSION
205 a.showMainWidget( &m ); 206 a.showMainWidget( &m );
206#else 207#else
207 a.setMainWidget( &m ); 208 a.setMainWidget( &m );
208 m.resize (640, 480 ); 209 m.resize (640, 480 );
209 m.show(); 210 m.show();
210#endif 211#endif
211 */ 212 */
212 QObject::connect( &a, SIGNAL( lastWindowClosed()), &a, SLOT (quit())); 213 QObject::connect( &a, SIGNAL( lastWindowClosed()), &a, SLOT (quit()));
213 a.exec(); 214 a.exec();
215 dumpMissing();
214 KPimGlobalPrefs::instance()->writeConfig(); 216 KPimGlobalPrefs::instance()->writeConfig();
215 } 217 }
216 qDebug("PWMPI: Bye! "); 218 qDebug("PWMPI: Bye! ");
217 219
218#endif 220#endif
219 221
220} 222}
diff --git a/pwmanager/pwmanager/pwminit.cpp b/pwmanager/pwmanager/pwminit.cpp
index 68f3637..0cf248c 100644
--- a/pwmanager/pwmanager/pwminit.cpp
+++ b/pwmanager/pwmanager/pwminit.cpp
@@ -166,50 +166,51 @@ void PwMInit::initializeApp()
166 createMainWnd(conf()->confGlobAutoStart(), 166 createMainWnd(conf()->confGlobAutoStart(),
167 openDeeplocked, 167 openDeeplocked,
168 true, 168 true,
169 0, 169 0,
170 savedCmd.minimized); 170 savedCmd.minimized);
171 171
172 172
173 173
174 174
175 //} 175 //}
176 } else { 176 } else {
177 createMainWnd(conf()->confGlobAutoStart(), 177 createMainWnd(conf()->confGlobAutoStart(),
178 openDeeplocked, 178 openDeeplocked,
179 true, 179 true,
180 0, 180 0,
181 savedCmd.minimized); 181 savedCmd.minimized);
182 } 182 }
183 runStatus = running; 183 runStatus = running;
184} 184}
185 185
186void PwMInit::shutdownApp(int exitStatus) 186void PwMInit::shutdownApp(int exitStatus)
187{ 187{
188 188
189 189
190 PwM * iii; 190 PwM * iii;;
191 while ( iii = _mainWndList.first() ) { 191 while ( _mainWndList.count() ) {
192 iii = _mainWndList.first();
192 disconnect(iii, SIGNAL(closed(PwM *)), 193 disconnect(iii, SIGNAL(closed(PwM *)),
193 this, SLOT(mainWndClosed(PwM *))); 194 this, SLOT(mainWndClosed(PwM *)));
194 mainWndClosed((iii)); 195 mainWndClosed((iii));
195 } 196 }
196 197
197 printDebug(string("PwMInit::shutdownApp(") 198 printDebug(string("PwMInit::shutdownApp(")
198 + tostr(exitStatus) + ") called."); 199 + tostr(exitStatus) + ") called.");
199 PWM_ASSERT((runStatus == running) || (runStatus == init)); 200 PWM_ASSERT((runStatus == running) || (runStatus == init));
200 runStatus = shutdown; 201 runStatus = shutdown;
201 QApplication::exit(exitStatus); 202 QApplication::exit(exitStatus);
202 /* The destructor of PwMInit is called when control 203 /* The destructor of PwMInit is called when control
203 * leaves main() 204 * leaves main()
204 */ 205 */
205} 206}
206 207
207void PwMInit::initPosixSignalHandler() 208void PwMInit::initPosixSignalHandler()
208{ 209{
209 signal(SIGINT, sig_handler); 210 signal(SIGINT, sig_handler);
210 signal(SIGTERM, sig_handler); 211 signal(SIGTERM, sig_handler);
211} 212}
212 213
213void PwMInit::initDCOP() 214void PwMInit::initDCOP()
214{ 215{
215#ifndef PWM_EMBEDDED 216#ifndef PWM_EMBEDDED