summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-10-23 14:56:10 (UTC)
committer zautrix <zautrix>2004-10-23 14:56:10 (UTC)
commita682b1d39c63cff8d709c67460569c70b661d889 (patch) (unidiff)
treedd5cb4052b07927b63bafa68b2fd6d40bce6a6dc
parent73c0cb5307a8276f628765c651ef0284b85d64de (diff)
downloadkdepimpi-a682b1d39c63cff8d709c67460569c70b661d889.zip
kdepimpi-a682b1d39c63cff8d709c67460569c70b661d889.tar.gz
kdepimpi-a682b1d39c63cff8d709c67460569c70b661d889.tar.bz2
fixed several memory leaks
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/mainembedded.cpp7
-rw-r--r--kmicromail/main.cpp3
-rw-r--r--korganizer/kolistview.cpp1
-rw-r--r--korganizer/koprefs.cpp10
-rw-r--r--korganizer/main.cpp3
-rw-r--r--libkdepim/externalapphandler.cpp12
-rw-r--r--libkdepim/externalapphandler.h2
-rw-r--r--libkdepim/kpimglobalprefs.cpp3
-rw-r--r--microkde/kdeui/klistview.cpp5
-rw-r--r--pwmanager/pwmanager/main.cpp2
-rw-r--r--pwmanager/pwmanager/pwm.cpp2
11 files changed, 28 insertions, 22 deletions
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp
index a8816f9..547d208 100644
--- a/kaddressbook/mainembedded.cpp
+++ b/kaddressbook/mainembedded.cpp
@@ -17,83 +17,84 @@
17#include <qdir.h> 17#include <qdir.h>
18#include "kabprefs.h" 18#include "kabprefs.h"
19#include "kaddressbookmain.h" 19#include "kaddressbookmain.h"
20#include "externalapphandler.h" 20#include "externalapphandler.h"
21#include <libkdepim/kpimglobalprefs.h> 21#include <libkdepim/kpimglobalprefs.h>
22void dumpMissing(); 22void dumpMissing();
23int main( int argc, char **argv ) 23int main( int argc, char **argv )
24{ 24{
25#ifndef DESKTOP_VERSION 25#ifndef DESKTOP_VERSION
26 QPEApplication a( argc, argv ); 26 QPEApplication a( argc, argv );
27 a.setKeepRunning (); 27 a.setKeepRunning ();
28#else 28#else
29 QApplication a( argc, argv ); 29 QApplication a( argc, argv );
30 QApplication::setStyle( new QPlatinumStyle ()); 30 QApplication::setStyle( new QPlatinumStyle ());
31 QString hdir = QDir::homeDirPath(); 31 QString hdir = QDir::homeDirPath();
32 // there is a bug when creating dirs for WIN 98 32 // there is a bug when creating dirs for WIN 98
33 // it is difficult to fix, because we have no WIN 98 runnung 33 // it is difficult to fix, because we have no WIN 98 runnung
34 // such that we try it to create the dirs at startup here 34 // such that we try it to create the dirs at startup here
35 if ( hdir == "C:\\" ) { // win 98 or ME 35 if ( hdir == "C:\\" ) { // win 98 or ME
36 QDir app_dir; 36 QDir app_dir;
37 if ( !app_dir.exists("C:\\kdepim") ) 37 if ( !app_dir.exists("C:\\kdepim") )
38 app_dir.mkdir ("C:\\kdepim"); 38 app_dir.mkdir ("C:\\kdepim");
39 if ( !app_dir.exists("C:\\kdepim\\apps") ) 39 if ( !app_dir.exists("C:\\kdepim\\apps") )
40 app_dir.mkdir ("C:\\kdepim\\apps"); 40 app_dir.mkdir ("C:\\kdepim\\apps");
41 if ( !app_dir.exists("C:\\kdepim\\config") ) 41 if ( !app_dir.exists("C:\\kdepim\\config") )
42 app_dir.mkdir ("C:\\kdepim\\config"); 42 app_dir.mkdir ("C:\\kdepim\\config");
43 if ( !app_dir.exists("C:\\kdepim\\apps\\kaddressbook") ) 43 if ( !app_dir.exists("C:\\kdepim\\apps\\kaddressbook") )
44 app_dir.mkdir ("C:\\kdepim\\apps\\kaddressbook"); 44 app_dir.mkdir ("C:\\kdepim\\apps\\kaddressbook");
45 } 45 }
46#endif 46#endif
47 47
48 bool exitHelp = false; 48 bool exitHelp = false;
49 if ( argc > 1 ) { 49 if ( argc > 1 ) {
50 QString command = argv[1]; 50 QString command = argv[1];
51 if ( command == "-help" ){ 51 if ( command == "-help" ){
52 printf("KA/E command line commands:\n"); 52 printf("KA/E command line commands:\n");
53 printf(" no command: Start KA/E in usual way\n"); 53 printf(" no command: Start KA/E in usual way\n");
54 printf(" -help: This output\n"); 54 printf(" -help: This output\n");
55 printf(" KA/E is exiting now. Bye!\n"); 55 printf(" KA/E is exiting now. Bye!\n");
56 exitHelp = true; 56 exitHelp = true;
57 } 57 }
58 } 58 }
59 if ( ! exitHelp ) { 59 if ( ! exitHelp ) {
60 60
61 KGlobal::setAppName( "kaddressbook" ); 61 KGlobal::setAppName( "kaddressbook" );
62#ifndef DESKTOP_VERSION 62#ifndef DESKTOP_VERSION
63 if ( QApplication::desktop()->width() > 320 ) 63 if ( QApplication::desktop()->width() > 320 )
64 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons22/"); 64 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons22/");
65 else 65 else
66 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/"); 66 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/");
67#else 67#else
68 QString fileName ; 68 QString fileName ;
69 fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons22/"; 69 fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons22/";
70 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); 70 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName));
71 QApplication::addLibraryPath ( qApp->applicationDirPath () ); 71 QApplication::addLibraryPath ( qApp->applicationDirPath () );
72 72
73#endif 73#endif
74 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook"))); 74 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook")));
75 // init language 75 // init language
76 KABPrefs::instance(); 76 KABPrefs::instance();
77 KAddressBookMain m ; 77 KAddressBookMain m ;
78//US MainWindow m; 78//US MainWindow m;
79 QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); 79 QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
80 80
81 { 81
82 KPimGlobalPrefs::instance()->setGlobalConfig(); 82 KPimGlobalPrefs::instance()->setGlobalConfig();
83 } 83
84#ifndef DESKTOP_VERSION 84#ifndef DESKTOP_VERSION
85 a.showMainWidget( &m ); 85 a.showMainWidget( &m );
86 86
87#else 87#else
88 a.setMainWidget( &m ); 88 a.setMainWidget( &m );
89 m.resize (640, 480 ); 89 m.resize (640, 480 );
90 m.show(); 90 m.show();
91#endif 91#endif
92 a.exec(); 92 a.exec();
93 93
94 dumpMissing(); 94 dumpMissing();
95 95
96 KPimGlobalPrefs::instance()->writeConfig();
96 } 97 }
97 qDebug("KA: Bye! "); 98 qDebug("KA: Bye! ");
98} 99}
99 100
diff --git a/kmicromail/main.cpp b/kmicromail/main.cpp
index 8947ff8..8341c5a 100644
--- a/kmicromail/main.cpp
+++ b/kmicromail/main.cpp
@@ -1,63 +1,66 @@
1// CHANGED 2004-08-06 Lutz Rogowski 1// CHANGED 2004-08-06 Lutz Rogowski
2 2
3 3
4#ifndef DESKTOP_VERSION 4#ifndef DESKTOP_VERSION
5#include <qpe/qpeapplication.h> 5#include <qpe/qpeapplication.h>
6#include <libkdepim/externalapphandler.h> 6#include <libkdepim/externalapphandler.h>
7#include <stdlib.h> 7#include <stdlib.h>
8#else 8#else
9#include <qapplication.h> 9#include <qapplication.h>
10#include <qstring.h> 10#include <qstring.h>
11#include <qwindowsstyle.h> 11#include <qwindowsstyle.h>
12#include <qplatinumstyle.h> 12#include <qplatinumstyle.h>
13#include <qsgistyle.h> 13#include <qsgistyle.h>
14#endif 14#endif
15#include "opiemail.h" 15#include "opiemail.h"
16#include <qdir.h> 16#include <qdir.h>
17#include <kstandarddirs.h> 17#include <kstandarddirs.h>
18#include <kglobal.h> 18#include <kglobal.h>
19#include <stdio.h> 19#include <stdio.h>
20#include "mainwindow.h" 20#include "mainwindow.h"
21#include "koprefs.h" 21#include "koprefs.h"
22#include <libkdepim/kpimglobalprefs.h>
22void dumpMissing(); 23void dumpMissing();
23//using namespace Opie::Core; 24//using namespace Opie::Core;
24int main( int argc, char **argv ) { 25int main( int argc, char **argv ) {
25 26
26#ifndef DESKTOP_VERSION 27#ifndef DESKTOP_VERSION
27 QPEApplication a( argc, argv ); 28 QPEApplication a( argc, argv );
28 a.setKeepRunning (); 29 a.setKeepRunning ();
29#else 30#else
30 QApplication a( argc, argv ); 31 QApplication a( argc, argv );
31 QApplication::setStyle( new QPlatinumStyle ()); 32 QApplication::setStyle( new QPlatinumStyle ());
32#endif 33#endif
33 a.setFont( KOPrefs::instance()->mAppFont ); 34 a.setFont( KOPrefs::instance()->mAppFont );
34 KGlobal::setAppName( "kopiemail" ); 35 KGlobal::setAppName( "kopiemail" );
35 QString fileName ; 36 QString fileName ;
36#ifndef DESKTOP_VERSION 37#ifndef DESKTOP_VERSION
37 fileName = getenv("QPEDIR"); 38 fileName = getenv("QPEDIR");
38 if ( QApplication::desktop()->width() > 320 ) 39 if ( QApplication::desktop()->width() > 320 )
39 KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/kopiemail/icons22/"); 40 KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/kopiemail/icons22/");
40 else 41 else
41 KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/kopiemail/"); 42 KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/kopiemail/");
42#else 43#else
43 fileName = qApp->applicationDirPath () + "/kdepim/kopiemail/"; 44 fileName = qApp->applicationDirPath () + "/kdepim/kopiemail/";
44 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); 45 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName));
45#endif 46#endif
46 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kopiemail"))); 47 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kopiemail")));
47 OpieMail mw; 48 OpieMail mw;
48#ifndef DESKTOP_VERSION 49#ifndef DESKTOP_VERSION
49 //qDebug("CONNECT "); 50 //qDebug("CONNECT ");
50 QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&mw, SLOT(message( const QCString&, const QByteArray& ))); 51 QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&mw, SLOT(message( const QCString&, const QByteArray& )));
51 // QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); 52 // QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
52 a.showMainWidget(&mw ); 53 a.showMainWidget(&mw );
53#else 54#else
54 a.setMainWidget(&mw ); 55 a.setMainWidget(&mw );
55 mw.show(); 56 mw.show();
56 //m.resize( 800, 600 ); 57 //m.resize( 800, 600 );
57 QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); 58 QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
58#endif 59#endif
59 int rv = a.exec(); 60 int rv = a.exec();
60 dumpMissing(); 61 dumpMissing();
62
63 KPimGlobalPrefs::instance()->writeConfig();
61 return rv; 64 return rv;
62 65
63} 66}
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index d3aa650..3d4acb7 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -945,128 +945,129 @@ void KOListViewListView::keyPressEvent ( QKeyEvent *e)
945 cn = currentItem(); 945 cn = currentItem();
946 if ( ! cn ) 946 if ( ! cn )
947 return; 947 return;
948 if ( jump == 0 ) 948 if ( jump == 0 )
949 jump = 1; 949 jump = 1;
950 while ( jump && cn->itemAbove ()) { 950 while ( jump && cn->itemAbove ()) {
951 cn = cn->itemAbove (); 951 cn = cn->itemAbove ();
952 --jump; 952 --jump;
953 } 953 }
954 setCurrentItem ( cn ); 954 setCurrentItem ( cn );
955 ensureItemVisible ( cn ); 955 ensureItemVisible ( cn );
956 } else 956 } else
957 QListView::keyPressEvent ( e ) ; 957 QListView::keyPressEvent ( e ) ;
958 e->accept(); 958 e->accept();
959 break; 959 break;
960 case Qt::Key_I: { 960 case Qt::Key_I: {
961 QListViewItem* cn; 961 QListViewItem* cn;
962 cn = currentItem(); 962 cn = currentItem();
963 if ( cn ) { 963 if ( cn ) {
964 KOListViewItem* ci = (KOListViewItem*)( cn ); 964 KOListViewItem* ci = (KOListViewItem*)( cn );
965 if ( ci ){ 965 if ( ci ){
966 emit showIncidence( ci->data()); 966 emit showIncidence( ci->data());
967 cn = cn->nextSibling(); 967 cn = cn->nextSibling();
968 if ( cn ) { 968 if ( cn ) {
969 setCurrentItem ( cn ); 969 setCurrentItem ( cn );
970 ensureItemVisible ( cn ); 970 ensureItemVisible ( cn );
971 } 971 }
972 } 972 }
973 } 973 }
974 e->accept(); 974 e->accept();
975 } 975 }
976 break; 976 break;
977 case Qt::Key_Return: 977 case Qt::Key_Return:
978 case Qt::Key_Enter: 978 case Qt::Key_Enter:
979 { 979 {
980 QListViewItem* cn; 980 QListViewItem* cn;
981 cn = currentItem(); 981 cn = currentItem();
982 if ( cn ) { 982 if ( cn ) {
983 KOListViewItem* ci = (KOListViewItem*)( cn ); 983 KOListViewItem* ci = (KOListViewItem*)( cn );
984 if ( ci ){ 984 if ( ci ){
985 if ( e->state() == ShiftButton ) 985 if ( e->state() == ShiftButton )
986 ci->setSelected( false ); 986 ci->setSelected( false );
987 else 987 else
988 ci->setSelected( true ); 988 ci->setSelected( true );
989 cn = cn->nextSibling(); 989 cn = cn->nextSibling();
990 if ( cn ) { 990 if ( cn ) {
991 setCurrentItem ( cn ); 991 setCurrentItem ( cn );
992 ensureItemVisible ( cn ); 992 ensureItemVisible ( cn );
993 } 993 }
994 } 994 }
995 } 995 }
996 e->accept(); 996 e->accept();
997 } 997 }
998 break; 998 break;
999 default: 999 default:
1000 e->ignore(); 1000 e->ignore();
1001 } 1001 }
1002} 1002}
1003KOListViewListView::KOListViewListView(KOListView * lv ) 1003KOListViewListView::KOListViewListView(KOListView * lv )
1004 : KListView( lv ) 1004 : KListView( lv )
1005{ 1005{
1006#ifndef DESKTOP_VERSION 1006#ifndef DESKTOP_VERSION
1007 QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold ); 1007 QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold );
1008#endif 1008#endif
1009 mYMousePos = -1000;
1009 setSelectionMode( QListView::Multi ); 1010 setSelectionMode( QListView::Multi );
1010 setMultiSelection( true); 1011 setMultiSelection( true);
1011 mAllowPopupMenu = true; 1012 mAllowPopupMenu = true;
1012 mMouseDown = false; 1013 mMouseDown = false;
1013 1014
1014} 1015}
1015void KOListViewListView::contentsMouseDoubleClickEvent(QMouseEvent *e) 1016void KOListViewListView::contentsMouseDoubleClickEvent(QMouseEvent *e)
1016{ 1017{
1017 if (!e) return; 1018 if (!e) return;
1018 QPoint vp = contentsToViewport(e->pos()); 1019 QPoint vp = contentsToViewport(e->pos());
1019 QListViewItem *item = itemAt(vp); 1020 QListViewItem *item = itemAt(vp);
1020 if (!item) { 1021 if (!item) {
1021 emit newEvent(); 1022 emit newEvent();
1022 return; 1023 return;
1023 } 1024 }
1024 KListView::contentsMouseDoubleClickEvent(e); 1025 KListView::contentsMouseDoubleClickEvent(e);
1025} 1026}
1026 1027
1027 1028
1028void KOListViewListView::contentsMousePressEvent(QMouseEvent *e) 1029void KOListViewListView::contentsMousePressEvent(QMouseEvent *e)
1029{ 1030{
1030 //qDebug("contentsMousePressEvent++++ "); 1031 //qDebug("contentsMousePressEvent++++ ");
1031 if (! mMouseDown ) { 1032 if (! mMouseDown ) {
1032 mAllowPopupMenu = true; 1033 mAllowPopupMenu = true;
1033 mYMousePos = mapToGlobal( (e->pos())).y(); 1034 mYMousePos = mapToGlobal( (e->pos())).y();
1034 } 1035 }
1035 if ( e->button() == RightButton && mMouseDown ) 1036 if ( e->button() == RightButton && mMouseDown )
1036 return; 1037 return;
1037 if ( e->button() == LeftButton ) 1038 if ( e->button() == LeftButton )
1038 mMouseDown = true; 1039 mMouseDown = true;
1039 KListView::contentsMousePressEvent( e ); 1040 KListView::contentsMousePressEvent( e );
1040} 1041}
1041void KOListViewListView::contentsMouseReleaseEvent(QMouseEvent *e) 1042void KOListViewListView::contentsMouseReleaseEvent(QMouseEvent *e)
1042{ 1043{
1043 //qDebug("contentsMouseReleaseEv---- "); 1044 //qDebug("contentsMouseReleaseEv---- ");
1044 if ( ! mMouseDown ) { 1045 if ( ! mMouseDown ) {
1045 if ( e->button() == RightButton && ! mAllowPopupMenu ) 1046 if ( e->button() == RightButton && ! mAllowPopupMenu )
1046 return; 1047 return;
1047 QListViewItem* ci = currentItem(); 1048 QListViewItem* ci = currentItem();
1048 if ( ci ) 1049 if ( ci )
1049 ci->setSelected( true ); 1050 ci->setSelected( true );
1050 KListView::contentsMouseReleaseEvent(e); 1051 KListView::contentsMouseReleaseEvent(e);
1051 return; 1052 return;
1052 } 1053 }
1053 if ( e->button() == LeftButton ) 1054 if ( e->button() == LeftButton )
1054 mMouseDown = false; 1055 mMouseDown = false;
1055 if ( e->button() == RightButton && ! mAllowPopupMenu ) 1056 if ( e->button() == RightButton && ! mAllowPopupMenu )
1056 return; 1057 return;
1057 if ( e->button() == RightButton ) { 1058 if ( e->button() == RightButton ) {
1058 QListViewItem* ci = currentItem(); 1059 QListViewItem* ci = currentItem();
1059 if ( ci ) 1060 if ( ci )
1060 ci->setSelected( true ); 1061 ci->setSelected( true );
1061 } 1062 }
1062 KListView::contentsMouseReleaseEvent(e); 1063 KListView::contentsMouseReleaseEvent(e);
1063} 1064}
1064void KOListViewListView::contentsMouseMoveEvent(QMouseEvent *e) 1065void KOListViewListView::contentsMouseMoveEvent(QMouseEvent *e)
1065{ 1066{
1066 // qDebug("contentsMouseMoveEv....... "); 1067 // qDebug("contentsMouseMoveEv....... ");
1067 // qDebug("start: %d current %d ",mYMousePos , mapToGlobal( (e->pos())).y() ); 1068 // qDebug("start: %d current %d ",mYMousePos , mapToGlobal( (e->pos())).y() );
1068 int diff = mYMousePos - mapToGlobal( (e->pos())).y(); 1069 int diff = mYMousePos - mapToGlobal( (e->pos())).y();
1069 if ( diff < 0 ) diff = -diff; 1070 if ( diff < 0 ) diff = -diff;
1070 if ( diff > 20 ) 1071 if ( diff > 20 )
1071 mAllowPopupMenu = false; 1072 mAllowPopupMenu = false;
1072 KListView::contentsMouseMoveEvent(e); 1073 KListView::contentsMouseMoveEvent(e);
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index f44debc..8dca3ae 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -106,139 +106,129 @@ KOPrefs::KOPrefs() :
106 addItemBool("ToolBarHor",&mToolBarHor, true ); 106 addItemBool("ToolBarHor",&mToolBarHor, true );
107 addItemBool("ToolBarUp",&mToolBarUp, false ); 107 addItemBool("ToolBarUp",&mToolBarUp, false );
108 addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false ); 108 addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false );
109 addItemInt("Whats Next Days",&mWhatsNextDays,3); 109 addItemInt("Whats Next Days",&mWhatsNextDays,3);
110 addItemInt("Whats Next Prios",&mWhatsNextPrios,1); 110 addItemInt("Whats Next Prios",&mWhatsNextPrios,1);
111 111
112 addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true); 112 addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true);
113 addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true); 113 addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true);
114 addItemInt("AllDay Size",&mAllDaySize,28); 114 addItemInt("AllDay Size",&mAllDaySize,28);
115 QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav"; 115 QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav";
116 addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm ); 116 addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm );
117 117
118 addItemStringList("LocationDefaults",&mLocationDefaults ); 118 addItemStringList("LocationDefaults",&mLocationDefaults );
119 addItemStringList("EventSummary User",&mEventSummaryUser); 119 addItemStringList("EventSummary User",&mEventSummaryUser);
120 addItemStringList("TodoSummary User",&mTodoSummaryUser); 120 addItemStringList("TodoSummary User",&mTodoSummaryUser);
121 121
122 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); 122 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false);
123 addItemBool("Enable Project View",&mEnableProjectView,false); 123 addItemBool("Enable Project View",&mEnableProjectView,false);
124 addItemBool("Auto Save",&mAutoSave,false); 124 addItemBool("Auto Save",&mAutoSave,false);
125 addItemInt("Auto Save Interval",&mAutoSaveInterval,3); 125 addItemInt("Auto Save Interval",&mAutoSaveInterval,3);
126 addItemBool("Confirm Deletes",&mConfirm,true); 126 addItemBool("Confirm Deletes",&mConfirm,true);
127 addItemString("Archive File",&mArchiveFile); 127 addItemString("Archive File",&mArchiveFile);
128 addItemString("Html Export File",&mHtmlExportFile, 128 addItemString("Html Export File",&mHtmlExportFile,
129 QDir::homeDirPath() + "/" + i18n("Default export file", "calendar.html")); 129 QDir::homeDirPath() + "/" + i18n("Default export file", "calendar.html"));
130 addItemBool("Html With Save",&mHtmlWithSave,false); 130 addItemBool("Html With Save",&mHtmlWithSave,false);
131 131
132 KPrefs::setCurrentGroup("Personal Settings"); 132 KPrefs::setCurrentGroup("Personal Settings");
133 133
134 addItemInt("Mail Client",&mMailClient,MailClientKMail); 134 addItemInt("Mail Client",&mMailClient,MailClientKMail);
135 addItemBool("Use Control Center Email",&mEmailControlCenter,false); 135 addItemBool("Use Control Center Email",&mEmailControlCenter,false);
136 addItemBool("Bcc",&mBcc,false); 136 addItemBool("Bcc",&mBcc,false);
137 137
138 KPrefs::setCurrentGroup("Time & Date"); 138 KPrefs::setCurrentGroup("Time & Date");
139 139
140 140
141 addItemInt("Default Start Time",&mStartTime,10); 141 addItemInt("Default Start Time",&mStartTime,10);
142 addItemInt("Default Duration",&mDefaultDuration,2); 142 addItemInt("Default Duration",&mDefaultDuration,2);
143 addItemInt("Default Alarm Time",&mAlarmTime,3); 143 addItemInt("Default Alarm Time",&mAlarmTime,3);
144 KPrefs::setCurrentGroup("AlarmSettings"); 144 KPrefs::setCurrentGroup("AlarmSettings");
145 addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20); 145 addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20);
146 addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7); 146 addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7);
147 addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5); 147 addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5);
148 addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3); 148 addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3);
149 149
150 150
151 KPrefs::setCurrentGroup("Calendar"); 151 KPrefs::setCurrentGroup("Calendar");
152 152
153 addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar); 153 addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar);
154 154
155 KPrefs::setCurrentGroup("Fonts"); 155 KPrefs::setCurrentGroup("Fonts");
156 // qDebug(" KPrefs::setCurrentGroup(Fonts); "); 156 // qDebug(" KPrefs::setCurrentGroup(Fonts); ");
157 addItemFont("TimeBar Font",&mTimeBarFont); 157 addItemFont("TimeBar Font",&mTimeBarFont);
158 addItemFont("MonthView Font",&mMonthViewFont); 158 addItemFont("MonthView Font",&mMonthViewFont);
159 addItemFont("AgendaView Font",&mAgendaViewFont); 159 addItemFont("AgendaView Font",&mAgendaViewFont);
160 addItemFont("MarcusBains Font",&mMarcusBainsFont); 160 addItemFont("MarcusBains Font",&mMarcusBainsFont);
161 addItemFont("TimeLabels Font",&mTimeLabelsFont); 161 addItemFont("TimeLabels Font",&mTimeLabelsFont);
162 addItemFont("TodoView Font",&mTodoViewFont); 162 addItemFont("TodoView Font",&mTodoViewFont);
163 addItemFont("ListView Font",&mListViewFont); 163 addItemFont("ListView Font",&mListViewFont);
164 addItemFont("DateNavigator Font",&mDateNavigatorFont); 164 addItemFont("DateNavigator Font",&mDateNavigatorFont);
165 addItemFont("EditBox Font",&mEditBoxFont); 165 addItemFont("EditBox Font",&mEditBoxFont);
166 addItemFont("JournalView Font",&mJornalViewFont); 166 addItemFont("JournalView Font",&mJornalViewFont);
167 addItemFont("WhatsNextView Font",&mWhatsNextFont); 167 addItemFont("WhatsNextView Font",&mWhatsNextFont);
168 addItemFont("EventView Font",&mEventViewFont); 168 addItemFont("EventView Font",&mEventViewFont);
169 169
170// KPrefs::setCurrentGroup("SyncProfiles");
171// addItemString("LocalMachineName",&mLocalMachineName, "undefined");
172// addItemStringList("SyncProfileNames",&mSyncProfileNames);
173// addItemStringList("ExternSyncProfiles",&mExternSyncProfileNames);
174
175 KPrefs::setCurrentGroup("RemoteSyncing"); 170 KPrefs::setCurrentGroup("RemoteSyncing");
176// addItemBool("UsePasswd",&mUsePassWd,false);
177// addItemBool("WriteBackFile",&mWriteBackFile,true);
178// addItemBool("WriteBackExistingOnly",&mWriteBackExistingOnly,false);
179// addItemBool("AskForPreferences",&mAskForPreferences,true);
180// addItemBool("ShowSyncSummary",&mShowSyncSummary,true);
181 addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" ); 171 addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" );
182 addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" ); 172 addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" );
183 addItemBool("ShowSyncEvents",&mShowSyncEvents,false); 173 addItemBool("ShowSyncEvents",&mShowSyncEvents,false);
184 addItemInt("LastSyncTime",&mLastSyncTime,0); 174 addItemInt("LastSyncTime",&mLastSyncTime,0);
185 175
186#ifdef _WIN32_ 176#ifdef _WIN32_
187 QString hdp= locateLocal("data","korganizer")+"\\\\"; 177 QString hdp= locateLocal("data","korganizer")+"\\\\";
188#else 178#else
189 QString hdp= locateLocal("data","korganizer")+"/"; 179 QString hdp= locateLocal("data","korganizer")+"/";
190#endif 180#endif
191 181
192 KPrefs::setCurrentGroup("LoadSaveFileNames"); 182 KPrefs::setCurrentGroup("LoadSaveFileNames");
193 183
194 addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" ); 184 addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" );
195 addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" ); 185 addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" );
196 addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" ); 186 addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" );
197 addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" ); 187 addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" );
198 188
199 189
200 KPrefs::setCurrentGroup("Locale"); 190 KPrefs::setCurrentGroup("Locale");
201 addItemBool("ShortDateInViewer",&mShortDateInViewer,false); 191 addItemBool("ShortDateInViewer",&mShortDateInViewer,false);
202 192
203 193
204 KPrefs::setCurrentGroup("Colors"); 194 KPrefs::setCurrentGroup("Colors");
205 addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor); 195 addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor);
206 addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor); 196 addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor);
207 addItemColor("Event Color",&mEventColor,mDefaultCategoryColor); 197 addItemColor("Event Color",&mEventColor,mDefaultCategoryColor);
208 addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor); 198 addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor);
209 addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor); 199 addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor);
210 addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor); 200 addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor);
211 addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor); 201 addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor);
212 addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 )); 202 addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 ));
213 addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 )); 203 addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 ));
214 addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 )); 204 addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 ));
215 addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true); 205 addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true);
216 addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true); 206 addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true);
217 addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false); 207 addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false);
218 addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 )); 208 addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 ));
219 addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 )); 209 addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 ));
220 addItemBool("UseAppColors",&mUseAppColors,false); 210 addItemBool("UseAppColors",&mUseAppColors,false);
221 211
222 212
223 213
224 KPrefs::setCurrentGroup("Views"); 214 KPrefs::setCurrentGroup("Views");
225 addItemInt("Hour Size",&mHourSize,8); 215 addItemInt("Hour Size",&mHourSize,8);
226 addItemBool("Show Daily Recurrences",&mDailyRecur,true); 216 addItemBool("Show Daily Recurrences",&mDailyRecur,true);
227 addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true); 217 addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true);
228 addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true); 218 addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true);
229 addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true); 219 addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true);
230 addItemBool("ShowShortMonthName",&mMonthShowShort,false); 220 addItemBool("ShowShortMonthName",&mMonthShowShort,false);
231 addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true); 221 addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true);
232 addItemBool("Enable ToolTips",&mEnableToolTips,false); 222 addItemBool("Enable ToolTips",&mEnableToolTips,false);
233 addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false); 223 addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false);
234 addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false); 224 addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false);
235 addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true); 225 addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true);
236 addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true); 226 addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true);
237 addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,false); 227 addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,false);
238 addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false); 228 addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false);
239 addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false); 229 addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false);
240 addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true); 230 addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true);
241 addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true); 231 addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true);
242 addItemBool("WNViewShowsParents",&mWNViewShowsParents,true); 232 addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);
243 addItemBool("WNViewShowLocation",&mWNViewShowLocation,false); 233 addItemBool("WNViewShowLocation",&mWNViewShowLocation,false);
244 addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false); 234 addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false);
diff --git a/korganizer/main.cpp b/korganizer/main.cpp
index 4194d12..2481ca4 100644
--- a/korganizer/main.cpp
+++ b/korganizer/main.cpp
@@ -1,106 +1,109 @@
1 1
2 2
3#ifndef DESKTOP_VERSION 3#ifndef DESKTOP_VERSION
4#include <qpe/qpeapplication.h> 4#include <qpe/qpeapplication.h>
5#include <qcopchannel_qws.h> 5#include <qcopchannel_qws.h>
6#include <qpe/global.h> 6#include <qpe/global.h>
7#include <stdlib.h> 7#include <stdlib.h>
8#else 8#else
9#include <qapplication.h> 9#include <qapplication.h>
10#include <qstring.h> 10#include <qstring.h>
11#include <qwindowsstyle.h> 11#include <qwindowsstyle.h>
12#include <qplatinumstyle.h> 12#include <qplatinumstyle.h>
13#include <qsgistyle.h> 13#include <qsgistyle.h>
14#endif 14#endif
15#include <qtextcodec.h> 15#include <qtextcodec.h>
16 16
17#include <qdir.h> 17#include <qdir.h>
18#include <kstandarddirs.h> 18#include <kstandarddirs.h>
19#include <kglobal.h> 19#include <kglobal.h>
20#include <stdio.h> 20#include <stdio.h>
21#include "mainwindow.h" 21#include "mainwindow.h"
22#include <libkdepim/kpimglobalprefs.h>
22void dumpMissing(); 23void dumpMissing();
23int main( int argc, char **argv ) 24int main( int argc, char **argv )
24{ 25{
25#ifndef DESKTOP_VERSION 26#ifndef DESKTOP_VERSION
26 QPEApplication a( argc, argv ); 27 QPEApplication a( argc, argv );
27 a.setKeepRunning (); 28 a.setKeepRunning ();
28#else 29#else
29 QApplication a( argc, argv ); 30 QApplication a( argc, argv );
30 QApplication::setStyle( new QPlatinumStyle ()); 31 QApplication::setStyle( new QPlatinumStyle ());
31 QString hdir = QDir::homeDirPath(); 32 QString hdir = QDir::homeDirPath();
32 // there is a bug when creating dirs for WIN 98 33 // there is a bug when creating dirs for WIN 98
33 // it is difficult to fix, because we have no WIN 98 runnung 34 // it is difficult to fix, because we have no WIN 98 runnung
34 // such that we try it to create the dirs at startup here 35 // such that we try it to create the dirs at startup here
35 if ( hdir == "C:\\" ) { // win 98 or ME 36 if ( hdir == "C:\\" ) { // win 98 or ME
36 QDir app_dir; 37 QDir app_dir;
37 if ( !app_dir.exists("C:\\kdepim") ) 38 if ( !app_dir.exists("C:\\kdepim") )
38 app_dir.mkdir ("C:\\kdepim"); 39 app_dir.mkdir ("C:\\kdepim");
39 if ( !app_dir.exists("C:\\kdepim\\apps") ) 40 if ( !app_dir.exists("C:\\kdepim\\apps") )
40 app_dir.mkdir ("C:\\kdepim\\apps"); 41 app_dir.mkdir ("C:\\kdepim\\apps");
41 if ( !app_dir.exists("C:\\kdepim\\config") ) 42 if ( !app_dir.exists("C:\\kdepim\\config") )
42 app_dir.mkdir ("C:\\kdepim\\config"); 43 app_dir.mkdir ("C:\\kdepim\\config");
43 if ( !app_dir.exists("C:\\kdepim\\apps\\korganizer") ) 44 if ( !app_dir.exists("C:\\kdepim\\apps\\korganizer") )
44 app_dir.mkdir ("C:\\kdepim\\apps\\korganizer"); 45 app_dir.mkdir ("C:\\kdepim\\apps\\korganizer");
45 } 46 }
46#endif 47#endif
47 bool exitHelp = false; 48 bool exitHelp = false;
48 if ( argc > 1 ) { 49 if ( argc > 1 ) {
49 QString command = argv[1]; 50 QString command = argv[1];
50 if ( command == "-help" ){ 51 if ( command == "-help" ){
51 printf("KO/Pi command line commands:\n"); 52 printf("KO/Pi command line commands:\n");
52 printf(" no command: Start KO/Pi in usual way\n"); 53 printf(" no command: Start KO/Pi in usual way\n");
53 printf(" -help: This output\n"); 54 printf(" -help: This output\n");
54 printf("Next Option: Open or Show after start:\n"); 55 printf("Next Option: Open or Show after start:\n");
55 printf(" -newTodo: New Todo dialog\n"); 56 printf(" -newTodo: New Todo dialog\n");
56 printf(" -newEvent: New Event dialog\n"); 57 printf(" -newEvent: New Event dialog\n");
57 printf(" -showList: List view\n"); 58 printf(" -showList: List view\n");
58 printf(" -showDay: Day view\n"); 59 printf(" -showDay: Day view\n");
59 printf(" -showWWeek: Work Week view\n"); 60 printf(" -showWWeek: Work Week view\n");
60 printf(" -showWeek: Week view\n"); 61 printf(" -showWeek: Week view\n");
61 printf(" -showTodo: Todo view\n"); 62 printf(" -showTodo: Todo view\n");
62 printf(" -showJournal: Journal view\n"); 63 printf(" -showJournal: Journal view\n");
63 printf(" -showKO: Next Days view\n"); 64 printf(" -showKO: Next Days view\n");
64 printf(" -showWNext: What's Next view\n"); 65 printf(" -showWNext: What's Next view\n");
65 printf(" -showNextXView: Next X View\n"); 66 printf(" -showNextXView: Next X View\n");
66 printf(" -new[Y] and -show[X] may be used togehther\n"); 67 printf(" -new[Y] and -show[X] may be used togehther\n");
67 printf(" KO/Pi is exiting now. Bye!\n"); 68 printf(" KO/Pi is exiting now. Bye!\n");
68 exitHelp = true; 69 exitHelp = true;
69 } 70 }
70 } 71 }
71 if ( ! exitHelp ) { 72 if ( ! exitHelp ) {
72 KGlobal::setAppName( "korganizer" ); 73 KGlobal::setAppName( "korganizer" );
73 QString fileName ; 74 QString fileName ;
74#ifndef DESKTOP_VERSION 75#ifndef DESKTOP_VERSION
75 fileName = getenv("QPEDIR"); 76 fileName = getenv("QPEDIR");
76 KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/korganizer/"); 77 KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/korganizer/");
77#else 78#else
78 fileName = qApp->applicationDirPath () + "/kdepim/korganizer/"; 79 fileName = qApp->applicationDirPath () + "/kdepim/korganizer/";
79 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); 80 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName));
80#endif 81#endif
81 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "korganizer"))); 82 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "korganizer")));
82 MainWindow m; 83 MainWindow m;
83#ifndef DESKTOP_VERSION 84#ifndef DESKTOP_VERSION
84 85
85 QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& ))); 86 QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& )));
86 a.showMainWidget(&m ); 87 a.showMainWidget(&m );
87#else 88#else
88 a.setMainWidget(&m ); 89 a.setMainWidget(&m );
89 m.show(); 90 m.show();
90 //m.resize( 800, 600 ); 91 //m.resize( 800, 600 );
91 QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); 92 QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
92#endif 93#endif
93 if ( argc > 1 ) { 94 if ( argc > 1 ) {
94 QCString command = argv[1]; 95 QCString command = argv[1];
95 if ( argc > 2 ) 96 if ( argc > 2 )
96 command += argv[2]; 97 command += argv[2];
97 qApp->processEvents(); 98 qApp->processEvents();
98 m.recieve(command, QByteArray() ); 99 m.recieve(command, QByteArray() );
99 100
100 } 101 }
101 102
102 a.exec(); 103 a.exec();
103 dumpMissing(); 104 dumpMissing();
105
106 KPimGlobalPrefs::instance()->writeConfig();
104 } 107 }
105 qDebug("KO: Bye! "); 108 qDebug("KO: Bye! ");
106} 109}
diff --git a/libkdepim/externalapphandler.cpp b/libkdepim/externalapphandler.cpp
index 779b20e..9085673 100644
--- a/libkdepim/externalapphandler.cpp
+++ b/libkdepim/externalapphandler.cpp
@@ -1,128 +1,128 @@
1/* 1/*
2 This file is part of libkdepim. 2 This file is part of libkdepim.
3 Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24/* 24/*
25Enhanced Version of the file for platform independent KDE tools. 25Enhanced Version of the file for platform independent KDE tools.
26Copyright (c) 2004 Ulf Schenk 26Copyright (c) 2004 Ulf Schenk
27 27
28$Id$ 28$Id$
29*/ 29*/
30#include <stdlib.h> 30#include <stdlib.h>
31 31
32#include <qfile.h> 32#include <qfile.h>
33#include <qmap.h> 33#include <qmap.h>
34#include <qregexp.h> 34#include <qregexp.h>
35 35
36#ifndef DESKTOP_VERSION 36#ifndef DESKTOP_VERSION
37#include <qpe/qpeapplication.h> 37#include <qpe/qpeapplication.h>
38#include <qtopia/qcopenvelope_qws.h> 38#include <qtopia/qcopenvelope_qws.h>
39#else 39#else
40#include <qapplication.h> 40#include <qapplication.h>
41#endif 41#endif
42 42
43#include <kstaticdeleter.h> 43#include <kstaticdeleter.h>
44#include <kmessagebox.h> 44#include <kmessagebox.h>
45 45
46 46
47#include "externalapphandler.h" 47#include "externalapphandler.h"
48 48
49#include "kpimglobalprefs.h" 49#include "kpimglobalprefs.h"
50 50
51//uncomment line to get debug output 51//uncomment line to get debug output
52//#define DEBUG_EXT_APP_HANDLER 52//#define DEBUG_EXT_APP_HANDLER
53 53
54/********************************************************************************* 54/*********************************************************************************
55 * 55 *
56 ********************************************************************************/ 56 ********************************************************************************/
57 57
58 58
59QCopTransferItem::QCopTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage) 59QCopTransferItem::QCopTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage)
60 : _usedSourceParameters(usedSourceParameters), _sourceMessage(sourceMessage), _targetChannel(targetChannel), _targetMessage(targetMessage) 60 : _usedSourceParameters(usedSourceParameters), _sourceMessage(sourceMessage), _targetChannel(targetChannel), _targetMessage(targetMessage)
61{ 61{
62 //sourceMessage passes later three parameters: sourceChannel, uid, param1 62 //sourceMessage passes later three parameters: sourceChannel, uid, param1
63 if (_usedSourceParameters == 0) 63 if (_usedSourceParameters == 0)
64 _sourceMessageParameters = "(QString,QString)"; 64 _sourceMessageParameters = "QString,QString)";
65 else if (_usedSourceParameters == 1) 65 else if (_usedSourceParameters == 1)
66 _sourceMessageParameters = "(QString,QString,QString)"; 66 _sourceMessageParameters = "(QString,QString,QString)";
67 else if (_usedSourceParameters == 2) 67 else if (_usedSourceParameters == 2)
68 _sourceMessageParameters = "(QString,QString,QString,QString)"; 68 _sourceMessageParameters = "(QString,QString,QString,QString)";
69 else if (_usedSourceParameters == 3) 69 else if (_usedSourceParameters == 3)
70 _sourceMessageParameters = "(QString,QString,QString,QString,QString)"; 70 _sourceMessageParameters = "(QString,QString,QString,QString,QString)";
71} 71}
72 72
73/*********************************************************************************/ 73/*********************************************************************************/
74 74
75QCopTransferItem::QCopTransferItem() 75QCopTransferItem::QCopTransferItem()
76{ 76{
77} 77}
78 78
79/*********************************************************************************/ 79/*********************************************************************************/
80bool QCopTransferItem::sendMessageToTarget(const QString& uid, const QString& param1, const QString& param2, const QString& param3) 80bool QCopTransferItem::sendMessageToTarget(const QString& uid, const QString& param1, const QString& param2, const QString& param3)
81{ 81{
82 82
83#ifndef DESKTOP_VERSION 83#ifndef DESKTOP_VERSION
84 //sourceMessage passes two parameters: sourceChannel, uid 84 //sourceMessage passes two parameters: sourceChannel, uid
85 QString sourceMessage = _sourceMessage + _sourceMessageParameters; 85 QString sourceMessage = _sourceMessage + _sourceMessageParameters;
86#ifdef DEBUG_EXT_APP_HANDLER 86#ifdef DEBUG_EXT_APP_HANDLER
87 qDebug("1Using QCopEnvelope e(\"%s\",\"%s\")", _targetChannel.latin1(), sourceMessage.latin1()); 87 qDebug("1Using QCopEnvelope e(\"%s\",\"%s\")", _targetChannel.latin1(), sourceMessage.latin1());
88 qDebug("passing sourcechannel(%s), uid(%s), param1(%s), param2(%s), param3(%s) as parameter to QCopEnvelope", _sourceChannel.latin1(), uid.latin1(), param1.latin1(), param2.latin1(), param3.latin1()); 88 qDebug("passing sourcechannel(%s), uid(%s), param1(%s), param2(%s), param3(%s) as parameter to QCopEnvelope", _sourceChannel.latin1(), uid.latin1(), param1.latin1(), param2.latin1(), param3.latin1());
89#endif 89#endif
90 90
91 QCopEnvelope e(_targetChannel.latin1(), sourceMessage.latin1()); 91 QCopEnvelope e(_targetChannel.latin1(), sourceMessage.latin1());
92 92
93 e << _sourceChannel << uid; 93 e << _sourceChannel << uid;
94 94
95 if (_usedSourceParameters == 1) 95 if (_usedSourceParameters == 1)
96 e << param1; 96 e << param1;
97 else if (_usedSourceParameters == 2) 97 else if (_usedSourceParameters == 2)
98 e << param1 << param2; 98 e << param1 << param2;
99 else if (_usedSourceParameters == 3) 99 else if (_usedSourceParameters == 3)
100 e << param1 << param2 << param3; 100 e << param1 << param2 << param3;
101 101
102 qApp->processEvents(); 102 qApp->processEvents();
103 103
104 return true; 104 return true;
105 105
106#else 106#else
107 KMessageBox::sorry( 0, i18n( "This version does not support QCop." ) ); 107 KMessageBox::sorry( 0, i18n( "This version does not support QCop." ) );
108 return false; 108 return false;
109#endif 109#endif
110 110
111} 111}
112 112
113 113
114/*********************************************************************************/ 114/*********************************************************************************/
115void QCopTransferItem::setSourceChannel(const QString& sourceChannel) 115void QCopTransferItem::setSourceChannel(const QString& sourceChannel)
116{ 116{
117 117
118 if ( !sourceChannel.isEmpty()) 118 if ( !sourceChannel.isEmpty())
119 _sourceChannel = sourceChannel; 119 _sourceChannel = sourceChannel;
120} 120}
121 121
122 122
123/*********************************************************************************/ 123/*********************************************************************************/
124bool QCopTransferItem::appMessage( const QCString& cmsg, const QByteArray& data ) 124bool QCopTransferItem::appMessage( const QCString& cmsg, const QByteArray& data )
125{ 125{
126 126
127 // copied from old mail2 127 // copied from old mail2
128/* 128/*
@@ -196,247 +196,255 @@ QCopMapTransferItem::QCopMapTransferItem(int usedSourceParameters, const QString
196 196
197/*********************************************************************************/ 197/*********************************************************************************/
198bool QCopMapTransferItem::sendMessageToSource(const QString& uid, const QMap<QString,QString>& nameEmailMap) 198bool QCopMapTransferItem::sendMessageToSource(const QString& uid, const QMap<QString,QString>& nameEmailMap)
199{ 199{
200#ifndef DESKTOP_VERSION 200#ifndef DESKTOP_VERSION
201 //targetMessage passes two parameters: uid, map 201 //targetMessage passes two parameters: uid, map
202 QString targetMessage = _targetMessage + _targetMessageParameters; 202 QString targetMessage = _targetMessage + _targetMessageParameters;
203 203
204#ifdef DEBUG_EXT_APP_HANDLER 204#ifdef DEBUG_EXT_APP_HANDLER
205 qDebug("2Using QCopEnvelope e(\"%s\",\"%s\")", _sourceChannel.latin1(), targetMessage.latin1()); 205 qDebug("2Using QCopEnvelope e(\"%s\",\"%s\")", _sourceChannel.latin1(), targetMessage.latin1());
206 qDebug("passing uid(%s) and map as parameter to QCopEnvelope", uid.latin1()); 206 qDebug("passing uid(%s) and map as parameter to QCopEnvelope", uid.latin1());
207#endif 207#endif
208 208
209 QCopEnvelope e(_sourceChannel.latin1(), targetMessage.latin1()); 209 QCopEnvelope e(_sourceChannel.latin1(), targetMessage.latin1());
210 //US we need no names in the To field. The emailadresses are enough 210 //US we need no names in the To field. The emailadresses are enough
211 211
212 e << uid << nameEmailMap; 212 e << uid << nameEmailMap;
213 213
214 qApp->processEvents(); 214 qApp->processEvents();
215 215
216 return true; 216 return true;
217 217
218#else 218#else
219 KMessageBox::sorry( 0, i18n( "This version does not support QCop." ) ); 219 KMessageBox::sorry( 0, i18n( "This version does not support QCop." ) );
220 return false; 220 return false;
221#endif 221#endif
222 222
223} 223}
224 224
225 225
226/*********************************************************************************/ 226/*********************************************************************************/
227bool QCopMapTransferItem::appMessage( const QCString& cmsg, const QByteArray& data ) 227bool QCopMapTransferItem::appMessage( const QCString& cmsg, const QByteArray& data )
228{ 228{
229 bool res = QCopTransferItem::appMessage( cmsg, data ); 229 bool res = QCopTransferItem::appMessage( cmsg, data );
230 230
231 if (res == false) 231 if (res == false)
232 { 232 {
233 QDataStream stream( data, IO_ReadOnly ); 233 QDataStream stream( data, IO_ReadOnly );
234 234
235// qDebug("QCopMapTransferItem- QCOP message received: %s ", cmsg.data() ); 235// qDebug("QCopMapTransferItem- QCOP message received: %s ", cmsg.data() );
236 236
237 //we are in the source and get an answer from the target 237 //we are in the source and get an answer from the target
238 if ((_targetMessage + _targetMessageParameters) == cmsg.data()) 238 if ((_targetMessage + _targetMessageParameters) == cmsg.data())
239 { 239 {
240 QMap<QString,QString> adrMap; 240 QMap<QString,QString> adrMap;
241 QString uid; 241 QString uid;
242 242
243 stream >> uid >> adrMap; 243 stream >> uid >> adrMap;
244 244
245 emit receivedMessageFromTarget(uid, adrMap); 245 emit receivedMessageFromTarget(uid, adrMap);
246 246
247 247
248 return true; 248 return true;
249 } 249 }
250 } 250 }
251 251
252 return false; 252 return false;
253} 253}
254 254
255 255
256/********************************************************************************* 256/*********************************************************************************
257 * 257 *
258 ********************************************************************************/ 258 ********************************************************************************/
259 259
260QCopListTransferItem::~QCopListTransferItem()
261{
262
263}
260 264
261QCopListTransferItem::QCopListTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage) 265QCopListTransferItem::QCopListTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage)
262 : QCopTransferItem(usedSourceParameters, sourceMessage, targetChannel,targetMessage) 266 : QCopTransferItem(usedSourceParameters, sourceMessage, targetChannel,targetMessage)
263{ 267{
264 //targetMessage returns later two parameters: uid, and three lists 268 //targetMessage returns later two parameters: uid, and three lists
265 _targetMessageParameters = "(QString,QStringList,QStringList,QStringList,QStringList,QStringList,QStringList)"; 269 _targetMessageParameters = "(QString,QStringList,QStringList,QStringList,QStringList,QStringList,QStringList)";
266} 270}
267 271
268/*********************************************************************************/ 272/*********************************************************************************/
269bool QCopListTransferItem::sendMessageToSource(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3, const QStringList& list4, const QStringList& list5, const QStringList& list6) 273bool QCopListTransferItem::sendMessageToSource(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3, const QStringList& list4, const QStringList& list5, const QStringList& list6)
270{ 274{
271#ifndef DESKTOP_VERSION 275#ifndef DESKTOP_VERSION
272 //targetMessage passes two parameters: uid, map 276 //targetMessage passes two parameters: uid, map
273 QString targetMessage = _targetMessage + _targetMessageParameters; 277 QString targetMessage = _targetMessage + _targetMessageParameters;
274 278
275#ifdef DEBUG_EXT_APP_HANDLER 279#ifdef DEBUG_EXT_APP_HANDLER
276 qDebug("3Using QCopEnvelope e(\"%s\",\"%s\")", _sourceChannel.latin1(), targetMessage.latin1()); 280 qDebug("3Using QCopEnvelope e(\"%s\",\"%s\")", _sourceChannel.latin1(), targetMessage.latin1());
277 qDebug("passing uid(%s) and list1, list2, list3, list4, list5, list6 as parameter to QCopEnvelope", uid.latin1()); 281 qDebug("passing uid(%s) and list1, list2, list3, list4, list5, list6 as parameter to QCopEnvelope", uid.latin1());
278 282
279 283
280 for ( int i = 0; i < list3.count(); i++) 284 for ( int i = 0; i < list3.count(); i++)
281 qDebug("listentry list3: %s",list3[i].latin1()); 285 qDebug("listentry list3: %s",list3[i].latin1());
282#endif 286#endif
283 287
284 QCopEnvelope e(_sourceChannel.latin1(), targetMessage.latin1()); 288 QCopEnvelope e(_sourceChannel.latin1(), targetMessage.latin1());
285 //US we need no names in the To field. The emailadresses are enough 289 //US we need no names in the To field. The emailadresses are enough
286 290
287 e << uid << list1 << list2 << list3 << list4 << list5 << list6; 291 e << uid << list1 << list2 << list3 << list4 << list5 << list6;
288 292
289 qApp->processEvents(); 293 qApp->processEvents();
290 294
291 return true; 295 return true;
292 296
293#else 297#else
294 KMessageBox::sorry( 0, i18n( "This version does not support QCop." ) ); 298 KMessageBox::sorry( 0, i18n( "This version does not support QCop." ) );
295 return false; 299 return false;
296#endif 300#endif
297 301
298} 302}
299 303
300 304
301/*********************************************************************************/ 305/*********************************************************************************/
302bool QCopListTransferItem::appMessage( const QCString& cmsg, const QByteArray& data ) 306bool QCopListTransferItem::appMessage( const QCString& cmsg, const QByteArray& data )
303{ 307{
304 bool res = QCopTransferItem::appMessage( cmsg, data ); 308 bool res = QCopTransferItem::appMessage( cmsg, data );
305#ifdef DEBUG_EXT_APP_HANDLER 309#ifdef DEBUG_EXT_APP_HANDLER
306 qDebug("1QCopListTransferItem- QCOP message received: %s ", cmsg.data() ); 310 qDebug("1QCopListTransferItem- QCOP message received: %s ", cmsg.data() );
307#endif 311#endif
308 312
309 if (res == false) 313 if (res == false)
310 { 314 {
311 QDataStream stream( data, IO_ReadOnly ); 315 QDataStream stream( data, IO_ReadOnly );
312 316
313#ifdef DEBUG_EXT_APP_HANDLER 317#ifdef DEBUG_EXT_APP_HANDLER
314 qDebug("2QCopListTransferItem- QCOP message received: %s ", cmsg.data() ); 318 qDebug("2QCopListTransferItem- QCOP message received: %s ", cmsg.data() );
315#endif 319#endif
316 320
317 //we are in the source and get an answer from the target 321 //we are in the source and get an answer from the target
318 if ((_targetMessage + _targetMessageParameters) == cmsg.data()) 322 if ((_targetMessage + _targetMessageParameters) == cmsg.data())
319 { 323 {
320 QStringList list1; 324 QStringList list1;
321 QStringList list2; 325 QStringList list2;
322 QStringList list3; 326 QStringList list3;
323 QStringList list4; 327 QStringList list4;
324 QStringList list5; 328 QStringList list5;
325 QStringList list6; 329 QStringList list6;
326 QString uid; 330 QString uid;
327 331
328#ifdef DEBUG_EXT_APP_HANDLER 332#ifdef DEBUG_EXT_APP_HANDLER
329 qDebug("3QCopListTransferItem- QCOP message received: %s ", cmsg.data() ); 333 qDebug("3QCopListTransferItem- QCOP message received: %s ", cmsg.data() );
330#endif 334#endif
331 335
332 stream >> uid >> list1 >> list2 >> list3 >> list4 >> list5 >> list6; 336 stream >> uid >> list1 >> list2 >> list3 >> list4 >> list5 >> list6;
333 emit receivedMessageFromTarget(uid, list1, list2, list3, list4, list5, list6); 337 emit receivedMessageFromTarget(uid, list1, list2, list3, list4, list5, list6);
334 338
335 339
336 return true; 340 return true;
337 } 341 }
338 } 342 }
339 343
340 return false; 344 return false;
341} 345}
342 346
343 347
344 348
345/********************************************************************************* 349/*********************************************************************************
346 * 350 *
347 ********************************************************************************/ 351 ********************************************************************************/
348 352
349 353
350ExternalAppHandler *ExternalAppHandler::sInstance = 0; 354ExternalAppHandler *ExternalAppHandler::sInstance = 0;
351static KStaticDeleter<ExternalAppHandler> staticDeleter; 355static KStaticDeleter<ExternalAppHandler> staticDeleter;
352 356
353ExternalAppHandler::ExternalAppHandler() 357ExternalAppHandler::ExternalAppHandler()
354{ 358{
355 mDefaultItems.setAutoDelete(true); 359 mDefaultItems.setAutoDelete(true);
356 360
357 mNameEmailUidListFromKAPITransfer = new QCopListTransferItem(0, "requestNameEmailUIDListFromKAPI", "QPE/Application/kapi", "receiveNameEmailUIDList"); 361 mNameEmailUidListFromKAPITransfer = new QCopListTransferItem(0, "requestNameEmailUIDListFromKAPI", "QPE/Application/kapi", "receiveNameEmailUIDList");
358 connect(mNameEmailUidListFromKAPITransfer, SIGNAL (receivedMessageFromSource(const QString&, const QString&)), this, SIGNAL (requestForNameEmailUidList(const QString&, const QString&))); 362 connect(mNameEmailUidListFromKAPITransfer, SIGNAL (receivedMessageFromSource(const QString&, const QString&)), this, SIGNAL (requestForNameEmailUidList(const QString&, const QString&)));
359 connect(mNameEmailUidListFromKAPITransfer, SIGNAL (receivedMessageFromTarget(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), this, SLOT (receivedNameEmailUidList_Slot(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); 363 connect(mNameEmailUidListFromKAPITransfer, SIGNAL (receivedMessageFromTarget(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), this, SLOT (receivedNameEmailUidList_Slot(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)));
360 364
361//US mFindByEmailFromKAPITransfer = new QCopListTransferItem(1, "requestFindByEmailFromKAPI", "QPE/Application/kapi", "receiveFindByEmailNameEmailUIDList"); 365//US mFindByEmailFromKAPITransfer = new QCopListTransferItem(1, "requestFindByEmailFromKAPI", "QPE/Application/kapi", "receiveFindByEmailNameEmailUIDList");
362//US connect(mFindByEmailFromKAPITransfer, SIGNAL (receivedMessageFromSource(const QString&, const QString&, const QString&)), this, SIGNAL (requestForFindByEmail(const QString&, const QString&, const QString&))); 366//US connect(mFindByEmailFromKAPITransfer, SIGNAL (receivedMessageFromSource(const QString&, const QString&, const QString&)), this, SIGNAL (requestForFindByEmail(const QString&, const QString&, const QString&)));
363//US connect(mFindByEmailFromKAPITransfer, SIGNAL (receivedMessageFromTarget(const QString&, const QStringList&, const QStringList&, const QStringList&)), this, SIGNAL (receivedFindByEmailEvent(const QString&, const QStringList&, const QStringList&, const QStringList&))); 367//US connect(mFindByEmailFromKAPITransfer, SIGNAL (receivedMessageFromTarget(const QString&, const QStringList&, const QStringList&, const QStringList&)), this, SIGNAL (receivedFindByEmailEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)));
364 368
365 mDisplayDetails = new QCopListTransferItem(3, "requestDisplayDetailsFromKAPI", "QPE/Application/kapi", ""); 369 mDisplayDetails = new QCopListTransferItem(3, "requestDisplayDetailsFromKAPI", "QPE/Application/kapi", "");
366 connect(mDisplayDetails, SIGNAL (receivedMessageFromSource(const QString&, const QString&, const QString&, const QString&, const QString&)), this, SIGNAL (requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&))); 370 connect(mDisplayDetails, SIGNAL (receivedMessageFromSource(const QString&, const QString&, const QString&, const QString&, const QString&)), this, SIGNAL (requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&)));
367 371
368 372
369 373
370 mBirthdayListFromKAPITransfer = new QCopListTransferItem(0, "requestBirthdayListFromKAPI", "QPE/Application/kapi", "receiveBirthdayList"); 374 mBirthdayListFromKAPITransfer = new QCopListTransferItem(0, "requestBirthdayListFromKAPI", "QPE/Application/kapi", "receiveBirthdayList");
371 connect(mBirthdayListFromKAPITransfer, SIGNAL (receivedMessageFromSource(const QString&, const QString&)), this, SIGNAL (requestForBirthdayList(const QString&, const QString&))); 375 connect(mBirthdayListFromKAPITransfer, SIGNAL (receivedMessageFromSource(const QString&, const QString&)), this, SIGNAL (requestForBirthdayList(const QString&, const QString&)));
372 connect(mBirthdayListFromKAPITransfer, SIGNAL (receivedMessageFromTarget(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), this, SIGNAL (receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); 376 connect(mBirthdayListFromKAPITransfer, SIGNAL (receivedMessageFromTarget(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), this, SIGNAL (receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)));
373 377
374 378
375} 379}
376 380
377ExternalAppHandler::~ExternalAppHandler() 381ExternalAppHandler::~ExternalAppHandler()
378{ 382{
383 delete mNameEmailUidListFromKAPITransfer;
384 //delete mFindByEmailFromKAPITransfer;
385 delete mDisplayDetails;
386 delete mBirthdayListFromKAPITransfer;
379} 387}
380 388
381void ExternalAppHandler::receivedNameEmailUidList_Slot(const QString& uid, 389void ExternalAppHandler::receivedNameEmailUidList_Slot(const QString& uid,
382 const QStringList& nameList, 390 const QStringList& nameList,
383 const QStringList& emailList, 391 const QStringList& emailList,
384 const QStringList& uidList, 392 const QStringList& uidList,
385 const QStringList&, 393 const QStringList&,
386 const QStringList&, 394 const QStringList&,
387 const QStringList& ) 395 const QStringList& )
388{ 396{
389 // this method is a conevnient way to reduce the number of parameters I have to pass 397 // this method is a conevnient way to reduce the number of parameters I have to pass
390 emit receivedNameEmailUidListEvent(uid, nameList, emailList, uidList); 398 emit receivedNameEmailUidListEvent(uid, nameList, emailList, uidList);
391} 399}
392 400
393 401
394void ExternalAppHandler::loadConfig() 402void ExternalAppHandler::loadConfig()
395{ 403{
396 404
397 mDefaultItems.clear(); 405 mDefaultItems.clear();
398 mEmailAppAvailable = UNDEFINED; 406 mEmailAppAvailable = UNDEFINED;
399 mPhoneAppAvailable = UNDEFINED; 407 mPhoneAppAvailable = UNDEFINED;
400 mFaxAppAvailable = UNDEFINED; 408 mFaxAppAvailable = UNDEFINED;
401 mSMSAppAvailable = UNDEFINED; 409 mSMSAppAvailable = UNDEFINED;
402 mPagerAppAvailable = UNDEFINED; 410 mPagerAppAvailable = UNDEFINED;
403 mSIPAppAvailable = UNDEFINED; 411 mSIPAppAvailable = UNDEFINED;
404 412
405 QString opiepath = QString::fromLatin1( getenv("OPIEDIR") ); 413 QString opiepath = QString::fromLatin1( getenv("OPIEDIR") );
406 QString qtopiapath = QString::fromLatin1( getenv("QPEDIR") ); 414 QString qtopiapath = QString::fromLatin1( getenv("QPEDIR") );
407 415
408 if (opiepath.isEmpty()) 416 if (opiepath.isEmpty())
409 opiepath = qtopiapath; 417 opiepath = qtopiapath;
410 418
411 //mailclients 419 //mailclients
412 QString mailmsg1 = "writeMail(QString,QString)"; 420 QString mailmsg1 = "writeMail(QString,QString)";
413 QString mailmsg2 = "writeMail(QMap(QString,QString))"; 421 QString mailmsg2 = "writeMail(QMap(QString,QString))";
414 422
415 QString undefined = ""; 423 QString undefined = "";
416 424
417 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::NONE_EMC, "No email client installed", undefined, undefined, undefined, undefined, undefined); 425 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::NONE_EMC, "No email client installed", undefined, undefined, undefined, undefined, undefined);
418 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::OTHER_EMC, "Userdefined email client", undefined, undefined, undefined, undefined, undefined); 426 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::OTHER_EMC, "Userdefined email client", undefined, undefined, undefined, undefined, undefined);
419 427
420 if (( QFile::exists( qtopiapath + "/bin/ompi" )) || 428 if (( QFile::exists( qtopiapath + "/bin/ompi" )) ||
421 ( QFile::exists( opiepath + "/bin/ompi" ))) 429 ( QFile::exists( opiepath + "/bin/ompi" )))
422 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::OMPI_EMC, "OM/Pi email client", "QPE/Application/ompi", mailmsg1, "%1;%2", mailmsg2, "TO=%1;ATTACHMENT=%2"); 430 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::OMPI_EMC, "OM/Pi email client", "QPE/Application/ompi", mailmsg1, "%1;%2", mailmsg2, "TO=%1;ATTACHMENT=%2");
423 431
424 if ( QFile::exists( qtopiapath + "/bin/qtmail" )) 432 if ( QFile::exists( qtopiapath + "/bin/qtmail" ))
425 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::QTOPIA_EMC, "Qtopia email client", "QPE/Application/qtmail", mailmsg1, "%1;%2", mailmsg2, "TO=%1;ATTACHMENT=%2"); 433 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::QTOPIA_EMC, "Qtopia email client", "QPE/Application/qtmail", mailmsg1, "%1;%2", mailmsg2, "TO=%1;ATTACHMENT=%2");
426 434
427 if ( QFile::exists( opiepath + "/bin/opiemail" )) 435 if ( QFile::exists( opiepath + "/bin/opiemail" ))
428 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::OPIE_EMC, "Opie email client", "QPE/Application/opiemail", mailmsg1, "%1;%2", mailmsg2, "TO=%1;ATTACHMENT=%2"); 436 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::OPIE_EMC, "Opie email client", "QPE/Application/opiemail", mailmsg1, "%1;%2", mailmsg2, "TO=%1;ATTACHMENT=%2");
429 437
430 438
431 439
432 //phoneclients 440 //phoneclients
433 441
434 addDefaultAppItem(ExternalAppHandler::PHONE, KPimGlobalPrefs::NONE_PHC, "No phone client installed", undefined, undefined, undefined, undefined, undefined); 442 addDefaultAppItem(ExternalAppHandler::PHONE, KPimGlobalPrefs::NONE_PHC, "No phone client installed", undefined, undefined, undefined, undefined, undefined);
435 addDefaultAppItem(ExternalAppHandler::PHONE, KPimGlobalPrefs::OTHER_PHC, "Other phone client", undefined, undefined, undefined, undefined, undefined); 443 addDefaultAppItem(ExternalAppHandler::PHONE, KPimGlobalPrefs::OTHER_PHC, "Other phone client", undefined, undefined, undefined, undefined, undefined);
436 if (( QFile::exists( qtopiapath + "/bin/kppi" )) || 444 if (( QFile::exists( qtopiapath + "/bin/kppi" )) ||
437 ( QFile::exists( opiepath + "/bin/kppi" ))) 445 ( QFile::exists( opiepath + "/bin/kppi" )))
438 addDefaultAppItem(ExternalAppHandler::PHONE, KPimGlobalPrefs::KPPI_PHC, "KP/Pi phone client", "QPE/Application/kppi", "-ring:%1", "", undefined, undefined); 446 addDefaultAppItem(ExternalAppHandler::PHONE, KPimGlobalPrefs::KPPI_PHC, "KP/Pi phone client", "QPE/Application/kppi", "-ring:%1", "", undefined, undefined);
439 447
440 //faxclients 448 //faxclients
441 addDefaultAppItem(ExternalAppHandler::FAX, KPimGlobalPrefs::NONE_FAC, "No fax client installed", undefined, undefined, undefined, undefined, undefined); 449 addDefaultAppItem(ExternalAppHandler::FAX, KPimGlobalPrefs::NONE_FAC, "No fax client installed", undefined, undefined, undefined, undefined, undefined);
442 addDefaultAppItem(ExternalAppHandler::FAX, KPimGlobalPrefs::OTHER_FAC, "Other fax client", undefined, undefined, undefined, undefined, undefined); 450 addDefaultAppItem(ExternalAppHandler::FAX, KPimGlobalPrefs::OTHER_FAC, "Other fax client", undefined, undefined, undefined, undefined, undefined);
diff --git a/libkdepim/externalapphandler.h b/libkdepim/externalapphandler.h
index 4c6f1ea..6f5d345 100644
--- a/libkdepim/externalapphandler.h
+++ b/libkdepim/externalapphandler.h
@@ -39,129 +39,129 @@ class QCopEnvelope;
39 39
40 40
41class ExternalAppHandler; 41class ExternalAppHandler;
42class QCopTransferItem : public QObject 42class QCopTransferItem : public QObject
43{ 43{
44 Q_OBJECT 44 Q_OBJECT
45 public: 45 public:
46 QCopTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage); 46 QCopTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage);
47 QCopTransferItem(); 47 QCopTransferItem();
48 48
49 bool sendMessageToTarget(const QString& uid, const QString& param1 = QString::null, const QString& param2 = QString::null, const QString& param3 = QString::null); 49 bool sendMessageToTarget(const QString& uid, const QString& param1 = QString::null, const QString& param2 = QString::null, const QString& param3 = QString::null);
50 50
51 void setSourceChannel(const QString& sourceChannel); 51 void setSourceChannel(const QString& sourceChannel);
52 52
53 virtual bool appMessage( const QCString& msg, const QByteArray& data ); 53 virtual bool appMessage( const QCString& msg, const QByteArray& data );
54 54
55 55
56 signals: 56 signals:
57 void receivedMessageFromSource(const QString& sourceChannel, const QString& uid); 57 void receivedMessageFromSource(const QString& sourceChannel, const QString& uid);
58 void receivedMessageFromSource(const QString& sourceChannel, const QString& uid, const QString& param1); 58 void receivedMessageFromSource(const QString& sourceChannel, const QString& uid, const QString& param1);
59 void receivedMessageFromSource(const QString& sourceChannel, const QString& uid, const QString& param1, const QString& param2); 59 void receivedMessageFromSource(const QString& sourceChannel, const QString& uid, const QString& param1, const QString& param2);
60 void receivedMessageFromSource(const QString& sourceChannel, const QString& uid, const QString& param1, const QString& param2, const QString& param3); 60 void receivedMessageFromSource(const QString& sourceChannel, const QString& uid, const QString& param1, const QString& param2, const QString& param3);
61 61
62 public: 62 public:
63 int _usedSourceParameters; 63 int _usedSourceParameters;
64 QString _sourceChannel; 64 QString _sourceChannel;
65 QString _sourceMessage; 65 QString _sourceMessage;
66 QString _sourceMessageParameters; 66 QString _sourceMessageParameters;
67 QString _targetChannel; 67 QString _targetChannel;
68 QString _targetMessage; 68 QString _targetMessage;
69 QString _targetMessageParameters; 69 QString _targetMessageParameters;
70 70
71}; 71};
72 72
73/********************************************************************************* 73/*********************************************************************************
74 * 74 *
75 ********************************************************************************/ 75 ********************************************************************************/
76 76
77class QCopMapTransferItem : public QCopTransferItem 77class QCopMapTransferItem : public QCopTransferItem
78{ 78{
79 Q_OBJECT 79 Q_OBJECT
80 public: 80 public:
81 QCopMapTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage); 81 QCopMapTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage);
82 82
83 bool sendMessageToSource(const QString& uid, const QMap<QString,QString>& nameEmailMap); 83 bool sendMessageToSource(const QString& uid, const QMap<QString,QString>& nameEmailMap);
84 84
85 85
86 virtual bool appMessage( const QCString& msg, const QByteArray& data ); 86 virtual bool appMessage( const QCString& msg, const QByteArray& data );
87 87
88 88
89 signals: 89 signals:
90 void receivedMessageFromTarget(const QString& uid, const QMap<QString,QString>& nameEmailMap); 90 void receivedMessageFromTarget(const QString& uid, const QMap<QString,QString>& nameEmailMap);
91 91
92}; 92};
93 93
94/********************************************************************************* 94/*********************************************************************************
95 * 95 *
96 ********************************************************************************/ 96 ********************************************************************************/
97 97
98class QCopListTransferItem : public QCopTransferItem 98class QCopListTransferItem : public QCopTransferItem
99{ 99{
100 Q_OBJECT 100 Q_OBJECT
101 public: 101 public:
102 QCopListTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage); 102 QCopListTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage);
103 103 ~QCopListTransferItem();
104 bool sendMessageToSource(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3, const QStringList& list4, const QStringList& list5, const QStringList& list6); 104 bool sendMessageToSource(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3, const QStringList& list4, const QStringList& list5, const QStringList& list6);
105 105
106 106
107 virtual bool appMessage( const QCString& msg, const QByteArray& data ); 107 virtual bool appMessage( const QCString& msg, const QByteArray& data );
108 108
109 109
110 signals: 110 signals:
111 void receivedMessageFromTarget(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3, const QStringList& list4 , const QStringList& list5, const QStringList& list6); 111 void receivedMessageFromTarget(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3, const QStringList& list4 , const QStringList& list5, const QStringList& list6);
112 112
113}; 113};
114 114
115/********************************************************************************* 115/*********************************************************************************
116 * 116 *
117 ********************************************************************************/ 117 ********************************************************************************/
118 118
119 119
120class DefaultAppItem 120class DefaultAppItem
121{ 121{
122 public: 122 public:
123 DefaultAppItem(int type, int id, const QString& label, const QString& channel, const QString& message, const QString& parameters, const QString& message2, const QString& parameters2) 123 DefaultAppItem(int type, int id, const QString& label, const QString& channel, const QString& message, const QString& parameters, const QString& message2, const QString& parameters2)
124 : _type(type), _id(id), _label(label), _channel(channel), _message(message), _parameters(parameters), _message2(message2), _parameters2(parameters2) 124 : _type(type), _id(id), _label(label), _channel(channel), _message(message), _parameters(parameters), _message2(message2), _parameters2(parameters2)
125 {} 125 {}
126 126
127 DefaultAppItem() 127 DefaultAppItem()
128 { } 128 { }
129 129
130 public: 130 public:
131 int _type; 131 int _type;
132 int _id; 132 int _id;
133 QString _label; 133 QString _label;
134 QString _channel; 134 QString _channel;
135 QString _message; 135 QString _message;
136 QString _parameters;// a list of parameters in stringrepresentation. Delimiter is ; 136 QString _parameters;// a list of parameters in stringrepresentation. Delimiter is ;
137 QString _message2; 137 QString _message2;
138 QString _parameters2; // a list of parameters in stringrepresentation. Delimiter is ; 138 QString _parameters2; // a list of parameters in stringrepresentation. Delimiter is ;
139 139
140}; 140};
141 141
142/********************************************************************************* 142/*********************************************************************************
143 * 143 *
144 ********************************************************************************/ 144 ********************************************************************************/
145 145
146class ExternalAppHandler : public QObject 146class ExternalAppHandler : public QObject
147{ 147{
148 Q_OBJECT 148 Q_OBJECT
149 public: 149 public:
150 virtual ~ExternalAppHandler(); 150 virtual ~ExternalAppHandler();
151 151
152 static ExternalAppHandler *instance(); 152 static ExternalAppHandler *instance();
153 153
154 enum Types { 154 enum Types {
155 EMAIL = 0, 155 EMAIL = 0,
156 PHONE = 1, 156 PHONE = 1,
157 SMS = 2, 157 SMS = 2,
158 FAX = 3, 158 FAX = 3,
159 PAGER = 4, 159 PAGER = 4,
160 SIP = 5 160 SIP = 5
161 }; 161 };
162 162
163 enum Availability { 163 enum Availability {
164 UNDEFINED = -1, 164 UNDEFINED = -1,
165 UNAVAILABLE = 0, 165 UNAVAILABLE = 0,
166 AVAILABLE = 1 166 AVAILABLE = 1
167 }; 167 };
diff --git a/libkdepim/kpimglobalprefs.cpp b/libkdepim/kpimglobalprefs.cpp
index 3771569..0fdc3e4 100644
--- a/libkdepim/kpimglobalprefs.cpp
+++ b/libkdepim/kpimglobalprefs.cpp
@@ -83,123 +83,122 @@ KPimGlobalPrefs::KPimGlobalPrefs( const QString &name )
83 addItemString( "FaxChannelMessage", &mFaxOtherMessage, "" ); 83 addItemString( "FaxChannelMessage", &mFaxOtherMessage, "" );
84 addItemString( "FaxChannelParameters", &mFaxOtherMessageParameters, "" ); 84 addItemString( "FaxChannelParameters", &mFaxOtherMessageParameters, "" );
85 85
86 addItemInt( "SMSChannelType", &mSMSClient, NONE_SMC ); 86 addItemInt( "SMSChannelType", &mSMSClient, NONE_SMC );
87 addItemString( "SMSChannel", &mSMSOtherChannel, "" ); 87 addItemString( "SMSChannel", &mSMSOtherChannel, "" );
88 addItemString( "SMSChannelMessage", &mSMSOtherMessage, "" ); 88 addItemString( "SMSChannelMessage", &mSMSOtherMessage, "" );
89 addItemString( "SMSChannelParameters", &mSMSOtherMessageParameters, "" ); 89 addItemString( "SMSChannelParameters", &mSMSOtherMessageParameters, "" );
90 90
91 addItemInt( "PagerChannelType", &mPagerClient, NONE_PAC ); 91 addItemInt( "PagerChannelType", &mPagerClient, NONE_PAC );
92 addItemString( "PagerChannel", &mPagerOtherChannel, "" ); 92 addItemString( "PagerChannel", &mPagerOtherChannel, "" );
93 addItemString( "PagerChannelMessage", &mPagerOtherMessage, "" ); 93 addItemString( "PagerChannelMessage", &mPagerOtherMessage, "" );
94 addItemString( "PagerChannelParameters", &mPagerOtherMessageParameters, "" ); 94 addItemString( "PagerChannelParameters", &mPagerOtherMessageParameters, "" );
95 95
96 addItemInt( "SIPChannelType", &mSipClient, KPPI_SIC ); 96 addItemInt( "SIPChannelType", &mSipClient, KPPI_SIC );
97 addItemString( "SIPChannel", &mSipOtherChannel, "" ); 97 addItemString( "SIPChannel", &mSipOtherChannel, "" );
98 addItemString( "SIPChannelMessage", &mSipOtherMessage, "" ); 98 addItemString( "SIPChannelMessage", &mSipOtherMessage, "" );
99 addItemString( "SIPChannelParameters", &mSipOtherMessageParameters, "" ); 99 addItemString( "SIPChannelParameters", &mSipOtherMessageParameters, "" );
100 100
101 KPrefs::setCurrentGroup( "PhoneAccess" ); 101 KPrefs::setCurrentGroup( "PhoneAccess" );
102 addItemString("Ex2PhoneDevice",&mEx2PhoneDevice,"/dev/ircomm"); 102 addItemString("Ex2PhoneDevice",&mEx2PhoneDevice,"/dev/ircomm");
103 addItemString("Ex2PhoneConnection",&mEx2PhoneConnection,"irda"); 103 addItemString("Ex2PhoneConnection",&mEx2PhoneConnection,"irda");
104 addItemString("Ex2PhoneModel",&mEx2PhoneModel,"6310i"); 104 addItemString("Ex2PhoneModel",&mEx2PhoneModel,"6310i");
105 105
106} 106}
107 107
108void KPimGlobalPrefs::setGlobalConfig() 108void KPimGlobalPrefs::setGlobalConfig()
109{ 109{
110 if ( mLocaleDict == 0 ) { 110 if ( mLocaleDict == 0 ) {
111 QString fileName ; 111 QString fileName ;
112 QString name = KGlobal::getAppName() +"/"; 112 QString name = KGlobal::getAppName() +"/";
113#ifndef DESKTOP_VERSION 113#ifndef DESKTOP_VERSION
114 fileName= QString(getenv("QPEDIR"))+"/pics/kdepim/"+name 114 fileName= QString(getenv("QPEDIR"))+"/pics/kdepim/"+name
115#else 115#else
116 fileName = qApp->applicationDirPath () + "/kdepim/"+ name; 116 fileName = qApp->applicationDirPath () + "/kdepim/"+ name;
117#endif 117#endif
118 mLocaleDict = 0; 118 mLocaleDict = 0;
119 if ( mPreferredLanguage > 0 && mPreferredLanguage < 5 ) { 119 if ( mPreferredLanguage > 0 && mPreferredLanguage < 5 ) {
120 120
121 if ( mPreferredLanguage == 1 ) 121 if ( mPreferredLanguage == 1 )
122 fileName = fileName+"germantranslation.txt"; 122 fileName = fileName+"germantranslation.txt";
123 else if ( mPreferredLanguage == 4 ) 123 else if ( mPreferredLanguage == 4 )
124 fileName = fileName+"usertranslation.txt"; 124 fileName = fileName+"usertranslation.txt";
125 else if ( mPreferredLanguage == 2 ) 125 else if ( mPreferredLanguage == 2 )
126 fileName = fileName+"frenchtranslation.txt"; 126 fileName = fileName+"frenchtranslation.txt";
127 else if ( mPreferredLanguage == 3 ) 127 else if ( mPreferredLanguage == 3 )
128 fileName = fileName+"italiantranslation.txt"; 128 fileName = fileName+"italiantranslation.txt";
129 QFile file( fileName ); 129 QFile file( fileName );
130 if (file.open( IO_ReadOnly ) ) { 130 if (file.open( IO_ReadOnly ) ) {
131 QTextStream ts( &file ); 131 QTextStream ts( &file );
132 ts.setEncoding( QTextStream::Latin1 ); 132 ts.setEncoding( QTextStream::Latin1 );
133 //ts.setCodec( QTextCodec::latin1 ); 133 //ts.setCodec( QTextCodec::latin1 );
134 QString text = ts.read(); 134 QString text = ts.read();
135 file.close(); 135 file.close();
136 text.replace( QRegExp("\\\\n"), "\n" ); 136 text.replace( QRegExp("\\\\n"), "\n" );
137 QString line; 137 QString line;
138 QString we; 138 QString we;
139 QString wt; 139 QString wt;
140 int br = 0; 140 int br = 0;
141 int nbr; 141 int nbr;
142 nbr = text.find ( "},", br ); 142 nbr = text.find ( "},", br );
143 line = text.mid( br, nbr - br ); 143 line = text.mid( br, nbr - br );
144 br = nbr+1; 144 br = nbr+1;
145 int se, ee, st, et; 145 int se, ee, st, et;
146 mLocaleDict = new QDict<QString>; 146 mLocaleDict = new QDict<QString>;
147 mLocaleDict->setAutoDelete( true );
147 QString end = "{ \"\",\"\" }"; 148 QString end = "{ \"\",\"\" }";
148 while ( (line != end) && (br > 1) ) { 149 while ( (line != end) && (br > 1) ) {
149 //qDebug("%d *%s* ", br, line.latin1()); 150 //qDebug("%d *%s* ", br, line.latin1());
150 se = line.find("\"")+1; 151 se = line.find("\"")+1;
151 et = line.findRev("\"",-1); 152 et = line.findRev("\"",-1);
152 ee = line.find("\",\""); 153 ee = line.find("\",\"");
153 st = ee+3; 154 st = ee+3;
154 we = line.mid( se, ee-se ); 155 we = line.mid( se, ee-se );
155 wt = line.mid( st, et-st ); 156 wt = line.mid( st, et-st );
156 //qDebug("*%s* *%s* ", we.latin1(), wt.latin1()); 157 //qDebug("*%s* *%s* ", we.latin1(), wt.latin1());
157 mLocaleDict->insert( we, new QString (wt) ); 158 mLocaleDict->insert( we, new QString (wt) );
158 nbr = text.find ( "}", br ); 159 nbr = text.find ( "}", br );
159 line = text.mid( br, nbr - br ); 160 line = text.mid( br, nbr - br );
160 br = nbr+1; 161 br = nbr+1;
161 } 162 }
162 //qDebug("end *%s* ", end.latin1()); 163 //qDebug("end *%s* ", end.latin1());
163 164
164 setLocaleDict( mLocaleDict ); 165 setLocaleDict( mLocaleDict );
165 } else { 166 } else {
166 qDebug("KO: Cannot find translation file %s",fileName.latin1() ); 167 qDebug("KO: Cannot find translation file %s",fileName.latin1() );
167 } 168 }
168 } 169 }
169 } 170 }
170 171
171 KGlobal::locale()->setHore24Format( !mPreferredTime ); 172 KGlobal::locale()->setHore24Format( !mPreferredTime );
172 KGlobal::locale()->setWeekStartMonday( !mWeekStartsOnSunday ); 173 KGlobal::locale()->setWeekStartMonday( !mWeekStartsOnSunday );
173 KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)mPreferredDate ); 174 KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)mPreferredDate );
174 KGlobal::locale()->setLanguage( mPreferredLanguage ); 175 KGlobal::locale()->setLanguage( mPreferredLanguage );
175 QString dummy = mUserDateFormatLong; 176 QString dummy = mUserDateFormatLong;
176 KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") )); 177 KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") ));
177 dummy = mUserDateFormatShort; 178 dummy = mUserDateFormatShort;
178 KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") )); 179 KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") ));
179 KGlobal::locale()->setDaylightSaving( mUseDaylightsaving, 180 KGlobal::locale()->setDaylightSaving( mUseDaylightsaving,
180 mDaylightsavingStart, 181 mDaylightsavingStart,
181 mDaylightsavingEnd ); 182 mDaylightsavingEnd );
182 KGlobal::locale()->setTimezone( mTimeZoneId, mTimeZoneAdd30min ); 183 KGlobal::locale()->setTimezone( mTimeZoneId, mTimeZoneAdd30min );
183 184
184} 185}
185KPimGlobalPrefs::~KPimGlobalPrefs() 186KPimGlobalPrefs::~KPimGlobalPrefs()
186{ 187{
187 if (sInstance == this) 188 if (sInstance == this)
188 sInstance = staticDeleterGP.setObject(0); 189 sInstance = staticDeleterGP.setObject(0);
189 else 190 else
190 qDebug("Whats this? Error in KPimGlobalPrefs::~KPimGlobalPrefs() ?"); 191 qDebug("Whats this? Error in KPimGlobalPrefs::~KPimGlobalPrefs() ?");
191 //qDebug("KPimGlobalPrefs::~KPimGlobalPrefs() ");
192 writeConfig();
193 if ( mLocaleDict ) 192 if ( mLocaleDict )
194 delete mLocaleDict; 193 delete mLocaleDict;
195} 194}
196 195
197KPimGlobalPrefs *KPimGlobalPrefs::instance() 196KPimGlobalPrefs *KPimGlobalPrefs::instance()
198{ 197{
199 if ( !sInstance ) { 198 if ( !sInstance ) {
200 sInstance = staticDeleterGP.setObject( new KPimGlobalPrefs() ); 199 sInstance = staticDeleterGP.setObject( new KPimGlobalPrefs() );
201 sInstance->readConfig(); 200 sInstance->readConfig();
202 } 201 }
203 202
204 return sInstance; 203 return sInstance;
205} 204}
diff --git a/microkde/kdeui/klistview.cpp b/microkde/kdeui/klistview.cpp
index 5b50ba9..3c809b4 100644
--- a/microkde/kdeui/klistview.cpp
+++ b/microkde/kdeui/klistview.cpp
@@ -33,147 +33,146 @@
33#include <kapplication.h> 33#include <kapplication.h>
34//US #include <kipc.h> 34//US #include <kipc.h>
35#include <kdebug.h> 35#include <kdebug.h>
36#ifdef _WIN32_ 36#ifdef _WIN32_
37#define Q_WS_QWS 37#define Q_WS_QWS
38#endif 38#endif
39#ifndef _WIN32_ 39#ifndef _WIN32_
40#define private public 40#define private public
41#include <qlistview.h> 41#include <qlistview.h>
42#undef private 42#undef private
43#endif 43#endif
44#include "klistview.h" 44#include "klistview.h"
45//US #include "klistviewlineedit.h" 45//US #include "klistviewlineedit.h"
46#ifndef DESKTOP_VERSION 46#ifndef DESKTOP_VERSION
47#include <qpe/qpeapplication.h> 47#include <qpe/qpeapplication.h>
48#endif 48#endif
49 49
50// /*US 50// /*US
51class KListView::Tooltip : public QToolTip 51class KListView::Tooltip : public QToolTip
52{ 52{
53public: 53public:
54 Tooltip (KListView* parent, QToolTipGroup* group = 0L); 54 Tooltip (KListView* parent, QToolTipGroup* group = 0L);
55 virtual ~Tooltip () {} 55 virtual ~Tooltip () {}
56 56
57protected: 57protected:
58 // */ 58 // */
59 /** 59 /**
60 * Reimplemented from QToolTip for internal reasons. 60 * Reimplemented from QToolTip for internal reasons.
61 */ 61 */
62 // /*US 62 // /*US
63 virtual void maybeTip (const QPoint&); 63 virtual void maybeTip (const QPoint&);
64 64
65private: 65private:
66 KListView* mParent; 66 KListView* mParent;
67}; 67};
68 68
69KListView::Tooltip::Tooltip (KListView* parent, QToolTipGroup* group) 69KListView::Tooltip::Tooltip (KListView* parent, QToolTipGroup* group)
70 : QToolTip (parent, group), 70 : QToolTip (parent, group),
71 mParent (parent) 71 mParent (parent)
72{ 72{
73} 73}
74 74
75void KListView::Tooltip::maybeTip (const QPoint&) 75void KListView::Tooltip::maybeTip (const QPoint&)
76{ 76{
77 // FIXME 77 // FIXME
78} 78}
79// */ 79// */
80 80
81class KListView::KListViewPrivate 81class KListView::KListViewPrivate
82{ 82{
83public: 83public:
84 KListViewPrivate (KListView* listview) 84 KListViewPrivate (KListView* listview)
85 : pCurrentItem (0L), 85 : pCurrentItem (0L),
86 autoSelectDelay(1), 86 autoSelectDelay(1),
87//US dragDelay (KGlobalSettings::dndEventDelay()), 87//US dragDelay (KGlobalSettings::dndEventDelay()),
88 88
89 dragDelay (10), 89 dragDelay (10),
90//US editor (new KListViewLineEdit (listview)), 90//US editor (new KListViewLineEdit (listview)),
91 cursorInExecuteArea(false), 91 cursorInExecuteArea(false),
92 bUseSingle(false), 92 bUseSingle(false),
93 bChangeCursorOverItem(false), 93 bChangeCursorOverItem(false),
94 itemsMovable (true), 94 itemsMovable (true),
95 selectedBySimpleMove(false), 95 selectedBySimpleMove(false),
96 selectedUsingMouse(false), 96 selectedUsingMouse(false),
97 showContextMenusOnPress(true),
98 itemsRenameable (false), 97 itemsRenameable (false),
99 validDrag (false), 98 validDrag (false),
100 dragEnabled (false), 99 dragEnabled (false),
101 autoOpen (true), 100 autoOpen (true),
102 dropVisualizer (true), 101 dropVisualizer (true),
103 dropHighlighter (false), 102 dropHighlighter (false),
104 createChildren (true), 103 createChildren (true),
105 pressedOnSelected (false), 104 pressedOnSelected (false),
106 wasShiftEvent (false), 105 wasShiftEvent (false),
107 fullWidth (false), 106 fullWidth (false),
108 sortAscending(true), 107 sortAscending(true),
109 tabRename(true), 108 tabRename(true),
110 sortColumn(0), 109 sortColumn(0),
111 selectionDirection(0), 110 selectionDirection(0),
112 tooltipColumn (0), 111 tooltipColumn (0),
113 selectionMode (Single), 112 selectionMode (Single),
114//US contextMenuKey (KGlobalSettings::contextMenuKey()), 113 contextMenuKey ( Qt::Key_Menu ),//KGlobalSettings::contextMenuKey()),
115//US showContextMenusOnPress (KGlobalSettings::showContextMenusOnPress()), 114 showContextMenusOnPress (true),//showContextMenusOnPress (KGlobalSettings::showContextMenusOnPress()),
116 mDropVisualizerWidth (4) 115 mDropVisualizerWidth (4)
117 { 116 {
118 renameable += 0; 117 renameable += 0;
119//US connect(editor, SIGNAL(done(QListViewItem*,int)), listview, SLOT(doneEditing(QListViewItem*,int))); 118//US connect(editor, SIGNAL(done(QListViewItem*,int)), listview, SLOT(doneEditing(QListViewItem*,int)));
120 } 119 }
121 120
122 ~KListViewPrivate () 121 ~KListViewPrivate ()
123 { 122 {
124//US delete editor; 123//US delete editor;
125 } 124 }
126 125
127 QListViewItem* pCurrentItem; 126 QListViewItem* pCurrentItem;
128 127
129 QTimer autoSelect; 128 QTimer autoSelect;
130 int autoSelectDelay; 129 int autoSelectDelay;
131 130
132 QTimer dragExpand; 131 QTimer dragExpand;
133 QListViewItem* dragOverItem; 132 QListViewItem* dragOverItem;
134 QPoint dragOverPoint; 133 QPoint dragOverPoint;
135 134
136 QPoint startDragPos; 135 QPoint startDragPos;
137 int dragDelay; 136 int dragDelay;
138 137
139//US KListViewLineEdit *editor; 138//US KListViewLineEdit *editor;
140 QValueList<int> renameable; 139 QValueList<int> renameable;
141 140
142 bool cursorInExecuteArea:1; 141 bool cursorInExecuteArea:1;
143 bool bUseSingle:1; 142 bool bUseSingle:1;
144 bool bChangeCursorOverItem:1; 143 bool bChangeCursorOverItem:1;
145 bool itemsMovable:1; 144 bool itemsMovable:1;
146 bool selectedBySimpleMove : 1; 145 bool selectedBySimpleMove : 1;
147 bool selectedUsingMouse:1; 146 bool selectedUsingMouse:1;
148 bool itemsRenameable:1; 147 bool itemsRenameable:1;
149 bool validDrag:1; 148 bool validDrag:1;
150 bool dragEnabled:1; 149 bool dragEnabled:1;
151 bool autoOpen:1; 150 bool autoOpen:1;
152 bool dropVisualizer:1; 151 bool dropVisualizer:1;
153 bool dropHighlighter:1; 152 bool dropHighlighter:1;
154 bool createChildren:1; 153 bool createChildren:1;
155 bool pressedOnSelected:1; 154 bool pressedOnSelected:1;
156 bool wasShiftEvent:1; 155 bool wasShiftEvent:1;
157 bool fullWidth:1; 156 bool fullWidth:1;
158 bool sortAscending:1; 157 bool sortAscending:1;
159 bool tabRename:1; 158 bool tabRename:1;
160 159
161 int sortColumn; 160 int sortColumn;
162 161
163 //+1 means downwards (y increases, -1 means upwards, 0 means not selected), aleXXX 162 //+1 means downwards (y increases, -1 means upwards, 0 means not selected), aleXXX
164 int selectionDirection; 163 int selectionDirection;
165 int tooltipColumn; 164 int tooltipColumn;
166 165
167 SelectionModeExt selectionMode; 166 SelectionModeExt selectionMode;
168 int contextMenuKey; 167 int contextMenuKey;
169 bool showContextMenusOnPress; 168 bool showContextMenusOnPress;
170 169
171 QRect mOldDropVisualizer; 170 QRect mOldDropVisualizer;
172 int mDropVisualizerWidth; 171 int mDropVisualizerWidth;
173 QRect mOldDropHighlighter; 172 QRect mOldDropHighlighter;
174 QListViewItem *afterItemDrop; 173 QListViewItem *afterItemDrop;
175 QListViewItem *parentItemDrop; 174 QListViewItem *parentItemDrop;
176 175
177 QColor alternateBackground; 176 QColor alternateBackground;
178}; 177};
179 178
diff --git a/pwmanager/pwmanager/main.cpp b/pwmanager/pwmanager/main.cpp
index 3f2d055..81e257f 100644
--- a/pwmanager/pwmanager/main.cpp
+++ b/pwmanager/pwmanager/main.cpp
@@ -143,71 +143,71 @@ int main(int argc, char *argv[])
143 "http://passwordmanager.sourceforge.net/", 143 "http://passwordmanager.sourceforge.net/",
144 "mbuesch@freenet.de"); 144 "mbuesch@freenet.de");
145 addAuthors(&aboutData); 145 addAuthors(&aboutData);
146 146
147 KCmdLineArgs::init(argc, argv, &aboutData); 147 KCmdLineArgs::init(argc, argv, &aboutData);
148 KCmdLineArgs::addCmdLineOptions(options); 148 KCmdLineArgs::addCmdLineOptions(options);
149 149
150 KUniqueApplication::addCmdLineOptions(); 150 KUniqueApplication::addCmdLineOptions();
151 if (!KUniqueApplication::start()) { 151 if (!KUniqueApplication::start()) {
152 printInfo("already running."); 152 printInfo("already running.");
153 return EXIT_SUCCESS; 153 return EXIT_SUCCESS;
154 } 154 }
155 PwMApplication a; 155 PwMApplication a;
156 aboutData.setLicenseTextFile(LICENSE_FILE); 156 aboutData.setLicenseTextFile(LICENSE_FILE);
157 return a.exec(); 157 return a.exec();
158#else 158#else
159 159
160 bool exitHelp = false; 160 bool exitHelp = false;
161 if ( argc > 1 ) { 161 if ( argc > 1 ) {
162 QString command = argv[1]; 162 QString command = argv[1];
163 if ( command == "-help" ){ 163 if ( command == "-help" ){
164 printf("PWM/PI command line commands:\n"); 164 printf("PWM/PI command line commands:\n");
165 printf(" no command: Start PWM/PI in usual way\n"); 165 printf(" no command: Start PWM/PI in usual way\n");
166 printf(" -help: This output\n"); 166 printf(" -help: This output\n");
167 printf(" PWM/PI is exiting now. Bye!\n"); 167 printf(" PWM/PI is exiting now. Bye!\n");
168 exitHelp = true; 168 exitHelp = true;
169 } 169 }
170 } 170 }
171 if ( ! exitHelp ) { 171 if ( ! exitHelp ) {
172 172
173 PwMApplication a(argc, argv); 173 PwMApplication a(argc, argv);
174 174
175 KGlobal::setAppName( "pwmanager" ); 175 KGlobal::setAppName( "pwmanager" );
176#ifndef DESKTOP_VERSION 176#ifndef DESKTOP_VERSION
177 //qDebug("width %d ",QApplication::desktop()->width() ); 177 //qDebug("width %d ",QApplication::desktop()->width() );
178 if ( QApplication::desktop()->width() > 320 ) 178 if ( QApplication::desktop()->width() > 320 )
179 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/pwmanager/icons22/"); 179 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/pwmanager/icons22/");
180 else 180 else
181 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/pwmanager/icons16/"); 181 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/pwmanager/icons16/");
182#else 182#else
183 QString fileName ; 183 QString fileName ;
184 fileName = qApp->applicationDirPath () + "/kdepim/pwmanager/icons22/"; 184 fileName = qApp->applicationDirPath () + "/kdepim/pwmanager/icons22/";
185 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); 185 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName));
186 QApplication::addLibraryPath ( qApp->applicationDirPath () ); 186 QApplication::addLibraryPath ( qApp->applicationDirPath () );
187 187
188#endif 188#endif
189 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "pwmanager"))); 189 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "pwmanager")));
190 KPimGlobalPrefs::instance()->setGlobalConfig(); 190 KPimGlobalPrefs::instance()->setGlobalConfig();
191 191
192 a.newInstance(); 192 a.newInstance();
193 193
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 a.exec(); 206 a.exec();
207 207 KPimGlobalPrefs::instance()->writeConfig();
208 } 208 }
209 qDebug("PWMPI: Bye! "); 209 qDebug("PWMPI: Bye! ");
210 210
211#endif 211#endif
212 212
213} 213}
diff --git a/pwmanager/pwmanager/pwm.cpp b/pwmanager/pwmanager/pwm.cpp
index b7b5307..d92c90d 100644
--- a/pwmanager/pwmanager/pwm.cpp
+++ b/pwmanager/pwmanager/pwm.cpp
@@ -111,155 +111,157 @@ enum {
111enum { 111enum {
112 BUTTON_POPUP_VIEW_FIND = 0, 112 BUTTON_POPUP_VIEW_FIND = 0,
113 BUTTON_POPUP_VIEW_LOCK, 113 BUTTON_POPUP_VIEW_LOCK,
114 BUTTON_POPUP_VIEW_DEEPLOCK, 114 BUTTON_POPUP_VIEW_DEEPLOCK,
115 BUTTON_POPUP_VIEW_UNLOCK 115 BUTTON_POPUP_VIEW_UNLOCK
116}; 116};
117// Button IDs for "options" popup menu 117// Button IDs for "options" popup menu
118enum { 118enum {
119 BUTTON_POPUP_OPTIONS_CONFIG = 0 119 BUTTON_POPUP_OPTIONS_CONFIG = 0
120}; 120};
121// Button IDs for "export" popup menu (in "file" popup menu) 121// Button IDs for "export" popup menu (in "file" popup menu)
122enum { 122enum {
123 BUTTON_POPUP_EXPORT_TEXT = 0, 123 BUTTON_POPUP_EXPORT_TEXT = 0,
124 BUTTON_POPUP_EXPORT_GPASMAN, 124 BUTTON_POPUP_EXPORT_GPASMAN,
125 BUTTON_POPUP_EXPORT_CSV 125 BUTTON_POPUP_EXPORT_CSV
126#ifdef CONFIG_KWALLETIF 126#ifdef CONFIG_KWALLETIF
127 ,BUTTON_POPUP_EXPORT_KWALLET 127 ,BUTTON_POPUP_EXPORT_KWALLET
128#endif 128#endif
129}; 129};
130// Button IDs for "import" popup menu (in "file" popup menu) 130// Button IDs for "import" popup menu (in "file" popup menu)
131enum { 131enum {
132 BUTTON_POPUP_IMPORT_TEXT = 0, 132 BUTTON_POPUP_IMPORT_TEXT = 0,
133 BUTTON_POPUP_IMPORT_GPASMAN, 133 BUTTON_POPUP_IMPORT_GPASMAN,
134 BUTTON_POPUP_IMPORT_CSV 134 BUTTON_POPUP_IMPORT_CSV
135#ifdef CONFIG_KWALLETIF 135#ifdef CONFIG_KWALLETIF
136 ,BUTTON_POPUP_IMPORT_KWALLET 136 ,BUTTON_POPUP_IMPORT_KWALLET
137#endif 137#endif
138}; 138};
139 139
140#ifdef PWM_EMBEDDED 140#ifdef PWM_EMBEDDED
141// Button IDs for "help" popup menu 141// Button IDs for "help" popup menu
142enum { 142enum {
143 BUTTON_POPUP_HELP_LICENSE = 0, 143 BUTTON_POPUP_HELP_LICENSE = 0,
144 BUTTON_POPUP_HELP_FAQ, 144 BUTTON_POPUP_HELP_FAQ,
145 BUTTON_POPUP_HELP_ABOUT, 145 BUTTON_POPUP_HELP_ABOUT,
146 BUTTON_POPUP_HELP_SYNC, 146 BUTTON_POPUP_HELP_SYNC,
147 BUTTON_POPUP_HELP_WHATSNEW 147 BUTTON_POPUP_HELP_WHATSNEW
148}; 148};
149#endif 149#endif
150 150
151// Button IDs for toolbar 151// Button IDs for toolbar
152enum { 152enum {
153 BUTTON_TOOL_NEW = 0, 153 BUTTON_TOOL_NEW = 0,
154 BUTTON_TOOL_OPEN, 154 BUTTON_TOOL_OPEN,
155 BUTTON_TOOL_SAVE, 155 BUTTON_TOOL_SAVE,
156 BUTTON_TOOL_SAVEAS, 156 BUTTON_TOOL_SAVEAS,
157 BUTTON_TOOL_PRINT, 157 BUTTON_TOOL_PRINT,
158 BUTTON_TOOL_ADD, 158 BUTTON_TOOL_ADD,
159 BUTTON_TOOL_EDIT, 159 BUTTON_TOOL_EDIT,
160 BUTTON_TOOL_DEL, 160 BUTTON_TOOL_DEL,
161 BUTTON_TOOL_FIND, 161 BUTTON_TOOL_FIND,
162 BUTTON_TOOL_LOCK, 162 BUTTON_TOOL_LOCK,
163 BUTTON_TOOL_DEEPLOCK, 163 BUTTON_TOOL_DEEPLOCK,
164 BUTTON_TOOL_UNLOCK 164 BUTTON_TOOL_UNLOCK
165}; 165};
166 166
167 167
168PwM::PwM(PwMInit *_init, PwMDoc *doc, 168PwM::PwM(PwMInit *_init, PwMDoc *doc,
169 bool virginity, 169 bool virginity,
170 QWidget *parent, const char *name) 170 QWidget *parent, const char *name)
171 : KMainWindow(parent, "HALLO") 171 : KMainWindow(parent, "HALLO")
172 , forceQuit (false) 172 , forceQuit (false)
173 , forceMinimizeToTray (false) 173 , forceMinimizeToTray (false)
174{ 174{
175 syncManager = 0;
175 virgin = !virginity; 176 virgin = !virginity;
176 init = _init; 177 init = _init;
177 connect(doc, SIGNAL(docClosed(PwMDoc *)), 178 connect(doc, SIGNAL(docClosed(PwMDoc *)),
178 this, SLOT(docClosed(PwMDoc *))); 179 this, SLOT(docClosed(PwMDoc *)));
179 initMenubar(); 180 initMenubar();
180 initToolbar(); 181 initToolbar();
181 initMetrics(); 182 initMetrics();
182 setVirgin(virginity); 183 setVirgin(virginity);
183 setFocusPolicy(QWidget::WheelFocus); 184 setFocusPolicy(QWidget::WheelFocus);
184#ifndef PWM_EMBEDDED 185#ifndef PWM_EMBEDDED
185 statusBar()->show(); 186 statusBar()->show();
186#endif 187#endif
187 view = makeNewListView(doc); 188 view = makeNewListView(doc);
188 setCentralWidget(view); 189 setCentralWidget(view);
189 updateCaption(); 190 updateCaption();
190 showStatMsg(i18n("Ready.")); 191 showStatMsg(i18n("Ready."));
191} 192}
192 193
193PwM::~PwM() 194PwM::~PwM()
194{ 195{
195 //qDebug("PwM::~PwM()"); 196 //qDebug("PwM::~PwM()");
196 disconnect(curDoc(), SIGNAL(docClosed(PwMDoc *)), 197 disconnect(curDoc(), SIGNAL(docClosed(PwMDoc *)),
197 this, SLOT(docClosed(PwMDoc *))); 198 this, SLOT(docClosed(PwMDoc *)));
198 conf()->confWndMainWndSize(size()); 199 conf()->confWndMainWndSize(size());
199 emit closed(this); 200 emit closed(this);
200 //qDebug("PwM::~PwM() emited closed(this)"); 201 //qDebug("PwM::~PwM() emited closed(this)");
201 delete view; 202 delete view;
203 delete syncManager;
202} 204}
203 205
204void PwM::initMenubar() 206void PwM::initMenubar()
205{ 207{
206 KIconLoader* picons; 208 KIconLoader* picons;
207#ifndef PWM_EMBEDDED 209#ifndef PWM_EMBEDDED
208 KIconLoader icons; 210 KIconLoader icons;
209 picons = &icons; 211 picons = &icons;
210#else 212#else
211 picons = KGlobal::iconLoader(); 213 picons = KGlobal::iconLoader();
212 214
213 215
214 syncPopup = new KPopupMenu(this); 216 syncPopup = new KPopupMenu(this);
215 217
216 syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::PWMPI, PWMPrefs::instance(), syncPopup); 218 syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::PWMPI, PWMPrefs::instance(), syncPopup);
217 syncManager->setBlockSave(false); 219 syncManager->setBlockSave(false);
218 220
219 connect ( syncPopup, SIGNAL( activated ( int ) ), syncManager, SLOT (slotSyncMenu( int ) ) ); 221 connect ( syncPopup, SIGNAL( activated ( int ) ), syncManager, SLOT (slotSyncMenu( int ) ) );
220 syncManager->fillSyncMenu(); 222 syncManager->fillSyncMenu();
221 223
222#endif 224#endif
223 filePopup = new KPopupMenu(this); 225 filePopup = new KPopupMenu(this);
224 importPopup = new KPopupMenu(filePopup); 226 importPopup = new KPopupMenu(filePopup);
225 exportPopup = new KPopupMenu(filePopup); 227 exportPopup = new KPopupMenu(filePopup);
226 managePopup = new KPopupMenu(this); 228 managePopup = new KPopupMenu(this);
227#ifdef CONFIG_KEYCARD 229#ifdef CONFIG_KEYCARD
228 chipcardPopup = new KPopupMenu(this); 230 chipcardPopup = new KPopupMenu(this);
229#endif // CONFIG_KEYCARD 231#endif // CONFIG_KEYCARD
230 viewPopup = new KPopupMenu(this); 232 viewPopup = new KPopupMenu(this);
231 optionsPopup = new KPopupMenu(this); 233 optionsPopup = new KPopupMenu(this);
232 234
233// "file" popup menu 235// "file" popup menu
234 filePopup->insertItem(QIconSet(picons->loadIcon("filenew", KIcon::Small)), 236 filePopup->insertItem(QIconSet(picons->loadIcon("filenew", KIcon::Small)),
235 i18n("&New"), this, 237 i18n("&New"), this,
236 SLOT(new_slot()), 0, BUTTON_POPUP_FILE_NEW); 238 SLOT(new_slot()), 0, BUTTON_POPUP_FILE_NEW);
237 filePopup->insertItem(QIconSet(picons->loadIcon("fileopen", KIcon::Small)), 239 filePopup->insertItem(QIconSet(picons->loadIcon("fileopen", KIcon::Small)),
238 i18n("&Open"), this, 240 i18n("&Open"), this,
239 SLOT(open_slot()), 0, BUTTON_POPUP_FILE_OPEN); 241 SLOT(open_slot()), 0, BUTTON_POPUP_FILE_OPEN);
240 filePopup->insertItem(QIconSet(picons->loadIcon("fileclose", KIcon::Small)), 242 filePopup->insertItem(QIconSet(picons->loadIcon("fileclose", KIcon::Small)),
241 i18n("&Close"), this, 243 i18n("&Close"), this,
242 SLOT(close_slot()), 0, BUTTON_POPUP_FILE_CLOSE); 244 SLOT(close_slot()), 0, BUTTON_POPUP_FILE_CLOSE);
243 filePopup->insertSeparator(); 245 filePopup->insertSeparator();
244 filePopup->insertItem(QIconSet(picons->loadIcon("filesave", KIcon::Small)), 246 filePopup->insertItem(QIconSet(picons->loadIcon("filesave", KIcon::Small)),
245 i18n("&Save"), this, 247 i18n("&Save"), this,
246 SLOT(save_slot()), 0, BUTTON_POPUP_FILE_SAVE); 248 SLOT(save_slot()), 0, BUTTON_POPUP_FILE_SAVE);
247 filePopup->insertItem(QIconSet(picons->loadIcon("filesaveas", KIcon::Small)), 249 filePopup->insertItem(QIconSet(picons->loadIcon("filesaveas", KIcon::Small)),
248 i18n("Save &as..."), 250 i18n("Save &as..."),
249 this, SLOT(saveAs_slot()), 0, 251 this, SLOT(saveAs_slot()), 0,
250 BUTTON_POPUP_FILE_SAVEAS); 252 BUTTON_POPUP_FILE_SAVEAS);
251 filePopup->insertSeparator(); 253 filePopup->insertSeparator();
252 // "file/export" popup menu 254 // "file/export" popup menu
253 exportPopup->insertItem(i18n("&Text-file..."), this, 255 exportPopup->insertItem(i18n("&Text-file..."), this,
254 SLOT(exportToText()), 0, BUTTON_POPUP_EXPORT_TEXT); 256 SLOT(exportToText()), 0, BUTTON_POPUP_EXPORT_TEXT);
255 exportPopup->insertItem(i18n("&Gpasman / Kpasman ..."), this, 257 exportPopup->insertItem(i18n("&Gpasman / Kpasman ..."), this,
256 SLOT(exportToGpasman()), 0, BUTTON_POPUP_EXPORT_GPASMAN); 258 SLOT(exportToGpasman()), 0, BUTTON_POPUP_EXPORT_GPASMAN);
257 exportPopup->insertItem(i18n("&CSV (Comma Separated Value) ..."), this, 259 exportPopup->insertItem(i18n("&CSV (Comma Separated Value) ..."), this,
258 SLOT(exportToCsv()), 0, BUTTON_POPUP_EXPORT_CSV); 260 SLOT(exportToCsv()), 0, BUTTON_POPUP_EXPORT_CSV);
259#ifdef CONFIG_KWALLETIF 261#ifdef CONFIG_KWALLETIF
260 exportPopup->insertItem(i18n("&KWallet..."), this, 262 exportPopup->insertItem(i18n("&KWallet..."), this,
261 SLOT(exportToKWallet()), 0, BUTTON_POPUP_EXPORT_KWALLET); 263 SLOT(exportToKWallet()), 0, BUTTON_POPUP_EXPORT_KWALLET);
262#endif 264#endif
263 filePopup->insertItem(QIconSet(picons->loadIcon("fileexport", KIcon::Small)), 265 filePopup->insertItem(QIconSet(picons->loadIcon("fileexport", KIcon::Small)),
264 i18n("E&xport"), exportPopup, 266 i18n("E&xport"), exportPopup,
265 BUTTON_POPUP_FILE_EXPORT); 267 BUTTON_POPUP_FILE_EXPORT);