KIO

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

KDE's Doxygen guidelines are available online.