diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 460c52653ab0dcca6f19a4f492ed2c5e4e963ab0 (patch) | |
tree | 67208f7c145782a7e90b123b982ca78d88cc2c87 /knode/knglobals.cpp | |
download | tdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.tar.gz tdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'knode/knglobals.cpp')
-rw-r--r-- | knode/knglobals.cpp | 114 |
1 files changed, 114 insertions, 0 deletions
diff --git a/knode/knglobals.cpp b/knode/knglobals.cpp new file mode 100644 index 000000000..5238bebec --- /dev/null +++ b/knode/knglobals.cpp @@ -0,0 +1,114 @@ +/* + knglobals.h + + KNode, the KDE newsreader + Copyright (c) 1999-2004 the KNode authors. + See file AUTHORS for details + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, US +*/ + +#include "knglobals.h" + + +#include <kconfig.h> +#include <kstaticdeleter.h> + +#include "knconfigmanager.h" +#include "knnetaccess.h" +#include "knaccountmanager.h" +#include "kngroupmanager.h" +#include "knarticlemanager.h" +#include "knfiltermanager.h" +#include "knfoldermanager.h" +#include "knscoring.h" +#include "knmemorymanager.h" +#include "knmainwidget.h" +#include "knwidgets.h" + +KConfig* KNGlobals::config() +{ + if (!c_onfig) { + c_onfig = KSharedConfig::openConfig( "knoderc" ); + } + return c_onfig; +} + +KNConfigManager* KNGlobals::configManager() +{ + if (!mCfgManager) + mCfgManager = new KNConfigManager(); + return mCfgManager; +} + +KNNetAccess* KNGlobals::netAccess() +{ + if(!mNetAccess) + mNetAccess = new KNNetAccess(); + return mNetAccess; +} + +KNAccountManager* KNGlobals::accountManager() +{ + if(!mAccManager) + mAccManager = new KNAccountManager(groupManager()); + return mAccManager; +} + +KNGroupManager* KNGlobals::groupManager() +{ + if(!mGrpManager) + mGrpManager = new KNGroupManager(); + return mGrpManager; +} + +KNArticleManager* KNGlobals::articleManager() +{ + if(!mArtManager) + mArtManager = new KNArticleManager(); + return mArtManager; +} + +KNFilterManager* KNGlobals::filterManager() +{ + if (!mFilManager) + mFilManager = new KNFilterManager(); + return mFilManager; +} + +KNFolderManager* KNGlobals::folderManager() +{ + if(!mFolManager) + mFolManager = new KNFolderManager(articleManager()); + return mFolManager; +} + +KNScoringManager* KNGlobals::mScoreManager = 0; + +KNScoringManager* KNGlobals::scoringManager() +{ + static KStaticDeleter<KNScoringManager> sd; + if (!mScoreManager) + sd.setObject(mScoreManager, new KNScoringManager()); + return mScoreManager; +} + +KNMemoryManager* KNGlobals::memoryManager() +{ + if(!mMemManager) + mMemManager = new KNMemoryManager(); + return mMemManager; +} + + +void KNGlobals::setStatusMsg(const QString &text, int id) +{ + if(top) + top->setStatusMsg(text, id); +} |