summaryrefslogtreecommitdiffabout
path: root/libkdepim/ksyncprofile.cpp
Unidiff
Diffstat (limited to 'libkdepim/ksyncprofile.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/ksyncprofile.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libkdepim/ksyncprofile.cpp b/libkdepim/ksyncprofile.cpp
index a43ebe2..2bf4e6c 100644
--- a/libkdepim/ksyncprofile.cpp
+++ b/libkdepim/ksyncprofile.cpp
@@ -1,182 +1,182 @@
1/* 1/*
2 This file is part of KDE-Pim/Pi. 2 This file is part of KDE-Pim/Pi.
3 Copyright (c) 2004 Lutz Rogowski <rogowski@kde.org> 3 Copyright (c) 2004 Lutz Rogowski <rogowski@kde.org>
4 4
5 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public 6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either 7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version. 8 version 2 of the License, or (at your option) any later version.
9 9
10 This library is distributed in the hope that it will be useful, 10 This library 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 GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21// $Id$ 21// $Id$
22 22
23#include <qcolor.h> 23#include <qcolor.h>
24 24
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(): QObject () 33KSyncProfile::KSyncProfile(): QObject ()
34{ 34{
35 setDefault(); 35 setDefault();
36} 36}
37KSyncProfile::~KSyncProfile() 37KSyncProfile::~KSyncProfile()
38{ 38{
39 39
40} 40}
41 41
42 42
43KSyncProfile* KSyncProfile::clone() 43KSyncProfile* KSyncProfile::clone()
44{ 44{
45 KSyncProfile* myClone = new KSyncProfile(); 45 KSyncProfile* myClone = new KSyncProfile();
46 myClone->setPreSyncCommand( mPreSyncCommand ); 46 myClone->setPreSyncCommand( mPreSyncCommand );
47 myClone->setPostSyncCommand( mPostSyncCommand ); 47 myClone->setPostSyncCommand( mPostSyncCommand );
48 myClone->setLocalTempFile( mLocalTempFile); 48 myClone->setLocalTempFile( mLocalTempFile);
49 myClone->setRemoteFileName( mRemoteFileName ); 49 myClone->setRemoteFileName( mRemoteFileName );
50 myClone->setPreSyncCommandAB( mPreSyncCommandAB ); 50 myClone->setPreSyncCommandAB( mPreSyncCommandAB );
51 myClone->setPostSyncCommandAB( mPostSyncCommandAB ); 51 myClone->setPostSyncCommandAB( mPostSyncCommandAB );
52 myClone->setLocalTempFileAB( mLocalTempFileAB); 52 myClone->setLocalTempFileAB( mLocalTempFileAB);
53 myClone->setRemoteFileNameAB( mRemoteFileNameAB ); 53 myClone->setRemoteFileNameAB( mRemoteFileNameAB );
54 myClone->setPreSyncCommandPWM( mPreSyncCommandPWM ); 54 myClone->setPreSyncCommandPWM( mPreSyncCommandPWM );
55 myClone->setPostSyncCommandPWM( mPostSyncCommandPWM ); 55 myClone->setPostSyncCommandPWM( mPostSyncCommandPWM );
56 myClone->setLocalTempFilePWM( mLocalTempFilePWM); 56 myClone->setLocalTempFilePWM( mLocalTempFilePWM);
57 myClone->setRemoteFileNamePWM( mRemoteFileNamePWM ); 57 myClone->setRemoteFileNamePWM( mRemoteFileNamePWM );
58 myClone->setShowSummaryAfterSync( mShowSummaryAfterSync ); 58 myClone->setShowSummaryAfterSync( mShowSummaryAfterSync );
59 myClone->setAskForPreferences( mAskForPreferences); 59 myClone->setAskForPreferences( mAskForPreferences);
60 myClone->setWriteBackExisting(mWriteBackExisting ); 60 myClone->setWriteBackExisting(mWriteBackExisting );
61 myClone->setWriteBackFile( mWriteBackFile); 61 myClone->setWriteBackFile( mWriteBackFile);
62 myClone->setWriteBackFuture( mWriteBackFuture ); 62 myClone->setWriteBackFuture( mWriteBackFuture );
63 myClone->setWriteBackFutureWeeks( mWriteBackFutureWeeks ); 63 myClone->setWriteBackFutureWeeks( mWriteBackFutureWeeks );
64 myClone->setIncludeInRingSync( mIncludeInRingSync ); 64 myClone->setIncludeInRingSync( mIncludeInRingSync );
65 myClone->setIncludeInRingSyncAB( mIncludeInRingSyncAB ); 65 myClone->setIncludeInRingSyncAB( mIncludeInRingSyncAB );
66 myClone->setIncludeInRingSyncPWM( mIncludeInRingSyncPWM ); 66 myClone->setIncludeInRingSyncPWM( mIncludeInRingSyncPWM );
67 myClone->setSyncPrefs( mSyncPrefs); 67 myClone->setSyncPrefs( mSyncPrefs);
68 myClone->setIsLocalFileSync( mIsLocalFileSync ); 68 myClone->setIsLocalFileSync( mIsLocalFileSync );
69 myClone->setIsPhoneSync( mIsPhoneSync ); 69 myClone->setIsPhoneSync( mIsPhoneSync );
70 myClone->setWriteContactToSIM( mWriteContactToSIM ); 70 myClone->setWriteContactToSIM( mWriteContactToSIM );
71 myClone->setName( "noName" ); 71 myClone->setName( "noName" );
72 //myClone->setIdentifier( "noID" ); 72 //myClone->setIdentifier( "noID" );
73 return myClone; 73 return myClone;
74} 74}
75 75
76 76
77void KSyncProfile::setDefault() 77void KSyncProfile::setDefault()
78{ 78{
79 mPreSyncCommand = i18n("command for downloading remote file to local device"); 79 mPreSyncCommand = i18n("command for downloading remote file to local device");
80 mPostSyncCommand = i18n("command for uploading local temp file to remote device"); 80 mPostSyncCommand = i18n("command for uploading local temp file to remote device");
81 mLocalTempFile = "/tmp/mycalendar.ics"; 81 mLocalTempFile = "/tmp/mycalendar.ics";
82 mRemoteFileName = "/home/polo/kdepim/apps/korganizer/localfile.ics"; 82 mRemoteFileName = "/home/polo/kdepim/apps/korganizer/localfile.ics";
83 mPreSyncCommandAB = i18n("command for downloading remote file to local device"); 83 mPreSyncCommandAB = i18n("command for downloading remote file to local device");
84 mPostSyncCommandAB = i18n("command for uploading local temp file to remote device"); 84 mPostSyncCommandAB = i18n("command for uploading local temp file to remote device");
85 mLocalTempFileAB = "/tmp/std.vcf"; 85 mLocalTempFileAB = "/tmp/std.vcf";
86 mRemoteFileNamePWM = "/home/polo/kdepim/apps/kabc/localfile.vcf"; 86 mRemoteFileNameAB = "/home/polo/kdepim/apps/kabc/localfile.vcf";
87 mPreSyncCommandPWM = i18n("command for downloading remote file to local device"); 87 mPreSyncCommandPWM = i18n("command for downloading remote file to local device");
88 mPostSyncCommandPWM = i18n("command for uploading local temp file to remote device"); 88 mPostSyncCommandPWM = i18n("command for uploading local temp file to remote device");
89 mLocalTempFilePWM = "/tmp/passwords.pwm"; 89 mLocalTempFilePWM = "/tmp/passwords.pwm";
90 mRemoteFileNamePWM = "/home/polo/kdepim/apps/pwmanager/localfile.pwm"; 90 mRemoteFileNamePWM = "/home/polo/kdepim/apps/pwmanager/localfile.pwm";
91 mShowSummaryAfterSync = true; 91 mShowSummaryAfterSync = true;
92 mAskForPreferences = true; 92 mAskForPreferences = true;
93 mWriteBackExisting = false; 93 mWriteBackExisting = false;
94 mWriteBackFuture = false; 94 mWriteBackFuture = false;
95 mWriteBackFutureWeeks = 12; 95 mWriteBackFutureWeeks = 12;
96 mWriteBackFile = true; 96 mWriteBackFile = true;
97 mIncludeInRingSync = false; 97 mIncludeInRingSync = false;
98 mIncludeInRingSyncAB = false; 98 mIncludeInRingSyncAB = false;
99 mIncludeInRingSyncPWM = false; 99 mIncludeInRingSyncPWM = false;
100 mSyncPrefs = SYNC_PREF_ASK; 100 mSyncPrefs = SYNC_PREF_ASK;
101 mIsLocalFileSync = true; 101 mIsLocalFileSync = true;
102 mName = "noName"; 102 mName = "noName";
103 mIsPhoneSync = false; 103 mIsPhoneSync = false;
104 mWriteContactToSIM = false; 104 mWriteContactToSIM = false;
105 mPhoneDevice = "/dev/ircomm"; 105 mPhoneDevice = "/dev/ircomm";
106 mPhoneConnection = "irda"; 106 mPhoneConnection = "irda";
107 mPhoneModel = "6310i"; 107 mPhoneModel = "6310i";
108} 108}
109void KSyncProfile::readConfig(KConfig *config ) 109void KSyncProfile::readConfig(KConfig *config )
110{ 110{
111 if (config) 111 if (config)
112 { 112 {
113 113
114 config->setGroup( mName ); 114 config->setGroup( mName );
115 115
116 mName = config->readEntry( "Name", mName ); 116 mName = config->readEntry( "Name", mName );
117 mPreSyncCommand = config->readEntry( "PreSyncCommand",mPreSyncCommand ); 117 mPreSyncCommand = config->readEntry( "PreSyncCommand",mPreSyncCommand );
118 mPostSyncCommand = config->readEntry( "PostSyncCommand", mPostSyncCommand ); 118 mPostSyncCommand = config->readEntry( "PostSyncCommand", mPostSyncCommand );
119 mLocalTempFile = config->readEntry( "LocalTempFile", mLocalTempFile ); 119 mLocalTempFile = config->readEntry( "LocalTempFile", mLocalTempFile );
120 mRemoteFileName = config->readEntry( "RemoteFileName", mRemoteFileName ); 120 mRemoteFileName = config->readEntry( "RemoteFileName", mRemoteFileName );
121 121
122 mPreSyncCommandAB = config->readEntry( "PreSyncCommandAB",mPreSyncCommandAB ); 122 mPreSyncCommandAB = config->readEntry( "PreSyncCommandAB",mPreSyncCommandAB );
123 mPostSyncCommandAB = config->readEntry( "PostSyncCommandAB", mPostSyncCommandAB ); 123 mPostSyncCommandAB = config->readEntry( "PostSyncCommandAB", mPostSyncCommandAB );
124 mLocalTempFileAB = config->readEntry( "LocalTempFileAB", mLocalTempFileAB ); 124 mLocalTempFileAB = config->readEntry( "LocalTempFileAB", mLocalTempFileAB );
125 mRemoteFileNameAB = config->readEntry( "RemoteFileNameAB", mRemoteFileNameAB ); 125 mRemoteFileNameAB = config->readEntry( "RemoteFileNameAB", mRemoteFileNameAB );
126 126
127 mPreSyncCommandPWM = config->readEntry( "PreSyncCommandPWM",mPreSyncCommandPWM ); 127 mPreSyncCommandPWM = config->readEntry( "PreSyncCommandPWM",mPreSyncCommandPWM );
128 mPostSyncCommandPWM = config->readEntry( "PostSyncCommandPWM", mPostSyncCommandPWM ); 128 mPostSyncCommandPWM = config->readEntry( "PostSyncCommandPWM", mPostSyncCommandPWM );
129 mLocalTempFilePWM = config->readEntry( "LocalTempFilePWM", mLocalTempFilePWM ); 129 mLocalTempFilePWM = config->readEntry( "LocalTempFilePWM", mLocalTempFilePWM );
130 mRemoteFileNamePWM = config->readEntry( "RemoteFileNamePWM", mRemoteFileNamePWM ); 130 mRemoteFileNamePWM = config->readEntry( "RemoteFileNamePWM", mRemoteFileNamePWM );
131 131
132 mPhoneDevice = config->readEntry( "PhoneDevice", mPhoneDevice ); 132 mPhoneDevice = config->readEntry( "PhoneDevice", mPhoneDevice );
133 mPhoneConnection = config->readEntry( "PhoneConnection", mPhoneConnection ); 133 mPhoneConnection = config->readEntry( "PhoneConnection", mPhoneConnection );
134 mPhoneModel = config->readEntry( "PhoneModel", mPhoneModel ); 134 mPhoneModel = config->readEntry( "PhoneModel", mPhoneModel );
135 135
136 mIncludeInRingSync = config->readBoolEntry( "IncludeInRingSync",mIncludeInRingSync ); 136 mIncludeInRingSync = config->readBoolEntry( "IncludeInRingSync",mIncludeInRingSync );
137 mIncludeInRingSyncAB = config->readBoolEntry( "IncludeInRingSyncAB",mIncludeInRingSyncAB ); 137 mIncludeInRingSyncAB = config->readBoolEntry( "IncludeInRingSyncAB",mIncludeInRingSyncAB );
138 mIncludeInRingSyncPWM = config->readBoolEntry( "IncludeInRingSyncPWM",mIncludeInRingSyncPWM ); 138 mIncludeInRingSyncPWM = config->readBoolEntry( "IncludeInRingSyncPWM",mIncludeInRingSyncPWM );
139 mShowSummaryAfterSync = config->readBoolEntry( "ShowSummaryAfterSync", mShowSummaryAfterSync ); 139 mShowSummaryAfterSync = config->readBoolEntry( "ShowSummaryAfterSync", mShowSummaryAfterSync );
140 mAskForPreferences = config->readBoolEntry( "AskForPreferences",mAskForPreferences ); 140 mAskForPreferences = config->readBoolEntry( "AskForPreferences",mAskForPreferences );
141 mWriteBackExisting = config->readBoolEntry( "WriteBackExisting",mWriteBackExisting ); 141 mWriteBackExisting = config->readBoolEntry( "WriteBackExisting",mWriteBackExisting );
142 mWriteBackFuture = config->readBoolEntry( "WriteBackFuture",mWriteBackFuture ); 142 mWriteBackFuture = config->readBoolEntry( "WriteBackFuture",mWriteBackFuture );
143 mWriteBackFile = config->readBoolEntry( "WriteBackFile",mWriteBackFile ); 143 mWriteBackFile = config->readBoolEntry( "WriteBackFile",mWriteBackFile );
144 mWriteContactToSIM = config->readBoolEntry( "WriteContactToSIM",mWriteContactToSIM ); 144 mWriteContactToSIM = config->readBoolEntry( "WriteContactToSIM",mWriteContactToSIM );
145 mSyncPrefs = config->readNumEntry( "SyncPrefs", mSyncPrefs ); 145 mSyncPrefs = config->readNumEntry( "SyncPrefs", mSyncPrefs );
146 mWriteBackFutureWeeks = config->readNumEntry( "WriteBackFutureWeeks", mWriteBackFutureWeeks ); 146 mWriteBackFutureWeeks = config->readNumEntry( "WriteBackFutureWeeks", mWriteBackFutureWeeks );
147 mIsLocalFileSync= config->readBoolEntry( "IsLocalFileSync", mIsLocalFileSync ); 147 mIsLocalFileSync= config->readBoolEntry( "IsLocalFileSync", mIsLocalFileSync );
148 mIsPhoneSync= config->readBoolEntry( "IsPhoneSync", mIsPhoneSync ); 148 mIsPhoneSync= config->readBoolEntry( "IsPhoneSync", mIsPhoneSync );
149 } 149 }
150 else 150 else
151 { 151 {
152 setDefault(); 152 setDefault();
153 } 153 }
154} 154}
155 155
156void KSyncProfile::deleteConfig(KConfig *config ) 156void KSyncProfile::deleteConfig(KConfig *config )
157{ 157{
158 config->deleteGroup( mName ); 158 config->deleteGroup( mName );
159} 159}
160 160
161void KSyncProfile::writeConfig( KConfig * config ) 161void KSyncProfile::writeConfig( KConfig * config )
162{ 162{
163 config->setGroup(mName); 163 config->setGroup(mName);
164 164
165 config->writeEntry( "Name", mName ); 165 config->writeEntry( "Name", mName );
166 config->writeEntry( "PreSyncCommand",mPreSyncCommand ); 166 config->writeEntry( "PreSyncCommand",mPreSyncCommand );
167 config->writeEntry( "PostSyncCommand", mPostSyncCommand ); 167 config->writeEntry( "PostSyncCommand", mPostSyncCommand );
168 config->writeEntry( "LocalTempFile", mLocalTempFile ); 168 config->writeEntry( "LocalTempFile", mLocalTempFile );
169 config->writeEntry( "RemoteFileName", mRemoteFileName ); 169 config->writeEntry( "RemoteFileName", mRemoteFileName );
170 170
171 config->writeEntry( "PreSyncCommandAB",mPreSyncCommandAB ); 171 config->writeEntry( "PreSyncCommandAB",mPreSyncCommandAB );
172 config->writeEntry( "PostSyncCommandAB", mPostSyncCommandAB ); 172 config->writeEntry( "PostSyncCommandAB", mPostSyncCommandAB );
173 config->writeEntry( "LocalTempFileAB", mLocalTempFileAB ); 173 config->writeEntry( "LocalTempFileAB", mLocalTempFileAB );
174 config->writeEntry( "RemoteFileNameAB", mRemoteFileNameAB ); 174 config->writeEntry( "RemoteFileNameAB", mRemoteFileNameAB );
175 175
176 config->writeEntry( "PreSyncCommandPWM",mPreSyncCommandPWM ); 176 config->writeEntry( "PreSyncCommandPWM",mPreSyncCommandPWM );
177 config->writeEntry( "PostSyncCommandPWM", mPostSyncCommandPWM ); 177 config->writeEntry( "PostSyncCommandPWM", mPostSyncCommandPWM );
178 config->writeEntry( "LocalTempFilePWM", mLocalTempFilePWM ); 178 config->writeEntry( "LocalTempFilePWM", mLocalTempFilePWM );
179 config->writeEntry( "RemoteFileNamePWM", mRemoteFileNamePWM ); 179 config->writeEntry( "RemoteFileNamePWM", mRemoteFileNamePWM );
180 180
181 config->writeEntry( "PhoneDevice", mPhoneDevice ); 181 config->writeEntry( "PhoneDevice", mPhoneDevice );
182 config->writeEntry( "PhoneConnection", mPhoneConnection ); 182 config->writeEntry( "PhoneConnection", mPhoneConnection );