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

KDE's Doxygen guidelines are available online.