-rw-r--r-- | libkdepim/ksyncprofile.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
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 | ||
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 | { |
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 | ||
76 | void KSyncProfile::setDefault() | 71 | void 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 | } |
102 | void KSyncProfile::readConfig(KConfig *config ) | 97 | 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 ); |
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 | ||
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 ); |
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 ); |