summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2004-10-06 20:51:01 (UTC)
committer zautrix <zautrix>2004-10-06 20:51:01 (UTC)
commit0afcfa29ace7bc5e42a11fae44301e1e8230a376 (patch) (side-by-side diff)
treeb54f85b19ace24219be1b845469444089cacc94f /korganizer
parented4675de07d947f55d2672c721599e3a0af1e24b (diff)
downloadkdepimpi-0afcfa29ace7bc5e42a11fae44301e1e8230a376.zip
kdepimpi-0afcfa29ace7bc5e42a11fae44301e1e8230a376.tar.gz
kdepimpi-0afcfa29ace7bc5e42a11fae44301e1e8230a376.tar.bz2
some prefs cleanups
Diffstat (limited to 'korganizer') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/calendarview.cpp14
-rw-r--r--korganizer/calendarview.h2
-rw-r--r--korganizer/mainwindow.cpp1
3 files changed, 0 insertions, 17 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 38b55f7..1de2759 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -856,63 +856,49 @@ int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , b
return 0;
}
Event* CalendarView::getLastSyncEvent()
{
Event* lse;
//qDebug("CurrentSyncDevice %s ",mCurrentSyncDevice .latin1() );
lse = mCalendar->event( "last-syncEvent-"+mCurrentSyncDevice );
if (!lse) {
lse = new Event();
lse->setUid( "last-syncEvent-"+mCurrentSyncDevice );
QString sum = "";
if ( KOPrefs::instance()->mExternSyncProfiles.contains( mCurrentSyncDevice ) )
sum = "E: ";
lse->setSummary(sum+mCurrentSyncDevice + i18n(" - sync event"));
lse->setDtStart( mLastCalendarSync );
lse->setDtEnd( mLastCalendarSync.addSecs( 7200 ) );
lse->setCategories( i18n("SyncEvent") );
lse->setReadOnly( true );
mCalendar->addEvent( lse );
}
return lse;
}
-// probaly useless
-void CalendarView::setupExternSyncProfiles()
-{
- Event* lse;
- mExternLastSyncEvent.clear();
- int i;
- for ( i = 0; i < KOPrefs::instance()->mExternSyncProfiles.count(); ++i ) {
- lse = mCalendar->event( "last-syncEvent-"+ KOPrefs::instance()->mExternSyncProfiles[i] );
- if ( lse )
- mExternLastSyncEvent.append( lse );
- else
- qDebug("Last Sync event not found for %s ", KOPrefs::instance()->mExternSyncProfiles[i].latin1());
- }
-}
// we check, if the to delete event has a id for a profile
// if yes, we set this id in the profile to delete
void CalendarView::checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete )
{
if ( lastSync.count() == 0 ) {
//qDebug(" lastSync.count() == 0");
return;
}
if ( toDelete->type() == "Journal" )
return;
Event* eve = lastSync.first();
while ( eve ) {
QString id = toDelete->getID( eve->uid().mid( 15 ) ); // this is the sync profile name
if ( !id.isEmpty() ) {
QString des = eve->description();
QString pref = "e";
if ( toDelete->type() == "Todo" )
pref = "t";
des += pref+ id + ",";
eve->setReadOnly( false );
eve->setDescription( des );
//qDebug("setdes %s ", des.latin1());
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index a713c91..0f7e696 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -92,49 +92,48 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
const char *name = 0 );
CalendarView( Calendar *calendar, QWidget *parent = 0,
const char *name = 0 );
virtual ~CalendarView();
Calendar *calendar() { return mCalendar; }
KOViewManager *viewManager();
KODialogManager *dialogManager();
QDate startDate();
QDate endDate();
QWidgetStack *viewStack();
QWidget *leftFrame();
NavigatorBar *navigatorBar();
DateNavigator *dateNavigator();
KDateNavigator *dateNavigatorWidget();
void addView(KOrg::BaseView *);
void showView(KOrg::BaseView *);
KOEventViewerDialog* getEventViewerDialog();
Incidence *currentSelection();
- void setupExternSyncProfiles();
signals:
/** This todo has been modified */
void todoModified(Todo *, int);
/** when change is made to options dialog, the topwidget will catch this
* and emit this signal which notifies all widgets which have registered
* for notification to update their settings. */
void configChanged();
/** emitted when the topwidget is closing down, so that any attached
child windows can also close. */
void closingDown();
/** emitted right before we die */
void closed(QWidget *);
/** Emitted when state of modified flag changes */
void modifiedChanged(bool);
void signalmodified();
/** Emitted when state of read-only flag changes */
void readOnlyChanged(bool);
/** Emitted when the unit of navigation changes */
void changeNavStringPrev(const QString &);
@@ -523,49 +522,48 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
ResourceView *mResourceView;
// calendar object for this viewing instance
Calendar *mCalendar;
CalendarResourceManager *mResourceManager;
FileStorage *mStorage;
DateNavigator *mNavigator;
KOViewManager *mViewManager;
KODialogManager *mDialogManager;
// Calendar filters
QPtrList<CalFilter> mFilters;
// various housekeeping variables.
bool mModified; // flag indicating if calendar is modified
bool mReadOnly; // flag indicating if calendar is read-only
QDate mSaveSingleDate;
Incidence *mSelectedIncidence;
Incidence *mMoveIncidence;
- QPtrList<Event> mExternLastSyncEvent;
KOTodoView *mTodoList;
KOEventEditor * mEventEditor;
KOTodoEditor * mTodoEditor;
KOEventViewerDialog * mEventViewerDialog;
void keyPressEvent ( QKeyEvent *e) ;
//QMap<Incidence*,KOIncidenceEditor*> mDialogList;
};
class CalendarViewVisitor : public Incidence::Visitor
{
public:
CalendarViewVisitor() : mView( 0 ) {}
bool act( Incidence *incidence, CalendarView *view )
{
mView = view;
return incidence->accept( *this );
}
protected:
CalendarView *mView;
};
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index ec69b11..9104347 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -969,49 +969,48 @@ void MainWindow::fillSyncMenu()
temp->writeConfig(&config);
temp->setName( prof[1] );
temp->writeConfig(&config);
temp->setName( prof[2] );
temp->writeConfig(&config);
config.setGroup("General");
config.writeEntry("SyncProfileNames",prof);
config.writeEntry("ExternSyncProfiles","Sharp_DTM");
config.sync();
delete temp;
}
KOPrefs::instance()->mExternSyncProfiles = config.readListEntry("ExternSyncProfiles");
KOPrefs::instance()->mSyncProfileNames = prof;
int i;
for ( i = 0; i < prof.count(); ++i ) {
syncMenu->insertItem( prof[i], 1000+i );
if ( i == 2 )
syncMenu->insertSeparator();
}
QDir app_dir;
if ( !app_dir.exists(QDir::homeDirPath()+"/Applications/dtm" ) ) {
syncMenu->setItemEnabled( false , 1000 );
}
- mView->setupExternSyncProfiles();
}
int MainWindow::ringSync()
{
int syncedProfiles = 0;
int i;
QTime timer;
KConfig config ( locateLocal( "config","ksyncprofilesrc" ) );
QStringList syncProfileNames = KOPrefs::instance()->mSyncProfileNames;
KSyncProfile* temp = new KSyncProfile ();
KOPrefs::instance()->mAskForPreferences = false;
for ( i = 0; i < syncProfileNames.count(); ++i ) {
mCurrentSyncProfile = i;
temp->setName(syncProfileNames[mCurrentSyncProfile]);
temp->readConfig(&config);
if ( temp->getIncludeInRingSync() && ( i < 1 || i > 2 )) {
setCaption(i18n("Profile ")+syncProfileNames[mCurrentSyncProfile]+ i18n(" is synced ... "));
++syncedProfiles;
// KOPrefs::instance()->mAskForPreferences = temp->getAskForPreferences();
KOPrefs::instance()->mWriteBackFile = temp->getWriteBackFile();
KOPrefs::instance()->mWriteBackExistingOnly = temp->getWriteBackExisting();
KOPrefs::instance()->mWriteBackInFuture = 0;
if ( temp->getWriteBackFuture() )
KOPrefs::instance()->mWriteBackInFuture = temp->getWriteBackFutureWeeks( );