diff --git a/src/core/job_error.cpp b/src/core/job_error.cpp --- a/src/core/job_error.cpp +++ b/src/core/job_error.cpp @@ -20,11 +20,15 @@ #include "kioglobal_p.h" #include #include +#include + #include #include #include #include // S_IRUSR etc +static const int maxFilePathLength = 80; + QString KIO::Job::errorString() const { return KIO::buildErrorString(error(), errorText()); @@ -39,7 +43,7 @@ result = i18n("Could not read %1.", errorText); break; case KIO::ERR_CANNOT_OPEN_FOR_WRITING: - result = i18n("Could not write to %1.", errorText); + result = i18n("Could not write to %1.", KStringHandler::csqueeze(errorText, maxFilePathLength)); break; case KIO::ERR_CANNOT_LAUNCH_PROCESS: result = i18n("Could not start process %1.", errorText); @@ -142,16 +146,16 @@ result = i18n("Could not terminate listing %1.", errorText); break; case KIO::ERR_CANNOT_MKDIR: - result = i18n("Could not make folder %1.", errorText); + result = i18n("Could not make folder %1.", KStringHandler::csqueeze(errorText, maxFilePathLength)); break; case KIO::ERR_CANNOT_RMDIR: result = i18n("Could not remove folder %1.", errorText); break; case KIO::ERR_CANNOT_RESUME: result = i18n("Could not resume file %1.", errorText); break; case KIO::ERR_CANNOT_RENAME: - result = i18n("Could not rename file %1.", errorText); + result = i18n("Could not rename file %1.", KStringHandler::csqueeze(errorText, maxFilePathLength)); break; case KIO::ERR_CANNOT_CHMOD: result = i18n("Could not change permissions for %1.", errorText); @@ -403,7 +407,7 @@ errorName = i18n("Cannot Open Resource For Writing"); description = i18n("This means that the file, %1, could " "not be written to as requested, because access with permission to " - "write could not be obtained.", filename); + "write could not be obtained.", KStringHandler::csqueeze(filename, maxFilePathLength)); causes << cAccess << cLocked << cHardware; solutions << sAccess << sQuerylock << sSysadmin; break; @@ -831,7 +835,7 @@ case KIO::ERR_CANNOT_RENAME: errorName = i18n("Could Not Rename Resource"); description = i18n("An attempt to rename the specified resource " - "%1 failed.", url); + "%1 failed.", KStringHandler::csqueeze(url, maxFilePathLength)); causes << cAccess << cExists; if (!isSlaveNetwork) { causes << cProtocol;