diff options
Diffstat (limited to 'libkcal')
-rw-r--r-- | libkcal/resourcecached.cpp | 15 | ||||
-rw-r--r-- | libkcal/resourcecached.h | 3 |
2 files changed, 18 insertions, 0 deletions
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. |