Implement a single global instance of TDEHiddenFileMatcher, available to

all applications that do not require their own class instance. Match
criteria defaults to duplicating traditional dotfile detection but
can be modifed and extended as desired.

Criteria is stored ${TDEHOME}/share/config/kdeglobals. A future TDE
control module will implemented that provides a user interface for
viewing or modifying the global match criteria default.

Signed-off-by: Vincent Reher <tde@4reher.org>
pull/178/head
Vincent Reher 3 years ago
parent 42fd81138d
commit a084db1966

@ -33,6 +33,7 @@
#include <tdeconfig.h> #include <tdeconfig.h>
#include <tdelocale.h> #include <tdelocale.h>
#include <kcharsets.h> #include <kcharsets.h>
#include <tdestringmatcher.h>
#include <kiconloader.h> #include <kiconloader.h>
#ifdef __TDE_HAVE_TDEHWLIB #ifdef __TDE_HAVE_TDEHWLIB
#include <tdehardwaredevices.h> #include <tdehardwaredevices.h>
@ -131,6 +132,16 @@ KCharsets *TDEGlobal::charsets()
return _charsets; return _charsets;
} }
TDEHiddenFileMatcher *TDEGlobal::hiddenFileMatcher()
{
if( _hiddenFileMatcher == 0 ) {
_hiddenFileMatcher = new TDEHiddenFileMatcher();
kglobal_init();
}
return _hiddenFileMatcher;
}
void TDEGlobal::setActiveInstance(TDEInstance *i) void TDEGlobal::setActiveInstance(TDEInstance *i)
{ {
_activeInstance = i; _activeInstance = i;
@ -223,6 +234,8 @@ TDEInstance *TDEGlobal::_instance = 0;
TDEInstance *TDEGlobal::_activeInstance = 0; TDEInstance *TDEGlobal::_activeInstance = 0;
TDELocale *TDEGlobal::_locale = 0; TDELocale *TDEGlobal::_locale = 0;
KCharsets *TDEGlobal::_charsets = 0; KCharsets *TDEGlobal::_charsets = 0;
TDEHiddenFileMatcher *TDEGlobal::_hiddenFileMatcher = 0;
KStaticDeleterList *TDEGlobal::_staticDeleters = 0; KStaticDeleterList *TDEGlobal::_staticDeleters = 0;
#ifdef WIN32 #ifdef WIN32

@ -30,6 +30,7 @@ class TDEHardwareDevices;
class TDEGlobalNetworkManager; class TDEGlobalNetworkManager;
#endif #endif
class TDELocale; class TDELocale;
class TDEHiddenFileMatcher;
class TDEStandardDirs; class TDEStandardDirs;
class KStaticDeleterBase; class KStaticDeleterBase;
class KStaticDeleterList; class KStaticDeleterList;
@ -107,6 +108,12 @@ public:
*/ */
static KCharsets *charsets(); static KCharsets *charsets();
/**
* The global hidden file matcher.
* @return the global hidden file matcher
*/
static TDEHiddenFileMatcher *hiddenFileMatcher();
/** /**
* Creates a static TQString. * Creates a static TQString.
* *
@ -174,6 +181,7 @@ public:
static TDEInstance *_instance; static TDEInstance *_instance;
static TDELocale *_locale; static TDELocale *_locale;
static KCharsets *_charsets; static KCharsets *_charsets;
static TDEHiddenFileMatcher *_hiddenFileMatcher;
static KStaticDeleterList *_staticDeleters; static KStaticDeleterList *_staticDeleters;
/** /**

Loading…
Cancel
Save