summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2024-04-14 23:21:04 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2024-04-14 23:38:31 +0900
commited66240370f342229f44f538414400fb48aa6400 (patch)
tree6245fe6b360aafdb6bb108af9aac921c2057bfe9
parent3ce92a8bea328cafeac34dd79442f6b5c5e3b5d0 (diff)
downloadkrusader-ed66240370f342229f44f538414400fb48aa6400.tar.gz
krusader-ed66240370f342229f44f538414400fb48aa6400.zip
Fix compatibiliry with c++17 standard
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
-rw-r--r--krusader/UserAction/expander.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/krusader/UserAction/expander.cpp b/krusader/UserAction/expander.cpp
index a037901..4b5a745 100644
--- a/krusader/UserAction/expander.cpp
+++ b/krusader/UserAction/expander.cpp
@@ -671,10 +671,19 @@ TagString exp_Copy::expFunc( const ListPanel*, const TagStringList& parameter, c
// or transform(...) ?
KURL dest = vfs::fromPathOrURL( parameter[1].string() );
- if ( !dest.isValid() || find_if(src.constBegin(),src.constEnd(),not1(mem_fun_ref(&KURL::isValid) ))!=src.end()) {
+ if (!dest.isValid())
+ {
setError(exp, Error(Error::S_FATAL,Error::C_ARGUMENT,i18n("Expander: invalid URL's in %_Copy(\"src\", \"dest\")%") ));
return TQString();
}
+ for (const KURL &url : src)
+ {
+ if (!url.isValid())
+ {
+ setError(exp, Error(Error::S_FATAL,Error::C_ARGUMENT,i18n("Expander: invalid URL's in %_Copy(\"src\", \"dest\")%") ));
+ return TQString();
+ }
+ }
PreservingCopyJob::createCopyJob( PM_DEFAULT, src, dest, TDEIO::CopyJob::Copy, false, true );
@@ -702,9 +711,18 @@ TagString exp_Move::expFunc( const ListPanel*, const TagStringList& parameter, c
// or transform(...) ?
KURL dest = vfs::fromPathOrURL( parameter[1].string() );
- if ( !dest.isValid() || find_if(src.constBegin(),src.constEnd(),not1(mem_fun_ref(&KURL::isValid) ))!=src.end()) {
+ if (!dest.isValid())
+ {
+ setError(exp, Error(Error::S_FATAL,Error::C_ARGUMENT,i18n("Expander: invalid URL's in %_Move(\"src\", \"dest\")%") ));
+ return TQString();
+ }
+ for (const KURL &url : src)
+ {
+ if (!url.isValid())
+ {
setError(exp, Error(Error::S_FATAL,Error::C_ARGUMENT,i18n("Expander: invalid URL's in %_Move(\"src\", \"dest\")%") ));
return TQString();
+ }
}
PreservingCopyJob::createCopyJob( PM_DEFAULT, src, dest, TDEIO::CopyJob::Move, false, true );