summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-08-07 16:10:09 (UTC)
committer zautrix <zautrix>2004-08-07 16:10:09 (UTC)
commitef8a09ce74ad3f0a51484d03fdf009bd5b3677bf (patch) (unidiff)
tree7ff6c37e8ad6b7f1dbd672d28de6fcea916caf8f
parenta9a774e19c02f03de948b6064804b913abd4f08b (diff)
downloadkdepimpi-ef8a09ce74ad3f0a51484d03fdf009bd5b3677bf.zip
kdepimpi-ef8a09ce74ad3f0a51484d03fdf009bd5b3677bf.tar.gz
kdepimpi-ef8a09ce74ad3f0a51484d03fdf009bd5b3677bf.tar.bz2
Fix of the syncprofiles
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
@@ -37,8 +37,8 @@ Resource::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}
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index f859b90..689618d 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -1173,6 +1173,10 @@ bool CalendarView::syncCalendar(QString filename, int mode)
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
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index d564473..b2838db 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -425,6 +425,7 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
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 *) ;
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h
index 424fa98..446fe2e 100644
--- a/korganizer/koprefs.h
+++ b/korganizer/koprefs.h
@@ -210,6 +210,9 @@ class KOPrefs : public KPimPrefs
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;
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index c3c4c26..062c95f 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -897,7 +897,13 @@ int MainWindow::ringSync()
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 }
@@ -2037,6 +2043,14 @@ void MainWindow::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{
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h
index fba8c52..1d87db0 100644
--- a/korganizer/mainwindow.h
+++ b/korganizer/mainwindow.h
@@ -75,6 +75,7 @@ class MainWindow : public QMainWindow
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();
diff --git a/libkdepim/ksyncprofile.cpp b/libkdepim/ksyncprofile.cpp
index 15dc152..e7c35fb 100644
--- a/libkdepim/ksyncprofile.cpp
+++ b/libkdepim/ksyncprofile.cpp
@@ -30,13 +30,8 @@
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()
@@ -68,7 +63,7 @@ KSyncProfile* KSyncProfile::clone()
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
@@ -104,7 +99,7 @@ void KSyncProfile::readConfig(KConfig *config )
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 );
@@ -140,12 +135,12 @@ void KSyncProfile::readConfig(KConfig *config )
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 );
diff --git a/libkdepim/ksyncprofile.h b/libkdepim/ksyncprofile.h
index 8995def..a0cfb71 100644
--- a/libkdepim/ksyncprofile.h
+++ b/libkdepim/ksyncprofile.h
@@ -46,7 +46,7 @@ class KConfig;
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();
@@ -55,8 +55,6 @@ class KSyncProfile : public QObject {
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;}
@@ -112,7 +110,6 @@ class KSyncProfile : public QObject {
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;