diff options
author | Vincent Reher <tde@4reher.org> | 2023-06-22 09:22:42 -0700 |
---|---|---|
committer | Vincent Reher <tde@4reher.org> | 2023-10-02 11:22:04 -0700 |
commit | a39403fb8be586e9b9e4b326616156fbfed27c6c (patch) | |
tree | 85f7bf35279604d3c648d7fe0521890e2ee5283d /tdecore/tdeglobal.cpp | |
parent | 4c0dae60b2fbc60996fc8f4bd29ee6219b869527 (diff) | |
download | tdelibs-a39403fb8be586e9b9e4b326616156fbfed27c6c.tar.gz tdelibs-a39403fb8be586e9b9e4b326616156fbfed27c6c.zip |
This new branch is a follow-up to the latest and
final commit to branch issue/270/tdelibs-V3.
It includes the following files that were mistakenly
omitted in that commit:
tdecore/CMakeLists.txt
tdecore/README.tdestringmatcher
tdecore/tdeglobal.cpp
tdecore/tdeglobal.h
tdecore/tdestringmatcher.cpp
tdecore/tdestringmatcher.h
tdeio/tdeio/tdefileitem.cpp
tdeio/tdeio/tdefileitem.h
It also includes updates to the following files, some
of which are based on recent feedback from @MicheleC:
tdecore/tequivchars-mapping.h
tdecore/tequivchars.cpp
tdecore/tequivchars.h
Signed-off-by: Vincent Reher <tde@4reher.org>
Diffstat (limited to 'tdecore/tdeglobal.cpp')
-rw-r--r-- | tdecore/tdeglobal.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tdecore/tdeglobal.cpp b/tdecore/tdeglobal.cpp index 09f496034..03f39ac80 100644 --- a/tdecore/tdeglobal.cpp +++ b/tdecore/tdeglobal.cpp @@ -33,6 +33,8 @@ #include <tdeconfig.h> #include <tdelocale.h> #include <kcharsets.h> +#include <tequivchars.h> +#include <tdestringmatcher.h> #include <kiconloader.h> #ifdef __TDE_HAVE_TDEHWLIB #include <tdehardwaredevices.h> @@ -131,6 +133,32 @@ KCharsets *TDEGlobal::charsets() return _charsets; } +TEquivChars *TDEGlobal::equivChars() +{ + if( _equivChars == 0 ) { + _equivChars = new TEquivChars(); + } + return _equivChars; +} + +TDEStringMatcher *TDEGlobal::hiddenFileMatcher() +{ + if( _hiddenFileMatcher == 0 ) { + //-Debug: TSMTRACE << "TDEGlobal::hiddenFileMatcher(): Global HFM initialization STARTED" << endl; + _hiddenFileMatcher = new TDEStringMatcher(); + TDEGlobal::config()->setGroup( "General" ); + const char* settingsDefault = "wc=\t.*"; // wildcard match of dotfiles + // CAUTION: for economy of expression, we are leveraging our insider knowledge + // that TSM::StringDivider is defined as '\t' instead of more properly doing this: + // char settingsDefault[5] = { 'w', TSM::StringDivider, '.', '*', 0 }; + TQString settings = TDEGlobal::config()->readEntry( "globalHiddenFileSpec", settingsDefault ); + //-Debug: TSMTRACE << "TDEGlobal::hiddenFileMatcher(): using retrieved patternString = '" << settings << "'" << endl; + _hiddenFileMatcher->setMatchSpecs( settings ); + } + + return _hiddenFileMatcher; +} + void TDEGlobal::setActiveInstance(TDEInstance *i) { _activeInstance = i; @@ -223,6 +251,9 @@ TDEInstance *TDEGlobal::_instance = 0; TDEInstance *TDEGlobal::_activeInstance = 0; TDELocale *TDEGlobal::_locale = 0; KCharsets *TDEGlobal::_charsets = 0; +TEquivChars *TDEGlobal::_equivChars = 0; +TDEStringMatcher *TDEGlobal::_hiddenFileMatcher = 0; + KStaticDeleterList *TDEGlobal::_staticDeleters = 0; #ifdef WIN32 |