KIO

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

KDE's Doxygen guidelines are available online.