Fix compatibiliry with c++17 standard

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit ed66240370)
r14.1.x
Michele Calgaro 7 months ago
parent 02a4efe088
commit da1694c4a9
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -671,10 +671,19 @@ TagString exp_Copy::expFunc( const ListPanel*, const TagStringList& parameter, c
// or transform(...) ? // or transform(...) ?
KURL dest = vfs::fromPathOrURL( parameter[1].string() ); 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\")%") )); setError(exp, Error(Error::S_FATAL,Error::C_ARGUMENT,i18n("Expander: invalid URL's in %_Copy(\"src\", \"dest\")%") ));
return TQString(); 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 ); 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(...) ? // or transform(...) ?
KURL dest = vfs::fromPathOrURL( parameter[1].string() ); 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\")%") )); setError(exp, Error(Error::S_FATAL,Error::C_ARGUMENT,i18n("Expander: invalid URL's in %_Move(\"src\", \"dest\")%") ));
return TQString(); return TQString();
}
} }
PreservingCopyJob::createCopyJob( PM_DEFAULT, src, dest, TDEIO::CopyJob::Move, false, true ); PreservingCopyJob::createCopyJob( PM_DEFAULT, src, dest, TDEIO::CopyJob::Move, false, true );

Loading…
Cancel
Save