From f8fb0a6b61511cee7d2001dd781e0bfaf934b690 Mon Sep 17 00:00:00 2001 From: tpearson Date: Tue, 24 Aug 2010 21:12:08 +0000 Subject: Moved the editor open variable out of kocore to remove accidental compilation circular dependency git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1167544 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- libkcal/resourcecached.cpp | 15 +++++++++++++++ libkcal/resourcecached.h | 3 +++ 2 files changed, 18 insertions(+) (limited to 'libkcal') 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. -- cgit v1.2.1