author | zautrix <zautrix> | 2004-08-07 16:10:09 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-08-07 16:10:09 (UTC) |
commit | ef8a09ce74ad3f0a51484d03fdf009bd5b3677bf (patch) (unidiff) | |
tree | 7ff6c37e8ad6b7f1dbd672d28de6fcea916caf8f /libkdepim | |
parent | a9a774e19c02f03de948b6064804b913abd4f08b (diff) | |
download | kdepimpi-ef8a09ce74ad3f0a51484d03fdf009bd5b3677bf.zip kdepimpi-ef8a09ce74ad3f0a51484d03fdf009bd5b3677bf.tar.gz kdepimpi-ef8a09ce74ad3f0a51484d03fdf009bd5b3677bf.tar.bz2 |
Fix of the syncprofiles
-rw-r--r-- | libkdepim/ksyncprofile.cpp | 15 | ||||
-rw-r--r-- | libkdepim/ksyncprofile.h | 5 |
2 files changed, 6 insertions, 14 deletions
diff --git a/libkdepim/ksyncprofile.cpp b/libkdepim/ksyncprofile.cpp index 15dc152..e7c35fb 100644 --- a/libkdepim/ksyncprofile.cpp +++ b/libkdepim/ksyncprofile.cpp | |||
@@ -29,15 +29,10 @@ | |||
29 | 29 | ||
30 | #include "ksyncprofile.h" | 30 | #include "ksyncprofile.h" |
31 | 31 | ||
32 | 32 | ||
33 | KSyncProfile::KSyncProfile( const char * identifier): QObject (0, identifier ) | 33 | KSyncProfile::KSyncProfile(): QObject () |
34 | { | 34 | { |
35 | setIdentifier( identifier ); | ||
36 | |||
37 | if (getIdentifier().isEmpty()) | ||
38 | setIdentifier( "noID" ); | ||
39 | |||
40 | setDefault(); | 35 | setDefault(); |
41 | } | 36 | } |
42 | KSyncProfile::~KSyncProfile() | 37 | KSyncProfile::~KSyncProfile() |
43 | { | 38 | { |
@@ -67,9 +62,9 @@ KSyncProfile* KSyncProfile::clone() | |||
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 | ||
@@ -103,9 +98,9 @@ void 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 ); |
@@ -139,14 +134,14 @@ void KSyncProfile::readConfig(KConfig *config ) | |||
139 | } | 134 | } |
140 | 135 | ||
141 | void KSyncProfile::deleteConfig(KConfig *config ) | 136 | void KSyncProfile::deleteConfig(KConfig *config ) |
142 | { | 137 | { |
143 | config->deleteGroup( "SyncProfile_" + mIdentifier ); | 138 | config->deleteGroup( mName ); |
144 | } | 139 | } |
145 | 140 | ||
146 | void KSyncProfile::writeConfig( KConfig * config ) | 141 | void 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 ); |
diff --git a/libkdepim/ksyncprofile.h b/libkdepim/ksyncprofile.h index 8995def..a0cfb71 100644 --- a/libkdepim/ksyncprofile.h +++ b/libkdepim/ksyncprofile.h | |||
@@ -45,19 +45,17 @@ class KConfig; | |||
45 | have to register instances with the function KPrefs::addItem(). | 45 | have to register instances with the function KPrefs::addItem(). |
46 | */ | 46 | */ |
47 | class KSyncProfile : public QObject { | 47 | class 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;} |
@@ -111,9 +109,8 @@ class KSyncProfile : public QObject { | |||
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; |