author | zautrix <zautrix> | 2004-10-26 22:56:24 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-26 22:56:24 (UTC) |
commit | 00d623c9391a9bdaeb142f443f1dd09861317608 (patch) (unidiff) | |
tree | 941b77a6da7a5db84ed9f4c00ab18918231cb643 | |
parent | 6385f303bef3cbcd19d097a7b05c30e144d5dd6e (diff) | |
download | kdepimpi-00d623c9391a9bdaeb142f443f1dd09861317608.zip kdepimpi-00d623c9391a9bdaeb142f443f1dd09861317608.tar.gz kdepimpi-00d623c9391a9bdaeb142f443f1dd09861317608.tar.bz2 |
added external time for pisync - kdesync
-rw-r--r-- | korganizer/calendarview.cpp | 11 | ||||
-rw-r--r-- | libkdepim/ksyncmanager.cpp | 16 | ||||
-rw-r--r-- | libkdepim/ksyncmanager.h | 1 |
3 files changed, 24 insertions, 4 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index a08f243..326db88 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -926,9 +926,16 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int | |||
926 | QPtrList<Event> eventLSyncSharp = local->getExternLastSyncEvents(); | 926 | QPtrList<Event> eventLSyncSharp = local->getExternLastSyncEvents(); |
927 | bool fullDateRange = false; | 927 | bool fullDateRange = false; |
928 | local->resetTempSyncStat(); | 928 | local->resetTempSyncStat(); |
929 | if ( mSyncKDE ) | ||
930 | remote->resetPilotStat(1); | ||
931 | mLastCalendarSync = QDateTime::currentDateTime(); | 929 | mLastCalendarSync = QDateTime::currentDateTime(); |
930 | if ( mSyncKDE ) { | ||
931 | remote->resetPilotStat(1); | ||
932 | if ( KSyncManager::mRequestedSyncEvent.isValid() ) { | ||
933 | mLastCalendarSync = KSyncManager::mRequestedSyncEvent; | ||
934 | qDebug("using extern time for calendar sync: %s ", mLastCalendarSync.toString().latin1() ); | ||
935 | } else { | ||
936 | qDebug("ERROR: KSyncManager::mRequestedSyncEvent has invalid datatime "); | ||
937 | } | ||
938 | } | ||
932 | QDateTime modifiedCalendar = mLastCalendarSync;; | 939 | QDateTime modifiedCalendar = mLastCalendarSync;; |
933 | eventLSync = getLastSyncEvent(); | 940 | eventLSync = getLastSyncEvent(); |
934 | eventR = remote->event("last-syncEvent-"+mCurrentSyncName ); | 941 | eventR = remote->event("last-syncEvent-"+mCurrentSyncName ); |
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp index feb184b..e09050e 100644 --- a/libkdepim/ksyncmanager.cpp +++ b/libkdepim/ksyncmanager.cpp | |||
@@ -55,6 +55,9 @@ | |||
55 | #include <kconfig.h> | 55 | #include <kconfig.h> |
56 | #include <kfiledialog.h> | 56 | #include <kfiledialog.h> |
57 | 57 | ||
58 | QDateTime KSyncManager::mRequestedSyncEvent; | ||
59 | |||
60 | |||
58 | KSyncManager::KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu) | 61 | KSyncManager::KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu) |
59 | : QObject(), mParent(parent), mImplementation(implementation), mTargetApp(ta), mPrefs(prefs ),mSyncMenu(syncmenu) | 62 | : QObject(), mParent(parent), mImplementation(implementation), mTargetApp(ta), mPrefs(prefs ),mSyncMenu(syncmenu) |
60 | { | 63 | { |
@@ -1111,9 +1114,16 @@ void KServerSocket::readClient() | |||
1111 | //qDebug("KServerSocket readline: %s ", line.latin1()); | 1114 | //qDebug("KServerSocket readline: %s ", line.latin1()); |
1112 | QStringList tokens = QStringList::split( QRegExp("[ \r\n][ \r\n]*"), line ); | 1115 | QStringList tokens = QStringList::split( QRegExp("[ \r\n][ \r\n]*"), line ); |
1113 | if ( tokens[0] == "GET" ) { | 1116 | if ( tokens[0] == "GET" ) { |
1114 | if ( tokens[1] == mPassWord ) | 1117 | if ( tokens[1] == mPassWord ) { |
1115 | //emit sendFile( mSocket ); | 1118 | //emit sendFile( mSocket ); |
1119 | bool ok = false; | ||
1120 | QDateTime dt = KGlobal::locale()->readDateTime( tokens[2], KLocale::ISODate, &ok); | ||
1121 | if ( ok ) | ||
1122 | KSyncManager::mRequestedSyncEvent = dt; | ||
1123 | else | ||
1124 | KSyncManager::mRequestedSyncEvent = QDateTime(); | ||
1116 | send_file(); | 1125 | send_file(); |
1126 | } | ||
1117 | else { | 1127 | else { |
1118 | KMessageBox::error( 0, i18n("Got send file request\nwith invalid password")); | 1128 | KMessageBox::error( 0, i18n("Got send file request\nwith invalid password")); |
1119 | //qDebug("password %s, invalid password %s ",mPassWord.latin1(), tokens[1].latin1() ); | 1129 | //qDebug("password %s, invalid password %s ",mPassWord.latin1(), tokens[1].latin1() ); |
@@ -1267,7 +1277,9 @@ void KCommandSocket::readFile( QString fn ) | |||
1267 | mSocket->connectToHost( mHost, mPort ); | 1277 | mSocket->connectToHost( mHost, mPort ); |
1268 | QTextStream os( mSocket ); | 1278 | QTextStream os( mSocket ); |
1269 | os.setEncoding( QTextStream::Latin1 ); | 1279 | os.setEncoding( QTextStream::Latin1 ); |
1270 | os << "GET " << mPassWord << "\r\n"; | 1280 | |
1281 | QString curDt = KGlobal::locale()->formatDateTime(QDateTime::currentDateTime().addSecs(-1),true, true,KLocale::ISODate ); | ||
1282 | os << "GET " << mPassWord << curDt <<"\r\n"; | ||
1271 | mTimerSocket->start( 20000 ); | 1283 | mTimerSocket->start( 20000 ); |
1272 | } | 1284 | } |
1273 | 1285 | ||
diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h index aa32e28..2af891b 100644 --- a/libkdepim/ksyncmanager.h +++ b/libkdepim/ksyncmanager.h | |||
@@ -146,6 +146,7 @@ class KSyncManager : public QObject | |||
146 | QString mPassWordPiSync; | 146 | QString mPassWordPiSync; |
147 | QString mActiveSyncPort; | 147 | QString mActiveSyncPort; |
148 | QString mActiveSyncIP ; | 148 | QString mActiveSyncIP ; |
149 | static QDateTime mRequestedSyncEvent; | ||
149 | 150 | ||
150 | signals: | 151 | signals: |
151 | void save(); | 152 | void save(); |