1 | /* |
2 | This file is part of the KDE libraries |
3 | SPDX-FileCopyrightText: 2000 David Faure <faure@kde.org> |
4 | |
5 | SPDX-License-Identifier: LGPL-2.0-only |
6 | */ |
7 | |
8 | #include "job.h" |
9 | #include <KLocalizedString> |
10 | #include <KStringHandler> |
11 | #include <kprotocolmanager.h> |
12 | |
13 | #include <QDataStream> |
14 | #include <QDateTime> |
15 | #include <QLocale> |
16 | #include <QUrl> |
17 | |
18 | #ifdef Q_OS_WIN |
19 | #include "kioglobal_p.h" |
20 | #else |
21 | #include <sys/stat.h> // S_IRUSR etc |
22 | #endif |
23 | |
24 | static const int s_maxFilePathLength = 80; |
25 | |
26 | QString KIO::Job::errorString() const |
27 | { |
28 | return KIO::buildErrorString(errorCode: error(), errorText: errorText()); |
29 | } |
30 | |
31 | KIOCORE_EXPORT QString KIO::buildErrorString(int errorCode, const QString &errorText) |
32 | { |
33 | QString result; |
34 | |
35 | switch (errorCode) { |
36 | case KIO::ERR_CANNOT_OPEN_FOR_READING: |
37 | result = i18n("Could not read %1." , errorText); |
38 | break; |
39 | case KIO::ERR_CANNOT_OPEN_FOR_WRITING: |
40 | result = i18n("Could not write to %1." , KStringHandler::csqueeze(errorText, s_maxFilePathLength)); |
41 | break; |
42 | case KIO::ERR_CANNOT_LAUNCH_PROCESS: |
43 | result = i18n("Could not start process %1." , errorText); |
44 | break; |
45 | case KIO::ERR_INTERNAL: |
46 | result = i18n("Internal Error\nPlease send a full bug report at https://bugs.kde.org\n%1" , errorText); |
47 | break; |
48 | case KIO::ERR_MALFORMED_URL: |
49 | result = i18n("Malformed URL %1." , errorText); |
50 | break; |
51 | case KIO::ERR_UNSUPPORTED_PROTOCOL: |
52 | result = i18n("The protocol %1 is not supported." , errorText); |
53 | break; |
54 | case KIO::ERR_NO_SOURCE_PROTOCOL: |
55 | result = i18n("The protocol %1 is only a filter protocol." , errorText); |
56 | break; |
57 | case KIO::ERR_UNSUPPORTED_ACTION: |
58 | result = errorText; |
59 | // result = i18n( "Unsupported action %1" ).arg( errorText ); |
60 | break; |
61 | case KIO::ERR_IS_DIRECTORY: |
62 | result = i18n("%1 is a folder, but a file was expected." , errorText); |
63 | break; |
64 | case KIO::ERR_IS_FILE: |
65 | result = i18n("%1 is a file, but a folder was expected." , errorText); |
66 | break; |
67 | case KIO::ERR_DOES_NOT_EXIST: |
68 | result = i18n("The file or folder %1 does not exist." , errorText); |
69 | break; |
70 | case KIO::ERR_FILE_ALREADY_EXIST: |
71 | result = i18n("A file named %1 already exists." , errorText); |
72 | break; |
73 | case KIO::ERR_DIR_ALREADY_EXIST: |
74 | result = i18n("A folder named %1 already exists." , errorText); |
75 | break; |
76 | case KIO::ERR_UNKNOWN_HOST: |
77 | result = errorText.isEmpty() ? i18n("No hostname specified." ) : i18n("Unknown host %1" , errorText); |
78 | break; |
79 | case KIO::ERR_ACCESS_DENIED: |
80 | result = i18n("Access denied to %1." , errorText); |
81 | break; |
82 | case KIO::ERR_WRITE_ACCESS_DENIED: |
83 | result = i18n("Access denied.\nCould not write to %1." , errorText); |
84 | break; |
85 | case KIO::ERR_CANNOT_ENTER_DIRECTORY: |
86 | result = i18n("Could not enter folder %1." , errorText); |
87 | break; |
88 | case KIO::ERR_PROTOCOL_IS_NOT_A_FILESYSTEM: |
89 | result = i18n("The protocol %1 does not implement a folder service." , errorText); |
90 | break; |
91 | case KIO::ERR_CYCLIC_LINK: |
92 | result = i18n("Found a cyclic link in %1." , errorText); |
93 | break; |
94 | case KIO::ERR_CYCLIC_COPY: |
95 | result = i18n("Found a cyclic link while copying %1." , errorText); |
96 | break; |
97 | case KIO::ERR_CANNOT_CREATE_SOCKET: |
98 | result = i18n("Could not create socket for accessing %1." , errorText); |
99 | break; |
100 | case KIO::ERR_CANNOT_CONNECT: |
101 | result = i18n("Could not connect to host %1." , errorText.isEmpty() ? QStringLiteral("localhost" ) : errorText); |
102 | break; |
103 | case KIO::ERR_CONNECTION_BROKEN: |
104 | result = i18n("Connection to host %1 is broken." , errorText); |
105 | break; |
106 | case KIO::ERR_NOT_FILTER_PROTOCOL: |
107 | result = i18n("The protocol %1 is not a filter protocol." , errorText); |
108 | break; |
109 | case KIO::ERR_CANNOT_MOUNT: |
110 | result = i18n("Could not mount device.\nThe reported error was:\n%1" , errorText); |
111 | break; |
112 | case KIO::ERR_CANNOT_UNMOUNT: |
113 | result = i18n("Could not unmount device.\nThe reported error was:\n%1" , errorText); |
114 | break; |
115 | case KIO::ERR_CANNOT_READ: |
116 | result = i18n("Could not read file %1." , errorText); |
117 | break; |
118 | case KIO::ERR_CANNOT_WRITE: |
119 | result = i18n("Could not write to file %1." , errorText); |
120 | break; |
121 | case KIO::ERR_CANNOT_BIND: |
122 | result = i18n("Could not bind %1." , errorText); |
123 | break; |
124 | case KIO::ERR_CANNOT_LISTEN: |
125 | result = i18n("Could not listen %1." , errorText); |
126 | break; |
127 | case KIO::ERR_CANNOT_ACCEPT: |
128 | result = i18n("Could not accept %1." , errorText); |
129 | break; |
130 | case KIO::ERR_CANNOT_LOGIN: |
131 | result = errorText; |
132 | break; |
133 | case KIO::ERR_CANNOT_STAT: |
134 | result = i18n("Could not access %1." , errorText); |
135 | break; |
136 | case KIO::ERR_CANNOT_CLOSEDIR: |
137 | result = i18n("Could not terminate listing %1." , errorText); |
138 | break; |
139 | case KIO::ERR_CANNOT_MKDIR: |
140 | result = i18n("Could not make folder %1." , KStringHandler::csqueeze(errorText, s_maxFilePathLength)); |
141 | break; |
142 | case KIO::ERR_CANNOT_RMDIR: |
143 | result = i18n("Could not remove folder %1." , errorText); |
144 | break; |
145 | case KIO::ERR_CANNOT_RESUME: |
146 | result = i18n("Could not resume file %1." , errorText); |
147 | break; |
148 | case KIO::ERR_CANNOT_RENAME: |
149 | result = i18n("Could not rename file %1." , KStringHandler::csqueeze(errorText, s_maxFilePathLength)); |
150 | break; |
151 | case KIO::ERR_CANNOT_CHMOD: |
152 | result = i18n("Could not change permissions for %1." , errorText); |
153 | break; |
154 | case KIO::ERR_CANNOT_CHOWN: |
155 | result = i18n("Could not change ownership for %1." , errorText); |
156 | break; |
157 | case KIO::ERR_CANNOT_DELETE: |
158 | result = i18n("Could not delete file %1." , errorText); |
159 | break; |
160 | case KIO::ERR_WORKER_DIED: |
161 | result = i18n("The process for the %1 protocol died unexpectedly." , errorText); |
162 | break; |
163 | case KIO::ERR_OUT_OF_MEMORY: |
164 | result = i18n("Error. Out of memory.\n%1" , errorText); |
165 | break; |
166 | case KIO::ERR_UNKNOWN_PROXY_HOST: |
167 | result = i18n("Unknown proxy host\n%1" , errorText); |
168 | break; |
169 | case KIO::ERR_CANNOT_AUTHENTICATE: |
170 | result = i18n("Authorization failed, %1 authentication not supported" , errorText); |
171 | break; |
172 | case KIO::ERR_USER_CANCELED: |
173 | // Typically no message should be shown to the user in this case; |
174 | // however the text is set here only for debugging purposes. |
175 | case KIO::ERR_ABORTED: |
176 | result = i18n("User canceled action\n%1" , errorText); |
177 | break; |
178 | case KIO::ERR_INTERNAL_SERVER: |
179 | result = i18n("Internal error in server\n%1" , errorText); |
180 | break; |
181 | case KIO::ERR_SERVER_TIMEOUT: |
182 | result = i18n("Timeout on server\n%1" , errorText); |
183 | break; |
184 | case KIO::ERR_UNKNOWN: |
185 | result = i18n("Unknown error\n%1" , errorText); |
186 | break; |
187 | case KIO::ERR_UNKNOWN_INTERRUPT: |
188 | result = i18n("Unknown interrupt\n%1" , errorText); |
189 | break; |
190 | /* |
191 | case KIO::ERR_CHECKSUM_MISMATCH: |
192 | if (errorText) |
193 | result = i18n( "Warning: MD5 Checksum for %1 does not match checksum returned from server" ).arg(errorText); |
194 | else |
195 | result = i18n( "Warning: MD5 Checksum for %1 does not match checksum returned from server" ).arg("document"); |
196 | break; |
197 | */ |
198 | case KIO::ERR_CANNOT_DELETE_ORIGINAL: |
199 | result = i18n("Could not delete original file %1.\nPlease check permissions." , errorText); |
200 | break; |
201 | case KIO::ERR_CANNOT_DELETE_PARTIAL: |
202 | result = i18n("Could not delete partial file %1.\nPlease check permissions." , errorText); |
203 | break; |
204 | case KIO::ERR_CANNOT_RENAME_ORIGINAL: |
205 | result = i18n("Could not rename original file %1.\nPlease check permissions." , errorText); |
206 | break; |
207 | case KIO::ERR_CANNOT_RENAME_PARTIAL: |
208 | result = i18n("Could not rename partial file %1.\nPlease check permissions." , errorText); |
209 | break; |
210 | case KIO::ERR_CANNOT_SYMLINK: |
211 | result = i18n("Could not create symlink %1.\nPlease check permissions." , errorText); |
212 | break; |
213 | case KIO::ERR_SYMLINKS_NOT_SUPPORTED: |
214 | result = i18n("Cannot create symlinks at %1.\nThe destination filesystem doesn't support symlinks." , errorText); |
215 | break; |
216 | case KIO::ERR_NO_CONTENT: |
217 | result = errorText; |
218 | break; |
219 | case KIO::ERR_DISK_FULL: |
220 | result = i18n("There is not enough space on the disk to write %1." , errorText); |
221 | break; |
222 | case KIO::ERR_IDENTICAL_FILES: |
223 | result = i18n("The source and destination are the same file.\n%1" , errorText); |
224 | break; |
225 | case KIO::ERR_WORKER_DEFINED: |
226 | Q_FALLTHROUGH(); |
227 | case KJob::UserDefinedError: |
228 | result = errorText; |
229 | break; |
230 | case KIO::ERR_UPGRADE_REQUIRED: |
231 | result = i18n("%1 is required by the server, but is not available." , errorText); |
232 | break; |
233 | case KIO::ERR_POST_DENIED: |
234 | result = i18n("Access to restricted port in POST denied." ); |
235 | break; |
236 | case KIO::ERR_POST_NO_SIZE: |
237 | result = i18n("The required content size information was not provided for a POST operation." ); |
238 | break; |
239 | case KIO::ERR_DROP_ON_ITSELF: |
240 | result = i18n("A file or folder cannot be dropped onto itself" ); |
241 | break; |
242 | case KIO::ERR_CANNOT_MOVE_INTO_ITSELF: |
243 | result = i18n("A folder cannot be moved into itself" ); |
244 | break; |
245 | case KIO::ERR_PASSWD_SERVER: |
246 | result = i18n("Communication with the local password server failed" ); |
247 | break; |
248 | case KIO::ERR_CANNOT_CREATE_WORKER: |
249 | result = i18n("Unable to create KIO worker. %1" , errorText); |
250 | break; |
251 | case KIO::ERR_FILE_TOO_LARGE_FOR_FAT32: |
252 | result = xi18nc("@info" , |
253 | "Cannot transfer <filename>%1</filename> because it is too large. The destination filesystem only supports files up to 4GiB" , |
254 | errorText); |
255 | break; |
256 | case KIO::ERR_PRIVILEGE_NOT_REQUIRED: |
257 | result = |
258 | i18n("Privilege escalation is not necessary because \n'%1' is owned by the current user.\nPlease retry after changing permissions." , errorText); |
259 | break; |
260 | case KIO::ERR_TRASH_FILE_TOO_LARGE: |
261 | result = i18n("File is too large to be trashed." ); |
262 | break; |
263 | default: |
264 | result = i18n("Unknown error code %1\n%2\nPlease send a full bug report at https://bugs.kde.org." , errorCode, errorText); |
265 | break; |
266 | } |
267 | |
268 | return result; |
269 | } |
270 | |
271 | QStringList KIO::Job::detailedErrorStrings(const QUrl *reqUrl /*= 0*/, int method /*= -1*/) const |
272 | { |
273 | QString errorName; |
274 | QString techName; |
275 | QString description; |
276 | QString ret2; |
277 | QStringList causes; |
278 | QStringList solutions; |
279 | QStringList ret; |
280 | |
281 | QByteArray raw = rawErrorDetail(errorCode: error(), errorText: errorText(), reqUrl, method); |
282 | QDataStream stream(raw); |
283 | |
284 | stream >> errorName >> techName >> description >> causes >> solutions; |
285 | |
286 | QString url; |
287 | QString protocol; |
288 | QString datetime; |
289 | if (reqUrl) { |
290 | QString prettyUrl; |
291 | prettyUrl = reqUrl->toDisplayString(); |
292 | url = prettyUrl.toHtmlEscaped(); |
293 | protocol = reqUrl->scheme(); |
294 | } else { |
295 | url = i18nc("@info url" , "(unknown)" ); |
296 | } |
297 | |
298 | datetime = QLocale().toString(dateTime: QDateTime::currentDateTime(), format: QLocale::LongFormat); |
299 | |
300 | ret << errorName; |
301 | ret << i18nc("@info %1 error name, %2 description" , "<qt><p><b>%1</b></p><p>%2</p></qt>" , errorName, description); |
302 | |
303 | ret2 = QStringLiteral("<qt>" ); |
304 | if (!techName.isEmpty()) { |
305 | ret2 += QLatin1String("<p>" ) + i18n("<b>Technical reason</b>: " ) + techName + QLatin1String("</p>" ); |
306 | } |
307 | ret2 += QLatin1String("<p>" ) + i18n("<b>Details of the request</b>:" ) + QLatin1String("</p><ul>" ) + i18n("<li>URL: %1</li>" , url); |
308 | if (!protocol.isEmpty()) { |
309 | ret2 += i18n("<li>Protocol: %1</li>" , protocol); |
310 | } |
311 | ret2 += i18n("<li>Date and time: %1</li>" , datetime) + i18n("<li>Additional information: %1</li>" , errorText()) + QLatin1String("</ul>" ); |
312 | if (!causes.isEmpty()) { |
313 | ret2 += QLatin1String("<p>" ) + i18n("<b>Possible causes</b>:" ) + QLatin1String("</p><ul><li>" ) + causes.join(sep: QLatin1String("</li><li>" )) |
314 | + QLatin1String("</li></ul>" ); |
315 | } |
316 | if (!solutions.isEmpty()) { |
317 | ret2 += QLatin1String("<p>" ) + i18n("<b>Possible solutions</b>:" ) + QLatin1String("</p><ul><li>" ) + solutions.join(sep: QLatin1String("</li><li>" )) |
318 | + QLatin1String("</li></ul>" ); |
319 | } |
320 | ret2 += QLatin1String("</qt>" ); |
321 | ret << ret2; |
322 | |
323 | return ret; |
324 | } |
325 | |
326 | KIOCORE_EXPORT QByteArray KIO::rawErrorDetail(int errorCode, const QString &errorText, const QUrl *reqUrl /*= 0*/, int /*method = -1*/) |
327 | { |
328 | QString url; |
329 | QString host; |
330 | QString protocol; |
331 | QString datetime; |
332 | QString domain; |
333 | QString path; |
334 | QString filename; |
335 | bool isWorkerNetwork = false; |
336 | if (reqUrl) { |
337 | url = reqUrl->toDisplayString(); |
338 | host = reqUrl->host(); |
339 | protocol = reqUrl->scheme(); |
340 | |
341 | const QLatin1String web("www." ); |
342 | if (host.startsWith(s: web)) { |
343 | domain = host.mid(position: web.size()); |
344 | } else { |
345 | domain = host; |
346 | } |
347 | |
348 | filename = reqUrl->fileName(); |
349 | path = reqUrl->path(); |
350 | |
351 | // detect if protocol is a network protocol... |
352 | if (!protocol.isEmpty()) { |
353 | isWorkerNetwork = KProtocolInfo::protocolClass(protocol) == QLatin1String(":internet" ); |
354 | } |
355 | } else { |
356 | // assume that the errorText has the location we are interested in |
357 | url = host = domain = path = filename = errorText; |
358 | } |
359 | |
360 | if (protocol.isEmpty()) { |
361 | protocol = i18nc("@info protocol" , "(unknown)" ); |
362 | } |
363 | |
364 | datetime = QLocale().toString(dateTime: QDateTime::currentDateTime(), format: QLocale::LongFormat); |
365 | |
366 | QString errorName; |
367 | QString techName; |
368 | QString description; |
369 | QStringList causes; |
370 | QStringList solutions; |
371 | |
372 | // c == cause, s == solution |
373 | QString sSysadmin = i18n( |
374 | "Contact your appropriate computer support system, " |
375 | "whether the system administrator, or technical support group for further " |
376 | "assistance." ); |
377 | QString sServeradmin = i18n( |
378 | "Contact the administrator of the server " |
379 | "for further assistance." ); |
380 | // FIXME active link to permissions dialog |
381 | QString sAccess = i18n("Check your access permissions on this resource." ); |
382 | QString cAccess = i18n( |
383 | "Your access permissions may be inadequate to " |
384 | "perform the requested operation on this resource." ); |
385 | QString cLocked = i18n( |
386 | "The file may be in use (and thus locked) by " |
387 | "another user or application." ); |
388 | QString sQuerylock = i18n( |
389 | "Check to make sure that no other " |
390 | "application or user is using the file or has locked the file." ); |
391 | QString cHardware = i18n( |
392 | "Although unlikely, a hardware error may have " |
393 | "occurred." ); |
394 | QString cBug = i18n("You may have encountered a bug in the program." ); |
395 | QString cBuglikely = i18n( |
396 | "This is most likely to be caused by a bug in the " |
397 | "program. Please consider submitting a full bug report as detailed below." ); |
398 | QString sUpdate = i18n( |
399 | "Update your software to the latest version. " |
400 | "Your distribution should provide tools to update your software." ); |
401 | QString sBugreport = i18n( |
402 | "When all else fails, please consider helping the " |
403 | "KDE team or the third party maintainer of this software by submitting a " |
404 | "high quality bug report. If the software is provided by a third party, " |
405 | "please contact them directly. Otherwise, first look to see if " |
406 | "the same bug has been submitted by someone else by searching at the " |
407 | "<a href=\"https://bugs.kde.org/\">KDE bug reporting website</a>. If not, take " |
408 | "note of the details given above, and include them in your bug report, along " |
409 | "with as many other details as you think might help." ); |
410 | QString cNetwork = i18n( |
411 | "There may have been a problem with your network " |
412 | "connection." ); |
413 | // FIXME netconf kcontrol link |
414 | QString cNetconf = i18n( |
415 | "There may have been a problem with your network " |
416 | "configuration. If you have been accessing the Internet with no problems " |
417 | "recently, this is unlikely." ); |
418 | QString cNetpath = i18n( |
419 | "There may have been a problem at some point along " |
420 | "the network path between the server and this computer." ); |
421 | QString sTryagain = i18n("Try again, either now or at a later time." ); |
422 | QString cProtocol = i18n("A protocol error or incompatibility may have occurred." ); |
423 | QString sExists = i18n("Ensure that the resource exists, and try again." ); |
424 | QString cExists = i18n("The specified resource may not exist." ); |
425 | QString sTypo = i18n( |
426 | "Double-check that you have entered the correct location " |
427 | "and try again." ); |
428 | QString sNetwork = i18n("Check your network connection status." ); |
429 | |
430 | switch (errorCode) { |
431 | case KIO::ERR_CANNOT_OPEN_FOR_READING: |
432 | errorName = i18n("Cannot Open Resource For Reading" ); |
433 | description = i18n( |
434 | "This means that the contents of the requested file " |
435 | "or folder <strong>%1</strong> could not be retrieved, as read " |
436 | "access could not be obtained." , |
437 | path); |
438 | causes << i18n( |
439 | "You may not have permissions to read the file or open " |
440 | "the folder." ) |
441 | << cLocked << cHardware; |
442 | solutions << sAccess << sQuerylock << sSysadmin; |
443 | break; |
444 | |
445 | case KIO::ERR_CANNOT_OPEN_FOR_WRITING: |
446 | errorName = i18n("Cannot Open Resource For Writing" ); |
447 | description = i18n( |
448 | "This means that the file, <strong>%1</strong>, could " |
449 | "not be written to as requested, because access with permission to " |
450 | "write could not be obtained." , |
451 | KStringHandler::csqueeze(filename, s_maxFilePathLength)); |
452 | causes << cAccess << cLocked << cHardware; |
453 | solutions << sAccess << sQuerylock << sSysadmin; |
454 | break; |
455 | |
456 | case KIO::ERR_CANNOT_LAUNCH_PROCESS: |
457 | errorName = i18n("Cannot Launch Process required by the %1 Protocol" , protocol); |
458 | techName = i18n("Unable to Launch Process" ); |
459 | description = i18n( |
460 | "The program on your computer which provides access " |
461 | "to the <strong>%1</strong> protocol could not be found or started. This is " |
462 | "usually due to technical reasons." , |
463 | protocol); |
464 | causes << i18n( |
465 | "The program which provides compatibility with this " |
466 | "protocol may not have been updated with your last update of KDE. " |
467 | "This can cause the program to be incompatible with the current version " |
468 | "and thus not start." ) |
469 | << cBug; |
470 | solutions << sUpdate << sSysadmin; |
471 | break; |
472 | |
473 | case KIO::ERR_INTERNAL: |
474 | errorName = i18n("Internal Error" ); |
475 | description = i18n( |
476 | "The program on your computer which provides access " |
477 | "to the <strong>%1</strong> protocol has reported an internal error." , |
478 | protocol); |
479 | causes << cBuglikely; |
480 | solutions << sUpdate << sBugreport; |
481 | break; |
482 | |
483 | case KIO::ERR_MALFORMED_URL: |
484 | errorName = i18n("Improperly Formatted URL" ); |
485 | description = i18n( |
486 | "The <strong>U</strong>niform <strong>R</strong>esource " |
487 | "<strong>L</strong>ocator (URL) that you entered was not properly " |
488 | "formatted. The format of a URL is generally as follows:" |
489 | "<blockquote><strong>protocol://user:password@www.example.org:port/folder/" |
490 | "filename.extension?query=value</strong></blockquote>" ); |
491 | solutions << sTypo; |
492 | break; |
493 | |
494 | case KIO::ERR_UNSUPPORTED_PROTOCOL: |
495 | errorName = i18n("Unsupported Protocol %1" , protocol); |
496 | description = i18n( |
497 | "The protocol <strong>%1</strong> is not supported " |
498 | "by the KDE programs currently installed on this computer." , |
499 | protocol); |
500 | causes << i18n("The requested protocol may not be supported." ) |
501 | << i18n( |
502 | "The versions of the %1 protocol supported by this computer and " |
503 | "the server may be incompatible." , |
504 | protocol); |
505 | solutions << i18n( |
506 | "You may perform a search on the Internet for a software " |
507 | "plugin (called a \"KIO worker\") which supports this protocol. " |
508 | "Places to search include <a href=\"https://store.kde.org/\">" |
509 | "https://store.kde.org</a>." ) |
510 | << sUpdate << sSysadmin; |
511 | break; |
512 | |
513 | case KIO::ERR_NO_SOURCE_PROTOCOL: |
514 | errorName = i18n("URL Does Not Refer to a Resource." ); |
515 | techName = i18n("Protocol is a Filter Protocol" ); |
516 | description = i18n( |
517 | "The <strong>U</strong>niform <strong>R</strong>esource " |
518 | "<strong>L</strong>ocator (URL) that you entered did not refer to a " |
519 | "specific resource." ); |
520 | causes << i18n( |
521 | "KDE is able to communicate through a protocol within a " |
522 | "protocol; the protocol specified is only for use in such situations, " |
523 | "however this is not one of these situations. This is a rare event, and " |
524 | "is likely to indicate a programming error." ); |
525 | solutions << sTypo; |
526 | break; |
527 | |
528 | case KIO::ERR_UNSUPPORTED_ACTION: |
529 | errorName = i18n("Unsupported Action: %1" , errorText); |
530 | description = i18n( |
531 | "The requested action is not supported by the KDE " |
532 | "program which is implementing the <strong>%1</strong> protocol." , |
533 | protocol); |
534 | causes << i18n( |
535 | "This error is very much dependent on the KDE program. The " |
536 | "additional information should give you more information than is available " |
537 | "to the KDE input/output architecture." ); |
538 | solutions << i18n( |
539 | "Attempt to find another way to accomplish the same " |
540 | "outcome." ); |
541 | break; |
542 | |
543 | case KIO::ERR_IS_DIRECTORY: |
544 | errorName = i18n("File Expected" ); |
545 | description = i18n( |
546 | "The request expected a file, however the " |
547 | "folder <strong>%1</strong> was found instead." , |
548 | path); |
549 | causes << i18n("This may be an error on the server side." ) << cBug; |
550 | solutions << sUpdate << sSysadmin; |
551 | break; |
552 | |
553 | case KIO::ERR_IS_FILE: |
554 | errorName = i18n("Folder Expected" ); |
555 | description = i18n( |
556 | "The request expected a folder, however " |
557 | "the file <strong>%1</strong> was found instead." , |
558 | filename); |
559 | causes << cBug; |
560 | solutions << sUpdate << sSysadmin; |
561 | break; |
562 | |
563 | case KIO::ERR_DOES_NOT_EXIST: |
564 | errorName = i18n("File or Folder Does Not Exist" ); |
565 | description = i18n( |
566 | "The specified file or folder <strong>%1</strong> " |
567 | "does not exist." , |
568 | path); |
569 | causes << cExists; |
570 | solutions << sExists; |
571 | break; |
572 | |
573 | case KIO::ERR_FILE_ALREADY_EXIST: |
574 | errorName = i18n("File Already Exists" ); |
575 | description = i18n( |
576 | "The requested file could not be created because a " |
577 | "file with the same name already exists." ); |
578 | solutions << i18n( |
579 | "Try moving the current file out of the way first, " |
580 | "and then try again." ) |
581 | << i18n("Delete the current file and try again." ) << i18n("Choose an alternate filename for the new file." ); |
582 | break; |
583 | |
584 | case KIO::ERR_DIR_ALREADY_EXIST: |
585 | errorName = i18n("Folder Already Exists" ); |
586 | description = i18n( |
587 | "The requested folder could not be created because " |
588 | "a folder with the same name already exists." ); |
589 | solutions << i18n( |
590 | "Try moving the current folder out of the way first, " |
591 | "and then try again." ) |
592 | << i18n("Delete the current folder and try again." ) << i18n("Choose an alternate name for the new folder." ); |
593 | break; |
594 | |
595 | case KIO::ERR_UNKNOWN_HOST: |
596 | errorName = i18n("Unknown Host" ); |
597 | description = i18n( |
598 | "An unknown host error indicates that the server with " |
599 | "the requested name, <strong>%1</strong>, could not be " |
600 | "located on the Internet." , |
601 | host); |
602 | causes << i18n( |
603 | "The name that you typed, %1, may not exist: it may be " |
604 | "incorrectly typed." , |
605 | host) |
606 | << cNetwork << cNetconf; |
607 | solutions << sNetwork << sSysadmin; |
608 | break; |
609 | |
610 | case KIO::ERR_ACCESS_DENIED: |
611 | errorName = i18n("Access Denied" ); |
612 | description = i18n( |
613 | "Access was denied to the specified resource, " |
614 | "<strong>%1</strong>." , |
615 | url); |
616 | causes << i18n( |
617 | "You may have supplied incorrect authentication details or " |
618 | "none at all." ) |
619 | << i18n( |
620 | "Your account may not have permission to access the " |
621 | "specified resource." ); |
622 | solutions << i18n( |
623 | "Retry the request and ensure your authentication details " |
624 | "are entered correctly." ) |
625 | << sSysadmin; |
626 | if (!isWorkerNetwork) { |
627 | solutions << sServeradmin; |
628 | } |
629 | break; |
630 | |
631 | case KIO::ERR_WRITE_ACCESS_DENIED: |
632 | errorName = i18n("Write Access Denied" ); |
633 | description = i18n( |
634 | "This means that an attempt to write to the file " |
635 | "<strong>%1</strong> was rejected." , |
636 | filename); |
637 | causes << cAccess << cLocked << cHardware; |
638 | solutions << sAccess << sQuerylock << sSysadmin; |
639 | break; |
640 | |
641 | case KIO::ERR_CANNOT_ENTER_DIRECTORY: |
642 | errorName = i18n("Unable to Enter Folder" ); |
643 | description = i18n( |
644 | "This means that an attempt to enter (in other words, " |
645 | "to open) the requested folder <strong>%1</strong> was rejected." , |
646 | path); |
647 | causes << cAccess << cLocked; |
648 | solutions << sAccess << sQuerylock << sSysadmin; |
649 | break; |
650 | |
651 | case KIO::ERR_PROTOCOL_IS_NOT_A_FILESYSTEM: |
652 | errorName = i18n("Folder Listing Unavailable" ); |
653 | techName = i18n("Protocol %1 is not a Filesystem" , protocol); |
654 | description = i18n( |
655 | "This means that a request was made which requires " |
656 | "determining the contents of the folder, and the KDE program supporting " |
657 | "this protocol is unable to do so." ); |
658 | causes << cBug; |
659 | solutions << sUpdate << sBugreport; |
660 | break; |
661 | |
662 | case KIO::ERR_CYCLIC_LINK: |
663 | errorName = i18n("Cyclic Link Detected" ); |
664 | description = i18n( |
665 | "UNIX environments are commonly able to link a file or " |
666 | "folder to a separate name and/or location. KDE detected a link or " |
667 | "series of links that results in an infinite loop - i.e. the file was " |
668 | "(perhaps in a roundabout way) linked to itself." ); |
669 | solutions << i18n( |
670 | "Delete one part of the loop in order that it does not " |
671 | "cause an infinite loop, and try again." ) |
672 | << sSysadmin; |
673 | break; |
674 | |
675 | case KIO::ERR_USER_CANCELED: |
676 | // Do nothing in this case. The user doesn't need to be told what he just did. |
677 | // rodda: However, if we have been called, an application is about to display |
678 | // this information anyway. If we don't return sensible information, the |
679 | // user sees a blank dialog (I have seen this myself) |
680 | errorName = i18n("Request Aborted By User" ); |
681 | description = i18n( |
682 | "The request was not completed because it was " |
683 | "aborted." ); |
684 | solutions << i18n("Retry the request." ); |
685 | break; |
686 | |
687 | case KIO::ERR_CYCLIC_COPY: |
688 | errorName = i18n("Cyclic Link Detected During Copy" ); |
689 | description = i18n( |
690 | "UNIX environments are commonly able to link a file or " |
691 | "folder to a separate name and/or location. During the requested copy " |
692 | "operation, KDE detected a link or series of links that results in an " |
693 | "infinite loop - i.e. the file was (perhaps in a roundabout way) linked " |
694 | "to itself." ); |
695 | solutions << i18n( |
696 | "Delete one part of the loop in order that it does not " |
697 | "cause an infinite loop, and try again." ) |
698 | << sSysadmin; |
699 | break; |
700 | |
701 | case KIO::ERR_CANNOT_CREATE_SOCKET: |
702 | errorName = i18n("Could Not Create Network Connection" ); |
703 | techName = i18n("Could Not Create Socket" ); |
704 | description = i18n( |
705 | "This is a fairly technical error in which a required " |
706 | "device for network communications (a socket) could not be created." ); |
707 | causes << i18n( |
708 | "The network connection may be incorrectly configured, or " |
709 | "the network interface may not be enabled." ); |
710 | solutions << sNetwork << sSysadmin; |
711 | break; |
712 | |
713 | case KIO::ERR_CANNOT_CONNECT: |
714 | errorName = i18n("Connection to Server Refused" ); |
715 | description = i18n( |
716 | "The server <strong>%1</strong> refused to allow this " |
717 | "computer to make a connection." , |
718 | host); |
719 | causes << i18n( |
720 | "The server, while currently connected to the Internet, " |
721 | "may not be configured to allow requests." ) |
722 | << i18n( |
723 | "The server, while currently connected to the Internet, " |
724 | "may not be running the requested service (%1)." , |
725 | protocol) |
726 | << i18n( |
727 | "A network firewall (a device which restricts Internet " |
728 | "requests), either protecting your network or the network of the server, " |
729 | "may have intervened, preventing this request." ); |
730 | solutions << sTryagain << sServeradmin << sSysadmin; |
731 | break; |
732 | |
733 | case KIO::ERR_CONNECTION_BROKEN: |
734 | errorName = i18n("Connection to Server Closed Unexpectedly" ); |
735 | description = i18n( |
736 | "Although a connection was established to " |
737 | "<strong>%1</strong>, the connection was closed at an unexpected point " |
738 | "in the communication." , |
739 | host); |
740 | causes << cNetwork << cNetpath |
741 | << i18n( |
742 | "A protocol error may have occurred, " |
743 | "causing the server to close the connection as a response to the error." ); |
744 | solutions << sTryagain << sServeradmin << sSysadmin; |
745 | break; |
746 | |
747 | case KIO::ERR_NOT_FILTER_PROTOCOL: |
748 | errorName = i18n("URL Resource Invalid" ); |
749 | techName = i18n("Protocol %1 is not a Filter Protocol" , protocol); |
750 | description = i18n( |
751 | "The <strong>U</strong>niform <strong>R</strong>esource " |
752 | "<strong>L</strong>ocator (URL) that you entered did not refer to " |
753 | "a valid mechanism of accessing the specific resource, " |
754 | "<strong>%1%2</strong>." , |
755 | !host.isNull() ? host + QLatin1Char('/') : QString(), |
756 | path); |
757 | causes << i18n( |
758 | "KDE is able to communicate through a protocol within a " |
759 | "protocol. This request specified a protocol be used as such, however " |
760 | "this protocol is not capable of such an action. This is a rare event, " |
761 | "and is likely to indicate a programming error." ); |
762 | solutions << sTypo << sSysadmin; |
763 | break; |
764 | |
765 | case KIO::ERR_CANNOT_MOUNT: |
766 | errorName = i18n("Unable to Initialize Input/Output Device" ); |
767 | techName = i18n("Could Not Mount Device" ); |
768 | description = i18n( |
769 | "The requested device could not be initialized " |
770 | "(\"mounted\"). The reported error was: <strong>%1</strong>" , |
771 | errorText); |
772 | causes << i18n( |
773 | "The device may not be ready, for example there may be " |
774 | "no media in a removable media device (i.e. no CD-ROM in a CD drive), " |
775 | "or in the case of a peripheral/portable device, the device may not " |
776 | "be correctly connected." ) |
777 | << i18n( |
778 | "You may not have permissions to initialize (\"mount\") the " |
779 | "device. On UNIX systems, often system administrator privileges are " |
780 | "required to initialize a device." ) |
781 | << cHardware; |
782 | solutions << i18n( |
783 | "Check that the device is ready; removable drives " |
784 | "must contain media, and portable devices must be connected and powered " |
785 | "on.; and try again." ) |
786 | << sAccess << sSysadmin; |
787 | break; |
788 | |
789 | case KIO::ERR_CANNOT_UNMOUNT: |
790 | errorName = i18n("Unable to Uninitialize Input/Output Device" ); |
791 | techName = i18n("Could Not Unmount Device" ); |
792 | description = i18n( |
793 | "The requested device could not be uninitialized " |
794 | "(\"unmounted\"). The reported error was: <strong>%1</strong>" , |
795 | errorText); |
796 | causes << i18n( |
797 | "The device may be busy, that is, still in use by " |
798 | "another application or user. Even such things as having an open " |
799 | "browser window on a location on this device may cause the device to " |
800 | "remain in use." ) |
801 | << i18n( |
802 | "You may not have permissions to uninitialize (\"unmount\") " |
803 | "the device. On UNIX systems, system administrator privileges are " |
804 | "often required to uninitialize a device." ) |
805 | << cHardware; |
806 | solutions << i18n( |
807 | "Check that no applications are accessing the device, " |
808 | "and try again." ) |
809 | << sAccess << sSysadmin; |
810 | break; |
811 | |
812 | case KIO::ERR_CANNOT_READ: |
813 | errorName = i18n("Cannot Read From Resource" ); |
814 | description = i18n( |
815 | "This means that although the resource, " |
816 | "<strong>%1</strong>, was able to be opened, an error occurred while " |
817 | "reading the contents of the resource." , |
818 | url); |
819 | causes << i18n("You may not have permissions to read from the resource." ); |
820 | if (!isWorkerNetwork) { |
821 | causes << cNetwork; |
822 | } |
823 | causes << cHardware; |
824 | solutions << sAccess; |
825 | if (!isWorkerNetwork) { |
826 | solutions << sNetwork; |
827 | } |
828 | solutions << sSysadmin; |
829 | break; |
830 | |
831 | case KIO::ERR_CANNOT_WRITE: |
832 | errorName = i18n("Cannot Write to Resource" ); |
833 | description = i18n( |
834 | "This means that although the resource, <strong>%1</strong>" |
835 | ", was able to be opened, an error occurred while writing to the resource." , |
836 | url); |
837 | causes << i18n("You may not have permissions to write to the resource." ); |
838 | if (!isWorkerNetwork) { |
839 | causes << cNetwork; |
840 | } |
841 | causes << cHardware; |
842 | solutions << sAccess; |
843 | if (!isWorkerNetwork) { |
844 | solutions << sNetwork; |
845 | } |
846 | solutions << sSysadmin; |
847 | break; |
848 | |
849 | case KIO::ERR_CANNOT_BIND: |
850 | errorName = i18n("Could Not Listen for Network Connections" ); |
851 | techName = i18n("Could Not Bind" ); |
852 | description = i18n( |
853 | "This is a fairly technical error in which a required " |
854 | "device for network communications (a socket) could not be established " |
855 | "to listen for incoming network connections." ); |
856 | causes << i18n( |
857 | "The network connection may be incorrectly configured, or " |
858 | "the network interface may not be enabled." ); |
859 | solutions << sNetwork << sSysadmin; |
860 | break; |
861 | |
862 | case KIO::ERR_CANNOT_LISTEN: |
863 | errorName = i18n("Could Not Listen for Network Connections" ); |
864 | techName = i18n("Could Not Listen" ); |
865 | description = i18n( |
866 | "This is a fairly technical error in which a required " |
867 | "device for network communications (a socket) could not be established " |
868 | "to listen for incoming network connections." ); |
869 | causes << i18n( |
870 | "The network connection may be incorrectly configured, or " |
871 | "the network interface may not be enabled." ); |
872 | solutions << sNetwork << sSysadmin; |
873 | break; |
874 | |
875 | case KIO::ERR_CANNOT_ACCEPT: |
876 | errorName = i18n("Could Not Accept Network Connection" ); |
877 | description = i18n( |
878 | "This is a fairly technical error in which an error " |
879 | "occurred while attempting to accept an incoming network connection." ); |
880 | causes << i18n( |
881 | "The network connection may be incorrectly configured, or " |
882 | "the network interface may not be enabled." ) |
883 | << i18n("You may not have permissions to accept the connection." ); |
884 | solutions << sNetwork << sSysadmin; |
885 | break; |
886 | |
887 | case KIO::ERR_CANNOT_LOGIN: |
888 | errorName = i18n("Could Not Login: %1" , errorText); |
889 | description = i18n( |
890 | "An attempt to login to perform the requested " |
891 | "operation was unsuccessful." ); |
892 | causes << i18n( |
893 | "You may have supplied incorrect authentication details or " |
894 | "none at all." ) |
895 | << i18n( |
896 | "Your account may not have permission to access the " |
897 | "specified resource." ) |
898 | << cProtocol; |
899 | solutions << i18n( |
900 | "Retry the request and ensure your authentication details " |
901 | "are entered correctly." ) |
902 | << sServeradmin << sSysadmin; |
903 | break; |
904 | |
905 | case KIO::ERR_CANNOT_STAT: |
906 | errorName = i18n("Could Not Determine Resource Status" ); |
907 | techName = i18n("Could Not Stat Resource" ); |
908 | description = i18n( |
909 | "An attempt to determine information about the status " |
910 | "of the resource <strong>%1</strong>, such as the resource name, type, " |
911 | "size, etc., was unsuccessful." , |
912 | url); |
913 | causes << i18n( |
914 | "The specified resource may not have existed or may " |
915 | "not be accessible." ) |
916 | << cProtocol << cHardware; |
917 | solutions << i18n( |
918 | "Retry the request and ensure your authentication details " |
919 | "are entered correctly." ) |
920 | << sSysadmin; |
921 | break; |
922 | |
923 | case KIO::ERR_CANNOT_CLOSEDIR: |
924 | // result = i18n( "Could not terminate listing %1" ).arg( errorText ); |
925 | errorName = i18n("Could Not Cancel Listing" ); |
926 | techName = i18n("FIXME: Document this" ); |
927 | break; |
928 | |
929 | case KIO::ERR_CANNOT_MKDIR: |
930 | errorName = i18n("Could Not Create Folder" ); |
931 | description = i18n("An attempt to create the requested folder failed." ); |
932 | causes << cAccess |
933 | << i18n( |
934 | "The location where the folder was to be created " |
935 | "may not exist." ); |
936 | if (!isWorkerNetwork) { |
937 | causes << cProtocol; |
938 | } |
939 | solutions << i18n("Retry the request." ) << sAccess; |
940 | break; |
941 | |
942 | case KIO::ERR_CANNOT_RMDIR: |
943 | errorName = i18n("Could Not Remove Folder" ); |
944 | description = i18n( |
945 | "An attempt to remove the specified folder, " |
946 | "<strong>%1</strong>, failed." , |
947 | path); |
948 | causes << i18n("The specified folder may not exist." ) << i18n("The specified folder may not be empty." ) << cAccess; |
949 | if (!isWorkerNetwork) { |
950 | causes << cProtocol; |
951 | } |
952 | solutions << i18n( |
953 | "Ensure that the folder exists and is empty, and try " |
954 | "again." ) |
955 | << sAccess; |
956 | break; |
957 | |
958 | case KIO::ERR_CANNOT_RESUME: |
959 | errorName = i18n("Could Not Resume File Transfer" ); |
960 | description = i18n( |
961 | "The specified request asked that the transfer of " |
962 | "file <strong>%1</strong> be resumed at a certain point of the " |
963 | "transfer. This was not possible." , |
964 | filename); |
965 | causes << i18n( |
966 | "The protocol, or the server, may not support file " |
967 | "resuming." ); |
968 | solutions << i18n( |
969 | "Retry the request without attempting to resume " |
970 | "transfer." ); |
971 | break; |
972 | |
973 | case KIO::ERR_CANNOT_RENAME: |
974 | errorName = i18n("Could Not Rename Resource" ); |
975 | description = i18n( |
976 | "An attempt to rename the specified resource " |
977 | "<strong>%1</strong> failed." , |
978 | KStringHandler::csqueeze(url, s_maxFilePathLength)); |
979 | causes << cAccess << cExists; |
980 | if (!isWorkerNetwork) { |
981 | causes << cProtocol; |
982 | } |
983 | solutions << sAccess << sExists; |
984 | break; |
985 | |
986 | case KIO::ERR_CANNOT_CHMOD: |
987 | errorName = i18n("Could Not Alter Permissions of Resource" ); |
988 | description = i18n( |
989 | "An attempt to alter the permissions on the specified " |
990 | "resource <strong>%1</strong> failed." , |
991 | url); |
992 | causes << cAccess << cExists; |
993 | solutions << sAccess << sExists; |
994 | break; |
995 | |
996 | case KIO::ERR_CANNOT_CHOWN: |
997 | errorName = i18n("Could Not Change Ownership of Resource" ); |
998 | description = i18n( |
999 | "An attempt to change the ownership of the specified " |
1000 | "resource <strong>%1</strong> failed." , |
1001 | url); |
1002 | causes << cAccess << cExists; |
1003 | solutions << sAccess << sExists; |
1004 | break; |
1005 | |
1006 | case KIO::ERR_CANNOT_DELETE: |
1007 | errorName = i18n("Could Not Delete Resource" ); |
1008 | description = i18n( |
1009 | "An attempt to delete the specified resource " |
1010 | "<strong>%1</strong> failed." , |
1011 | url); |
1012 | causes << cAccess << cExists; |
1013 | solutions << sAccess << sExists; |
1014 | break; |
1015 | |
1016 | case KIO::ERR_WORKER_DIED: |
1017 | errorName = i18n("Unexpected Program Termination" ); |
1018 | description = i18n( |
1019 | "The program on your computer which provides access " |
1020 | "to the <strong>%1</strong> protocol has unexpectedly terminated." , |
1021 | url); |
1022 | causes << cBuglikely; |
1023 | solutions << sUpdate << sBugreport; |
1024 | break; |
1025 | |
1026 | case KIO::ERR_OUT_OF_MEMORY: |
1027 | errorName = i18n("Out of Memory" ); |
1028 | description = i18n( |
1029 | "The program on your computer which provides access " |
1030 | "to the <strong>%1</strong> protocol could not obtain the memory " |
1031 | "required to continue." , |
1032 | protocol); |
1033 | causes << cBuglikely; |
1034 | solutions << sUpdate << sBugreport; |
1035 | break; |
1036 | |
1037 | case KIO::ERR_UNKNOWN_PROXY_HOST: |
1038 | errorName = i18n("Unknown Proxy Host" ); |
1039 | description = i18n( |
1040 | "While retrieving information about the specified " |
1041 | "proxy host, <strong>%1</strong>, an Unknown Host error was encountered. " |
1042 | "An unknown host error indicates that the requested name could not be " |
1043 | "located on the Internet." , |
1044 | errorText); |
1045 | causes << i18n( |
1046 | "There may have been a problem with your network " |
1047 | "configuration, specifically your proxy's hostname. If you have been " |
1048 | "accessing the Internet with no problems recently, this is unlikely." ) |
1049 | << cNetwork; |
1050 | solutions << i18n("Double-check your proxy settings and try again." ) << sSysadmin; |
1051 | break; |
1052 | |
1053 | case KIO::ERR_CANNOT_AUTHENTICATE: |
1054 | errorName = i18n("Authentication Failed: Method %1 Not Supported" , errorText); |
1055 | description = i18n( |
1056 | "Although you may have supplied the correct " |
1057 | "authentication details, the authentication failed because the " |
1058 | "method that the server is using is not supported by the KDE " |
1059 | "program implementing the protocol %1." , |
1060 | protocol); |
1061 | solutions << i18n( |
1062 | "Please file a bug at <a href=\"https://bugs.kde.org/\">" |
1063 | "https://bugs.kde.org/</a> to inform the KDE team of the unsupported " |
1064 | "authentication method." ) |
1065 | << sSysadmin; |
1066 | break; |
1067 | |
1068 | case KIO::ERR_ABORTED: |
1069 | errorName = i18n("Request Aborted" ); |
1070 | description = i18n( |
1071 | "The request was not completed because it was " |
1072 | "aborted." ); |
1073 | solutions << i18n("Retry the request." ); |
1074 | break; |
1075 | |
1076 | case KIO::ERR_INTERNAL_SERVER: |
1077 | errorName = i18n("Internal Error in Server" ); |
1078 | description = i18n( |
1079 | "The program on the server which provides access " |
1080 | "to the <strong>%1</strong> protocol has reported an internal error: " |
1081 | "%2." , |
1082 | protocol, |
1083 | errorText); |
1084 | causes << i18n( |
1085 | "This is most likely to be caused by a bug in the " |
1086 | "server program. Please consider submitting a full bug report as " |
1087 | "detailed below." ); |
1088 | solutions << i18n( |
1089 | "Contact the administrator of the server " |
1090 | "to advise them of the problem." ) |
1091 | << i18n( |
1092 | "If you know who the authors of the server software are, " |
1093 | "submit the bug report directly to them." ); |
1094 | break; |
1095 | |
1096 | case KIO::ERR_SERVER_TIMEOUT: |
1097 | errorName = i18n("Timeout Error" ); |
1098 | description = i18n( |
1099 | "Although contact was made with the server, a " |
1100 | "response was not received within the amount of time allocated for " |
1101 | "the request as follows:<ul>" |
1102 | "<li>Timeout for establishing a connection: %1 seconds</li>" |
1103 | "<li>Timeout for receiving a response: %2 seconds</li>" |
1104 | "<li>Timeout for accessing proxy servers: %3 seconds</li></ul>" |
1105 | "Please note that you can alter these timeout settings in the KDE " |
1106 | "System Settings, by selecting Network Settings -> Connection Preferences." , |
1107 | KProtocolManager::connectTimeout(), |
1108 | KProtocolManager::responseTimeout(), |
1109 | KProtocolManager::proxyConnectTimeout()); |
1110 | causes << cNetpath |
1111 | << i18n( |
1112 | "The server was too busy responding to other " |
1113 | "requests to respond." ); |
1114 | solutions << sTryagain << sServeradmin; |
1115 | break; |
1116 | |
1117 | case KIO::ERR_UNKNOWN: |
1118 | errorName = i18n("Unknown Error" ); |
1119 | description = i18n( |
1120 | "The program on your computer which provides access " |
1121 | "to the <strong>%1</strong> protocol has reported an unknown error: " |
1122 | "%2." , |
1123 | protocol, |
1124 | errorText); |
1125 | causes << cBug; |
1126 | solutions << sUpdate << sBugreport; |
1127 | break; |
1128 | |
1129 | case KIO::ERR_UNKNOWN_INTERRUPT: |
1130 | errorName = i18n("Unknown Interruption" ); |
1131 | description = i18n( |
1132 | "The program on your computer which provides access " |
1133 | "to the <strong>%1</strong> protocol has reported an interruption of " |
1134 | "an unknown type: %2." , |
1135 | protocol, |
1136 | errorText); |
1137 | causes << cBug; |
1138 | solutions << sUpdate << sBugreport; |
1139 | break; |
1140 | |
1141 | case KIO::ERR_CANNOT_DELETE_ORIGINAL: |
1142 | errorName = i18n("Could Not Delete Original File" ); |
1143 | description = i18n( |
1144 | "The requested operation required the deleting of " |
1145 | "the original file, most likely at the end of a file move operation. " |
1146 | "The original file <strong>%1</strong> could not be deleted." , |
1147 | errorText); |
1148 | causes << cAccess; |
1149 | solutions << sAccess; |
1150 | break; |
1151 | |
1152 | case KIO::ERR_CANNOT_DELETE_PARTIAL: |
1153 | errorName = i18n("Could Not Delete Temporary File" ); |
1154 | description = i18n( |
1155 | "The requested operation required the creation of " |
1156 | "a temporary file in which to save the new file while being " |
1157 | "downloaded. This temporary file <strong>%1</strong> could not be " |
1158 | "deleted." , |
1159 | errorText); |
1160 | causes << cAccess; |
1161 | solutions << sAccess; |
1162 | break; |
1163 | |
1164 | case KIO::ERR_CANNOT_RENAME_ORIGINAL: |
1165 | errorName = i18n("Could Not Rename Original File" ); |
1166 | description = i18n( |
1167 | "The requested operation required the renaming of " |
1168 | "the original file <strong>%1</strong>, however it could not be " |
1169 | "renamed." , |
1170 | errorText); |
1171 | causes << cAccess; |
1172 | solutions << sAccess; |
1173 | break; |
1174 | |
1175 | case KIO::ERR_CANNOT_RENAME_PARTIAL: |
1176 | errorName = i18n("Could Not Rename Temporary File" ); |
1177 | description = i18n( |
1178 | "The requested operation required the creation of " |
1179 | "a temporary file <strong>%1</strong>, however it could not be " |
1180 | "created." , |
1181 | errorText); |
1182 | causes << cAccess; |
1183 | solutions << sAccess; |
1184 | break; |
1185 | |
1186 | case KIO::ERR_CANNOT_SYMLINK: |
1187 | errorName = i18n("Could Not Create Link" ); |
1188 | techName = i18n("Could Not Create Symbolic Link" ); |
1189 | description = i18n("The requested symbolic link %1 could not be created." , errorText); |
1190 | causes << cAccess; |
1191 | solutions << sAccess; |
1192 | break; |
1193 | |
1194 | case KIO::ERR_NO_CONTENT: |
1195 | errorName = i18n("No Content" ); |
1196 | description = errorText; |
1197 | break; |
1198 | |
1199 | case KIO::ERR_DISK_FULL: |
1200 | errorName = i18n("Disk Full" ); |
1201 | description = i18n( |
1202 | "The requested file <strong>%1</strong> could not be " |
1203 | "written to as there is inadequate disk space." , |
1204 | errorText); |
1205 | solutions << i18n( |
1206 | "Free up enough disk space by 1) deleting unwanted and " |
1207 | "temporary files; 2) archiving files to removable media storage such as " |
1208 | "CD-Recordable discs; or 3) obtain more storage capacity." ) |
1209 | << sSysadmin; |
1210 | break; |
1211 | |
1212 | case KIO::ERR_IDENTICAL_FILES: |
1213 | errorName = i18n("Source and Destination Files Identical" ); |
1214 | description = i18n( |
1215 | "The operation could not be completed because the " |
1216 | "source and destination files are the same file." ); |
1217 | solutions << i18n("Choose a different filename for the destination file." ); |
1218 | break; |
1219 | |
1220 | case KIO::ERR_DROP_ON_ITSELF: |
1221 | errorName = i18n("File or Folder dropped onto itself" ); |
1222 | description = i18n( |
1223 | "The operation could not be completed because the " |
1224 | "source and destination file or folder are the same." ); |
1225 | solutions << i18n("Drop the item into a different file or folder." ); |
1226 | break; |
1227 | |
1228 | // We assume that the worker has all the details |
1229 | case KIO::ERR_WORKER_DEFINED: |
1230 | errorName.clear(); |
1231 | description = errorText; |
1232 | break; |
1233 | |
1234 | case KIO::ERR_CANNOT_MOVE_INTO_ITSELF: |
1235 | errorName = i18n("Folder moved into itself" ); |
1236 | description = i18n( |
1237 | "The operation could not be completed because the " |
1238 | "source can not be moved into itself." ); |
1239 | solutions << i18n("Move the item into a different folder." ); |
1240 | break; |
1241 | |
1242 | case KIO::ERR_PASSWD_SERVER: |
1243 | errorName = i18n("Could not communicate with password server" ); |
1244 | description = i18n( |
1245 | "The operation could not be completed because the " |
1246 | "service for requesting passwords (kpasswdserver) couldn't be contacted" ); |
1247 | solutions << i18n("Try restarting your session, or look in the logs for errors from kiod." ); |
1248 | break; |
1249 | |
1250 | case KIO::ERR_CANNOT_CREATE_WORKER: |
1251 | errorName = i18n("Cannot Initiate the %1 Protocol" , protocol); |
1252 | techName = i18n("Unable to Create KIO Worker" ); |
1253 | description = i18n( |
1254 | "The KIO worker which provides access " |
1255 | "to the <strong>%1</strong> protocol could not be started. This is " |
1256 | "usually due to technical reasons." , |
1257 | protocol); |
1258 | causes << i18n( |
1259 | "klauncher could not find or start the plugin which provides the protocol. " |
1260 | "This means you may have an outdated version of the plugin." ); |
1261 | solutions << sUpdate << sSysadmin; |
1262 | break; |
1263 | |
1264 | case KIO::ERR_FILE_TOO_LARGE_FOR_FAT32: |
1265 | errorName = xi18nc("@info" , "Cannot transfer <filename>%1</filename>" , errorText); |
1266 | description = xi18nc("@info" , |
1267 | "The file <filename>%1</filename> cannot be transferred," |
1268 | " because the destination filesystem does not support files that large" , |
1269 | errorText); |
1270 | solutions << i18n("Reformat the destination drive to use a filesystem that supports files that large." ); |
1271 | break; |
1272 | |
1273 | default: |
1274 | // fall back to the plain error... |
1275 | errorName = i18n("Undocumented Error" ); |
1276 | description = buildErrorString(errorCode, errorText); |
1277 | } |
1278 | |
1279 | QByteArray ret; |
1280 | QDataStream stream(&ret, QIODevice::WriteOnly); |
1281 | stream << errorName << techName << description << causes << solutions; |
1282 | return ret; |
1283 | } |
1284 | |
1285 | QFile::Permissions KIO::convertPermissions(int permissions) |
1286 | { |
1287 | QFile::Permissions qPermissions; |
1288 | |
1289 | if (permissions > 0) { |
1290 | if (permissions & S_IRUSR) { |
1291 | qPermissions |= QFile::ReadOwner; |
1292 | } |
1293 | if (permissions & S_IWUSR) { |
1294 | qPermissions |= QFile::WriteOwner; |
1295 | } |
1296 | if (permissions & S_IXUSR) { |
1297 | qPermissions |= QFile::ExeOwner; |
1298 | } |
1299 | |
1300 | if (permissions & S_IRGRP) { |
1301 | qPermissions |= QFile::ReadGroup; |
1302 | } |
1303 | if (permissions & S_IWGRP) { |
1304 | qPermissions |= QFile::WriteGroup; |
1305 | } |
1306 | if (permissions & S_IXGRP) { |
1307 | qPermissions |= QFile::ExeGroup; |
1308 | } |
1309 | |
1310 | if (permissions & S_IROTH) { |
1311 | qPermissions |= QFile::ReadOther; |
1312 | } |
1313 | if (permissions & S_IWOTH) { |
1314 | qPermissions |= QFile::WriteOther; |
1315 | } |
1316 | if (permissions & S_IXOTH) { |
1317 | qPermissions |= QFile::ExeOther; |
1318 | } |
1319 | } |
1320 | |
1321 | return qPermissions; |
1322 | } |
1323 | |