author | zautrix <zautrix> | 2004-10-05 08:07:41 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-05 08:07:41 (UTC) |
commit | ad859d26b813101adab963f50e694961702561d9 (patch) (unidiff) | |
tree | 36eb7f12ee6ee80f50cdd13bbfaba74e9a1b37d1 | |
parent | fc2c103f45a6d4e4105259436266538c645f2c87 (diff) | |
download | kdepimpi-ad859d26b813101adab963f50e694961702561d9.zip kdepimpi-ad859d26b813101adab963f50e694961702561d9.tar.gz kdepimpi-ad859d26b813101adab963f50e694961702561d9.tar.bz2 |
cleanup
-rw-r--r-- | korganizer/calendarview.cpp | 20 | ||||
-rw-r--r-- | korganizer/koprefs.cpp | 1 | ||||
-rw-r--r-- | korganizer/koprefs.h | 1 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 115 | ||||
-rw-r--r-- | korganizer/mainwindow.h | 2 | ||||
-rw-r--r-- | libkcal/calstorage.h | 2 | ||||
-rw-r--r-- | libkcal/filestorage.cpp | 4 | ||||
-rw-r--r-- | libkcal/filestorage.h | 2 | ||||
-rw-r--r-- | libkcal/icalformat.cpp | 24 | ||||
-rw-r--r-- | libkcal/icalformat.h | 3 |
10 files changed, 20 insertions, 154 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index eaea040..fecc7e2 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -1223,3 +1223,3 @@ bool CalendarView::syncCalendar(QString filename, int mode) | |||
1223 | // qDebug("loading ... "); | 1223 | // qDebug("loading ... "); |
1224 | if ( storage->load(KOPrefs::instance()->mUseQuicksave) ) { | 1224 | if ( storage->load() ) { |
1225 | getEventViewerDialog()->setSyncMode( true ); | 1225 | getEventViewerDialog()->setSyncMode( true ); |
@@ -1230,3 +1230,3 @@ bool CalendarView::syncCalendar(QString filename, int mode) | |||
1230 | { | 1230 | { |
1231 | storage->setSaveFormat( new ICalFormat( KOPrefs::instance()->mUseQuicksave) ); | 1231 | storage->setSaveFormat( new ICalFormat() ); |
1232 | storage->save(); | 1232 | storage->save(); |
@@ -1501,3 +1501,3 @@ bool CalendarView::openCalendar(QString filename, bool merge) | |||
1501 | 1501 | ||
1502 | if ( mStorage->load(KOPrefs::instance()->mUseQuicksave) ) { | 1502 | if ( mStorage->load() ) { |
1503 | if ( merge ) ;//setModified( true ); | 1503 | if ( merge ) ;//setModified( true ); |
@@ -1516,5 +1516,7 @@ bool CalendarView::openCalendar(QString filename, bool merge) | |||
1516 | updateView(); | 1516 | updateView(); |
1517 | if ( filename != MainWindow::defaultFileName() ) | ||
1518 | saveCalendar( MainWindow::defaultFileName() ); | ||
1519 | loadedFileVersion = QDateTime::currentDateTime(); | 1517 | loadedFileVersion = QDateTime::currentDateTime(); |
1518 | if ( filename != MainWindow::defaultFileName() ) { | ||
1519 | saveCalendar( MainWindow::defaultFileName() ); | ||
1520 | watchSavedFile(); | ||
1521 | } | ||
1520 | return true; | 1522 | return true; |
@@ -1602,3 +1604,3 @@ bool CalendarView::saveCalendar( QString filename ) | |||
1602 | 1604 | ||
1603 | mStorage->setSaveFormat( new ICalFormat( KOPrefs::instance()->mUseQuicksave) ); | 1605 | mStorage->setSaveFormat( new ICalFormat() ); |
1604 | mStorage->setFileName( filename ); | 1606 | mStorage->setFileName( filename ); |
@@ -2303,3 +2305,3 @@ void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel ) | |||
2303 | fn += ".ics"; | 2305 | fn += ".ics"; |
2304 | FileStorage storage( cal, fn, new ICalFormat( KOPrefs::instance()->mUseQuicksave) ); | 2306 | FileStorage storage( cal, fn, new ICalFormat( ) ); |
2305 | storage.save(); | 2307 | storage.save(); |
@@ -2858,3 +2860,3 @@ void CalendarView::action_mail() | |||
2858 | } | 2860 | } |
2859 | ICalFormat mForm( KOPrefs::instance()->mUseQuicksave); | 2861 | ICalFormat mForm(); |
2860 | QString attachment = mForm.toString( &cal_tmp ); | 2862 | QString attachment = mForm.toString( &cal_tmp ); |
@@ -3143,3 +3145,3 @@ void CalendarView::exportICalendar() | |||
3143 | 3145 | ||
3144 | FileStorage storage( mCalendar, filename, new ICalFormat( KOPrefs::instance()->mUseQuicksave) ); | 3146 | FileStorage storage( mCalendar, filename, new ICalFormat() ); |
3145 | storage.save(); | 3147 | storage.save(); |
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index 0034715..e0623d5 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp | |||
@@ -226,3 +226,2 @@ KOPrefs::KOPrefs() : | |||
226 | addItemBool("WeekStartsOnSunday",&mWeekStartsOnSunday,false); | 226 | addItemBool("WeekStartsOnSunday",&mWeekStartsOnSunday,false); |
227 | addItemBool("QuickSavingWOUnicode",&mUseQuicksave,false); | ||
228 | addItemBool("ShortDateInViewer",&mShortDateInViewer,false); | 227 | addItemBool("ShortDateInViewer",&mShortDateInViewer,false); |
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h index 696433e..7abd741 100644 --- a/korganizer/koprefs.h +++ b/korganizer/koprefs.h | |||
@@ -268,3 +268,2 @@ class KOPrefs : public KPimPrefs | |||
268 | bool mHightlightDateTimeEdit; | 268 | bool mHightlightDateTimeEdit; |
269 | bool mUseQuicksave; | ||
270 | bool mShortDateInViewer; | 269 | bool mShortDateInViewer; |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 5aa75f5..43ee2d7 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -1954,4 +1954,3 @@ void MainWindow::getFile( bool success ) | |||
1954 | } | 1954 | } |
1955 | // pending adjust time for watchSavedFile() | 1955 | mView->watchSavedFile(); |
1956 | //mView->watchSavedFile(); | ||
1957 | mView->openCalendar( defaultFileName() ); | 1956 | mView->openCalendar( defaultFileName() ); |
@@ -1965,7 +1964,2 @@ void MainWindow::syncPi() | |||
1965 | qApp->processEvents(); | 1964 | qApp->processEvents(); |
1966 | performQuickQuick(); | ||
1967 | } | ||
1968 | |||
1969 | void MainWindow::performQuickQuick() | ||
1970 | { | ||
1971 | bool ok; | 1965 | bool ok; |
@@ -1981,2 +1975,3 @@ void MainWindow::performQuickQuick() | |||
1981 | } | 1975 | } |
1976 | |||
1982 | void MainWindow::deleteCommandSocket(KCommandSocket*s, int state) | 1977 | void MainWindow::deleteCommandSocket(KCommandSocket*s, int state) |
@@ -2168,108 +2163,2 @@ void MainWindow::syncRemote( KSyncProfile* prof, bool ask) | |||
2168 | } | 2163 | } |
2169 | void MainWindow::syncSSH() | ||
2170 | { | ||
2171 | // not used anymore | ||
2172 | QTime timer; | ||
2173 | timer.start(); | ||
2174 | //qDebug("MainWindow::syncssh() "); | ||
2175 | KOPrefs *p = KOPrefs::instance(); | ||
2176 | QString localFile = p->mLocalTempFile; | ||
2177 | QString remoteIP = p->mRemoteIP; | ||
2178 | QString remoteUser = p->mRemoteUser; | ||
2179 | QString remoteFile = p->mRemoteFile; | ||
2180 | if ( p->mUsePassWd && p->mRemotePassWd.length() > 0 ) | ||
2181 | remoteUser += ":" + p->mRemotePassWd; | ||
2182 | |||
2183 | QString question = i18n("Do you really want\nto remote sync?\n \n") + | ||
2184 | i18n("IP: " ) +remoteIP +"\n" + | ||
2185 | i18n("User: " ) + remoteUser +"\n" ; | ||
2186 | int maxlen = 30; | ||
2187 | if ( QApplication::desktop()->width() > 320 ) | ||
2188 | maxlen += 25; | ||
2189 | if ( remoteFile.length() > maxlen ) | ||
2190 | question += i18n("Remote file:\n..." ) + remoteFile.right(maxlen) +"\n"; | ||
2191 | else | ||
2192 | question += i18n("Remote file:\n " ) + remoteFile +"\n"; | ||
2193 | if ( localFile.length() > maxlen ) | ||
2194 | question += i18n("Local temp file:\n..." ) + localFile.right(maxlen) +"\n"; | ||
2195 | else | ||
2196 | question += i18n("Local temp file:\n " ) + localFile +"\n"; | ||
2197 | |||
2198 | if ( QMessageBox::information( this, i18n("KO/Pi Sync"), | ||
2199 | question, | ||
2200 | i18n("Yes"), i18n("No"), | ||
2201 | 0, 0 ) != 0 ) | ||
2202 | return; | ||
2203 | // if ( !p->mUsePassWd ) { | ||
2204 | // QString pass = getPassword(); | ||
2205 | // if ( pass.length() > 0 ) | ||
2206 | // remoteUser += ":" + pass; | ||
2207 | // } | ||
2208 | QString command = "scp " + remoteUser + "@" + remoteIP +":" + remoteFile +" " +localFile; | ||
2209 | setCaption ( i18n( "Copy remote file to local machine..." ) ); | ||
2210 | int fileSize = 0; | ||
2211 | int result = system ( command ); | ||
2212 | // 0 : okay | ||
2213 | // 256: no such file or dir | ||
2214 | // | ||
2215 | qDebug("KO: Remote copy result(0 = okay): %d ",result ); | ||
2216 | if ( result != 0 ) { | ||
2217 | int len = maxlen; | ||
2218 | while ( len < command.length() ) { | ||
2219 | command.insert( len , "\n" ); | ||
2220 | len += maxlen +2; | ||
2221 | } | ||
2222 | question = i18n("Sorry, the copy command failed!\nCommand was:\n%1\n \nTry command on console to get more\ndetailed info about the reason.\n").arg (command) ; | ||
2223 | QMessageBox::information( this, i18n("KO/Pi Sync - ERROR"), | ||
2224 | question, | ||
2225 | i18n("Okay!")) ; | ||
2226 | setCaption ("KO/Pi"); | ||
2227 | return; | ||
2228 | } | ||
2229 | |||
2230 | |||
2231 | setCaption ( i18n( "Copying succeed." ) ); | ||
2232 | //mView->setSyncDevice("ssh-scp" ); | ||
2233 | if ( syncWithFile(localFile , true ) ) { | ||
2234 | // Event* e = mView->getLastSyncEvent(); | ||
2235 | // e->setReadOnly( false ); | ||
2236 | // e->setLocation( KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile]); | ||
2237 | // e->setReadOnly( true ); | ||
2238 | if ( KOPrefs::instance()->mWriteBackFile ) { | ||
2239 | command = "scp " + localFile +" " +remoteUser + "@" + remoteIP +":" + remoteFile ; | ||
2240 | setCaption ( i18n( "Writing back file ..." ) ); | ||
2241 | result = system ( command ); | ||
2242 | if ( result != 0 ) { | ||
2243 | int len = maxlen; | ||
2244 | while ( len < command.length() ) { | ||
2245 | command.insert( len , "\n" ); | ||
2246 | len += maxlen +2; | ||
2247 | } | ||
2248 | question = i18n("Sorry, the copy back command failed!\nCommand was:\n%1\n \nTry command on console to get more\ndetailed info about the reason.\n").arg (command) ; | ||
2249 | QMessageBox::information( this, i18n("KO/Pi Sync - ERROR"), | ||
2250 | question, | ||
2251 | i18n("Okay!")) ; | ||
2252 | setCaption ("KO/Pi"); | ||
2253 | return; | ||
2254 | } else { | ||
2255 | setCaption ( i18n( "Syncronization sucessfully completed" ) ); | ||
2256 | } | ||
2257 | } | ||
2258 | } | ||
2259 | return; | ||
2260 | #if 0 | ||
2261 | system ("scp zaurus@192.168.0.65:/home/zaurus/Applications/korganizer/mycalendar.ics /home/polo/Applications/korganizer/z_sync.ics"); | ||
2262 | while ( timer.elapsed() < 5000 ) | ||
2263 | qApp->processEvents(); | ||
2264 | |||
2265 | qDebug("MainWindow::merging) "); | ||
2266 | mView->syncCalendar( "/home/polo/Applications/korganizer/z_sync.ics", 0 ); | ||
2267 | while ( mBlockSaveFlag ) | ||
2268 | qApp->processEvents(); | ||
2269 | save(); | ||
2270 | system ("scp /home/polo/Applications/korganizer/mycalendar.ics zaurus@192.168.0.65:/home/zaurus/Applications/korganizer/mycalendar.ics"); | ||
2271 | #endif | ||
2272 | |||
2273 | } | ||
2274 | |||
2275 | 2164 | ||
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h index 4da371e..ba627b9 100644 --- a/korganizer/mainwindow.h +++ b/korganizer/mainwindow.h | |||
@@ -147,3 +147,2 @@ class MainWindow : public QMainWindow | |||
147 | void slotSyncMenu( int ); | 147 | void slotSyncMenu( int ); |
148 | void syncSSH(); | ||
149 | void confSync(); | 148 | void confSync(); |
@@ -179,3 +178,2 @@ class MainWindow : public QMainWindow | |||
179 | void enableQuick(); | 178 | void enableQuick(); |
180 | void performQuickQuick(); | ||
181 | void syncRemote( KSyncProfile* , bool ask = true); | 179 | void syncRemote( KSyncProfile* , bool ask = true); |
diff --git a/libkcal/calstorage.h b/libkcal/calstorage.h index 72972ea..82c8682 100644 --- a/libkcal/calstorage.h +++ b/libkcal/calstorage.h | |||
@@ -41,3 +41,3 @@ class CalStorage | |||
41 | virtual bool open() = 0; | 41 | virtual bool open() = 0; |
42 | virtual bool load(bool = false ) = 0; | 42 | virtual bool load( ) = 0; |
43 | virtual bool save() = 0; | 43 | virtual bool save() = 0; |
diff --git a/libkcal/filestorage.cpp b/libkcal/filestorage.cpp index 00c15d9..a139124 100644 --- a/libkcal/filestorage.cpp +++ b/libkcal/filestorage.cpp | |||
@@ -78,3 +78,3 @@ bool FileStorage::open() | |||
78 | 78 | ||
79 | bool FileStorage::load( bool quick ) | 79 | bool FileStorage::load( ) |
80 | { | 80 | { |
@@ -88,3 +88,3 @@ bool FileStorage::load( bool quick ) | |||
88 | // vCalendar file. | 88 | // vCalendar file. |
89 | ICalFormat iCal (quick ); | 89 | ICalFormat iCal; |
90 | 90 | ||
diff --git a/libkcal/filestorage.h b/libkcal/filestorage.h index e9dc15e..17010ac 100644 --- a/libkcal/filestorage.h +++ b/libkcal/filestorage.h | |||
@@ -46,3 +46,3 @@ class FileStorage : public CalStorage | |||
46 | bool open(); | 46 | bool open(); |
47 | bool load(bool quick = false ); | 47 | bool load( ); |
48 | bool save(); | 48 | bool save(); |
diff --git a/libkcal/icalformat.cpp b/libkcal/icalformat.cpp index f2e7dfc..3a2aac6 100644 --- a/libkcal/icalformat.cpp +++ b/libkcal/icalformat.cpp | |||
@@ -52,5 +52,4 @@ using namespace KCal; | |||
52 | 52 | ||
53 | ICalFormat::ICalFormat(bool quick ) | 53 | ICalFormat::ICalFormat( ) |
54 | { | 54 | { |
55 | mQuicksave = false; //quick; | ||
56 | mImpl = new ICalFormatImpl( this ); | 55 | mImpl = new ICalFormatImpl( this ); |
@@ -78,12 +77,3 @@ bool ICalFormat::load( Calendar *calendar, const QString &fileName) | |||
78 | QString text; | 77 | QString text; |
79 | #if 0 | 78 | |
80 | if ( !mQuicksave ) { | ||
81 | qDebug("KO: No quickload!"); | ||
82 | ts.setEncoding( QTextStream::Latin1 ); | ||
83 | text = ts.read(); | ||
84 | } else { | ||
85 | ts.setCodec( QTextCodec::codecForName("utf8") ); | ||
86 | text = ts.read(); | ||
87 | } | ||
88 | #endif | ||
89 | ts.setEncoding( QTextStream::Latin1 ); | 79 | ts.setEncoding( QTextStream::Latin1 ); |
@@ -116,12 +106,2 @@ bool ICalFormat::save( Calendar *calendar, const QString &fileName ) | |||
116 | 106 | ||
117 | // #ifdef DESKTOP_VERSION | ||
118 | // mQuicksave = false; | ||
119 | // #endif | ||
120 | // if ( mQuicksave ) { | ||
121 | // ts << text.utf8(); | ||
122 | // } else { | ||
123 | // ts.setEncoding( QTextStream::Latin1 ); | ||
124 | // ts << text; | ||
125 | // //ts << text.latin1(); | ||
126 | // } | ||
127 | ts.setEncoding( QTextStream::Latin1 ); | 107 | ts.setEncoding( QTextStream::Latin1 ); |
diff --git a/libkcal/icalformat.h b/libkcal/icalformat.h index 236efbf..485ab6e 100644 --- a/libkcal/icalformat.h +++ b/libkcal/icalformat.h | |||
@@ -42,3 +42,3 @@ class ICalFormat : public CalFormat { | |||
42 | /** Create new iCalendar format. */ | 42 | /** Create new iCalendar format. */ |
43 | ICalFormat( bool quick = false ); | 43 | ICalFormat( ); |
44 | virtual ~ICalFormat(); | 44 | virtual ~ICalFormat(); |
@@ -106,3 +106,2 @@ class ICalFormat : public CalFormat { | |||
106 | ICalFormatImpl *mImpl; | 106 | ICalFormatImpl *mImpl; |
107 | bool mQuicksave; | ||
108 | QString mTimeZoneId; | 107 | QString mTimeZoneId; |