From kde-commits Mon Mar 31 22:29:06 2014 From: Alex Merry Date: Mon, 31 Mar 2014 22:29:06 +0000 To: kde-commits Subject: [kio] src: Use the new name for the error codes Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=139630495718093 Git commit 173cdf21221c5dc91c0afe4205c6d3db28a76559 by Alex Merry. Committed on 30/03/2014 at 22:37. Pushed by alexmerry into branch 'master'. Use the new name for the error codes ERR_COULD_NOT_* has been replaced with ERR_CANNOT_*. REVIEW: 117195 M +30 -30 src/core/job_error.cpp M +1 -1 src/core/slavebase.h M +2 -2 src/core/tcpslavebase.cpp M +18 -18 src/ioslaves/file/file.cpp M +4 -4 src/ioslaves/file/file_unix.cpp M +20 -20 src/ioslaves/ftp/ftp.cpp M +1 -1 src/ioslaves/help/kio_help.cpp M +3 -3 src/ioslaves/http/http.cpp M +4 -4 src/widgets/accessmanagerreply_p.cpp http://commits.kde.org/kio/173cdf21221c5dc91c0afe4205c6d3db28a76559 diff --git a/src/core/job_error.cpp b/src/core/job_error.cpp index 1ec28c5..1551959 100644 --- a/src/core/job_error.cpp +++ b/src/core/job_error.cpp @@ -97,10 +97,10 @@ KIOCORE_EXPORT QString KIO::buildErrorString(int errorC= ode, const QString &error case KIO::ERR_CYCLIC_COPY: result =3D i18n("Found a cyclic link while copying %1.", errorTex= t); break; - case KIO::ERR_COULD_NOT_CREATE_SOCKET: + case KIO::ERR_CANNOT_CREATE_SOCKET: result =3D i18n("Could not create socket for accessing %1.", erro= rText); break; - case KIO::ERR_COULD_NOT_CONNECT: + case KIO::ERR_CANNOT_CONNECT: result =3D i18n("Could not connect to host %1.", errorText.isEmpt= y() ? QLatin1String("localhost") : errorText); break; case KIO::ERR_CONNECTION_BROKEN: @@ -109,40 +109,40 @@ KIOCORE_EXPORT QString KIO::buildErrorString(int erro= rCode, const QString &error case KIO::ERR_NOT_FILTER_PROTOCOL: result =3D i18n("The protocol %1 is not a filter protocol.", erro= rText); break; - case KIO::ERR_COULD_NOT_MOUNT: + case KIO::ERR_CANNOT_MOUNT: result =3D i18n("Could not mount device.\nThe reported error was:\= n%1", errorText); break; - case KIO::ERR_COULD_NOT_UNMOUNT: + case KIO::ERR_CANNOT_UNMOUNT: result =3D i18n("Could not unmount device.\nThe reported error was= :\n%1", errorText); break; - case KIO::ERR_COULD_NOT_READ: + case KIO::ERR_CANNOT_READ: result =3D i18n("Could not read file %1.", errorText); break; - case KIO::ERR_COULD_NOT_WRITE: + case KIO::ERR_CANNOT_WRITE: result =3D i18n("Could not write to file %1.", errorText); break; - case KIO::ERR_COULD_NOT_BIND: + case KIO::ERR_CANNOT_BIND: result =3D i18n("Could not bind %1.", errorText); break; - case KIO::ERR_COULD_NOT_LISTEN: + case KIO::ERR_CANNOT_LISTEN: result =3D i18n("Could not listen %1.", errorText); break; - case KIO::ERR_COULD_NOT_ACCEPT: + case KIO::ERR_CANNOT_ACCEPT: result =3D i18n("Could not accept %1.", errorText); break; - case KIO::ERR_COULD_NOT_LOGIN: + case KIO::ERR_CANNOT_LOGIN: result =3D errorText; break; - case KIO::ERR_COULD_NOT_STAT: + case KIO::ERR_CANNOT_STAT: result =3D i18n("Could not access %1.", errorText); break; - case KIO::ERR_COULD_NOT_CLOSEDIR: + case KIO::ERR_CANNOT_CLOSEDIR: result =3D i18n("Could not terminate listing %1.", errorText); break; - case KIO::ERR_COULD_NOT_MKDIR: + case KIO::ERR_CANNOT_MKDIR: result =3D i18n("Could not make folder %1.", errorText); break; - case KIO::ERR_COULD_NOT_RMDIR: + case KIO::ERR_CANNOT_RMDIR: result =3D i18n("Could not remove folder %1.", errorText); break; case KIO::ERR_CANNOT_RESUME: @@ -169,7 +169,7 @@ KIOCORE_EXPORT QString KIO::buildErrorString(int errorC= ode, const QString &error case KIO::ERR_UNKNOWN_PROXY_HOST: result =3D i18n("Unknown proxy host\n%1", errorText); break; - case KIO::ERR_COULD_NOT_AUTHENTICATE: + case KIO::ERR_CANNOT_AUTHENTICATE: result =3D i18n("Authorization failed, %1 authentication not suppo= rted", errorText); break; case KIO::ERR_ABORTED: @@ -594,7 +594,7 @@ KIOCORE_EXPORT QByteArray KIO::rawErrorDetail(int error= Code, const QString &erro "cause an infinite loop, and try again.") << sSy= sadmin; break; = - case KIO::ERR_COULD_NOT_CREATE_SOCKET: + case KIO::ERR_CANNOT_CREATE_SOCKET: errorName =3D i18n("Could Not Create Network Connection"); techName =3D i18n("Could Not Create Socket"); description =3D i18n("This is a fairly technical error in which a = required " @@ -604,7 +604,7 @@ KIOCORE_EXPORT QByteArray KIO::rawErrorDetail(int error= Code, const QString &erro solutions << sNetwork << sSysadmin; break; = - case KIO::ERR_COULD_NOT_CONNECT: + case KIO::ERR_CANNOT_CONNECT: errorName =3D i18n("Connection to Server Refused"); description =3D i18n("The server %1 refused to al= low this " "computer to make a connection.", host); @@ -643,7 +643,7 @@ KIOCORE_EXPORT QByteArray KIO::rawErrorDetail(int error= Code, const QString &erro solutions << sTypo << sSysadmin; break; = - case KIO::ERR_COULD_NOT_MOUNT: + case KIO::ERR_CANNOT_MOUNT: errorName =3D i18n("Unable to Initialize Input/Output Device"); techName =3D i18n("Could Not Mount Device"); description =3D i18n("The requested device could not be initialize= d " @@ -662,7 +662,7 @@ KIOCORE_EXPORT QByteArray KIO::rawErrorDetail(int error= Code, const QString &erro "on.; and try again.") << sAccess << sSysadmin; break; = - case KIO::ERR_COULD_NOT_UNMOUNT: + case KIO::ERR_CANNOT_UNMOUNT: errorName =3D i18n("Unable to Uninitialize Input/Output Device"); techName =3D i18n("Could Not Unmount Device"); description =3D i18n("The requested device could not be uninitiali= zed " @@ -680,7 +680,7 @@ KIOCORE_EXPORT QByteArray KIO::rawErrorDetail(int error= Code, const QString &erro "and try again.") << sAccess << sSysadmin; break; = - case KIO::ERR_COULD_NOT_READ: + case KIO::ERR_CANNOT_READ: errorName =3D i18n("Cannot Read From Resource"); description =3D i18n("This means that although the resource, " "%1, was able to be opened, an= error occurred while " @@ -697,7 +697,7 @@ KIOCORE_EXPORT QByteArray KIO::rawErrorDetail(int error= Code, const QString &erro solutions << sSysadmin; break; = - case KIO::ERR_COULD_NOT_WRITE: + case KIO::ERR_CANNOT_WRITE: errorName =3D i18n("Cannot Write to Resource"); description =3D i18n("This means that although the resource, %1" ", was able to be opened, an error occurred whi= le writing to the resource.", @@ -714,7 +714,7 @@ KIOCORE_EXPORT QByteArray KIO::rawErrorDetail(int error= Code, const QString &erro solutions << sSysadmin; break; = - case KIO::ERR_COULD_NOT_BIND: + case KIO::ERR_CANNOT_BIND: errorName =3D i18n("Could Not Listen for Network Connections"); techName =3D i18n("Could Not Bind"); description =3D i18n("This is a fairly technical error in which a = required " @@ -725,7 +725,7 @@ KIOCORE_EXPORT QByteArray KIO::rawErrorDetail(int error= Code, const QString &erro solutions << sNetwork << sSysadmin; break; = - case KIO::ERR_COULD_NOT_LISTEN: + case KIO::ERR_CANNOT_LISTEN: errorName =3D i18n("Could Not Listen for Network Connections"); techName =3D i18n("Could Not Listen"); description =3D i18n("This is a fairly technical error in which a = required " @@ -736,7 +736,7 @@ KIOCORE_EXPORT QByteArray KIO::rawErrorDetail(int error= Code, const QString &erro solutions << sNetwork << sSysadmin; break; = - case KIO::ERR_COULD_NOT_ACCEPT: + case KIO::ERR_CANNOT_ACCEPT: errorName =3D i18n("Could Not Accept Network Connection"); description =3D i18n("This is a fairly technical error in which an= error " "occurred while attempting to accept an incomin= g network connection."); @@ -746,7 +746,7 @@ KIOCORE_EXPORT QByteArray KIO::rawErrorDetail(int error= Code, const QString &erro solutions << sNetwork << sSysadmin; break; = - case KIO::ERR_COULD_NOT_LOGIN: + case KIO::ERR_CANNOT_LOGIN: errorName =3D i18n("Could Not Login: %1", errorText); description =3D i18n("An attempt to login to perform the requested= " "operation was unsuccessful."); @@ -758,7 +758,7 @@ KIOCORE_EXPORT QByteArray KIO::rawErrorDetail(int error= Code, const QString &erro "are entered correctly.") << sServeradmin << sSy= sadmin; break; = - case KIO::ERR_COULD_NOT_STAT: + case KIO::ERR_CANNOT_STAT: errorName =3D i18n("Could Not Determine Resource Status"); techName =3D i18n("Could Not Stat Resource"); description =3D i18n("An attempt to determine information about th= e status " @@ -770,13 +770,13 @@ KIOCORE_EXPORT QByteArray KIO::rawErrorDetail(int err= orCode, const QString &erro "are entered correctly.") << sSysadmin; break; = - case KIO::ERR_COULD_NOT_CLOSEDIR: + case KIO::ERR_CANNOT_CLOSEDIR: //result =3D i18n( "Could not terminate listing %1" ).arg( errorTe= xt ); errorName =3D i18n("Could Not Cancel Listing"); techName =3D i18n("FIXME: Document this"); break; = - case KIO::ERR_COULD_NOT_MKDIR: + case KIO::ERR_CANNOT_MKDIR: errorName =3D i18n("Could Not Create Folder"); description =3D i18n("An attempt to create the requested folder fa= iled."); causes << cAccess << i18n("The location where the folder was to be= created " @@ -787,7 +787,7 @@ KIOCORE_EXPORT QByteArray KIO::rawErrorDetail(int error= Code, const QString &erro solutions << i18n("Retry the request.") << sAccess; break; = - case KIO::ERR_COULD_NOT_RMDIR: + case KIO::ERR_CANNOT_RMDIR: errorName =3D i18n("Could Not Remove Folder"); description =3D i18n("An attempt to remove the specified folder, " "%1, failed.", path); @@ -879,7 +879,7 @@ KIOCORE_EXPORT QByteArray KIO::rawErrorDetail(int error= Code, const QString &erro << sSysadmin; break; = - case KIO::ERR_COULD_NOT_AUTHENTICATE: + case KIO::ERR_CANNOT_AUTHENTICATE: errorName =3D i18n("Authentication Failed: Method %1 Not Supported= ", errorText); description =3D i18n("Although you may have supplied the correct " diff --git a/src/core/slavebase.h b/src/core/slavebase.h index 4726915..7417c5e 100644 --- a/src/core/slavebase.h +++ b/src/core/slavebase.h @@ -480,7 +480,7 @@ public: * @param url path to the directory to create * @param permissions the permissions to set after creating the direct= ory * (-1 if no permissions to be set) - * The slave emits ERR_COULD_NOT_MKDIR if failure. + * The slave emits ERR_CANNOT_MKDIR if failure. */ virtual void mkdir(const QUrl &url, int permissions); = diff --git a/src/core/tcpslavebase.cpp b/src/core/tcpslavebase.cpp index ea0434e..07115ea 100644 --- a/src/core/tcpslavebase.cpp +++ b/src/core/tcpslavebase.cpp @@ -384,7 +384,7 @@ int TCPSlaveBase::connectToHost(const QString &host, qu= int16 port, QString *erro case KTcpSocket::HostNotFoundError: return ERR_UNKNOWN_HOST; default: - return ERR_COULD_NOT_CONNECT; + return ERR_CANNOT_CONNECT; } } = @@ -420,7 +420,7 @@ int TCPSlaveBase::connectToHost(const QString &host, qu= int16 port, QString *erro if (errorString) { *errorString =3D i18nc("%1 is a host name", "%1: SSL n= egotiation failed", host); } - return ERR_COULD_NOT_CONNECT; + return ERR_CANNOT_CONNECT; } } // If the SSL handshake was done with anything protocol other than= the default, diff --git a/src/ioslaves/file/file.cpp b/src/ioslaves/file/file.cpp index 6387d7f..a642a52 100644 --- a/src/ioslaves/file/file.cpp +++ b/src/ioslaves/file/file.cpp @@ -271,7 +271,7 @@ void FileProtocol::mkdir(const QUrl &url, int permissio= ns) if (QT_LSTAT(QFile::encodeName(path).constData(), &buff) =3D=3D -1) { if (!QDir().mkdir(path)) { //TODO: add access denied & disk full (or another reasons) han= dling (into Qt, possibly) - error(KIO::ERR_COULD_NOT_MKDIR, path); + error(KIO::ERR_CANNOT_MKDIR, path); return; } else { if (permissions !=3D -1) { @@ -367,7 +367,7 @@ void FileProtocol::get(const QUrl &url) if (errno =3D=3D EINTR) { continue; } - error(KIO::ERR_COULD_NOT_READ, path); + error(KIO::ERR_CANNOT_READ, path); f.close(); return; } @@ -459,7 +459,7 @@ void FileProtocol::read(KIO::filesize_t bytes) // empty array designates eof data(QByteArray()); if (!mFile->atEnd()) { - error(KIO::ERR_COULD_NOT_READ, mFile->fileName()); + error(KIO::ERR_CANNOT_READ, mFile->fileName()); close(); } break; @@ -481,7 +481,7 @@ void FileProtocol::write(const QByteArray &data) close(); } else { qWarning() << "Couldn't write. Error:" << mFile->errorString(); - error(KIO::ERR_COULD_NOT_WRITE, mFile->fileName()); + error(KIO::ERR_CANNOT_WRITE, mFile->fileName()); close(); } } else { @@ -497,7 +497,7 @@ void FileProtocol::seek(KIO::filesize_t offset) if (mFile->seek(offset)) { position(offset); } else { - error(KIO::ERR_COULD_NOT_SEEK, mFile->fileName()); + error(KIO::ERR_CANNOT_SEEK, mFile->fileName()); close(); } } @@ -618,7 +618,7 @@ void FileProtocol::put(const QUrl &url, int _mode, KIO:= :JobFlags _flags) result =3D -2; // means: remove dest file } else { qWarning() << "Couldn't write. Error:" << f.errorStrin= g(); - error(KIO::ERR_COULD_NOT_WRITE, dest_orig); + error(KIO::ERR_CANNOT_WRITE, dest_orig); result =3D -1; } } @@ -653,7 +653,7 @@ void FileProtocol::put(const QUrl &url, int _mode, KIO:= :JobFlags _flags) = if (f.error() !=3D QFile::NoError) { qWarning() << "Error when closing file descriptor:" << f.errorStri= ng(); - error(KIO::ERR_COULD_NOT_WRITE, dest_orig); + error(KIO::ERR_CANNOT_WRITE, dest_orig); return; } = @@ -886,7 +886,7 @@ void FileProtocol::mount(bool _ro, const char *_fstype,= const QString &_dev, con if (volmgt_check(devname.data()) =3D=3D 0) { // qDebug() << "VOLMGT: no media in " << devname.data(); err =3D i18n("No Media inserted or Media not recognized."); - error(KIO::ERR_COULD_NOT_MOUNT, err); + error(KIO::ERR_CANNOT_MOUNT, err); return; } else { // qDebug() << "VOLMGT: " << devname.data() << ": media ok"; @@ -896,7 +896,7 @@ void FileProtocol::mount(bool _ro, const char *_fstype,= const QString &_dev, con } else { err =3D i18n("\"vold\" is not running."); // qDebug() << "VOLMGT: " << err; - error(KIO::ERR_COULD_NOT_MOUNT, err); + error(KIO::ERR_CANNOT_MOUNT, err); return; } #else @@ -927,7 +927,7 @@ void FileProtocol::mount(bool _ro, const char *_fstype,= const QString &_dev, con mountProg =3D QStandardPaths::findExecutable(QLatin1String("mount"= ), fallbackSystemPath()).toLocal8Bit(); } if (mountProg.isEmpty()) { - error(KIO::ERR_COULD_NOT_MOUNT, i18n("Could not find program \"mou= nt\"")); + error(KIO::ERR_CANNOT_MOUNT, i18n("Could not find program \"mount\= "")); return; } = @@ -987,7 +987,7 @@ void FileProtocol::mount(bool _ro, const char *_fstype,= const QString &_dev, con // different devices, well they shouldn't specify the // mountpoint but just the device. } else { - error(KIO::ERR_COULD_NOT_MOUNT, err); + error(KIO::ERR_CANNOT_MOUNT, err); return; } } @@ -997,7 +997,7 @@ void FileProtocol::mount(bool _ro, const char *_fstype,= const QString &_dev, con #else QString err; err =3D i18n("mounting is not supported by wince."); - error(KIO::ERR_COULD_NOT_MOUNT, err); + error(KIO::ERR_CANNOT_MOUNT, err); #endif = } @@ -1029,7 +1029,7 @@ void FileProtocol::unmount(const QString &_point) if ((mnttab =3D QT_FOPEN(MNTTAB, "r")) =3D=3D NULL) { err =3D QLatin1String("could not open mnttab"); // qDebug() << "VOLMGT: " << err; - error(KIO::ERR_COULD_NOT_UNMOUNT, err); + error(KIO::ERR_CANNOT_UNMOUNT, err); return; } = @@ -1054,7 +1054,7 @@ void FileProtocol::unmount(const QString &_point) // qDebug() << "VOLMGT: " << QFile::encodeName(_point).data() << ": " << err; - error(KIO::ERR_COULD_NOT_UNMOUNT, err); + error(KIO::ERR_CANNOT_UNMOUNT, err); return; } = @@ -1092,7 +1092,7 @@ void FileProtocol::unmount(const QString &_point) */ err =3D i18n("\"vold\" is not running."); // qDebug() << "VOLMGT: " << err; - error(KIO::ERR_COULD_NOT_UNMOUNT, err); + error(KIO::ERR_CANNOT_UNMOUNT, err); return; } #else @@ -1101,7 +1101,7 @@ void FileProtocol::unmount(const QString &_point) umountProg =3D QStandardPaths::findExecutable(QLatin1String("umoun= t"), fallbackSystemPath()).toLocal8Bit(); } if (umountProg.isEmpty()) { - error(KIO::ERR_COULD_NOT_UNMOUNT, i18n("Could not find program \"u= mount\"")); + error(KIO::ERR_CANNOT_UNMOUNT, i18n("Could not find program \"umou= nt\"")); return; } buffer =3D umountProg + ' ' + QFile::encodeName(KShell::quoteArg(_poin= t)) + " 2>" + tmpFileName; @@ -1112,12 +1112,12 @@ void FileProtocol::unmount(const QString &_point) if (err.isEmpty()) { finished(); } else { - error(KIO::ERR_COULD_NOT_UNMOUNT, err); + error(KIO::ERR_CANNOT_UNMOUNT, err); } #else QString err; err =3D i18n("unmounting is not supported by wince."); - error(KIO::ERR_COULD_NOT_MOUNT, err); + error(KIO::ERR_CANNOT_MOUNT, err); #endif } = diff --git a/src/ioslaves/file/file_unix.cpp b/src/ioslaves/file/file_unix.= cpp index bb4d600..d405789 100644 --- a/src/ioslaves/file/file_unix.cpp +++ b/src/ioslaves/file/file_unix.cpp @@ -196,7 +196,7 @@ void FileProtocol::copy(const QUrl &srcUrl, const QUrl = &destUrl, } } else #endif - error(KIO::ERR_COULD_NOT_READ, src); + error(KIO::ERR_CANNOT_READ, src); src_file.close(); dest_file.close(); #if HAVE_POSIX_ACL @@ -218,7 +218,7 @@ void FileProtocol::copy(const QUrl &srcUrl, const QUrl = &destUrl, remove(_dest.data()); } else { qWarning() << "Couldn't write[2]. Error:" << dest_file= .errorString(); - error(KIO::ERR_COULD_NOT_WRITE, dest); + error(KIO::ERR_CANNOT_WRITE, dest); } #if HAVE_POSIX_ACL if (acl) { @@ -239,7 +239,7 @@ void FileProtocol::copy(const QUrl &srcUrl, const QUrl = &destUrl, = if (dest_file.error() !=3D QFile::NoError) { qWarning() << "Error when closing file descriptor[2]:" << dest_fil= e.errorString(); - error(KIO::ERR_COULD_NOT_WRITE, dest); + error(KIO::ERR_CANNOT_WRITE, dest); #if HAVE_POSIX_ACL if (acl) { acl_free(acl); @@ -534,7 +534,7 @@ void FileProtocol::del(const QUrl &url, bool isfile) error(KIO::ERR_ACCESS_DENIED, path); } else { // qDebug() << "could not rmdir " << perror; - error(KIO::ERR_COULD_NOT_RMDIR, path); + error(KIO::ERR_CANNOT_RMDIR, path); return; } } diff --git a/src/ioslaves/ftp/ftp.cpp b/src/ioslaves/ftp/ftp.cpp index 4903770..79f6144 100644 --- a/src/ioslaves/ftp/ftp.cpp +++ b/src/ioslaves/ftp/ftp.cpp @@ -134,7 +134,7 @@ static // JPF: in ftp.cc we make it static * This helper handles some special issues (blocking and interrupted * system call) when writing to a file handle. * - * @return 0 on success or an error code on failure (ERR_COULD_NOT_WRITE, + * @return 0 on success or an error code on failure (ERR_CANNOT_WRITE, * ERR_DISK_FULL, ERR_CONNECTION_BROKEN). */ int WriteToFile(int fd, const char *buf, size_t len) @@ -151,7 +151,7 @@ int WriteToFile(int fd, const char *buf, size_t len) case EINTR: continue; case EPIPE: return ERR_CONNECTION_BROKEN; case ENOSPC: return ERR_DISK_FULL; - default: return ERR_COULD_NOT_WRITE; + default: return ERR_CANNOT_WRITE; } } return 0; @@ -419,7 +419,7 @@ bool Ftp::ftpOpenControlConnection() = if (!supportedProxyScheme(scheme)) { // TODO: Need a new error code to indicate unsupported URL sch= eme. - errorCode =3D ERR_COULD_NOT_CONNECT; + errorCode =3D ERR_CANNOT_CONNECT; errorMessage =3D url.toString(); continue; } @@ -461,7 +461,7 @@ bool Ftp::ftpOpenControlConnection(const QString &host,= int port) m_control =3D synchronousConnectToHost(host, port); connect(m_control, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QA= uthenticator*)), this, SLOT(proxyAuthentication(QNetworkProxy,QAuthenticator*))= ); - int iErrorCode =3D m_control->state() =3D=3D QAbstractSocket::Connecte= dState ? 0 : ERR_COULD_NOT_CONNECT; + int iErrorCode =3D m_control->state() =3D=3D QAbstractSocket::Connecte= dState ? 0 : ERR_CANNOT_CONNECT; = // on connect success try to read the server message... if (iErrorCode =3D=3D 0) { @@ -471,7 +471,7 @@ bool Ftp::ftpOpenControlConnection(const QString &host,= int port) if (psz[0]) { sErrorMsg =3D i18n("%1.\n\nReason: %2", host, psz); } - iErrorCode =3D ERR_COULD_NOT_CONNECT; + iErrorCode =3D ERR_CANNOT_CONNECT; } } else { if (m_control->error() =3D=3D QAbstractSocket::HostNotFoundError) { @@ -681,7 +681,7 @@ bool Ftp::ftpLogin(bool *userChanged) // qDebug() << "Searching for pwd"; if (!ftpSendCmd("PWD") || (m_iRespType !=3D 2)) { // qDebug() << "Couldn't issue pwd command"; - error(ERR_COULD_NOT_LOGIN, i18n("Could not login to %1.", m_host))= ; // or anything better ? + error(ERR_CANNOT_LOGIN, i18n("Could not login to %1.", m_host)); = // or anything better ? return false; } = @@ -803,7 +803,7 @@ bool Ftp::ftpSendCmd(const QByteArray &cmd, int maxretr= ies) if (!m_bLoggedOn) { if (m_control !=3D NULL) { // if openConnection succee= ded ... // qDebug() << "Login failure, aborting"; - error(ERR_COULD_NOT_LOGIN, m_host); + error(ERR_CANNOT_LOGIN, m_host); closeConnection(); } return false; @@ -1000,7 +1000,7 @@ int Ftp::ftpOpenPortDataConnection() if (!m_server->isListening()) { delete m_server; m_server =3D NULL; - return ERR_COULD_NOT_LISTEN; + return ERR_CANNOT_LISTEN; } = m_server->setMaxPendingConnections(1); @@ -1035,7 +1035,7 @@ bool Ftp::ftpOpenCommand(const char *_command, const = QString &_path, char _mode, { int errCode =3D 0; if (!ftpDataMode(ftpModeFromPath(_path, _mode))) { - errCode =3D ERR_COULD_NOT_CONNECT; + errCode =3D ERR_CANNOT_CONNECT; } else { errCode =3D ftpOpenDataConnection(); } @@ -1093,7 +1093,7 @@ bool Ftp::ftpOpenCommand(const char *_command, const = QString &_path, char _mode, } = // qDebug() << "no connection received from remote."; - errorcode =3D ERR_COULD_NOT_ACCEPT; + errorcode =3D ERR_CANNOT_ACCEPT; errormessage =3D m_host; return false; } @@ -1143,7 +1143,7 @@ void Ftp::mkdir(const QUrl &url, int permissions) return; } = - error(ERR_COULD_NOT_MKDIR, path); + error(ERR_CANNOT_MKDIR, path); return; } = @@ -1932,7 +1932,7 @@ Ftp::StatusCode Ftp::ftpGet(int &iError, int iCopyFil= e, const QUrl &url, KIO::fi break; } // unexpected eof. Happens when the daemon gets killed. - iError =3D ERR_COULD_NOT_READ; + iError =3D ERR_CANNOT_READ; return statusServerError; } processed_size +=3D n; @@ -2018,14 +2018,14 @@ void Ftp::ftpAbortTransfer() // qDebug() << "send ABOR"; QCString buf =3D "ABOR\r\n"; if (KSocks::self()->write(sControl, buf.data(), buf.length()) <=3D 0) = { - error(ERR_COULD_NOT_WRITE, QString()); + error(ERR_CANNOT_WRITE, QString()); return; } = // // qDebug() << "read resp"; if (readresp() !=3D '2') { - error(ERR_COULD_NOT_READ, QString()); + error(ERR_CANNOT_READ, QString()); return; } = @@ -2141,7 +2141,7 @@ Ftp::StatusCode Ftp::ftpPut(int &iError, int iCopyFil= e, const QUrl &dest_url, } } = - if (! ftpOpenCommand("stor", dest, '?', ERR_COULD_NOT_WRITE, offset)) { + if (! ftpOpenCommand("stor", dest, '?', ERR_CANNOT_WRITE, offset)) { return statusServerError; } = @@ -2164,7 +2164,7 @@ Ftp::StatusCode Ftp::ftpPut(int &iError, int iCopyFil= e, const QUrl &dest_url, buffer.resize(iBlockSize); result =3D QT_READ(iCopyFile, buffer.data(), buffer.size()); if (result < 0) { - iError =3D ERR_COULD_NOT_WRITE; + iError =3D ERR_CANNOT_WRITE; } else { buffer.resize(result); } @@ -2194,7 +2194,7 @@ Ftp::StatusCode Ftp::ftpPut(int &iError, int iCopyFil= e, const QUrl &dest_url, } = if (!ftpCloseCommand()) { - iError =3D ERR_COULD_NOT_WRITE; + iError =3D ERR_CANNOT_WRITE; return statusServerError; } = @@ -2475,7 +2475,7 @@ Ftp::StatusCode Ftp::ftpCopyGet(int &iError, int &iCo= pyFile, const QString &sCop // delegate the real work (iError gets status) ... StatusCode iRes =3D ftpGet(iError, iCopyFile, url, hCopyOffset); if (QT_CLOSE(iCopyFile) && iRes =3D=3D statusSuccess) { - iError =3D ERR_COULD_NOT_WRITE; + iError =3D ERR_CANNOT_WRITE; iRes =3D statusClientError; } iCopyFile =3D -1; @@ -2528,7 +2528,7 @@ Ftp::StatusCode Ftp::ftpSendMimeType(int &iError, con= st QUrl &url) while (true) { // Wait for content to be available... if (m_data->bytesAvailable() =3D=3D 0 && !m_data->waitForReadyRead= ((readTimeout() * 1000))) { - iError =3D ERR_COULD_NOT_READ; + iError =3D ERR_CANNOT_READ; return statusServerError; } = @@ -2536,7 +2536,7 @@ Ftp::StatusCode Ftp::ftpSendMimeType(int &iError, con= st QUrl &url) = // If we got a -1, it must be an error so return an error. if (bytesRead =3D=3D -1) { - iError =3D ERR_COULD_NOT_READ; + iError =3D ERR_CANNOT_READ; return statusServerError; } = diff --git a/src/ioslaves/help/kio_help.cpp b/src/ioslaves/help/kio_help.cpp index df3e934..7cb8a95 100644 --- a/src/ioslaves/help/kio_help.cpp +++ b/src/ioslaves/help/kio_help.cpp @@ -391,7 +391,7 @@ void HelpProtocol::get_file(const QString &path) const qint64 n =3D f.read(array.data(), array.size()); if (n =3D=3D -1) { - error(KIO::ERR_COULD_NOT_READ, path); + error(KIO::ERR_CANNOT_READ, path); return; } if (n =3D=3D 0) diff --git a/src/ioslaves/http/http.cpp b/src/ioslaves/http/http.cpp index 3158628..de1a1dd 100644 --- a/src/ioslaves/http/http.cpp +++ b/src/ioslaves/http/http.cpp @@ -2190,7 +2190,7 @@ bool HTTPProtocol::httpOpenConnection() const QUrl url(proxyUrl); const QString proxyScheme(url.scheme()); if (!supportedProxyScheme(proxyScheme)) { - connectError =3D ERR_COULD_NOT_CONNECT; + connectError =3D ERR_CANNOT_CONNECT; errorString =3D url.toDisplayString(); badProxyUrls << url; continue; @@ -2283,7 +2283,7 @@ bool HTTPProtocol::satisfyRequestFromCache(bool *cach= eHasPage) if (isCacheOnly) { error(ERR_DOES_NOT_EXIST, m_request.url.toDisplayStrin= g()); } else if (offline) { - error(ERR_COULD_NOT_CONNECT, m_request.url.toDisplaySt= ring()); + error(ERR_CANNOT_CONNECT, m_request.url.toDisplayStrin= g()); } return true; } @@ -4521,7 +4521,7 @@ void HTTPProtocol::error(int _err, const QString &_te= xt) { // Close the connection only on connection errors. Otherwise, honor the // keep alive flag. - if (_err =3D=3D ERR_CONNECTION_BROKEN || _err =3D=3D ERR_COULD_NOT_CON= NECT) { + if (_err =3D=3D ERR_CONNECTION_BROKEN || _err =3D=3D ERR_CANNOT_CONNEC= T) { httpClose(false); } else { httpClose(m_request.isKeepAlive); diff --git a/src/widgets/accessmanagerreply_p.cpp b/src/widgets/accessmanag= erreply_p.cpp index 4322e02..c7df260 100644 --- a/src/widgets/accessmanagerreply_p.cpp +++ b/src/widgets/accessmanagerreply_p.cpp @@ -333,9 +333,9 @@ int AccessManagerReply::jobError(KJob *kJob) setHeader(QNetworkRequest::ContentTypeHeader, "inode/directory"); setError(QNetworkReply::NoError, kJob->errorText()); break; - case KIO::ERR_COULD_NOT_CONNECT: + case KIO::ERR_CANNOT_CONNECT: setError(QNetworkReply::ConnectionRefusedError, kJob->errorText()); - //qDebug() << "KIO::ERR_COULD_NOT_CONNECT -> QNetworkReply::Connec= tionRefusedError"; + //qDebug() << "KIO::ERR_CANNOT_CONNECT -> QNetworkReply::Connectio= nRefusedError"; break; case KIO::ERR_UNKNOWN_HOST: setError(QNetworkReply::HostNotFoundError, kJob->errorText()); @@ -366,9 +366,9 @@ int AccessManagerReply::jobError(KJob *kJob) setError(QNetworkReply::ContentNotFoundError, kJob->errorText()); //qDebug() << "KIO::ERR_DOES_NOT_EXIST -> QNetworkReply::ContentNo= tFoundError"; break; - case KIO::ERR_COULD_NOT_AUTHENTICATE: + case KIO::ERR_CANNOT_AUTHENTICATE: setError(QNetworkReply::AuthenticationRequiredError, kJob->errorTe= xt()); - //qDebug() << "KIO::ERR_COULD_NOT_AUTHENTICATE -> QNetworkReply::A= uthenticationRequiredError"; + //qDebug() << "KIO::ERR_CANNOT_AUTHENTICATE -> QNetworkReply::Auth= enticationRequiredError"; break; case KIO::ERR_UNSUPPORTED_PROTOCOL: case KIO::ERR_NO_SOURCE_PROTOCOL: