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
v3.5.13-sru
tpearson 14 years ago
parent c437f19f37
commit f8fb0a6b61

@ -14,7 +14,7 @@ INCLUDES = \
bin_PROGRAMS = korganizer bin_PROGRAMS = korganizer
korganizer_LDFLAGS = $(all_libraries) $(KDE_RPATH) korganizer_LDFLAGS = $(all_libraries) $(KDE_RPATH) -lkcal
korganizer_LDADD = libkorganizer.la korganizer_LDADD = libkorganizer.la
korganizer_SOURCES = main.cpp korganizer.cpp koapp.cpp korganizer_SOURCES = main.cpp korganizer.cpp koapp.cpp
korganizer_COMPILE_FIRST = koprefs_base.h korganizer_COMPILE_FIRST = koprefs_base.h

@ -41,8 +41,6 @@
#include <tqwidget.h> #include <tqwidget.h>
static bool m_editoropen = false;
KOCore *KOCore::mSelf = 0; KOCore *KOCore::mSelf = 0;
KOCore *KOCore::self() KOCore *KOCore::self()
@ -64,16 +62,6 @@ KOCore::~KOCore()
mSelf = 0; 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 ) KTrader::OfferList KOCore::availablePlugins( const TQString &type, int version )
{ {
TQString constraint; TQString constraint;

@ -84,9 +84,6 @@ class KDE_EXPORT KOCore
KPIM::IdentityManager* identityManager(); KPIM::IdentityManager* identityManager();
bool editorWindowOpen();
void setEditorWindowOpen(bool open);
protected: protected:
KOCore(); KOCore();

@ -54,13 +54,13 @@
#include <libkcal/todo.h> #include <libkcal/todo.h>
#include <libkcal/event.h> #include <libkcal/event.h>
#include <libkcal/resourcecached.h>
#include <libkdepim/kdateedit.h> #include <libkdepim/kdateedit.h>
#include <libkdepim/categoryselectdialog.h> #include <libkdepim/categoryselectdialog.h>
#include "koprefs.h" #include "koprefs.h"
#include "koglobals.h" #include "koglobals.h"
#include "kocore.h"
#include "koeditorgeneral.h" #include "koeditorgeneral.h"
#include "koeditoralarms.h" #include "koeditoralarms.h"
@ -71,13 +71,13 @@
KOEditorGeneral::KOEditorGeneral(TQObject* parent, const char* name) : KOEditorGeneral::KOEditorGeneral(TQObject* parent, const char* name) :
TQObject( parent, name ), mAttachments(0) TQObject( parent, name ), mAttachments(0)
{ {
KOCore::self()->setEditorWindowOpen(true); ResourceCached::setEditorWindowOpen(true);
mAlarmList.setAutoDelete( true ); mAlarmList.setAutoDelete( true );
} }
KOEditorGeneral::~KOEditorGeneral() KOEditorGeneral::~KOEditorGeneral()
{ {
KOCore::self()->setEditorWindowOpen(false); ResourceCached::setEditorWindowOpen(false);
} }

@ -15,7 +15,7 @@ libkcal_caldav_la_LDFLAGS = $(KDE_RPATH) $(all_libraries) \
libkcal_caldav_la_LIBADD = \ libkcal_caldav_la_LIBADD = \
$(top_builddir)/libkcal/libkcal.la \ $(top_builddir)/libkcal/libkcal.la \
$(top_builddir)/libkdepim/libkdepim.la \ $(top_builddir)/libkdepim/libkdepim.la \
-lcaldav -lkorganizer -lcaldav
libkcal_caldav_la_COMPILE_FIRST = prefsskel.h libkcal_caldav_la_COMPILE_FIRST = prefsskel.h
kde_module_LTLIBRARIES = kcal_caldav.la kde_module_LTLIBRARIES = kcal_caldav.la

@ -38,7 +38,6 @@
#include "resource.h" #include "resource.h"
#include "reader.h" #include "reader.h"
#include "writer.h" #include "writer.h"
#include <korganizer/kocore.h>
/*========================================================================= /*=========================================================================
| NAMESPACE | NAMESPACE
@ -144,9 +143,6 @@ bool ResourceCalDav::isSaving() {
bool ResourceCalDav::doLoad() { bool ResourceCalDav::doLoad() {
bool syncCache = true; 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)) { 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! return true; // Silently fail; the user has obviously not responded to a dialog and we don't need to pop up more of them!
} }

@ -46,6 +46,8 @@
using namespace KCal; using namespace KCal;
static bool m_editoropen = false;
ResourceCached::ResourceCached( const KConfig* config ) ResourceCached::ResourceCached( const KConfig* config )
: ResourceCalendar( config ), mCalendar( TQString::fromLatin1( "UTC" ) ), : ResourceCalendar( config ), mCalendar( TQString::fromLatin1( "UTC" ) ),
mReloadPolicy( ReloadNever ), mReloadInterval( 10 ), mReloadPolicy( ReloadNever ), mReloadInterval( 10 ),
@ -584,10 +586,23 @@ void ResourceCached::disableChangeNotification()
mCalendar.unregisterObserver( this ); mCalendar.unregisterObserver( this );
} }
bool ResourceCached::editorWindowOpen()
{
return m_editoropen;
}
void ResourceCached::setEditorWindowOpen(bool open)
{
m_editoropen = open;
}
void ResourceCached::slotReload() void ResourceCached::slotReload()
{ {
if ( !isActive() ) return; if ( !isActive() ) return;
// Make sure no editor windows are open
if (editorWindowOpen() == true) return;
kdDebug(5800) << "ResourceCached::slotReload()" << endl; kdDebug(5800) << "ResourceCached::slotReload()" << endl;
load(); load();

@ -66,6 +66,9 @@ class KDE_EXPORT ResourceCached : public ResourceCalendar,
void readConfig( const KConfig *config ); void readConfig( const KConfig *config );
void writeConfig( KConfig *config ); void writeConfig( KConfig *config );
static bool editorWindowOpen();
static void setEditorWindowOpen(bool open);
/** /**
Set reload policy. This controls when the cache is refreshed. Set reload policy. This controls when the cache is refreshed.

Loading…
Cancel
Save