Commit 7b32d80a authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port some deprecated methods

parent 203ea27c
......@@ -328,7 +328,7 @@ void ArchiveProtocolBase::stat( const QUrl & url )
if ( QT_STAT( QFile::encodeName( fullPath ), &buff ) == -1 )
{
// Should not happen, as the file was already stated by checkNewFile
error( KIO::ERR_COULD_NOT_STAT, url.toDisplayString() );
error( KIO::ERR_CANNOT_STAT, url.toDisplayString() );
return;
}
......@@ -474,7 +474,7 @@ void ArchiveProtocolBase::get( const QUrl & url )
if ( read != bufferSize )
{
qCWarning(KIO_ARCHIVE_LOG) << "Read" << read << "bytes but expected" << bufferSize ;
error( KIO::ERR_COULD_NOT_READ, url.toDisplayString() );
error( KIO::ERR_CANNOT_READ, url.toDisplayString() );
delete io;
return;
}
......
......@@ -82,7 +82,7 @@ void FilterProtocol::get(const QUrl& url)
QFile localFile(url.path());
if (!localFile.open(QIODevice::ReadOnly)) {
error(KIO::ERR_COULD_NOT_READ, QString::fromLatin1(mProtocol));
error(KIO::ERR_CANNOT_READ, QString::fromLatin1(mProtocol));
return;
}
......@@ -185,7 +185,7 @@ void FilterProtocol::get(const QUrl& url)
filter->terminate();
if (bError) {
error(KIO::ERR_COULD_NOT_READ, subURL.url());
error(KIO::ERR_CANNOT_READ, subURL.url());
} else {
finished();
}
......
......@@ -290,7 +290,7 @@ void fishProtocol::openConnection() {
sendCommand(FISH_FISH);
sendCommand(FISH_VER);
if (connectionStart()) {
error(ERR_COULD_NOT_CONNECT,connectionHost);
error(ERR_CANNOT_CONNECT,connectionHost);
shutdownConnection();
return;
};
......@@ -1059,7 +1059,7 @@ void fishProtocol::manageConnection(const QString &l) {
}
recvLen = line.toLongLong(&isOk);
if (!isOk) {
error(ERR_COULD_NOT_READ,url.toDisplayString());
error(ERR_CANNOT_READ,url.toDisplayString());
shutdownConnection();
break;
}
......@@ -1078,7 +1078,7 @@ void fishProtocol::manageConnection(const QString &l) {
case FISH_RETR:
myDebug( << "reading " << recvLen);
if (recvLen == -1) {
error(ERR_COULD_NOT_READ,url.toDisplayString());
error(ERR_CANNOT_READ,url.toDisplayString());
shutdownConnection();
} else {
rawRead = recvLen;
......@@ -1105,11 +1105,11 @@ void fishProtocol::manageConnection(const QString &l) {
case FISH_STOR:
case FISH_WRITE:
case FISH_APPEND:
error(ERR_COULD_NOT_WRITE,url.toDisplayString());
error(ERR_CANNOT_WRITE,url.toDisplayString());
shutdownConnection();
break;
case FISH_RETR:
error(ERR_COULD_NOT_READ,url.toDisplayString());
error(ERR_CANNOT_READ,url.toDisplayString());
shutdownConnection();
break;
case FISH_READ:
......@@ -1122,7 +1122,7 @@ void fishProtocol::manageConnection(const QString &l) {
}
else
{
error(ERR_COULD_NOT_READ,url.toDisplayString());
error(ERR_CANNOT_READ,url.toDisplayString());
shutdownConnection();
}
break;
......@@ -1158,10 +1158,10 @@ void fishProtocol::manageConnection(const QString &l) {
if ( rc == 501 )
error(ERR_DIR_ALREADY_EXIST,url.toDisplayString());
else
error(ERR_COULD_NOT_MKDIR,url.toDisplayString());
error(ERR_CANNOT_MKDIR,url.toDisplayString());
break;
case FISH_RMD:
error(ERR_COULD_NOT_RMDIR,url.toDisplayString());
error(ERR_CANNOT_RMDIR,url.toDisplayString());
break;
case FISH_DELE:
error(ERR_CANNOT_DELETE,url.toDisplayString());
......@@ -1172,7 +1172,7 @@ void fishProtocol::manageConnection(const QString &l) {
case FISH_COPY:
case FISH_LINK:
case FISH_SYMLINK:
error(ERR_COULD_NOT_WRITE,url.toDisplayString());
error(ERR_CANNOT_WRITE,url.toDisplayString());
break;
default : break;
}
......
......@@ -855,7 +855,7 @@ void MTPSlave::fileSystemFreeSpace(const QUrl &url)
}
}
}
error(KIO::ERR_COULD_NOT_STAT, url.toDisplayString());
error(KIO::ERR_CANNOT_STAT, url.toDisplayString());
}
int MTPSlave::waitForCopyOperation(const KMTPStorageInterface *storage)
......
......@@ -128,9 +128,9 @@ void NFSSlave::openConnection()
if (m_protocol == nullptr) {
// If we could not find a compatible protocol, send an error.
if (!connectionError) {
error(KIO::ERR_COULD_NOT_CONNECT, i18n("%1: Unsupported NFS version", m_host));
error(KIO::ERR_CANNOT_CONNECT, i18n("%1: Unsupported NFS version", m_host));
} else {
error(KIO::ERR_COULD_NOT_CONNECT, m_host);
error(KIO::ERR_CANNOT_CONNECT, m_host);
}
} else {
// Otherwise we open the connection
......@@ -631,7 +631,7 @@ int NFSProtocol::openConnection(const QString& host, int prog, int vers, CLIENT*
client = clntudp_create(&server_addr, prog, vers, pertry_timeout, &sock);
if (client == nullptr) {
::close(sock);
return KIO::ERR_COULD_NOT_CONNECT;
return KIO::ERR_CANNOT_CONNECT;
}
}
......@@ -697,13 +697,13 @@ bool NFSProtocol::checkForError(int clientStat, int nfsStat, const QString& text
m_slave->error(KIO::ERR_INTERNAL_SERVER, i18n("No space left on device"));
break;
case NFSERR_ROFS:
m_slave->error(KIO::ERR_COULD_NOT_WRITE, i18n("Read only file system"));
m_slave->error(KIO::ERR_CANNOT_WRITE, i18n("Read only file system"));
break;
case NFSERR_NAMETOOLONG:
m_slave->error(KIO::ERR_INTERNAL_SERVER, i18n("Filename too long"));
break;
case NFSERR_NOTEMPTY:
m_slave->error(KIO::ERR_COULD_NOT_RMDIR, text);
m_slave->error(KIO::ERR_CANNOT_RMDIR, text);
break;
//does this mapping make sense ?
case NFSERR_DQUOT:
......
......@@ -257,7 +257,7 @@ void NFSProtocolV2::openConnection()
// Check if some exported dirs failed to mount
if (failList.size() > 0) {
m_slave->error(KIO::ERR_COULD_NOT_MOUNT, i18n("Failed to mount %1", failList.join(", ")));
m_slave->error(KIO::ERR_CANNOT_MOUNT, i18n("Failed to mount %1", failList.join(", ")));
// All exports failed to mount, fail
if (failList.size() == exportsCount) {
......@@ -1179,7 +1179,7 @@ void NFSProtocolV2::copyFrom(const QUrl& src, const QUrl& dest, int _mode, KIO::
readArgs.offset += bytesRead;
if (destFile.write(readRes.readres_u.reply.data.data_val, bytesRead) != bytesRead) {
m_slave->error(KIO::ERR_COULD_NOT_WRITE, destPath);
m_slave->error(KIO::ERR_CANNOT_WRITE, destPath);
error = true;
break;
......@@ -1364,7 +1364,7 @@ void NFSProtocolV2::copyTo(const QUrl& src, const QUrl& dest, int _mode, KIO::Jo
do {
bytesRead = srcFile.read(writeArgs.data.data_val, NFS_MAXDATA);
if (bytesRead < 0) {
m_slave->error(KIO::ERR_COULD_NOT_READ, srcPath);
m_slave->error(KIO::ERR_CANNOT_READ, srcPath);
error = true;
break;
......
......@@ -272,7 +272,7 @@ void NFSProtocolV3::openConnection()
}
}
if (failList.size() > 0) {
m_slave->error(KIO::ERR_COULD_NOT_MOUNT, i18n("Failed to mount %1", failList.join(", ")));
m_slave->error(KIO::ERR_CANNOT_MOUNT, i18n("Failed to mount %1", failList.join(", ")));
// All exports failed to mount, fail
if (failList.size() == exportsCount) {
......@@ -1433,7 +1433,7 @@ void NFSProtocolV3::copyFrom(const QUrl& src, const QUrl& dest, int _mode, KIO::
readArgs.offset += bytesRead;
if (destFile.write(readRes.READ3res_u.resok.data.data_val, bytesRead) < 0) {
m_slave->error(KIO::ERR_COULD_NOT_WRITE, destPath);
m_slave->error(KIO::ERR_CANNOT_WRITE, destPath);
error = true;
break;
......@@ -1622,7 +1622,7 @@ void NFSProtocolV3::copyTo(const QUrl& src, const QUrl& dest, int _mode, KIO::Jo
bytesRead = srcFile.read(writeArgs.data.data_val, m_writeBufferSize);
if (bytesRead < 0) {
m_slave->error(KIO::ERR_COULD_NOT_READ, srcPath);
m_slave->error(KIO::ERR_CANNOT_READ, srcPath);
error = true;
break;
......
......@@ -131,7 +131,7 @@ static int writeToFile(int fd, const char *buf, size_t len)
case ENOSPC:
return ERR_DISK_FULL;
default:
return ERR_COULD_NOT_WRITE;
return ERR_CANNOT_WRITE;
}
}
return 0;
......@@ -804,7 +804,7 @@ void sftpProtocol::openConnection()
rc = ssh_userauth_none(mSession, nullptr);
if (rc == SSH_AUTH_ERROR) {
closeConnection();
error(KIO::ERR_COULD_NOT_LOGIN, i18n("Authentication failed."));
error(KIO::ERR_CANNOT_LOGIN, i18n("Authentication failed."));
return;
}
......@@ -812,7 +812,7 @@ void sftpProtocol::openConnection()
int method = ssh_auth_list(mSession);
if (rc != SSH_AUTH_SUCCESS && method == 0) {
closeConnection();
error(KIO::ERR_COULD_NOT_LOGIN, i18n("Authentication failed. The server "
error(KIO::ERR_CANNOT_LOGIN, i18n("Authentication failed. The server "
"didn't send any authentication methods"));
return;
}
......@@ -827,7 +827,7 @@ void sftpProtocol::openConnection()
QString::fromUtf8(ssh_get_error(mSession));
closeConnection();
clearPubKeyAuthInfo();
error(KIO::ERR_COULD_NOT_LOGIN, i18n("Authentication failed."));
error(KIO::ERR_CANNOT_LOGIN, i18n("Authentication failed."));
return;
} else if (rc != SSH_AUTH_DENIED || !mPublicKeyAuthInfo || !mPublicKeyAuthInfo->isModified()) {
clearPubKeyAuthInfo();
......@@ -844,7 +844,7 @@ void sftpProtocol::openConnection()
qCDebug(KIO_SFTP_LOG) << "Public key authentication failed:" <<
QString::fromUtf8(ssh_get_error(mSession));
closeConnection();
error(KIO::ERR_COULD_NOT_LOGIN, i18n("Authentication failed."));
error(KIO::ERR_CANNOT_LOGIN, i18n("Authentication failed."));
return;
}
}
......@@ -860,7 +860,7 @@ void sftpProtocol::openConnection()
qCDebug(KIO_SFTP_LOG) << "Keyboard interactive authentication failed:"
<< QString::fromUtf8(ssh_get_error(mSession));
closeConnection();
error(KIO::ERR_COULD_NOT_LOGIN, i18n("Authentication failed."));
error(KIO::ERR_CANNOT_LOGIN, i18n("Authentication failed."));
return;
}
}
......@@ -917,7 +917,7 @@ void sftpProtocol::openConnection()
qCDebug(KIO_SFTP_LOG) << "Password authentication failed:"
<< QString::fromUtf8(ssh_get_error(mSession));
closeConnection();
error(KIO::ERR_COULD_NOT_LOGIN, i18n("Authentication failed."));
error(KIO::ERR_CANNOT_LOGIN, i18n("Authentication failed."));
return;
}
......@@ -928,7 +928,7 @@ void sftpProtocol::openConnection()
// If we're still not authenticated then we need to leave.
if (rc != SSH_AUTH_SUCCESS) {
error(KIO::ERR_COULD_NOT_LOGIN, i18n("Authentication failed."));
error(KIO::ERR_CANNOT_LOGIN, i18n("Authentication failed."));
return;
}
......@@ -937,7 +937,7 @@ void sftpProtocol::openConnection()
mSftp = sftp_new(mSession);
if (mSftp == nullptr) {
closeConnection();
error(KIO::ERR_COULD_NOT_LOGIN, i18n("Unable to request the SFTP subsystem. "
error(KIO::ERR_CANNOT_LOGIN, i18n("Unable to request the SFTP subsystem. "
"Make sure SFTP is enabled on the server."));
return;
}
......@@ -945,7 +945,7 @@ void sftpProtocol::openConnection()
qCDebug(KIO_SFTP_LOG) << "Trying to initialize the sftp session";
if (sftp_init(mSftp) < 0) {
closeConnection();
error(KIO::ERR_COULD_NOT_LOGIN, i18n("Could not initialize the SFTP session."));
error(KIO::ERR_CANNOT_LOGIN, i18n("Could not initialize the SFTP session."));
return;
}
......@@ -1102,7 +1102,7 @@ void sftpProtocol::openConnection()
rc = ssh_userauth_none(mSession, nullptr);
if (rc == SSH_AUTH_ERROR) {
closeConnection();
error(KIO::ERR_COULD_NOT_LOGIN, i18n("Authentication failed."));
error(KIO::ERR_CANNOT_LOGIN, i18n("Authentication failed."));
return;
}
......@@ -1110,7 +1110,7 @@ void sftpProtocol::openConnection()
int method = ssh_auth_list(mSession);
if (rc != SSH_AUTH_SUCCESS && method == 0) {
closeConnection();
error(KIO::ERR_COULD_NOT_LOGIN, i18n("Authentication failed. The server "
error(KIO::ERR_CANNOT_LOGIN, i18n("Authentication failed. The server "
"didn't send any authentication methods"));
return;
}
......@@ -1125,7 +1125,7 @@ void sftpProtocol::openConnection()
QString::fromUtf8(ssh_get_error(mSession));
closeConnection();
clearPubKeyAuthInfo();
error(KIO::ERR_COULD_NOT_LOGIN, i18n("Authentication failed."));
error(KIO::ERR_CANNOT_LOGIN, i18n("Authentication failed."));
return;
} else if (rc != SSH_AUTH_DENIED || !mPublicKeyAuthInfo || !mPublicKeyAuthInfo->isModified()) {
clearPubKeyAuthInfo();
......@@ -1142,7 +1142,7 @@ void sftpProtocol::openConnection()
qCDebug(KIO_SFTP_LOG) << "Public key authentication failed:" <<
QString::fromUtf8(ssh_get_error(mSession));
closeConnection();
error(KIO::ERR_COULD_NOT_LOGIN, i18n("Authentication failed."));
error(KIO::ERR_CANNOT_LOGIN, i18n("Authentication failed."));
return;
}
}
......@@ -1158,7 +1158,7 @@ void sftpProtocol::openConnection()
qCDebug(KIO_SFTP_LOG) << "Keyboard interactive authentication failed:"
<< QString::fromUtf8(ssh_get_error(mSession));
closeConnection();
error(KIO::ERR_COULD_NOT_LOGIN, i18n("Authentication failed."));
error(KIO::ERR_CANNOT_LOGIN, i18n("Authentication failed."));
return;
}
}
......@@ -1215,7 +1215,7 @@ void sftpProtocol::openConnection()
qCDebug(KIO_SFTP_LOG) << "Password authentication failed:"
<< QString::fromUtf8(ssh_get_error(mSession));
closeConnection();
error(KIO::ERR_COULD_NOT_LOGIN, i18n("Authentication failed."));
error(KIO::ERR_CANNOT_LOGIN, i18n("Authentication failed."));
return;
}
......@@ -1226,7 +1226,7 @@ void sftpProtocol::openConnection()
// If we're still not authenticated then we need to leave.
if (rc != SSH_AUTH_SUCCESS) {
error(KIO::ERR_COULD_NOT_LOGIN, i18n("Authentication failed."));
error(KIO::ERR_CANNOT_LOGIN, i18n("Authentication failed."));
return;
}
......@@ -1235,7 +1235,7 @@ void sftpProtocol::openConnection()
mSftp = sftp_new(mSession);
if (mSftp == nullptr) {
closeConnection();
error(KIO::ERR_COULD_NOT_LOGIN, i18n("Unable to request the SFTP subsystem. "
error(KIO::ERR_CANNOT_LOGIN, i18n("Unable to request the SFTP subsystem. "
"Make sure SFTP is enabled on the server."));
return;
}
......@@ -1243,7 +1243,7 @@ void sftpProtocol::openConnection()
qCDebug(KIO_SFTP_LOG) << "Trying to initialize the sftp session";
if (sftp_init(mSftp) < 0) {
closeConnection();
error(KIO::ERR_COULD_NOT_LOGIN, i18n("Could not initialize the SFTP session."));
error(KIO::ERR_CANNOT_LOGIN, i18n("Could not initialize the SFTP session."));
return;
}
......@@ -1398,7 +1398,7 @@ void sftpProtocol::open(const QUrl &url, QIODevice::OpenMode mode) {
bytesRead = sftp_read(mOpenFile, buffer.data(), bytesRequested);
if (bytesRead < 0) {
error(KIO::ERR_COULD_NOT_READ, mOpenUrl.toDisplayString());
error(KIO::ERR_CANNOT_READ, mOpenUrl.toDisplayString());
closeWithoutFinish();
return;
} else {
......@@ -1432,7 +1432,7 @@ void sftpProtocol::read(KIO::filesize_t bytes) {
if (bytesRead < 0) {
qCDebug(KIO_SFTP_LOG) << "Could not read " << mOpenUrl;
error(KIO::ERR_COULD_NOT_READ, mOpenUrl.toDisplayString());
error(KIO::ERR_CANNOT_READ, mOpenUrl.toDisplayString());
closeWithoutFinish();
return;
}
......@@ -1449,7 +1449,7 @@ void sftpProtocol::write(const QByteArray &data) {
ssize_t bytesWritten = sftp_write(mOpenFile, data.data(), data.size());
if (bytesWritten < 0) {
qCDebug(KIO_SFTP_LOG) << "Could not write to " << mOpenUrl;
error(KIO::ERR_COULD_NOT_WRITE, mOpenUrl.toDisplayString());
error(KIO::ERR_CANNOT_WRITE, mOpenUrl.toDisplayString());
closeWithoutFinish();
return;
}
......@@ -1463,7 +1463,7 @@ void sftpProtocol::seek(KIO::filesize_t offset) {
Q_ASSERT(mOpenFile != nullptr);
if (sftp_seek64(mOpenFile, static_cast<uint64_t>(offset)) < 0) {
error(KIO::ERR_COULD_NOT_SEEK, mOpenUrl.path());
error(KIO::ERR_CANNOT_SEEK, mOpenUrl.path());
closeWithoutFinish();
return;
}
......@@ -1539,7 +1539,7 @@ sftpProtocol::StatusCode sftpProtocol::sftpGet(const QUrl& url, int& errorCode,
ssize_t bytesread = sftp_read(file, mimeTypeBuf, sizeof(mimeTypeBuf));
if (bytesread < 0) {
errorCode = KIO::ERR_COULD_NOT_READ;
errorCode = KIO::ERR_CANNOT_READ;
return sftpProtocol::ServerError;
} else {
QMimeDatabase db;
......@@ -1584,7 +1584,7 @@ sftpProtocol::StatusCode sftpProtocol::sftpGet(const QUrl& url, int& errorCode,
for (;;) {
// Enqueue get requests
if (!request.enqueueChunks()) {
errorCode = KIO::ERR_COULD_NOT_READ;
errorCode = KIO::ERR_CANNOT_READ;
return sftpProtocol::ServerError;
}
......@@ -1592,7 +1592,7 @@ sftpProtocol::StatusCode sftpProtocol::sftpGet(const QUrl& url, int& errorCode,
bytesread = request.readChunks(filedata);
// Read pending get requests
if (bytesread == -1) {
errorCode = KIO::ERR_COULD_NOT_READ;
errorCode = KIO::ERR_CANNOT_READ;
return sftpProtocol::ServerError;
} else if (bytesread == 0) {
if (file->eof)
......@@ -1688,7 +1688,7 @@ sftpProtocol::StatusCode sftpProtocol::sftpPut(const QUrl& url, int permissions,
qCDebug(KIO_SFTP_LOG) << "Failed to seek to" << sbPart->size << "bytes in source file. Reason given" << strerror(errno);
sftp_attributes_free(sb);
sftp_attributes_free(sbPart);
errorCode = ERR_COULD_NOT_SEEK;
errorCode = ERR_CANNOT_SEEK;
return sftpProtocol::ClientError;
}
flags |= KIO::Resume;
......@@ -1721,7 +1721,7 @@ sftpProtocol::StatusCode sftpProtocol::sftpPut(const QUrl& url, int permissions,
char buf[MAX_XFER_BUF_SIZE]; //
result = ::read(fd, buf, sizeof(buf));
if(result < 0) {
errorCode = ERR_COULD_NOT_READ;
errorCode = ERR_CANNOT_READ;
cs = sftpProtocol::ClientError;
break;
}
......@@ -1789,7 +1789,7 @@ sftpProtocol::StatusCode sftpProtocol::sftpPut(const QUrl& url, int permissions,
ssize_t bytesWritten = sftp_write(file, buffer.data(), buffer.size());
if (bytesWritten < 0) {
errorCode = KIO::ERR_COULD_NOT_WRITE;
errorCode = KIO::ERR_CANNOT_WRITE;
result = -1;
} else {
totalBytesSent += bytesWritten;
......@@ -1826,7 +1826,7 @@ sftpProtocol::StatusCode sftpProtocol::sftpPut(const QUrl& url, int permissions,
if (sftp_close(file) < 0) {
qCWarning(KIO_SFTP_LOG) << "Error when closing file descriptor";
error(KIO::ERR_COULD_NOT_WRITE, dest_orig);
error(KIO::ERR_CANNOT_WRITE, dest_orig);
return sftpProtocol::ServerError;
}
......@@ -2004,7 +2004,7 @@ sftpProtocol::StatusCode sftpProtocol::sftpCopyGet(const QUrl& url, const QStrin
StatusCode result = sftpGet(url, errorCode, offset, fd);
if( ::close(fd) && result == sftpProtocol::Success ) {
errorCode = ERR_COULD_NOT_WRITE;
errorCode = ERR_CANNOT_WRITE;
result = sftpProtocol::ClientError;
}
......
......@@ -632,14 +632,14 @@ void SMBSlave::fileSystemFreeSpace(const QUrl& url)
// requesting free space for smb:// which doesn't
// make sense to do to begin with
if (url.host().isEmpty()) {
error(KIO::ERR_COULD_NOT_STAT, url.url());
error(KIO::ERR_CANNOT_STAT, url.url());
return;
}
SMBUrl smbcUrl = url;
int handle = smbc_opendir(smbcUrl.toSmbcUrl());
if (handle < 0) {
error(KIO::ERR_COULD_NOT_STAT, url.url());
error(KIO::ERR_CANNOT_STAT, url.url());
return;
}
......@@ -649,7 +649,7 @@ void SMBSlave::fileSystemFreeSpace(const QUrl& url)
smbc_closedir(handle);
if (err < 0) {
error(KIO::ERR_COULD_NOT_STAT, url.url());
error(KIO::ERR_CANNOT_STAT, url.url());
return;
}
......
......@@ -184,8 +184,8 @@ void SMBSlave::smbCopy(const QUrl& ksrc, const QUrl& kdst, int permissions, KIO:
n = smbc_write(dstfd, buf, n);
if(n == -1)
{
qCDebug(KIO_SMB) << "SMBSlave::copy copy now KIO::ERR_COULD_NOT_WRITE";
error( KIO::ERR_COULD_NOT_WRITE, dst.toDisplayString());
qCDebug(KIO_SMB) << "SMBSlave::copy copy now KIO::ERR_CANNOT_WRITE";
error( KIO::ERR_CANNOT_WRITE, dst.toDisplayString());
break;
}
......@@ -198,7 +198,7 @@ void SMBSlave::smbCopy(const QUrl& ksrc, const QUrl& kdst, int permissions, KIO:
}
else
{
error( KIO::ERR_COULD_NOT_READ, src.toDisplayString());
error( KIO::ERR_CANNOT_READ, src.toDisplayString());
break;
}
}
......@@ -220,7 +220,7 @@ void SMBSlave::smbCopy(const QUrl& ksrc, const QUrl& kdst, int permissions, KIO:
}
else
{
error( KIO::ERR_COULD_NOT_WRITE, dst.toDisplayString());
error( KIO::ERR_CANNOT_WRITE, dst.toDisplayString());
return;
}
}
......@@ -338,7 +338,7 @@ void SMBSlave::smbCopyGet(const QUrl& ksrc, const QUrl& kdst, int permissions, K
qCDebug(KIO_SMB) << "seeking to size" << partInfo.size();
off_t offset = smbc_lseek(srcfd, partInfo.size(), SEEK_SET);
if (offset == -1) {
error(KIO::ERR_COULD_NOT_SEEK, src.toDisplayString());
error(KIO::ERR_CANNOT_SEEK, src.toDisplayString());
smbc_close(srcfd);
return;
} else {
......@@ -364,7 +364,7 @@ void SMBSlave::smbCopyGet(const QUrl& ksrc, const QUrl& kdst, int permissions, K
const ssize_t bytesRead = smbc_read(srcfd, buf, MAX_XFER_BUF_SIZE);
if (bytesRead <= 0) {
if (bytesRead < 0) {
error( KIO::ERR_COULD_NOT_READ, src.toDisplayString());
error( KIO::ERR_CANNOT_READ, src.toDisplayString());
isErr = true;
}
break;
......@@ -372,8 +372,8 @@ void SMBSlave::smbCopyGet(const QUrl& ksrc, const QUrl& kdst, int permissions, K
const qint64 bytesWritten = file.write(buf, bytesRead);
if (bytesWritten == -1) {
qCDebug(KIO_SMB) << "copy now KIO::ERR_COULD_NOT_WRITE";
error( KIO::ERR_COULD_NOT_WRITE, kdst.toDisplayString());
qCDebug(KIO_SMB) << "copy now KIO::ERR_CANNOT_WRITE";
error( KIO::ERR_CANNOT_WRITE, kdst.toDisplayString());
isErr = true;
break;
}
......@@ -501,7 +501,7 @@ void SMBSlave::smbCopyPut(const QUrl& ksrc, const QUrl& kdst, int permissions, K
} else {
const off_t offset = smbc_lseek(dstfd, 0, SEEK_END);
if (offset == (off_t)-1) {
error(KIO::ERR_COULD_NOT_SEEK, dstUrl.toDisplayString());
error(KIO::ERR_CANNOT_SEEK, dstUrl.toDisplayString());
smbc_close(dstfd);
return;
} else {
......@@ -545,7 +545,7 @@ void SMBSlave::smbCopyPut(const QUrl& ksrc, const QUrl& kdst, int permissions, K
const ssize_t bytesRead = srcFile.read(buf, MAX_XFER_BUF_SIZE);
if (bytesRead <= 0) {
if (bytesRead < 0) {
error(KIO::ERR_COULD_NOT_READ, ksrc.toDisplayString());
error(KIO::ERR_CANNOT_READ, ksrc.toDisplayString());
isErr = true;
}
break;
......@@ -553,7 +553,7 @@ void SMBSlave::smbCopyPut(const QUrl& ksrc, const QUrl& kdst, int permissions, K
const qint64 bytesWritten = smbc_write(dstfd, buf, bytesRead);
if (bytesWritten == -1) {
error(KIO::ERR_COULD_NOT_WRITE, kdst.toDisplayString());
error(KIO::ERR_CANNOT_WRITE, kdst.toDisplayString());
isErr = true;
break;
}
......@@ -563,13 +563,13 @@ void SMBSlave::smbCopyPut(const QUrl& ksrc, const QUrl& kdst, int permissions, K
}
} else {
isErr = true;
error(KIO::ERR_COULD_NOT_SEEK, ksrc.toDisplayString());
error(KIO::ERR_CANNOT_SEEK, ksrc.toDisplayString());
}
// FINISHED
if (smbc_close(dstfd) < 0) {
qCDebug(KIO_SMB) << dstUrl << "could not write";
error( KIO::ERR_COULD_NOT_WRITE, dstUrl.toDisplayString());
error( KIO::ERR_CANNOT_WRITE, dstUrl.toDisplayString());
return;
}
......
......@@ -101,7 +101,7 @@ void SMBSlave::get( const QUrl& kurl )
}
else if(bytesread < 0)
{
error( KIO::ERR_COULD_NOT_READ, url.toDisplayString());
error( KIO::ERR_CANNOT_READ, url.toDisplayString());
return;
}
......@@ -219,7 +219,7 @@ void SMBSlave::open( const QUrl& kurl, QIODevice::OpenMode mode)
bytesRead = smbc_read(m_openFd, buffer.data(), bytesRequested);
if(bytesRead < 0)
{
error( KIO::ERR_COULD_NOT_READ, m_openUrl.toDisplayString());
error( KIO::ERR_CANNOT_READ, m_openUrl.toDisplayString());
closeWithoutFinish();
return;
}
......@@ -232,7 +232,7 @@ void SMBSlave::open( const QUrl& kurl, QIODevice::OpenMode mode)
off_t res = smbc_lseek(m_openFd, 0, SEEK_SET);
if (res == (off_t)-1) {
error(KIO::ERR_COULD_NOT_SEEK, m_openUrl.path());
error(KIO::ERR_CANNOT_SEEK, m_openUrl.path());
closeWithoutFinish();
return;
}
......@@ -257,7 +257,7 @@ void SMBSlave::read( KIO::filesize_t bytesRequested )
if(bytesRead < 0)
{