summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-10-05 08:07:41 (UTC)
committer zautrix <zautrix>2004-10-05 08:07:41 (UTC)
commitad859d26b813101adab963f50e694961702561d9 (patch) (side-by-side diff)
tree36eb7f12ee6ee80f50cdd13bbfaba74e9a1b37d1
parentfc2c103f45a6d4e4105259436266538c645f2c87 (diff)
downloadkdepimpi-ad859d26b813101adab963f50e694961702561d9.zip
kdepimpi-ad859d26b813101adab963f50e694961702561d9.tar.gz
kdepimpi-ad859d26b813101adab963f50e694961702561d9.tar.bz2
cleanup
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp20
-rw-r--r--korganizer/koprefs.cpp1
-rw-r--r--korganizer/koprefs.h1
-rw-r--r--korganizer/mainwindow.cpp115
-rw-r--r--korganizer/mainwindow.h2
-rw-r--r--libkcal/calstorage.h2
-rw-r--r--libkcal/filestorage.cpp4
-rw-r--r--libkcal/filestorage.h2
-rw-r--r--libkcal/icalformat.cpp24
-rw-r--r--libkcal/icalformat.h3
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
@@ -1222,5 +1222,5 @@ bool CalendarView::syncCalendar(QString filename, int mode)
storage->setFileName( filename );
// qDebug("loading ... ");
- if ( storage->load(KOPrefs::instance()->mUseQuicksave) ) {
+ if ( storage->load() ) {
getEventViewerDialog()->setSyncMode( true );
syncOK = synchronizeCalendar( mCalendar, calendar, mode );
@@ -1229,5 +1229,5 @@ bool CalendarView::syncCalendar(QString filename, int mode)
if ( KOPrefs::instance()->mWriteBackFile )
{
- storage->setSaveFormat( new ICalFormat( KOPrefs::instance()->mUseQuicksave) );
+ storage->setSaveFormat( new ICalFormat() );
storage->save();
}
@@ -1500,5 +1500,5 @@ bool CalendarView::openCalendar(QString filename, bool merge)
mStorage->setFileName( filename );
- if ( mStorage->load(KOPrefs::instance()->mUseQuicksave) ) {
+ if ( mStorage->load() ) {
if ( merge ) ;//setModified( true );
else {
@@ -1515,7 +1515,9 @@ bool CalendarView::openCalendar(QString filename, bool merge)
updateUnmanagedViews();
updateView();
- if ( filename != MainWindow::defaultFileName() )
- saveCalendar( MainWindow::defaultFileName() );
loadedFileVersion = QDateTime::currentDateTime();
+ if ( filename != MainWindow::defaultFileName() ) {
+ saveCalendar( MainWindow::defaultFileName() );
+ watchSavedFile();
+ }
return true;
} else {
@@ -1601,5 +1603,5 @@ bool CalendarView::saveCalendar( QString filename )
//mStorage->setFileName( filename );
- mStorage->setSaveFormat( new ICalFormat( KOPrefs::instance()->mUseQuicksave) );
+ mStorage->setSaveFormat( new ICalFormat() );
mStorage->setFileName( filename );
bool success;
@@ -2302,5 +2304,5 @@ void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel )
} else {
fn += ".ics";
- FileStorage storage( cal, fn, new ICalFormat( KOPrefs::instance()->mUseQuicksave) );
+ FileStorage storage( cal, fn, new ICalFormat( ) );
storage.save();
}
@@ -2857,5 +2859,5 @@ void CalendarView::action_mail()
cal_tmp.addEvent(ev);
}
- ICalFormat mForm( KOPrefs::instance()->mUseQuicksave);
+ ICalFormat mForm();
QString attachment = mForm.toString( &cal_tmp );
if (ev) delete(ev);
@@ -3142,5 +3144,5 @@ void CalendarView::exportICalendar()
if (filename.right(4) != ".ics") filename += ".ics";
- FileStorage storage( mCalendar, filename, new ICalFormat( KOPrefs::instance()->mUseQuicksave) );
+ FileStorage storage( mCalendar, filename, new ICalFormat() );
storage.save();
}
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index 0034715..e0623d5 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -225,5 +225,4 @@ KOPrefs::KOPrefs() :
addItemInt("PreferredDate",&mPreferredDate,0);
addItemBool("WeekStartsOnSunday",&mWeekStartsOnSunday,false);
- addItemBool("QuickSavingWOUnicode",&mUseQuicksave,false);
addItemBool("ShortDateInViewer",&mShortDateInViewer,false);
addItemString("UserDateFormatLong", &mUserDateFormatLong, "%A %d %b %y");
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h
index 696433e..7abd741 100644
--- a/korganizer/koprefs.h
+++ b/korganizer/koprefs.h
@@ -267,5 +267,4 @@ class KOPrefs : public KPimPrefs
bool mHightlightDateTimeEdit;
- bool mUseQuicksave;
bool mShortDateInViewer;
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 5aa75f5..43ee2d7 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -1953,6 +1953,5 @@ void MainWindow::getFile( bool success )
return;
}
- // pending adjust time for watchSavedFile()
- //mView->watchSavedFile();
+ mView->watchSavedFile();
mView->openCalendar( defaultFileName() );
setCaption( i18n("Pi-Sync successful!") );
@@ -1964,9 +1963,4 @@ void MainWindow::syncPi()
{
qApp->processEvents();
- performQuickQuick();
-}
-
-void MainWindow::performQuickQuick()
-{
bool ok;
Q_UINT16 port = KOPrefs::instance()->mActiveSyncPort.toUInt(&ok);
@@ -1980,4 +1974,5 @@ void MainWindow::performQuickQuick()
commandSocket->readFile( syncFileName() );
}
+
void MainWindow::deleteCommandSocket(KCommandSocket*s, int state)
{
@@ -2167,110 +2162,4 @@ void MainWindow::syncRemote( KSyncProfile* prof, bool ask)
return;
}
-void MainWindow::syncSSH()
-{
- // not used anymore
- QTime timer;
- timer.start();
- //qDebug("MainWindow::syncssh() ");
- KOPrefs *p = KOPrefs::instance();
- QString localFile = p->mLocalTempFile;
- QString remoteIP = p->mRemoteIP;
- QString remoteUser = p->mRemoteUser;
- QString remoteFile = p->mRemoteFile;
- if ( p->mUsePassWd && p->mRemotePassWd.length() > 0 )
- remoteUser += ":" + p->mRemotePassWd;
-
- QString question = i18n("Do you really want\nto remote sync?\n \n") +
- i18n("IP: " ) +remoteIP +"\n" +
- i18n("User: " ) + remoteUser +"\n" ;
- int maxlen = 30;
- if ( QApplication::desktop()->width() > 320 )
- maxlen += 25;
- if ( remoteFile.length() > maxlen )
- question += i18n("Remote file:\n..." ) + remoteFile.right(maxlen) +"\n";
- else
- question += i18n("Remote file:\n " ) + remoteFile +"\n";
- if ( localFile.length() > maxlen )
- question += i18n("Local temp file:\n..." ) + localFile.right(maxlen) +"\n";
- else
- question += i18n("Local temp file:\n " ) + localFile +"\n";
-
- if ( QMessageBox::information( this, i18n("KO/Pi Sync"),
- question,
- i18n("Yes"), i18n("No"),
- 0, 0 ) != 0 )
- return;
- // if ( !p->mUsePassWd ) {
- // QString pass = getPassword();
- // if ( pass.length() > 0 )
- // remoteUser += ":" + pass;
- // }
- QString command = "scp " + remoteUser + "@" + remoteIP +":" + remoteFile +" " +localFile;
- setCaption ( i18n( "Copy remote file to local machine..." ) );
- int fileSize = 0;
- int result = system ( command );
- // 0 : okay
- // 256: no such file or dir
- //
- qDebug("KO: Remote copy result(0 = okay): %d ",result );
- if ( result != 0 ) {
- int len = maxlen;
- while ( len < command.length() ) {
- command.insert( len , "\n" );
- len += maxlen +2;
- }
- 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) ;
- QMessageBox::information( this, i18n("KO/Pi Sync - ERROR"),
- question,
- i18n("Okay!")) ;
- setCaption ("KO/Pi");
- return;
- }
-
-
- setCaption ( i18n( "Copying succeed." ) );
- //mView->setSyncDevice("ssh-scp" );
- if ( syncWithFile(localFile , true ) ) {
-// Event* e = mView->getLastSyncEvent();
-// e->setReadOnly( false );
-// e->setLocation( KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile]);
-// e->setReadOnly( true );
- if ( KOPrefs::instance()->mWriteBackFile ) {
- command = "scp " + localFile +" " +remoteUser + "@" + remoteIP +":" + remoteFile ;
- setCaption ( i18n( "Writing back file ..." ) );
- result = system ( command );
- if ( result != 0 ) {
- int len = maxlen;
- while ( len < command.length() ) {
- command.insert( len , "\n" );
- len += maxlen +2;
- }
- 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) ;
- QMessageBox::information( this, i18n("KO/Pi Sync - ERROR"),
- question,
- i18n("Okay!")) ;
- setCaption ("KO/Pi");
- return;
- } else {
- setCaption ( i18n( "Syncronization sucessfully completed" ) );
- }
- }
- }
- return;
-#if 0
- system ("scp zaurus@192.168.0.65:/home/zaurus/Applications/korganizer/mycalendar.ics /home/polo/Applications/korganizer/z_sync.ics");
- while ( timer.elapsed() < 5000 )
- qApp->processEvents();
-
- qDebug("MainWindow::merging) ");
- mView->syncCalendar( "/home/polo/Applications/korganizer/z_sync.ics", 0 );
- while ( mBlockSaveFlag )
- qApp->processEvents();
- save();
- system ("scp /home/polo/Applications/korganizer/mycalendar.ics zaurus@192.168.0.65:/home/zaurus/Applications/korganizer/mycalendar.ics");
-#endif
-
-}
-
void MainWindow::syncSharp()
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h
index 4da371e..ba627b9 100644
--- a/korganizer/mainwindow.h
+++ b/korganizer/mainwindow.h
@@ -146,5 +146,4 @@ class MainWindow : public QMainWindow
void slotSyncMenu( int );
- void syncSSH();
void confSync();
void syncSharp();
@@ -178,5 +177,4 @@ class MainWindow : public QMainWindow
int mCurrentSyncProfile;
void enableQuick();
- void performQuickQuick();
void syncRemote( KSyncProfile* , bool ask = true);
bool mFlagKeyPressed;
diff --git a/libkcal/calstorage.h b/libkcal/calstorage.h
index 72972ea..82c8682 100644
--- a/libkcal/calstorage.h
+++ b/libkcal/calstorage.h
@@ -40,5 +40,5 @@ class CalStorage
virtual bool open() = 0;
- virtual bool load(bool = false ) = 0;
+ virtual bool load( ) = 0;
virtual bool save() = 0;
virtual bool close() = 0;
diff --git a/libkcal/filestorage.cpp b/libkcal/filestorage.cpp
index 00c15d9..a139124 100644
--- a/libkcal/filestorage.cpp
+++ b/libkcal/filestorage.cpp
@@ -77,5 +77,5 @@ bool FileStorage::open()
}
-bool FileStorage::load( bool quick )
+bool FileStorage::load( )
{
kdDebug(5800) << "FileStorage::load(): '" << mFileName << "'" << endl;
@@ -87,5 +87,5 @@ bool FileStorage::load( bool quick )
// Always try to load with iCalendar. It will detect, if it is actually a
// vCalendar file.
- ICalFormat iCal (quick );
+ ICalFormat iCal;
bool success = iCal.load( calendar(), mFileName);
diff --git a/libkcal/filestorage.h b/libkcal/filestorage.h
index e9dc15e..17010ac 100644
--- a/libkcal/filestorage.h
+++ b/libkcal/filestorage.h
@@ -45,5 +45,5 @@ class FileStorage : public CalStorage
bool open();
- bool load(bool quick = false );
+ bool load( );
bool save();
bool close();
diff --git a/libkcal/icalformat.cpp b/libkcal/icalformat.cpp
index f2e7dfc..3a2aac6 100644
--- a/libkcal/icalformat.cpp
+++ b/libkcal/icalformat.cpp
@@ -51,7 +51,6 @@ extern "C" {
using namespace KCal;
-ICalFormat::ICalFormat(bool quick )
+ICalFormat::ICalFormat( )
{
- mQuicksave = false; //quick;
mImpl = new ICalFormatImpl( this );
tzOffsetMin = 0;
@@ -77,14 +76,5 @@ bool ICalFormat::load( Calendar *calendar, const QString &fileName)
QTextStream ts( &file );
QString text;
-#if 0
- if ( !mQuicksave ) {
- qDebug("KO: No quickload!");
- ts.setEncoding( QTextStream::Latin1 );
- text = ts.read();
- } else {
- ts.setCodec( QTextCodec::codecForName("utf8") );
- text = ts.read();
- }
-#endif
+
ts.setEncoding( QTextStream::Latin1 );
text = ts.read();
@@ -115,14 +105,4 @@ bool ICalFormat::save( Calendar *calendar, const QString &fileName )
QTextStream ts( &file );
-// #ifdef DESKTOP_VERSION
-// mQuicksave = false;
-// #endif
-// if ( mQuicksave ) {
-// ts << text.utf8();
-// } else {
-// ts.setEncoding( QTextStream::Latin1 );
-// ts << text;
-// //ts << text.latin1();
-// }
ts.setEncoding( QTextStream::Latin1 );
ts << text;
diff --git a/libkcal/icalformat.h b/libkcal/icalformat.h
index 236efbf..485ab6e 100644
--- a/libkcal/icalformat.h
+++ b/libkcal/icalformat.h
@@ -41,5 +41,5 @@ class ICalFormat : public CalFormat {
public:
/** Create new iCalendar format. */
- ICalFormat( bool quick = false );
+ ICalFormat( );
virtual ~ICalFormat();
@@ -105,5 +105,4 @@ class ICalFormat : public CalFormat {
private:
ICalFormatImpl *mImpl;
- bool mQuicksave;
QString mTimeZoneId;
QCString mTzString;