summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--korganizer/Makefile.am2
-rw-r--r--korganizer/kocore.cpp12
-rw-r--r--korganizer/kocore.h3
-rw-r--r--korganizer/koeditorgeneral.cpp6
-rw-r--r--kresources/caldav/Makefile.am2
-rw-r--r--kresources/caldav/resource.cpp4
-rw-r--r--libkcal/resourcecached.cpp15
-rw-r--r--libkcal/resourcecached.h3
8 files changed, 23 insertions, 24 deletions
diff --git a/korganizer/Makefile.am b/korganizer/Makefile.am
index 8b6e4d91..c25f3c5a 100644
--- a/korganizer/Makefile.am
+++ b/korganizer/Makefile.am
@@ -14,7 +14,7 @@ INCLUDES = \
bin_PROGRAMS = korganizer
-korganizer_LDFLAGS = $(all_libraries) $(KDE_RPATH)
+korganizer_LDFLAGS = $(all_libraries) $(KDE_RPATH) -lkcal
korganizer_LDADD = libkorganizer.la
korganizer_SOURCES = main.cpp korganizer.cpp koapp.cpp
korganizer_COMPILE_FIRST = koprefs_base.h
diff --git a/korganizer/kocore.cpp b/korganizer/kocore.cpp
index d5ed4f39..b9d404e7 100644
--- a/korganizer/kocore.cpp
+++ b/korganizer/kocore.cpp
@@ -41,8 +41,6 @@
#include <tqwidget.h>
-static bool m_editoropen = false;
-
KOCore *KOCore::mSelf = 0;
KOCore *KOCore::self()
@@ -64,16 +62,6 @@ KOCore::~KOCore()
mSelf = 0;
}
-bool KOCore::editorWindowOpen()
-{
- return m_editoropen;
-}
-
-void KOCore::setEditorWindowOpen(bool open)
-{
- m_editoropen = open;
-}
-
KTrader::OfferList KOCore::availablePlugins( const TQString &type, int version )
{
TQString constraint;
diff --git a/korganizer/kocore.h b/korganizer/kocore.h
index 1d6a4ebe..f2838263 100644
--- a/korganizer/kocore.h
+++ b/korganizer/kocore.h
@@ -84,9 +84,6 @@ class KDE_EXPORT KOCore
KPIM::IdentityManager* identityManager();
- bool editorWindowOpen();
- void setEditorWindowOpen(bool open);
-
protected:
KOCore();
diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp
index 26ec5a51..816806e3 100644
--- a/korganizer/koeditorgeneral.cpp
+++ b/korganizer/koeditorgeneral.cpp
@@ -54,13 +54,13 @@
#include <libkcal/todo.h>
#include <libkcal/event.h>
+#include <libkcal/resourcecached.h>
#include <libkdepim/kdateedit.h>
#include <libkdepim/categoryselectdialog.h>
#include "koprefs.h"
#include "koglobals.h"
-#include "kocore.h"
#include "koeditorgeneral.h"
#include "koeditoralarms.h"
@@ -71,13 +71,13 @@
KOEditorGeneral::KOEditorGeneral(TQObject* parent, const char* name) :
TQObject( parent, name ), mAttachments(0)
{
- KOCore::self()->setEditorWindowOpen(true);
+ ResourceCached::setEditorWindowOpen(true);
mAlarmList.setAutoDelete( true );
}
KOEditorGeneral::~KOEditorGeneral()
{
- KOCore::self()->setEditorWindowOpen(false);
+ ResourceCached::setEditorWindowOpen(false);
}
diff --git a/kresources/caldav/Makefile.am b/kresources/caldav/Makefile.am
index 604976cd..45c0f2c7 100644
--- a/kresources/caldav/Makefile.am
+++ b/kresources/caldav/Makefile.am
@@ -15,7 +15,7 @@ libkcal_caldav_la_LDFLAGS = $(KDE_RPATH) $(all_libraries) \
libkcal_caldav_la_LIBADD = \
$(top_builddir)/libkcal/libkcal.la \
$(top_builddir)/libkdepim/libkdepim.la \
- -lcaldav -lkorganizer
+ -lcaldav
libkcal_caldav_la_COMPILE_FIRST = prefsskel.h
kde_module_LTLIBRARIES = kcal_caldav.la
diff --git a/kresources/caldav/resource.cpp b/kresources/caldav/resource.cpp
index 58ea5838..4e154202 100644
--- a/kresources/caldav/resource.cpp
+++ b/kresources/caldav/resource.cpp
@@ -38,7 +38,6 @@
#include "resource.h"
#include "reader.h"
#include "writer.h"
-#include <korganizer/kocore.h>
/*=========================================================================
| NAMESPACE
@@ -144,9 +143,6 @@ bool ResourceCalDav::isSaving() {
bool ResourceCalDav::doLoad() {
bool syncCache = true;
- // Make sure no editor windows are open
- if (KOCore::self()->editorWindowOpen() == true) return true;
-
if ((mLoadingQueueReady == false) || (mLoadingQueue.isEmpty() == false) || (mLoader->running() == true) || (isSaving() == true)) {
return true; // Silently fail; the user has obviously not responded to a dialog and we don't need to pop up more of them!
}
diff --git a/libkcal/resourcecached.cpp b/libkcal/resourcecached.cpp
index 2fecbb50..3b654aef 100644
--- a/libkcal/resourcecached.cpp
+++ b/libkcal/resourcecached.cpp
@@ -46,6 +46,8 @@
using namespace KCal;
+static bool m_editoropen = false;
+
ResourceCached::ResourceCached( const KConfig* config )
: ResourceCalendar( config ), mCalendar( TQString::fromLatin1( "UTC" ) ),
mReloadPolicy( ReloadNever ), mReloadInterval( 10 ),
@@ -584,10 +586,23 @@ void ResourceCached::disableChangeNotification()
mCalendar.unregisterObserver( this );
}
+bool ResourceCached::editorWindowOpen()
+{
+ return m_editoropen;
+}
+
+void ResourceCached::setEditorWindowOpen(bool open)
+{
+ m_editoropen = open;
+}
+
void ResourceCached::slotReload()
{
if ( !isActive() ) return;
+ // Make sure no editor windows are open
+ if (editorWindowOpen() == true) return;
+
kdDebug(5800) << "ResourceCached::slotReload()" << endl;
load();
diff --git a/libkcal/resourcecached.h b/libkcal/resourcecached.h
index efda5a23..42212272 100644
--- a/libkcal/resourcecached.h
+++ b/libkcal/resourcecached.h
@@ -66,6 +66,9 @@ class KDE_EXPORT ResourceCached : public ResourceCalendar,
void readConfig( const KConfig *config );
void writeConfig( KConfig *config );
+ static bool editorWindowOpen();
+ static void setEditorWindowOpen(bool open);
+
/**
Set reload policy. This controls when the cache is refreshed.