summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/resource.cpp4
-rw-r--r--korganizer/calendarview.cpp4
-rw-r--r--korganizer/calendarview.h1
-rw-r--r--korganizer/koprefs.h3
-rw-r--r--korganizer/mainwindow.cpp16
-rw-r--r--korganizer/mainwindow.h1
-rw-r--r--libkdepim/ksyncprofile.cpp15
-rw-r--r--libkdepim/ksyncprofile.h5
8 files changed, 32 insertions, 17 deletions
diff --git a/kabc/resource.cpp b/kabc/resource.cpp
index d39fd6a..7b91239 100644
--- a/kabc/resource.cpp
+++ b/kabc/resource.cpp
@@ -32,18 +32,18 @@ $Id$
32#include "resource.h" 32#include "resource.h"
33 33
34using namespace KABC; 34using namespace KABC;
35 35
36Resource::Resource( const KConfig *config, bool syncable ) 36Resource::Resource( const KConfig *config, bool syncable )
37 : KRES::Resource( config ), mAddressBook( 0 ), mSyncProfile( 0 ) 37 : KRES::Resource( config ), mAddressBook( 0 ), mSyncProfile( 0 )
38{ 38{
39 if(syncable == true) { 39 if(syncable == true) {
40 mSyncProfile = new KSyncProfile( identifier() ); 40 mSyncProfile = new KSyncProfile( );
41 mSyncProfile->setName(resourceName()); 41 mSyncProfile->setName("pending" /*resourceName()*/);
42 mSyncProfile->readConfig( (KConfig *)config ); 42 mSyncProfile->readConfig( (KConfig *)config );
43 } 43 }
44} 44}
45 45
46Resource::~Resource() 46Resource::~Resource()
47{ 47{
48 if (mSyncProfile != 0) { 48 if (mSyncProfile != 0) {
49 delete mSyncProfile; 49 delete mSyncProfile;
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index f859b90..689618d 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -1168,16 +1168,20 @@ bool CalendarView::syncCalendar(QString filename, int mode)
1168 setModified( true ); 1168 setModified( true );
1169 } 1169 }
1170 delete storage; 1170 delete storage;
1171 delete calendar; 1171 delete calendar;
1172 if ( syncOK ) 1172 if ( syncOK )
1173 updateView(); 1173 updateView();
1174 return syncOK; 1174 return syncOK;
1175} 1175}
1176void CalendarView::syncPhone()
1177{
1178 qDebug("CalendarView::syncPhone() ");
1179}
1176void CalendarView::syncSharp() 1180void CalendarView::syncSharp()
1177{ 1181{
1178#ifndef DESKTOP_VERSION 1182#ifndef DESKTOP_VERSION
1179 mGlobalSyncMode = SYNC_MODE_EXTERNAL; 1183 mGlobalSyncMode = SYNC_MODE_EXTERNAL;
1180 //mCurrentSyncDevice = "sharp-DTM"; 1184 //mCurrentSyncDevice = "sharp-DTM";
1181 if ( KOPrefs::instance()->mAskForPreferences ) 1185 if ( KOPrefs::instance()->mAskForPreferences )
1182 edit_sync_options(); 1186 edit_sync_options();
1183 qApp->processEvents(); 1187 qApp->processEvents();
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index d564473..b2838db 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -420,16 +420,17 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
420 bool removeCompletedSubTodos( Todo* ); 420 bool removeCompletedSubTodos( Todo* );
421 void slotCalendarChanged(); 421 void slotCalendarChanged();
422 bool importBday(); 422 bool importBday();
423 bool addAnniversary( QDate data, QString name, KCal::Attendee* a , bool birthday ); 423 bool addAnniversary( QDate data, QString name, KCal::Attendee* a , bool birthday );
424 bool importQtopia( const QString &categoriesFile, 424 bool importQtopia( const QString &categoriesFile,
425 const QString &datebookFile, 425 const QString &datebookFile,
426 const QString &tasklistFile ); 426 const QString &tasklistFile );
427 void syncSharp( ); 427 void syncSharp( );
428 void syncPhone( );
428 void slotSelectPickerDate( QDate ) ; 429 void slotSelectPickerDate( QDate ) ;
429 void showDatePicker( ) ; 430 void showDatePicker( ) ;
430 void moveIncidence(Incidence *) ; 431 void moveIncidence(Incidence *) ;
431 void beamIncidence(Incidence *) ; 432 void beamIncidence(Incidence *) ;
432 void beamCalendar() ; 433 void beamCalendar() ;
433 void beamFilteredCalendar() ; 434 void beamFilteredCalendar() ;
434 void beamIncidenceList(QPtrList<Incidence>) ; 435 void beamIncidenceList(QPtrList<Incidence>) ;
435 void manageCategories(); 436 void manageCategories();
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h
index 424fa98..446fe2e 100644
--- a/korganizer/koprefs.h
+++ b/korganizer/koprefs.h
@@ -205,16 +205,19 @@ class KOPrefs : public KPimPrefs
205 bool mShowTodoInAgenda; 205 bool mShowTodoInAgenda;
206 bool mWriteBackExistingOnly; 206 bool mWriteBackExistingOnly;
207 207
208 QString mRemoteIP; 208 QString mRemoteIP;
209 QString mRemoteUser; 209 QString mRemoteUser;
210 QString mRemotePassWd; 210 QString mRemotePassWd;
211 QString mRemoteFile; 211 QString mRemoteFile;
212 QString mLocalTempFile; 212 QString mLocalTempFile;
213 QString mPhoneDevice;
214 QString mPhoneConnection;
215 QString mPhoneModel;
213 216
214 int mLastSyncTime; 217 int mLastSyncTime;
215 int mSyncAlgoPrefs; 218 int mSyncAlgoPrefs;
216 int mRingSyncAlgoPrefs; 219 int mRingSyncAlgoPrefs;
217 QStringList mSyncProfileNames; 220 QStringList mSyncProfileNames;
218 QStringList mExternSyncProfiles; 221 QStringList mExternSyncProfiles;
219 QString mLocalMachineName; 222 QString mLocalMachineName;
220 void setCategoryColor(QString cat,const QColor & color); 223 void setCategoryColor(QString cat,const QColor & color);
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index c3c4c26..062c95f 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -892,17 +892,23 @@ int MainWindow::ringSync()
892 mView->setSyncName( KOPrefs::instance()->mLocalMachineName ); 892 mView->setSyncName( KOPrefs::instance()->mLocalMachineName );
893 if ( i == 0 ) { 893 if ( i == 0 ) {
894 syncSharp(); 894 syncSharp();
895 } else { 895 } else {
896 if ( temp->getIsLocalFileSync() ) { 896 if ( temp->getIsLocalFileSync() ) {
897 if ( syncWithFile( temp->getRemoteFileName( ), true ) ) 897 if ( syncWithFile( temp->getRemoteFileName( ), true ) )
898 KOPrefs::instance()->mLastSyncedLocalFile = temp->getRemoteFileName(); 898 KOPrefs::instance()->mLastSyncedLocalFile = temp->getRemoteFileName();
899 } else { 899 } else {
900 syncRemote( temp, false ); 900 if ( temp->getIsPhoneSync() ) {
901 KOPrefs::instance()->mPhoneDevice = temp->getPhoneDevice( ) ;
902 KOPrefs::instance()->mPhoneConnection = temp->getPhoneConnection( );
903 KOPrefs::instance()->mPhoneModel = temp->getPhoneModel( );
904 syncPhone();
905 } else
906 syncRemote( temp, false );
901 907
902 } 908 }
903 } 909 }
904 timer.start(); 910 timer.start();
905 setCaption(i18n("Multiple sync in progress ... please wait!") ); 911 setCaption(i18n("Multiple sync in progress ... please wait!") );
906 while ( timer.elapsed () < 2000 ) { 912 while ( timer.elapsed () < 2000 ) {
907 qApp->processEvents(); 913 qApp->processEvents();
908#ifndef _WIN32_ 914#ifndef _WIN32_
@@ -2032,16 +2038,24 @@ void MainWindow::syncSSH()
2032void MainWindow::syncSharp() 2038void MainWindow::syncSharp()
2033{ 2039{
2034 if ( mCalendarModifiedFlag ) 2040 if ( mCalendarModifiedFlag )
2035 save(); 2041 save();
2036 mView->syncSharp(); 2042 mView->syncSharp();
2037 slotModifiedChanged( true ); 2043 slotModifiedChanged( true );
2038 2044
2039} 2045}
2046void MainWindow::syncPhone()
2047{
2048 if ( mCalendarModifiedFlag )
2049 save();
2050 mView->syncPhone();
2051 slotModifiedChanged( true );
2052
2053}
2040 2054
2041void MainWindow::printSel( ) 2055void MainWindow::printSel( )
2042{ 2056{
2043 mView->viewManager()->agendaView()->agenda()->printSelection(); 2057 mView->viewManager()->agendaView()->agenda()->printSelection();
2044} 2058}
2045 2059
2046void MainWindow::printCal() 2060void MainWindow::printCal()
2047{ 2061{
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h
index fba8c52..1d87db0 100644
--- a/korganizer/mainwindow.h
+++ b/korganizer/mainwindow.h
@@ -70,16 +70,17 @@ class MainWindow : public QMainWindow
70 void exportVCalendar(); 70 void exportVCalendar();
71 void fillFilterMenu(); 71 void fillFilterMenu();
72 void selectFilter( int ); 72 void selectFilter( int );
73 73
74 void slotSyncMenu( int ); 74 void slotSyncMenu( int );
75 void syncSSH(); 75 void syncSSH();
76 void confSync(); 76 void confSync();
77 void syncSharp(); 77 void syncSharp();
78 void syncPhone();
78 void syncLocalFile(); 79 void syncLocalFile();
79 bool syncWithFile( QString, bool ); 80 bool syncWithFile( QString, bool );
80 void quickSyncLocalFile(); 81 void quickSyncLocalFile();
81 82
82 83
83 protected: 84 protected:
84 void displayText( QString, QString); 85 void displayText( QString, QString);
85 void displayFile( QString, QString); 86 void displayFile( QString, QString);
diff --git a/libkdepim/ksyncprofile.cpp b/libkdepim/ksyncprofile.cpp
index 15dc152..e7c35fb 100644
--- a/libkdepim/ksyncprofile.cpp
+++ b/libkdepim/ksyncprofile.cpp
@@ -25,23 +25,18 @@
25#include <kconfig.h> 25#include <kconfig.h>
26#include <kstandarddirs.h> 26#include <kstandarddirs.h>
27#include <kglobal.h> 27#include <kglobal.h>
28#include <kdebug.h> 28#include <kdebug.h>
29 29
30#include "ksyncprofile.h" 30#include "ksyncprofile.h"
31 31
32 32
33KSyncProfile::KSyncProfile( const char * identifier): QObject (0, identifier ) 33KSyncProfile::KSyncProfile(): QObject ()
34{ 34{
35 setIdentifier( identifier );
36
37 if (getIdentifier().isEmpty())
38 setIdentifier( "noID" );
39
40 setDefault(); 35 setDefault();
41} 36}
42KSyncProfile::~KSyncProfile() 37KSyncProfile::~KSyncProfile()
43{ 38{
44 39
45} 40}
46 41
47 42
@@ -63,17 +58,17 @@ KSyncProfile* KSyncProfile::clone()
63 myClone->setWriteBackFuture( mWriteBackFuture ); 58 myClone->setWriteBackFuture( mWriteBackFuture );
64 myClone->setWriteBackFutureWeeks( mWriteBackFutureWeeks ); 59 myClone->setWriteBackFutureWeeks( mWriteBackFutureWeeks );
65 myClone->setIncludeInRingSync( mIncludeInRingSync ); 60 myClone->setIncludeInRingSync( mIncludeInRingSync );
66 myClone->setIncludeInRingSyncAB( mIncludeInRingSyncAB ); 61 myClone->setIncludeInRingSyncAB( mIncludeInRingSyncAB );
67 myClone->setSyncPrefs( mSyncPrefs); 62 myClone->setSyncPrefs( mSyncPrefs);
68 myClone->setIsLocalFileSync( mIsLocalFileSync ); 63 myClone->setIsLocalFileSync( mIsLocalFileSync );
69 myClone->setIsPhoneSync( mIsPhoneSync ); 64 myClone->setIsPhoneSync( mIsPhoneSync );
70 myClone->setName( "noName" ); 65 myClone->setName( "noName" );
71 myClone->setIdentifier( "noID" ); 66 //myClone->setIdentifier( "noID" );
72 return myClone; 67 return myClone;
73} 68}
74 69
75 70
76void KSyncProfile::setDefault() 71void KSyncProfile::setDefault()
77{ 72{
78 mPreSyncCommand = i18n("command for downloading remote file to local device"); 73 mPreSyncCommand = i18n("command for downloading remote file to local device");
79 mPostSyncCommand = i18n("command for uploading local temp file to remote device"); 74 mPostSyncCommand = i18n("command for uploading local temp file to remote device");
@@ -99,17 +94,17 @@ void KSyncProfile::setDefault()
99 mPhoneConnection = "irda"; 94 mPhoneConnection = "irda";
100 mPhoneModel = "6310i"; 95 mPhoneModel = "6310i";
101} 96}
102void KSyncProfile::readConfig(KConfig *config ) 97void KSyncProfile::readConfig(KConfig *config )
103{ 98{
104 if (config) 99 if (config)
105 { 100 {
106 101
107 config->setGroup("SyncProfile_" + mIdentifier); 102 config->setGroup( mName );
108 103
109 mName = config->readEntry( "Name", mName ); 104 mName = config->readEntry( "Name", mName );
110 mPreSyncCommand = config->readEntry( "PreSyncCommand",mPreSyncCommand ); 105 mPreSyncCommand = config->readEntry( "PreSyncCommand",mPreSyncCommand );
111 mPostSyncCommand = config->readEntry( "PostSyncCommand", mPostSyncCommand ); 106 mPostSyncCommand = config->readEntry( "PostSyncCommand", mPostSyncCommand );
112 mLocalTempFile = config->readEntry( "LocalTempFile", mLocalTempFile ); 107 mLocalTempFile = config->readEntry( "LocalTempFile", mLocalTempFile );
113 mRemoteFileName = config->readEntry( "RemoteFileName", mRemoteFileName ); 108 mRemoteFileName = config->readEntry( "RemoteFileName", mRemoteFileName );
114 109
115 mPreSyncCommandAB = config->readEntry( "PreSyncCommandAB",mPreSyncCommandAB ); 110 mPreSyncCommandAB = config->readEntry( "PreSyncCommandAB",mPreSyncCommandAB );
@@ -135,22 +130,22 @@ void KSyncProfile::readConfig(KConfig *config )
135 else 130 else
136 { 131 {
137 setDefault(); 132 setDefault();
138 } 133 }
139} 134}
140 135
141void KSyncProfile::deleteConfig(KConfig *config ) 136void KSyncProfile::deleteConfig(KConfig *config )
142{ 137{
143 config->deleteGroup( "SyncProfile_" + mIdentifier ); 138 config->deleteGroup( mName );
144} 139}
145 140
146void KSyncProfile::writeConfig( KConfig * config ) 141void KSyncProfile::writeConfig( KConfig * config )
147{ 142{
148 config->setGroup("SyncProfile_" + mIdentifier); 143 config->setGroup(mName);
149 144
150 config->writeEntry( "Name", mName ); 145 config->writeEntry( "Name", mName );
151 config->writeEntry( "PreSyncCommand",mPreSyncCommand ); 146 config->writeEntry( "PreSyncCommand",mPreSyncCommand );
152 config->writeEntry( "PostSyncCommand", mPostSyncCommand ); 147 config->writeEntry( "PostSyncCommand", mPostSyncCommand );
153 config->writeEntry( "LocalTempFile", mLocalTempFile ); 148 config->writeEntry( "LocalTempFile", mLocalTempFile );
154 config->writeEntry( "RemoteFileName", mRemoteFileName ); 149 config->writeEntry( "RemoteFileName", mRemoteFileName );
155 150
156 config->writeEntry( "PreSyncCommandAB",mPreSyncCommandAB ); 151 config->writeEntry( "PreSyncCommandAB",mPreSyncCommandAB );
diff --git a/libkdepim/ksyncprofile.h b/libkdepim/ksyncprofile.h
index 8995def..a0cfb71 100644
--- a/libkdepim/ksyncprofile.h
+++ b/libkdepim/ksyncprofile.h
@@ -41,27 +41,25 @@ class KConfig;
41 This class represents one preferences setting as used by @ref KPrefs. 41 This class represents one preferences setting as used by @ref KPrefs.
42 Subclasses of KPrefsItem implement storage functions for a certain type of 42 Subclasses of KPrefsItem implement storage functions for a certain type of
43 setting. Normally you don't have to use this class directly. Use the special 43 setting. Normally you don't have to use this class directly. Use the special
44 addItem() functions of KPrefs instead. If you subclass this class you will 44 addItem() functions of KPrefs instead. If you subclass this class you will
45 have to register instances with the function KPrefs::addItem(). 45 have to register instances with the function KPrefs::addItem().
46*/ 46*/
47class KSyncProfile : public QObject { 47class KSyncProfile : public QObject {
48 public: 48 public:
49 KSyncProfile( const char * identifier = 0); 49 KSyncProfile();
50 ~KSyncProfile() ; 50 ~KSyncProfile() ;
51 51
52 KSyncProfile* clone(); 52 KSyncProfile* clone();
53 void setDefault(); 53 void setDefault();
54 void readConfig(KConfig *); 54 void readConfig(KConfig *);
55 void writeConfig(KConfig *); 55 void writeConfig(KConfig *);
56 void deleteConfig(KConfig *); 56 void deleteConfig(KConfig *);
57 57
58 void setIdentifier( const QString& i ) {mIdentifier = i;}
59 QString getIdentifier( ) { return mIdentifier;}
60 void setPreSyncCommand( const QString& n ) {mPreSyncCommand = n;} 58 void setPreSyncCommand( const QString& n ) {mPreSyncCommand = n;}
61 QString getPreSyncCommand( ) { return mPreSyncCommand; } 59 QString getPreSyncCommand( ) { return mPreSyncCommand; }
62 void setPostSyncCommand( const QString& n ) {mPostSyncCommand = n;} 60 void setPostSyncCommand( const QString& n ) {mPostSyncCommand = n;}
63 QString getPostSyncCommand( ) { return mPostSyncCommand;} 61 QString getPostSyncCommand( ) { return mPostSyncCommand;}
64 void setLocalTempFile( const QString& n ) { mLocalTempFile= n;} 62 void setLocalTempFile( const QString& n ) { mLocalTempFile= n;}
65 QString getLocalTempFile( ) { return mLocalTempFile;} 63 QString getLocalTempFile( ) { return mLocalTempFile;}
66 void setRemoteFileName( const QString& n ) { mRemoteFileName = n;} 64 void setRemoteFileName( const QString& n ) { mRemoteFileName = n;}
67 QString getRemoteFileName( ) { return mRemoteFileName;} 65 QString getRemoteFileName( ) { return mRemoteFileName;}
@@ -107,17 +105,16 @@ class KSyncProfile : public QObject {
107 void setWriteBackFutureWeeks( int n ) { mWriteBackFutureWeeks= n;} 105 void setWriteBackFutureWeeks( int n ) { mWriteBackFutureWeeks= n;}
108 int getWriteBackFutureWeeks( ) { return mWriteBackFutureWeeks;} 106 int getWriteBackFutureWeeks( ) { return mWriteBackFutureWeeks;}
109 void setIsLocalFileSync( bool b ) { mIsLocalFileSync= b;} 107 void setIsLocalFileSync( bool b ) { mIsLocalFileSync= b;}
110 bool getIsLocalFileSync( ) { return mIsLocalFileSync;} 108 bool getIsLocalFileSync( ) { return mIsLocalFileSync;}
111 void setIsPhoneSync( bool b ) { mIsPhoneSync= b;} 109 void setIsPhoneSync( bool b ) { mIsPhoneSync= b;}
112 bool getIsPhoneSync( ) { return mIsPhoneSync;} 110 bool getIsPhoneSync( ) { return mIsPhoneSync;}
113 private: 111 private:
114 QString mName; 112 QString mName;
115 QString mIdentifier;
116 QString mPreSyncCommand; 113 QString mPreSyncCommand;
117 QString mPostSyncCommand; 114 QString mPostSyncCommand;
118 QString mLocalTempFile; 115 QString mLocalTempFile;
119 QString mRemoteFileName; 116 QString mRemoteFileName;
120 QString mPreSyncCommandAB; 117 QString mPreSyncCommandAB;
121 QString mPostSyncCommandAB; 118 QString mPostSyncCommandAB;
122 QString mLocalTempFileAB; 119 QString mLocalTempFileAB;
123 QString mRemoteFileNameAB; 120 QString mRemoteFileNameAB;