diff options
author | Vincent Reher <tde@4reher.org> | 2023-10-03 08:52:15 -0700 |
---|---|---|
committer | Vincent Reher <tde@4reher.org> | 2023-10-03 09:05:14 -0700 |
commit | 53a4f3cef248107cd0abfe89b9f7bc2199b7d11d (patch) | |
tree | e4fd257d78dee8cdd5e2f97b1caedb479d4b3ad9 /libkonq/update_tdestringmatcher.cpp | |
parent | 53ee298ff7d9427cee30fd1d0e89270168ef3813 (diff) | |
download | tdebase-53a4f3cef248107cd0abfe89b9f7bc2199b7d11d.tar.gz tdebase-53a4f3cef248107cd0abfe89b9f7bc2199b7d11d.zip |
Changes to bring code up to date and to synchronize with current changesissue/270/tdebase
in https://mirror.git.trinitydesktop.org/gitea/TDE/tdelibs/pulls/209.
Code now includes GUI enabling user to change TDEHiddenFileMatcher
for current KDirLister.
Signed-off-by: Vincent Reher <tde@4reher.org>
Diffstat (limited to 'libkonq/update_tdestringmatcher.cpp')
-rw-r--r-- | libkonq/update_tdestringmatcher.cpp | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/libkonq/update_tdestringmatcher.cpp b/libkonq/update_tdestringmatcher.cpp new file mode 100644 index 000000000..f46447d95 --- /dev/null +++ b/libkonq/update_tdestringmatcher.cpp @@ -0,0 +1,55 @@ +#include "update_tdestringmatcher.h" +#include "update_tdestringmatcher_dialog.h" + +#include <kdebug.h> + +UIresult +getTDEStringMatcherPatternsFromUser( + TDEStringMatcher *matcher, + TQString dialogTitle +) +{ + TDEStringMatcher::MatchSpecList matchSpecs = matcher->getMatchSpecs(); + TDEStringMatcher_UI *tsmDialog = new TDEStringMatcher_UI( matchSpecs, dialogTitle ); + tsmDialog->exec(); + UIresult requested_action; + if ( tsmDialog->result() ) { + requested_action = tsmDialog->getDialogResult(); + } + else { + requested_action = UIresult::NOCHANGE; + } + + switch ( requested_action ) { + case UIresult::NOCHANGE : + TSMTRACE + << "TDEStringMatcherUI::getMatchPropertiesFromUser: user edit cancelled" << endl; + return requested_action; + break; + case UIresult::RELOAD : + TSMTRACE + << "TDEStringMatcherUI::getMatchPropertiesFromUser: user asking caller to reload stored pattern" << endl; + return requested_action; + break; + } + + if ( matcher->setMatchSpecs( tsmDialog->getMatchSpecs() ) ) { + TSMTRACE + << "TDEStringMatcherUI::getMatchPropertiesFromUser: user edits applied: '" + << matcher->getMatchSpecString() << "'" << endl; + } + + else { + TSMTRACE + << "TDEStringMatcherUI::getMatchPropertiesFromUser: user edits rejected" << endl; + return UIresult::NOCHANGE; + } + + + if ( requested_action == UIresult::RELOAD ) { + TSMTRACE + << "TDEStringMatcherUI::getMatchPropertiesFromUser: user asking caller to save updated criteria string" << endl; + } + + return requested_action; +} |