Changeset View
Changeset View
Standalone View
Standalone View
src/ioslaves/ftp/ftp.cpp
Show First 20 Lines • Show All 1211 Lines • ▼ Show 20 Line(s) | 1211 | { | |||
---|---|---|---|---|---|
1212 | auto result = ftpOpenConnection(LoginMode::Implicit); | 1212 | auto result = ftpOpenConnection(LoginMode::Implicit); | ||
1213 | if (!result.success) { | 1213 | if (!result.success) { | ||
1214 | return result; | 1214 | return result; | ||
1215 | } | 1215 | } | ||
1216 | 1216 | | |||
1217 | // When deleting a directory, we must exit from it first | 1217 | // When deleting a directory, we must exit from it first | ||
1218 | // The last command probably went into it (to stat it) | 1218 | // The last command probably went into it (to stat it) | ||
1219 | if (!isfile) { | 1219 | if (!isfile) { | ||
1220 | (void) ftpFolder(q->remoteEncoding()->directory(url)); // ignore errors | 1220 | (void) ftpFolder(q->remoteEncoding()->decode(q->remoteEncoding()->directory(url))); // ignore errors | ||
dfaure: Should this be remoteEncoding()->decode(...) given that the method will then use q… | |||||
Yes, that makes much more sense; using remoteEncoding()->decode() makes this bit of code consistent with the reset of how the ftp ioslave handles encoding. ahmadsamir: Yes, that makes much more sense; using remoteEncoding()->decode() makes this bit of code… | |||||
1221 | } | 1221 | } | ||
1222 | 1222 | | |||
1223 | const QByteArray cmd = (isfile ? "DELE " : "RMD ") + q->remoteEncoding()->encode(url); | 1223 | const QByteArray cmd = (isfile ? "DELE " : "RMD ") + q->remoteEncoding()->encode(url); | ||
1224 | 1224 | | |||
1225 | if (!ftpSendCmd(cmd) || (m_iRespType != 2)) { | 1225 | if (!ftpSendCmd(cmd) || (m_iRespType != 2)) { | ||
1226 | return Result::fail(ERR_CANNOT_DELETE, url.path()); | 1226 | return Result::fail(ERR_CANNOT_DELETE, url.path()); | ||
1227 | } | 1227 | } | ||
1228 | 1228 | | |||
▲ Show 20 Lines • Show All 1109 Lines • ▼ Show 20 Line(s) | 2316 | { | |||
2338 | } | 2338 | } | ||
2339 | ftpCloseCommand(); // must close command! | 2339 | ftpCloseCommand(); // must close command! | ||
2340 | 2340 | | |||
2341 | return result; | 2341 | return result; | ||
2342 | } | 2342 | } | ||
2343 | 2343 | | |||
2344 | bool FtpInternal::isSocksProxyScheme(const QString &scheme) | 2344 | bool FtpInternal::isSocksProxyScheme(const QString &scheme) | ||
2345 | { | 2345 | { | ||
2346 | return scheme == "socks" || scheme == "socks5"; | 2346 | return scheme == QLatin1String("socks") || scheme == QLatin1String("socks5"); | ||
2347 | } | 2347 | } | ||
2348 | 2348 | | |||
2349 | bool FtpInternal::isSocksProxy() const | 2349 | bool FtpInternal::isSocksProxy() const | ||
2350 | { | 2350 | { | ||
2351 | return isSocksProxyScheme(m_proxyURL.scheme()); | 2351 | return isSocksProxyScheme(m_proxyURL.scheme()); | ||
2352 | } | 2352 | } | ||
2353 | 2353 | | |||
2354 | Result FtpInternal::ftpCopyPut(int &iCopyFile, const QString &sCopyFile, | 2354 | Result FtpInternal::ftpCopyPut(int &iCopyFile, const QString &sCopyFile, | ||
▲ Show 20 Lines • Show All 388 Lines • Show Last 20 Lines |
Should this be remoteEncoding()->decode(...) given that the method will then use q->remoteEncoding()->encode()?
(I'm a bit confused with kremoteencoding, I could be wrong)