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 8b6e4d91e..c25f3c5a4 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 d5ed4f39b..b9d404e70 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 1d6a4ebe6..f28382635 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 26ec5a517..816806e3a 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 604976cd7..45c0f2c7c 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 58ea5838e..4e1542029 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 2fecbb50f..3b654aef3 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 efda5a232..42212272b 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.