author | zautrix <zautrix> | 2004-10-13 03:05:35 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-13 03:05:35 (UTC) |
commit | 8f852fddc2dc5b63511d6ad1c85a1e74141969ff (patch) (unidiff) | |
tree | 123c7e845e1520a4dcd50dd2361252cc6ab7a76a /libkdepim/ksyncmanager.h | |
parent | e7833b80c28e38bfe6316ee5fce150635cdebe03 (diff) | |
download | kdepimpi-8f852fddc2dc5b63511d6ad1c85a1e74141969ff.zip kdepimpi-8f852fddc2dc5b63511d6ad1c85a1e74141969ff.tar.gz kdepimpi-8f852fddc2dc5b63511d6ad1c85a1e74141969ff.tar.bz2 |
fixed one syncing problem
-rw-r--r-- | libkdepim/ksyncmanager.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h index 5b05383..9094aac 100644 --- a/libkdepim/ksyncmanager.h +++ b/libkdepim/ksyncmanager.h | |||
@@ -73,128 +73,129 @@ class KServerSocket : public QServerSocket | |||
73 | class KCommandSocket : public QObject | 73 | class KCommandSocket : public QObject |
74 | { | 74 | { |
75 | Q_OBJECT | 75 | Q_OBJECT |
76 | public: | 76 | public: |
77 | enum state { successR, errorR, successW, errorW, errorTO, quiet }; | 77 | enum state { successR, errorR, successW, errorW, errorTO, quiet }; |
78 | KCommandSocket ( QString password, Q_UINT16 port, QString host, QObject * parent=0, const char * name=0 ); | 78 | KCommandSocket ( QString password, Q_UINT16 port, QString host, QObject * parent=0, const char * name=0 ); |
79 | void readFile( QString ); | 79 | void readFile( QString ); |
80 | void writeFile( QString ); | 80 | void writeFile( QString ); |
81 | void sendStop(); | 81 | void sendStop(); |
82 | 82 | ||
83 | signals: | 83 | signals: |
84 | void commandFinished( KCommandSocket*, int ); | 84 | void commandFinished( KCommandSocket*, int ); |
85 | private slots: | 85 | private slots: |
86 | void startReadFileFromSocket(); | 86 | void startReadFileFromSocket(); |
87 | void readFileFromSocket(); | 87 | void readFileFromSocket(); |
88 | void deleteSocket(); | 88 | void deleteSocket(); |
89 | void writeFileToSocket(); | 89 | void writeFileToSocket(); |
90 | private : | 90 | private : |
91 | QSocket* mSocket; | 91 | QSocket* mSocket; |
92 | QString mPassWord; | 92 | QString mPassWord; |
93 | Q_UINT16 mPort; | 93 | Q_UINT16 mPort; |
94 | QString mHost; | 94 | QString mHost; |
95 | QString mFileName; | 95 | QString mFileName; |
96 | QTimer* mTimerSocket; | 96 | QTimer* mTimerSocket; |
97 | int mRetVal; | 97 | int mRetVal; |
98 | QTime mTime; | 98 | QTime mTime; |
99 | QString mFileString; | 99 | QString mFileString; |
100 | bool mFirst; | 100 | bool mFirst; |
101 | }; | 101 | }; |
102 | 102 | ||
103 | 103 | ||
104 | class KSyncManager : public QObject | 104 | class KSyncManager : public QObject |
105 | { | 105 | { |
106 | Q_OBJECT | 106 | Q_OBJECT |
107 | 107 | ||
108 | public: | 108 | public: |
109 | enum TargetApp { | 109 | enum TargetApp { |
110 | KOPI = 0, | 110 | KOPI = 0, |
111 | KAPI = 1, | 111 | KAPI = 1, |
112 | PWMPI = 2 }; | 112 | PWMPI = 2 }; |
113 | 113 | ||
114 | KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu); | 114 | KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu); |
115 | ~KSyncManager() ; | 115 | ~KSyncManager() ; |
116 | 116 | ||
117 | void multiSync( bool askforPrefs ); | 117 | void multiSync( bool askforPrefs ); |
118 | bool blockSave() { return mBlockSaveFlag; } | 118 | bool blockSave() { return mBlockSaveFlag; } |
119 | void setBlockSave(bool sa) { mBlockSaveFlag = sa; } | 119 | void setBlockSave(bool sa) { mBlockSaveFlag = sa; } |
120 | void setDefaultFileName( QString s) { mDefFileName = s ;} | 120 | void setDefaultFileName( QString s) { mDefFileName = s ;} |
121 | QString defaultFileName() { return mDefFileName ;} | 121 | QString defaultFileName() { return mDefFileName ;} |
122 | QString syncFileName(); | 122 | QString syncFileName(); |
123 | 123 | ||
124 | QString getCurrentSyncDevice() { return mCurrentSyncDevice; } | 124 | QString getCurrentSyncDevice() { return mCurrentSyncDevice; } |
125 | QString getCurrentSyncName() { return mCurrentSyncName; } | 125 | QString getCurrentSyncName() { return mCurrentSyncName; } |
126 | 126 | ||
127 | void showProgressBar(int percentage, QString caption = QString::null, int total=100); | 127 | void showProgressBar(int percentage, QString caption = QString::null, int total=100); |
128 | void hideProgressBar(); | 128 | void hideProgressBar(); |
129 | bool isProgressBarCanceled(); | 129 | bool isProgressBarCanceled(); |
130 | 130 | ||
131 | // sync stuff | 131 | // sync stuff |
132 | QString mLocalMachineName; | 132 | QString mLocalMachineName; |
133 | QStringList mExternSyncProfiles; | 133 | QStringList mExternSyncProfiles; |
134 | QStringList mSyncProfileNames; | 134 | QStringList mSyncProfileNames; |
135 | bool mAskForPreferences; | 135 | bool mAskForPreferences; |
136 | bool mShowSyncSummary; | 136 | bool mShowSyncSummary; |
137 | bool mIsKapiFile; | ||
137 | bool mWriteBackExistingOnly; | 138 | bool mWriteBackExistingOnly; |
138 | int mSyncAlgoPrefs; | 139 | int mSyncAlgoPrefs; |
139 | bool mWriteBackFile; | 140 | bool mWriteBackFile; |
140 | int mWriteBackInFuture; | 141 | int mWriteBackInFuture; |
141 | QString mPhoneDevice; | 142 | QString mPhoneDevice; |
142 | QString mPhoneConnection; | 143 | QString mPhoneConnection; |
143 | QString mPhoneModel; | 144 | QString mPhoneModel; |
144 | QString mPassWordPiSync; | 145 | QString mPassWordPiSync; |
145 | QString mActiveSyncPort; | 146 | QString mActiveSyncPort; |
146 | QString mActiveSyncIP ; | 147 | QString mActiveSyncIP ; |
147 | 148 | ||
148 | signals: | 149 | signals: |
149 | void save(); | 150 | void save(); |
150 | void request_file(); | 151 | void request_file(); |
151 | void getFile( bool ); | 152 | void getFile( bool ); |
152 | 153 | ||
153 | public slots: | 154 | public slots: |
154 | void slotSyncMenu( int ); | 155 | void slotSyncMenu( int ); |
155 | void deleteCommandSocket(KCommandSocket*s, int state); | 156 | void deleteCommandSocket(KCommandSocket*s, int state); |
156 | void readFileFromSocket(); | 157 | void readFileFromSocket(); |
157 | void fillSyncMenu(); | 158 | void fillSyncMenu(); |
158 | 159 | ||
159 | private: | 160 | private: |
160 | void syncPi(); | 161 | void syncPi(); |
161 | KServerSocket * mServerSocket; | 162 | KServerSocket * mServerSocket; |
162 | void enableQuick(); | 163 | void enableQuick(); |
163 | KPimPrefs* mPrefs; | 164 | KPimPrefs* mPrefs; |
164 | QString mDefFileName; | 165 | QString mDefFileName; |
165 | QString mCurrentSyncDevice; | 166 | QString mCurrentSyncDevice; |
166 | QString mCurrentSyncName; | 167 | QString mCurrentSyncName; |
167 | void quickSyncLocalFile(); | 168 | void quickSyncLocalFile(); |
168 | bool syncWithFile( QString fn , bool quick ); | 169 | bool syncWithFile( QString fn , bool quick ); |
169 | void syncLocalFile(); | 170 | void syncLocalFile(); |
170 | void syncPhone(); | 171 | void syncPhone(); |
171 | void syncSharp(); | 172 | void syncSharp(); |
172 | bool syncExternalApplication(QString); | 173 | bool syncExternalApplication(QString); |
173 | int mCurrentSyncProfile ; | 174 | int mCurrentSyncProfile ; |
174 | void syncRemote( KSyncProfile* prof, bool ask = true); | 175 | void syncRemote( KSyncProfile* prof, bool ask = true); |
175 | void edit_sync_options(); | 176 | void edit_sync_options(); |
176 | void edit_pisync_options(); | 177 | void edit_pisync_options(); |
177 | int ringSync(); | 178 | int ringSync(); |
178 | QString getPassword( ); | 179 | QString getPassword( ); |
179 | 180 | ||
180 | private slots: | 181 | private slots: |
181 | void confSync(); | 182 | void confSync(); |
182 | private: | 183 | private: |
183 | bool mBlockSaveFlag; | 184 | bool mBlockSaveFlag; |
184 | QWidget* mParent; | 185 | QWidget* mParent; |
185 | KSyncInterface* mImplementation; | 186 | KSyncInterface* mImplementation; |
186 | TargetApp mTargetApp; | 187 | TargetApp mTargetApp; |
187 | QPopupMenu* mSyncMenu; | 188 | QPopupMenu* mSyncMenu; |
188 | QProgressBar* bar; | 189 | QProgressBar* bar; |
189 | 190 | ||
190 | }; | 191 | }; |
191 | 192 | ||
192 | 193 | ||
193 | class KSyncInterface | 194 | class KSyncInterface |
194 | { | 195 | { |
195 | public : | 196 | public : |
196 | virtual bool sync(KSyncManager* manager, QString filename, int mode) = 0; | 197 | virtual bool sync(KSyncManager* manager, QString filename, int mode) = 0; |
197 | virtual bool syncExternal(KSyncManager* manager, QString resource) | 198 | virtual bool syncExternal(KSyncManager* manager, QString resource) |
198 | { | 199 | { |
199 | // empty implementation, because some syncable applications do not | 200 | // empty implementation, because some syncable applications do not |
200 | // have an external(sharpdtm) syncmode, like pwmanager. | 201 | // have an external(sharpdtm) syncmode, like pwmanager. |