1 /* This file is part of the KDE libraries
2 Copyright (C) 2000 David Faure <faure@kde.org>
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.
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.
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.
27 #include <kiconloader.h>
28 #include <kprotocolmanager.h>
29 #include <kmimetype.h>
30 #include <kdynamicjobtracker_p.h>
32 #include <QtCore/QByteArray>
33 #include <QtCore/QDate>
34 #include <QtGui/QTextDocument>
36 #include <sys/types.h>
47 K_GLOBAL_STATIC(KDynamicJobTracker
, globalJobTracker
)
49 // If someone wants the SI-standard prefixes kB/MB/GB/TB, I would recommend
50 // a hidden kconfig option and getting the code from #57240 into the same
51 // method, so that all KDE apps use the same unit, instead of letting each app decide.
53 KIO_EXPORT QString
KIO::convertSize( KIO::filesize_t size
)
55 return KGlobal::locale()->formatByteSize(size
);
58 KIO_EXPORT QString
KIO::convertSizeFromKiB( KIO::filesize_t kibSize
)
60 return KGlobal::locale()->formatByteSize(kibSize
* 1024);
63 KIO_EXPORT QString
KIO::number( KIO::filesize_t size
)
66 sprintf(charbuf
, "%lld", size
);
67 return QLatin1String(charbuf
);
70 KIO_EXPORT
unsigned int KIO::calculateRemainingSeconds( KIO::filesize_t totalSize
,
71 KIO::filesize_t processedSize
, KIO::filesize_t speed
)
73 if ( (speed
!= 0) && (totalSize
!= 0) )
74 return ( totalSize
- processedSize
) / speed
;
79 KIO_EXPORT QString
KIO::convertSeconds( unsigned int seconds
)
81 unsigned int days
= seconds
/ 86400;
82 unsigned int hours
= (seconds
- (days
* 86400)) / 3600;
83 unsigned int mins
= (seconds
- (days
* 86400) - (hours
* 3600)) / 60;
84 seconds
= (seconds
- (days
* 86400) - (hours
* 3600) - (mins
* 60));
86 const QTime
time(hours
, mins
, seconds
);
87 const QString
timeStr( KGlobal::locale()->formatTime(time
, true /*with seconds*/, true /*duration*/) );
89 return i18np("1 day %2", "%1 days %2", days
, timeStr
);
94 KIO_EXPORT QTime
KIO::calculateRemaining( KIO::filesize_t totalSize
, KIO::filesize_t processedSize
, KIO::filesize_t speed
)
100 if ( totalSize
== 0 ) {
103 secs
= ( totalSize
- processedSize
) / speed
;
105 if (secs
>= (24*60*60)) // Limit to 23:59:59
107 int hr
= secs
/ ( 60 * 60 );
108 int mn
= ( secs
- hr
* 60 * 60 ) / 60;
109 int sc
= ( secs
- hr
* 60 * 60 - mn
* 60 );
111 remainingTime
.setHMS( hr
, mn
, sc
);
114 return remainingTime
;
117 KIO_EXPORT QString
KIO::itemsSummaryString(uint items
, uint files
, uint dirs
, KIO::filesize_t size
, bool showSize
)
119 if ( files
== 0 && dirs
== 0 && items
== 0 ) {
120 return i18np( "%1 Item", "%1 Items", 0 );
124 const QString foldersText
= i18np( "1 Folder", "%1 Folders", dirs
);
125 const QString filesText
= i18np( "1 File", "%1 Files", files
);
126 if ( files
> 0 && dirs
> 0 ) {
128 i18nc( "folders, files (size)", "%1, %2 (%3)", foldersText
, filesText
, KIO::convertSize( size
) ) :
129 i18nc( "folders, files", "%1, %2", foldersText
, filesText
);
130 } else if ( files
> 0 ) {
131 summary
= showSize
? i18nc( "files (size)", "%1 (%2)", filesText
, KIO::convertSize( size
) ) : filesText
;
132 } else if ( dirs
> 0 ) {
133 summary
= foldersText
;
136 if ( items
> dirs
+ files
) {
137 const QString itemsText
= i18np( "%1 Item", "%1 Items", items
);
138 summary
= summary
.isEmpty() ? itemsText
: i18nc( "items: folders, files (size)", "%1: %2", itemsText
, summary
);
144 KIO_EXPORT QString
KIO::encodeFileName( const QString
& _str
)
147 str
.replace('/', QChar(0x2044)); // "Fraction slash"
151 KIO_EXPORT QString
KIO::decodeFileName( const QString
& _str
)
153 // Nothing to decode. "Fraction slash" is fine in filenames.
157 KIO_EXPORT QString
KIO::Job::errorString() const
159 return KIO::buildErrorString(error(), errorText());
162 KIO_EXPORT QString
KIO::buildErrorString(int errorCode
, const QString
&errorText
)
168 case KIO::ERR_CANNOT_OPEN_FOR_READING
:
169 result
= i18n( "Could not read %1." , errorText
);
171 case KIO::ERR_CANNOT_OPEN_FOR_WRITING
:
172 result
= i18n( "Could not write to %1." , errorText
);
174 case KIO::ERR_CANNOT_LAUNCH_PROCESS
:
175 result
= i18n( "Could not start process %1." , errorText
);
177 case KIO::ERR_INTERNAL
:
178 result
= i18n( "Internal Error\nPlease send a full bug report at http://bugs.kde.org\n%1" , errorText
);
180 case KIO::ERR_MALFORMED_URL
:
181 result
= i18n( "Malformed URL %1." , errorText
);
183 case KIO::ERR_UNSUPPORTED_PROTOCOL
:
184 result
= i18n( "The protocol %1 is not supported." , errorText
);
186 case KIO::ERR_NO_SOURCE_PROTOCOL
:
187 result
= i18n( "The protocol %1 is only a filter protocol.", errorText
);
189 case KIO::ERR_UNSUPPORTED_ACTION
:
191 // result = i18n( "Unsupported action %1" ).arg( errorText );
193 case KIO::ERR_IS_DIRECTORY
:
194 result
= i18n( "%1 is a folder, but a file was expected." , errorText
);
196 case KIO::ERR_IS_FILE
:
197 result
= i18n( "%1 is a file, but a folder was expected." , errorText
);
199 case KIO::ERR_DOES_NOT_EXIST
:
200 result
= i18n( "The file or folder %1 does not exist." , errorText
);
202 case KIO::ERR_FILE_ALREADY_EXIST
:
203 result
= i18n( "A file named %1 already exists." , errorText
);
205 case KIO::ERR_DIR_ALREADY_EXIST
:
206 result
= i18n( "A folder named %1 already exists." , errorText
);
208 case KIO::ERR_UNKNOWN_HOST
:
209 result
= errorText
.isEmpty() ? i18n( "No hostname specified." ) : i18n( "Unknown host %1" , errorText
);
211 case KIO::ERR_ACCESS_DENIED
:
212 result
= i18n( "Access denied to %1." , errorText
);
214 case KIO::ERR_WRITE_ACCESS_DENIED
:
215 result
= i18n( "Access denied.\nCould not write to %1." , errorText
);
217 case KIO::ERR_CANNOT_ENTER_DIRECTORY
:
218 result
= i18n( "Could not enter folder %1." , errorText
);
220 case KIO::ERR_PROTOCOL_IS_NOT_A_FILESYSTEM
:
221 result
= i18n( "The protocol %1 does not implement a folder service." , errorText
);
223 case KIO::ERR_CYCLIC_LINK
:
224 result
= i18n( "Found a cyclic link in %1." , errorText
);
226 case KIO::ERR_USER_CANCELED
:
227 // Do nothing in this case. The user doesn't need to be told what he just did.
229 case KIO::ERR_CYCLIC_COPY
:
230 result
= i18n( "Found a cyclic link while copying %1." , errorText
);
232 case KIO::ERR_COULD_NOT_CREATE_SOCKET
:
233 result
= i18n( "Could not create socket for accessing %1." , errorText
);
235 case KIO::ERR_COULD_NOT_CONNECT
:
236 result
= i18n( "Could not connect to host %1." , errorText
.isEmpty() ? QLatin1String("localhost") : errorText
);
238 case KIO::ERR_CONNECTION_BROKEN
:
239 result
= i18n( "Connection to host %1 is broken." , errorText
);
241 case KIO::ERR_NOT_FILTER_PROTOCOL
:
242 result
= i18n( "The protocol %1 is not a filter protocol." , errorText
);
244 case KIO::ERR_COULD_NOT_MOUNT
:
245 result
= i18n( "Could not mount device.\nThe reported error was:\n%1" , errorText
);
247 case KIO::ERR_COULD_NOT_UNMOUNT
:
248 result
= i18n( "Could not unmount device.\nThe reported error was:\n%1" , errorText
);
250 case KIO::ERR_COULD_NOT_READ
:
251 result
= i18n( "Could not read file %1." , errorText
);
253 case KIO::ERR_COULD_NOT_WRITE
:
254 result
= i18n( "Could not write to file %1." , errorText
);
256 case KIO::ERR_COULD_NOT_BIND
:
257 result
= i18n( "Could not bind %1." , errorText
);
259 case KIO::ERR_COULD_NOT_LISTEN
:
260 result
= i18n( "Could not listen %1." , errorText
);
262 case KIO::ERR_COULD_NOT_ACCEPT
:
263 result
= i18n( "Could not accept %1." , errorText
);
265 case KIO::ERR_COULD_NOT_LOGIN
:
268 case KIO::ERR_COULD_NOT_STAT
:
269 result
= i18n( "Could not access %1." , errorText
);
271 case KIO::ERR_COULD_NOT_CLOSEDIR
:
272 result
= i18n( "Could not terminate listing %1." , errorText
);
274 case KIO::ERR_COULD_NOT_MKDIR
:
275 result
= i18n( "Could not make folder %1." , errorText
);
277 case KIO::ERR_COULD_NOT_RMDIR
:
278 result
= i18n( "Could not remove folder %1." , errorText
);
280 case KIO::ERR_CANNOT_RESUME
:
281 result
= i18n( "Could not resume file %1." , errorText
);
283 case KIO::ERR_CANNOT_RENAME
:
284 result
= i18n( "Could not rename file %1." , errorText
);
286 case KIO::ERR_CANNOT_CHMOD
:
287 result
= i18n( "Could not change permissions for %1." , errorText
);
289 case KIO::ERR_CANNOT_CHOWN
:
290 result
= i18n( "Could not change ownership for %1." , errorText
);
292 case KIO::ERR_CANNOT_DELETE
:
293 result
= i18n( "Could not delete file %1." , errorText
);
295 case KIO::ERR_SLAVE_DIED
:
296 result
= i18n( "The process for the %1 protocol died unexpectedly." , errorText
);
298 case KIO::ERR_OUT_OF_MEMORY
:
299 result
= i18n( "Error. Out of memory.\n%1" , errorText
);
301 case KIO::ERR_UNKNOWN_PROXY_HOST
:
302 result
= i18n( "Unknown proxy host\n%1" , errorText
);
304 case KIO::ERR_COULD_NOT_AUTHENTICATE
:
305 result
= i18n( "Authorization failed, %1 authentication not supported" , errorText
);
307 case KIO::ERR_ABORTED
:
308 result
= i18n( "User canceled action\n%1" , errorText
);
310 case KIO::ERR_INTERNAL_SERVER
:
311 result
= i18n( "Internal error in server\n%1" , errorText
);
313 case KIO::ERR_SERVER_TIMEOUT
:
314 result
= i18n( "Timeout on server\n%1" , errorText
);
316 case KIO::ERR_UNKNOWN
:
317 result
= i18n( "Unknown error\n%1" , errorText
);
319 case KIO::ERR_UNKNOWN_INTERRUPT
:
320 result
= i18n( "Unknown interrupt\n%1" , errorText
);
323 case KIO::ERR_CHECKSUM_MISMATCH:
325 result = i18n( "Warning: MD5 Checksum for %1 does not match checksum returned from server" ).arg(errorText);
327 result = i18n( "Warning: MD5 Checksum for %1 does not match checksum returned from server" ).arg("document");
330 case KIO::ERR_CANNOT_DELETE_ORIGINAL
:
331 result
= i18n( "Could not delete original file %1.\nPlease check permissions." , errorText
);
333 case KIO::ERR_CANNOT_DELETE_PARTIAL
:
334 result
= i18n( "Could not delete partial file %1.\nPlease check permissions." , errorText
);
336 case KIO::ERR_CANNOT_RENAME_ORIGINAL
:
337 result
= i18n( "Could not rename original file %1.\nPlease check permissions." , errorText
);
339 case KIO::ERR_CANNOT_RENAME_PARTIAL
:
340 result
= i18n( "Could not rename partial file %1.\nPlease check permissions." , errorText
);
342 case KIO::ERR_CANNOT_SYMLINK
:
343 result
= i18n( "Could not create symlink %1.\nPlease check permissions." , errorText
);
345 case KIO::ERR_NO_CONTENT
:
348 case KIO::ERR_DISK_FULL
:
349 result
= i18n( "Could not write file %1.\nDisk full." , errorText
);
351 case KIO::ERR_IDENTICAL_FILES
:
352 result
= i18n( "The source and destination are the same file.\n%1" , errorText
);
354 case KIO::ERR_SLAVE_DEFINED
:
357 case KIO::ERR_UPGRADE_REQUIRED
:
358 result
= i18n( "%1 is required by the server, but is not available." , errorText
);
360 case KIO::ERR_POST_DENIED
:
361 result
= i18n( "Access to restricted port in POST denied.");
364 result
= i18n( "Unknown error code %1\n%2\nPlease send a full bug report at http://bugs.kde.org." , errorCode
, errorText
);
371 KIO_EXPORT QString
KIO::unsupportedActionErrorString(const QString
&protocol
, int cmd
) {
374 return i18n("Opening connections is not supported with the protocol %1." , protocol
);
376 return i18n("Closing connections is not supported with the protocol %1." , protocol
);
378 return i18n("Accessing files is not supported with the protocol %1.", protocol
);
380 return i18n("Writing to %1 is not supported.", protocol
);
382 return i18n("There are no special actions available for protocol %1.", protocol
);
384 return i18n("Listing folders is not supported for protocol %1.", protocol
);
386 return i18n("Retrieving data from %1 is not supported.", protocol
);
388 return i18n("Retrieving mime type information from %1 is not supported.", protocol
);
390 return i18n("Renaming or moving files within %1 is not supported.", protocol
);
392 return i18n("Creating symlinks is not supported with protocol %1.", protocol
);
394 return i18n("Copying files within %1 is not supported.", protocol
);
396 return i18n("Deleting files from %1 is not supported.", protocol
);
398 return i18n("Creating folders is not supported with protocol %1.", protocol
);
400 return i18n("Changing the attributes of files is not supported with protocol %1.", protocol
);
402 return i18n("Changing the ownership of files is not supported with protocol %1.", protocol
);
404 return i18n("Using sub-URLs with %1 is not supported.", protocol
);
406 return i18n("Multiple get is not supported with protocol %1.", protocol
);
408 return i18n("Opening files is not supported with protocol %1.", protocol
);
410 return i18n("Protocol %1 does not support action %2.", protocol
, cmd
);
414 KIO_EXPORT QStringList
KIO::Job::detailedErrorStrings( const KUrl
*reqUrl
/*= 0L*/,
415 int method
/*= -1*/ ) const
417 QString errorName
, techName
, description
, ret2
;
418 QStringList causes
, solutions
, ret
;
420 QByteArray raw
= rawErrorDetail( error(), errorText(), reqUrl
, method
);
421 QDataStream
stream(raw
);
423 stream
>> errorName
>> techName
>> description
>> causes
>> solutions
;
425 QString url
, protocol
, datetime
;
427 url
= Qt::escape(reqUrl
->prettyUrl());
428 protocol
= reqUrl
->protocol();
430 url
= i18nc("@info url", "(unknown)" );
433 datetime
= KGlobal::locale()->formatDateTime( QDateTime::currentDateTime(),
437 ret
<< i18nc( "@info %1 error name, %2 description",
438 "<qt><p><b>%1</b></p><p>%2</p></qt>", errorName
, description
);
440 ret2
= QLatin1String( "<qt>" );
441 if ( !techName
.isEmpty() )
442 ret2
+= QLatin1String( "<p>" ) + i18n( "<b>Technical reason</b>: " ) +
443 techName
+ QLatin1String( "</p>" );
444 ret2
+= QLatin1String( "<p>" ) + i18n( "<b>Details of the request</b>:" ) +
445 QLatin1String( "</p><ul>" ) + i18n( "<li>URL: %1</li>", url
);
446 if ( !protocol
.isEmpty() ) {
447 ret2
+= i18n( "<li>Protocol: %1</li>" , protocol
);
449 ret2
+= i18n( "<li>Date and time: %1</li>", datetime
) +
450 i18n( "<li>Additional information: %1</li>" , errorText() ) +
451 QLatin1String( "</ul>" );
452 if ( !causes
.isEmpty() ) {
453 ret2
+= QLatin1String( "<p>" ) + i18n( "<b>Possible causes</b>:" ) +
454 QLatin1String( "</p><ul><li>" ) + causes
.join( "</li><li>" ) +
455 QLatin1String( "</li></ul>" );
457 if ( !solutions
.isEmpty() ) {
458 ret2
+= QLatin1String( "<p>" ) + i18n( "<b>Possible solutions</b>:" ) +
459 QLatin1String( "</p><ul><li>" ) + solutions
.join( "</li><li>" ) +
460 QLatin1String( "</li></ul>" );
462 ret2
+= QLatin1String( "</qt>" );
468 KIO_EXPORT QByteArray
KIO::rawErrorDetail(int errorCode
, const QString
&errorText
,
469 const KUrl
*reqUrl
/*= 0L*/, int /*method = -1*/ )
471 QString url
, host
, protocol
, datetime
, domain
, path
, filename
;
472 bool isSlaveNetwork
= false;
474 url
= reqUrl
->prettyUrl();
475 host
= reqUrl
->host();
476 protocol
= reqUrl
->protocol();
478 if ( host
.startsWith( QLatin1String( "www." ) ) )
479 domain
= host
.mid(4);
483 filename
= reqUrl
->fileName();
484 path
= reqUrl
->path();
486 // detect if protocol is a network protocol...
487 isSlaveNetwork
= KProtocolInfo::protocolClass(protocol
) == ":internet";
489 // assume that the errorText has the location we are interested in
490 url
= host
= domain
= path
= filename
= errorText
;
491 protocol
= i18nc("@info protocol", "(unknown)" );
494 datetime
= KGlobal::locale()->formatDateTime( QDateTime::currentDateTime(),
497 QString errorName
, techName
, description
;
498 QStringList causes
, solutions
;
500 // c == cause, s == solution
501 QString sSysadmin
= i18n( "Contact your appropriate computer support system, "
502 "whether the system administrator, or technical support group for further "
504 QString sServeradmin
= i18n( "Contact the administrator of the server "
505 "for further assistance." );
506 // FIXME active link to permissions dialog
507 QString sAccess
= i18n( "Check your access permissions on this resource." );
508 QString cAccess
= i18n( "Your access permissions may be inadequate to "
509 "perform the requested operation on this resource." );
510 QString cLocked
= i18n( "The file may be in use (and thus locked) by "
511 "another user or application." );
512 QString sQuerylock
= i18n( "Check to make sure that no other "
513 "application or user is using the file or has locked the file." );
514 QString cHardware
= i18n( "Although unlikely, a hardware error may have "
516 QString cBug
= i18n( "You may have encountered a bug in the program." );
517 QString cBuglikely
= i18n( "This is most likely to be caused by a bug in the "
518 "program. Please consider submitting a full bug report as detailed below." );
519 QString sUpdate
= i18n( "Update your software to the latest version. "
520 "Your distribution should provide tools to update your software." );
521 QString sBugreport
= i18n( "When all else fails, please consider helping the "
522 "KDE team or the third party maintainer of this software by submitting a "
523 "high quality bug report. If the software is provided by a third party, "
524 "please contact them directly. Otherwise, first look to see if "
525 "the same bug has been submitted by someone else by searching at the "
526 "<a href=\"http://bugs.kde.org/\">KDE bug reporting website</a>. If not, take "
527 "note of the details given above, and include them in your bug report, along "
528 "with as many other details as you think might help." );
529 QString cNetwork
= i18n( "There may have been a problem with your network "
531 // FIXME netconf kcontrol link
532 QString cNetconf
= i18n( "There may have been a problem with your network "
533 "configuration. If you have been accessing the Internet with no problems "
534 "recently, this is unlikely." );
535 QString cNetpath
= i18n( "There may have been a problem at some point along "
536 "the network path between the server and this computer." );
537 QString sTryagain
= i18n( "Try again, either now or at a later time." );
538 QString cProtocol
= i18n( "A protocol error or incompatibility may have occurred." );
539 QString sExists
= i18n( "Ensure that the resource exists, and try again." );
540 QString cExists
= i18n( "The specified resource may not exist." );
541 QString cTypo
= i18n( "You may have incorrectly typed the location." );
542 QString sTypo
= i18n( "Double-check that you have entered the correct location "
544 QString sNetwork
= i18n( "Check your network connection status." );
546 switch( errorCode
) {
547 case KIO::ERR_CANNOT_OPEN_FOR_READING
:
548 errorName
= i18n( "Cannot Open Resource For Reading" );
549 description
= i18n( "This means that the contents of the requested file "
550 "or folder <strong>%1</strong> could not be retrieved, as read "
551 "access could not be obtained.", path
);
552 causes
<< i18n( "You may not have permissions to read the file or open "
553 "the folder.") << cLocked
<< cHardware
;
554 solutions
<< sAccess
<< sQuerylock
<< sSysadmin
;
557 case KIO::ERR_CANNOT_OPEN_FOR_WRITING
:
558 errorName
= i18n( "Cannot Open Resource For Writing" );
559 description
= i18n( "This means that the file, <strong>%1</strong>, could "
560 "not be written to as requested, because access with permission to "
561 "write could not be obtained." , filename
);
562 causes
<< cAccess
<< cLocked
<< cHardware
;
563 solutions
<< sAccess
<< sQuerylock
<< sSysadmin
;
566 case KIO::ERR_CANNOT_LAUNCH_PROCESS
:
567 errorName
= i18n( "Cannot Initiate the %1 Protocol" , protocol
);
568 techName
= i18n( "Unable to Launch Process" );
569 description
= i18n( "The program on your computer which provides access "
570 "to the <strong>%1</strong> protocol could not be started. This is "
571 "usually due to technical reasons." , protocol
);
572 causes
<< i18n( "The program which provides compatibility with this "
573 "protocol may not have been updated with your last update of KDE. "
574 "This can cause the program to be incompatible with the current version "
575 "and thus not start." ) << cBug
;
576 solutions
<< sUpdate
<< sSysadmin
;
579 case KIO::ERR_INTERNAL
:
580 errorName
= i18n( "Internal Error" );
581 description
= i18n( "The program on your computer which provides access "
582 "to the <strong>%1</strong> protocol has reported an internal error." ,
584 causes
<< cBuglikely
;
585 solutions
<< sUpdate
<< sBugreport
;
588 case KIO::ERR_MALFORMED_URL
:
589 errorName
= i18n( "Improperly Formatted URL" );
590 description
= i18n( "The <strong>U</strong>niform <strong>R</strong>esource "
591 "<strong>L</strong>ocator (URL) that you entered was not properly "
592 "formatted. The format of a URL is generally as follows:"
593 "<blockquote><strong>protocol://user:password@www.example.org:port/folder/"
594 "filename.extension?query=value</strong></blockquote>" );
598 case KIO::ERR_UNSUPPORTED_PROTOCOL
:
599 errorName
= i18n( "Unsupported Protocol %1" , protocol
);
600 description
= i18n( "The protocol <strong>%1</strong> is not supported "
601 "by the KDE programs currently installed on this computer." ,
603 causes
<< i18n( "The requested protocol may not be supported." )
604 << i18n( "The versions of the %1 protocol supported by this computer and "
605 "the server may be incompatible." , protocol
);
606 solutions
<< i18n( "You may perform a search on the Internet for a KDE "
607 "program (called a kioslave or ioslave) which supports this protocol. "
608 "Places to search include <a href=\"http://kde-apps.org/\">"
609 "http://kde-apps.org/</a> and <a href=\"http://freshmeat.net/\">"
610 "http://freshmeat.net/</a>." )
611 << sUpdate
<< sSysadmin
;
614 case KIO::ERR_NO_SOURCE_PROTOCOL
:
615 errorName
= i18n( "URL Does Not Refer to a Resource." );
616 techName
= i18n( "Protocol is a Filter Protocol" );
617 description
= i18n( "The <strong>U</strong>niform <strong>R</strong>esource "
618 "<strong>L</strong>ocator (URL) that you entered did not refer to a "
619 "specific resource." );
620 causes
<< i18n( "KDE is able to communicate through a protocol within a "
621 "protocol; the protocol specified is only for use in such situations, "
622 "however this is not one of these situations. This is a rare event, and "
623 "is likely to indicate a programming error." );
627 case KIO::ERR_UNSUPPORTED_ACTION
:
628 errorName
= i18n( "Unsupported Action: %1" , errorText
);
629 description
= i18n( "The requested action is not supported by the KDE "
630 "program which is implementing the <strong>%1</strong> protocol." ,
632 causes
<< i18n( "This error is very much dependent on the KDE program. The "
633 "additional information should give you more information than is available "
634 "to the KDE input/output architecture." );
635 solutions
<< i18n( "Attempt to find another way to accomplish the same "
639 case KIO::ERR_IS_DIRECTORY
:
640 errorName
= i18n( "File Expected" );
641 description
= i18n( "The request expected a file, however the "
642 "folder <strong>%1</strong> was found instead." , path
);
643 causes
<< i18n( "This may be an error on the server side." ) << cBug
;
644 solutions
<< sUpdate
<< sSysadmin
;
647 case KIO::ERR_IS_FILE
:
648 errorName
= i18n( "Folder Expected" );
649 description
= i18n( "The request expected a folder, however "
650 "the file <strong>%1</strong> was found instead." , filename
);
652 solutions
<< sUpdate
<< sSysadmin
;
655 case KIO::ERR_DOES_NOT_EXIST
:
656 errorName
= i18n( "File or Folder Does Not Exist" );
657 description
= i18n( "The specified file or folder <strong>%1</strong> "
658 "does not exist." , path
);
660 solutions
<< sUpdate
<< sSysadmin
;
663 case KIO::ERR_FILE_ALREADY_EXIST
:
664 errorName
= i18n( "File Already Exists" );
665 description
= i18n( "The requested file could not be created because a "
666 "file with the same name already exists." );
667 solutions
<< i18n ( "Try moving the current file out of the way first, "
668 "and then try again." )
669 << i18n ( "Delete the current file and try again." )
670 << i18n( "Choose an alternate filename for the new file." );
673 case KIO::ERR_DIR_ALREADY_EXIST
:
674 errorName
= i18n( "Folder Already Exists" );
675 description
= i18n( "The requested folder could not be created because "
676 "a folder with the same name already exists." );
677 solutions
<< i18n( "Try moving the current folder out of the way first, "
678 "and then try again." )
679 << i18n( "Delete the current folder and try again." )
680 << i18n( "Choose an alternate name for the new folder." );
683 case KIO::ERR_UNKNOWN_HOST
:
684 errorName
= i18n( "Unknown Host" );
685 description
= i18n( "An unknown host error indicates that the server with "
686 "the requested name, <strong>%1</strong>, could not be "
687 "located on the Internet." , host
);
688 causes
<< i18n( "The name that you typed, %1, may not exist: it may be "
689 "incorrectly typed." , host
)
690 << cNetwork
<< cNetconf
;
691 solutions
<< sNetwork
<< sSysadmin
;
694 case KIO::ERR_ACCESS_DENIED
:
695 errorName
= i18n( "Access Denied" );
696 description
= i18n( "Access was denied to the specified resource, "
697 "<strong>%1</strong>." , url
);
698 causes
<< i18n( "You may have supplied incorrect authentication details or "
700 << i18n( "Your account may not have permission to access the "
701 "specified resource." );
702 solutions
<< i18n( "Retry the request and ensure your authentication details "
703 "are entered correctly." ) << sSysadmin
;
704 if ( !isSlaveNetwork
) solutions
<< sServeradmin
;
707 case KIO::ERR_WRITE_ACCESS_DENIED
:
708 errorName
= i18n( "Write Access Denied" );
709 description
= i18n( "This means that an attempt to write to the file "
710 "<strong>%1</strong> was rejected." , filename
);
711 causes
<< cAccess
<< cLocked
<< cHardware
;
712 solutions
<< sAccess
<< sQuerylock
<< sSysadmin
;
715 case KIO::ERR_CANNOT_ENTER_DIRECTORY
:
716 errorName
= i18n( "Unable to Enter Folder" );
717 description
= i18n( "This means that an attempt to enter (in other words, "
718 "to open) the requested folder <strong>%1</strong> was rejected." ,
720 causes
<< cAccess
<< cLocked
;
721 solutions
<< sAccess
<< sQuerylock
<< sSysadmin
;
724 case KIO::ERR_PROTOCOL_IS_NOT_A_FILESYSTEM
:
725 errorName
= i18n( "Folder Listing Unavailable" );
726 techName
= i18n( "Protocol %1 is not a Filesystem" , protocol
);
727 description
= i18n( "This means that a request was made which requires "
728 "determining the contents of the folder, and the KDE program supporting "
729 "this protocol is unable to do so." );
731 solutions
<< sUpdate
<< sBugreport
;
734 case KIO::ERR_CYCLIC_LINK
:
735 errorName
= i18n( "Cyclic Link Detected" );
736 description
= i18n( "UNIX environments are commonly able to link a file or "
737 "folder to a separate name and/or location. KDE detected a link or "
738 "series of links that results in an infinite loop - i.e. the file was "
739 "(perhaps in a roundabout way) linked to itself." );
740 solutions
<< i18n( "Delete one part of the loop in order that it does not "
741 "cause an infinite loop, and try again." ) << sSysadmin
;
744 case KIO::ERR_USER_CANCELED
:
745 // Do nothing in this case. The user doesn't need to be told what he just did.
746 // rodda: However, if we have been called, an application is about to display
747 // this information anyway. If we don't return sensible information, the
748 // user sees a blank dialog (I have seen this myself)
749 errorName
= i18n( "Request Aborted By User" );
750 description
= i18n( "The request was not completed because it was "
752 solutions
<< i18n( "Retry the request." );
755 case KIO::ERR_CYCLIC_COPY
:
756 errorName
= i18n( "Cyclic Link Detected During Copy" );
757 description
= i18n( "UNIX environments are commonly able to link a file or "
758 "folder to a separate name and/or location. During the requested copy "
759 "operation, KDE detected a link or series of links that results in an "
760 "infinite loop - i.e. the file was (perhaps in a roundabout way) linked "
762 solutions
<< i18n( "Delete one part of the loop in order that it does not "
763 "cause an infinite loop, and try again." ) << sSysadmin
;
766 case KIO::ERR_COULD_NOT_CREATE_SOCKET
:
767 errorName
= i18n( "Could Not Create Network Connection" );
768 techName
= i18n( "Could Not Create Socket" );
769 description
= i18n( "This is a fairly technical error in which a required "
770 "device for network communications (a socket) could not be created." );
771 causes
<< i18n( "The network connection may be incorrectly configured, or "
772 "the network interface may not be enabled." );
773 solutions
<< sNetwork
<< sSysadmin
;
776 case KIO::ERR_COULD_NOT_CONNECT
:
777 errorName
= i18n( "Connection to Server Refused" );
778 description
= i18n( "The server <strong>%1</strong> refused to allow this "
779 "computer to make a connection." , host
);
780 causes
<< i18n( "The server, while currently connected to the Internet, "
781 "may not be configured to allow requests." )
782 << i18n( "The server, while currently connected to the Internet, "
783 "may not be running the requested service (%1)." , protocol
)
784 << i18n( "A network firewall (a device which restricts Internet "
785 "requests), either protecting your network or the network of the server, "
786 "may have intervened, preventing this request." );
787 solutions
<< sTryagain
<< sServeradmin
<< sSysadmin
;
790 case KIO::ERR_CONNECTION_BROKEN
:
791 errorName
= i18n( "Connection to Server Closed Unexpectedly" );
792 description
= i18n( "Although a connection was established to "
793 "<strong>%1</strong>, the connection was closed at an unexpected point "
794 "in the communication." , host
);
795 causes
<< cNetwork
<< cNetpath
<< i18n( "A protocol error may have occurred, "
796 "causing the server to close the connection as a response to the error." );
797 solutions
<< sTryagain
<< sServeradmin
<< sSysadmin
;
800 case KIO::ERR_NOT_FILTER_PROTOCOL
:
801 errorName
= i18n( "URL Resource Invalid" );
802 techName
= i18n( "Protocol %1 is not a Filter Protocol" , protocol
);
803 description
= i18n( "The <strong>U</strong>niform <strong>R</strong>esource "
804 "<strong>L</strong>ocator (URL) that you entered did not refer to "
805 "a valid mechanism of accessing the specific resource, "
806 "<strong>%1%2</strong>." ,
807 !host
.isNull() ? host
+ '/' : QString() , path
);
808 causes
<< i18n( "KDE is able to communicate through a protocol within a "
809 "protocol. This request specified a protocol be used as such, however "
810 "this protocol is not capable of such an action. This is a rare event, "
811 "and is likely to indicate a programming error." );
812 solutions
<< sTypo
<< sSysadmin
;
815 case KIO::ERR_COULD_NOT_MOUNT
:
816 errorName
= i18n( "Unable to Initialize Input/Output Device" );
817 techName
= i18n( "Could Not Mount Device" );
818 description
= i18n( "The requested device could not be initialized "
819 "(\"mounted\"). The reported error was: <strong>%1</strong>" ,
821 causes
<< i18n( "The device may not be ready, for example there may be "
822 "no media in a removable media device (i.e. no CD-ROM in a CD drive), "
823 "or in the case of a peripheral/portable device, the device may not "
824 "be correctly connected." )
825 << i18n( "You may not have permissions to initialize (\"mount\") the "
826 "device. On UNIX systems, often system administrator privileges are "
827 "required to initialize a device." )
829 solutions
<< i18n( "Check that the device is ready; removable drives "
830 "must contain media, and portable devices must be connected and powered "
831 "on.; and try again." ) << sAccess
<< sSysadmin
;
834 case KIO::ERR_COULD_NOT_UNMOUNT
:
835 errorName
= i18n( "Unable to Uninitialize Input/Output Device" );
836 techName
= i18n( "Could Not Unmount Device" );
837 description
= i18n( "The requested device could not be uninitialized "
838 "(\"unmounted\"). The reported error was: <strong>%1</strong>" ,
840 causes
<< i18n( "The device may be busy, that is, still in use by "
841 "another application or user. Even such things as having an open "
842 "browser window on a location on this device may cause the device to "
844 << i18n( "You may not have permissions to uninitialize (\"unmount\") "
845 "the device. On UNIX systems, system administrator privileges are "
846 "often required to uninitialize a device." )
848 solutions
<< i18n( "Check that no applications are accessing the device, "
849 "and try again." ) << sAccess
<< sSysadmin
;
852 case KIO::ERR_COULD_NOT_READ
:
853 errorName
= i18n( "Cannot Read From Resource" );
854 description
= i18n( "This means that although the resource, "
855 "<strong>%1</strong>, was able to be opened, an error occurred while "
856 "reading the contents of the resource." , url
);
857 causes
<< i18n( "You may not have permissions to read from the resource." );
858 if ( !isSlaveNetwork
) causes
<< cNetwork
;
860 solutions
<< sAccess
;
861 if ( !isSlaveNetwork
) solutions
<< sNetwork
;
862 solutions
<< sSysadmin
;
865 case KIO::ERR_COULD_NOT_WRITE
:
866 errorName
= i18n( "Cannot Write to Resource" );
867 description
= i18n( "This means that although the resource, <strong>%1</strong>"
868 ", was able to be opened, an error occurred while writing to the resource." ,
870 causes
<< i18n( "You may not have permissions to write to the resource." );
871 if ( !isSlaveNetwork
) causes
<< cNetwork
;
873 solutions
<< sAccess
;
874 if ( !isSlaveNetwork
) solutions
<< sNetwork
;
875 solutions
<< sSysadmin
;
878 case KIO::ERR_COULD_NOT_BIND
:
879 errorName
= i18n( "Could Not Listen for Network Connections" );
880 techName
= i18n( "Could Not Bind" );
881 description
= i18n( "This is a fairly technical error in which a required "
882 "device for network communications (a socket) could not be established "
883 "to listen for incoming network connections." );
884 causes
<< i18n( "The network connection may be incorrectly configured, or "
885 "the network interface may not be enabled." );
886 solutions
<< sNetwork
<< sSysadmin
;
889 case KIO::ERR_COULD_NOT_LISTEN
:
890 errorName
= i18n( "Could Not Listen for Network Connections" );
891 techName
= i18n( "Could Not Listen" );
892 description
= i18n( "This is a fairly technical error in which a required "
893 "device for network communications (a socket) could not be established "
894 "to listen for incoming network connections." );
895 causes
<< i18n( "The network connection may be incorrectly configured, or "
896 "the network interface may not be enabled." );
897 solutions
<< sNetwork
<< sSysadmin
;
900 case KIO::ERR_COULD_NOT_ACCEPT
:
901 errorName
= i18n( "Could Not Accept Network Connection" );
902 description
= i18n( "This is a fairly technical error in which an error "
903 "occurred while attempting to accept an incoming network connection." );
904 causes
<< i18n( "The network connection may be incorrectly configured, or "
905 "the network interface may not be enabled." )
906 << i18n( "You may not have permissions to accept the connection." );
907 solutions
<< sNetwork
<< sSysadmin
;
910 case KIO::ERR_COULD_NOT_LOGIN
:
911 errorName
= i18n( "Could Not Login: %1" , errorText
);
912 description
= i18n( "An attempt to login to perform the requested "
913 "operation was unsuccessful." );
914 causes
<< i18n( "You may have supplied incorrect authentication details or "
916 << i18n( "Your account may not have permission to access the "
917 "specified resource." ) << cProtocol
;
918 solutions
<< i18n( "Retry the request and ensure your authentication details "
919 "are entered correctly." ) << sServeradmin
<< sSysadmin
;
922 case KIO::ERR_COULD_NOT_STAT
:
923 errorName
= i18n( "Could Not Determine Resource Status" );
924 techName
= i18n( "Could Not Stat Resource" );
925 description
= i18n( "An attempt to determine information about the status "
926 "of the resource <strong>%1</strong>, such as the resource name, type, "
927 "size, etc., was unsuccessful." , url
);
928 causes
<< i18n( "The specified resource may not have existed or may "
929 "not be accessible." ) << cProtocol
<< cHardware
;
930 solutions
<< i18n( "Retry the request and ensure your authentication details "
931 "are entered correctly." ) << sSysadmin
;
934 case KIO::ERR_COULD_NOT_CLOSEDIR
:
935 //result = i18n( "Could not terminate listing %1" ).arg( errorText );
936 errorName
= i18n( "Could Not Cancel Listing" );
937 techName
= i18n( "FIXME: Document this" );
940 case KIO::ERR_COULD_NOT_MKDIR
:
941 errorName
= i18n( "Could Not Create Folder" );
942 description
= i18n( "An attempt to create the requested folder failed." );
943 causes
<< cAccess
<< i18n( "The location where the folder was to be created "
945 if ( !isSlaveNetwork
) causes
<< cProtocol
;
946 solutions
<< i18n( "Retry the request." ) << sAccess
;
949 case KIO::ERR_COULD_NOT_RMDIR
:
950 errorName
= i18n( "Could Not Remove Folder" );
951 description
= i18n( "An attempt to remove the specified folder, "
952 "<strong>%1</strong>, failed." , path
);
953 causes
<< i18n( "The specified folder may not exist." )
954 << i18n( "The specified folder may not be empty." )
956 if ( !isSlaveNetwork
) causes
<< cProtocol
;
957 solutions
<< i18n( "Ensure that the folder exists and is empty, and try "
958 "again." ) << sAccess
;
961 case KIO::ERR_CANNOT_RESUME
:
962 errorName
= i18n( "Could Not Resume File Transfer" );
963 description
= i18n( "The specified request asked that the transfer of "
964 "file <strong>%1</strong> be resumed at a certain point of the "
965 "transfer. This was not possible." , filename
);
966 causes
<< i18n( "The protocol, or the server, may not support file "
968 solutions
<< i18n( "Retry the request without attempting to resume "
972 case KIO::ERR_CANNOT_RENAME
:
973 errorName
= i18n( "Could Not Rename Resource" );
974 description
= i18n( "An attempt to rename the specified resource "
975 "<strong>%1</strong> failed." , url
);
976 causes
<< cAccess
<< cExists
;
977 if ( !isSlaveNetwork
) causes
<< cProtocol
;
978 solutions
<< sAccess
<< sExists
;
981 case KIO::ERR_CANNOT_CHMOD
:
982 errorName
= i18n( "Could Not Alter Permissions of Resource" );
983 description
= i18n( "An attempt to alter the permissions on the specified "
984 "resource <strong>%1</strong> failed." , url
);
985 causes
<< cAccess
<< cExists
;
986 solutions
<< sAccess
<< sExists
;
989 case KIO::ERR_CANNOT_CHOWN
:
990 errorName
= i18n( "Could Not Change Ownership of Resource" );
991 description
= i18n( "An attempt to change the ownership of the specified "
992 "resource <strong>%1</strong> failed." , url
);
993 causes
<< cAccess
<< cExists
;
994 solutions
<< sAccess
<< sExists
;
997 case KIO::ERR_CANNOT_DELETE
:
998 errorName
= i18n( "Could Not Delete Resource" );
999 description
= i18n( "An attempt to delete the specified resource "
1000 "<strong>%1</strong> failed." , url
);
1001 causes
<< cAccess
<< cExists
;
1002 solutions
<< sAccess
<< sExists
;
1005 case KIO::ERR_SLAVE_DIED
:
1006 errorName
= i18n( "Unexpected Program Termination" );
1007 description
= i18n( "The program on your computer which provides access "
1008 "to the <strong>%1</strong> protocol has unexpectedly terminated." ,
1010 causes
<< cBuglikely
;
1011 solutions
<< sUpdate
<< sBugreport
;
1014 case KIO::ERR_OUT_OF_MEMORY
:
1015 errorName
= i18n( "Out of Memory" );
1016 description
= i18n( "The program on your computer which provides access "
1017 "to the <strong>%1</strong> protocol could not obtain the memory "
1018 "required to continue." , protocol
);
1019 causes
<< cBuglikely
;
1020 solutions
<< sUpdate
<< sBugreport
;
1023 case KIO::ERR_UNKNOWN_PROXY_HOST
:
1024 errorName
= i18n( "Unknown Proxy Host" );
1025 description
= i18n( "While retrieving information about the specified "
1026 "proxy host, <strong>%1</strong>, an Unknown Host error was encountered. "
1027 "An unknown host error indicates that the requested name could not be "
1028 "located on the Internet." , errorText
);
1029 causes
<< i18n( "There may have been a problem with your network "
1030 "configuration, specifically your proxy's hostname. If you have been "
1031 "accessing the Internet with no problems recently, this is unlikely." )
1033 solutions
<< i18n( "Double-check your proxy settings and try again." )
1037 case KIO::ERR_COULD_NOT_AUTHENTICATE
:
1038 errorName
= i18n( "Authentication Failed: Method %1 Not Supported" ,
1040 description
= i18n( "Although you may have supplied the correct "
1041 "authentication details, the authentication failed because the "
1042 "method that the server is using is not supported by the KDE "
1043 "program implementing the protocol %1." , protocol
);
1044 solutions
<< i18n( "Please file a bug at <a href=\"http://bugs.kde.org/\">"
1045 "http://bugs.kde.org/</a> to inform the KDE team of the unsupported "
1046 "authentication method." ) << sSysadmin
;
1049 case KIO::ERR_ABORTED
:
1050 errorName
= i18n( "Request Aborted" );
1051 description
= i18n( "The request was not completed because it was "
1053 solutions
<< i18n( "Retry the request." );
1056 case KIO::ERR_INTERNAL_SERVER
:
1057 errorName
= i18n( "Internal Error in Server" );
1058 description
= i18n( "The program on the server which provides access "
1059 "to the <strong>%1</strong> protocol has reported an internal error: "
1060 "%2." , protocol
, errorText
);
1061 causes
<< i18n( "This is most likely to be caused by a bug in the "
1062 "server program. Please consider submitting a full bug report as "
1063 "detailed below." );
1064 solutions
<< i18n( "Contact the administrator of the server "
1065 "to advise them of the problem." )
1066 << i18n( "If you know who the authors of the server software are, "
1067 "submit the bug report directly to them." );
1070 case KIO::ERR_SERVER_TIMEOUT
:
1071 errorName
= i18n( "Timeout Error" );
1072 description
= i18n( "Although contact was made with the server, a "
1073 "response was not received within the amount of time allocated for "
1074 "the request as follows:<ul>"
1075 "<li>Timeout for establishing a connection: %1 seconds</li>"
1076 "<li>Timeout for receiving a response: %2 seconds</li>"
1077 "<li>Timeout for accessing proxy servers: %3 seconds</li></ul>"
1078 "Please note that you can alter these timeout settings in the KDE "
1079 "Control Center, by selecting Network -> Preferences." ,
1080 KProtocolManager::connectTimeout() ,
1081 KProtocolManager::responseTimeout() ,
1082 KProtocolManager::proxyConnectTimeout() );
1083 causes
<< cNetpath
<< i18n( "The server was too busy responding to other "
1084 "requests to respond." );
1085 solutions
<< sTryagain
<< sServeradmin
;
1088 case KIO::ERR_UNKNOWN
:
1089 errorName
= i18n( "Unknown Error" );
1090 description
= i18n( "The program on your computer which provides access "
1091 "to the <strong>%1</strong> protocol has reported an unknown error: "
1092 "%2." , protocol
, errorText
);
1094 solutions
<< sUpdate
<< sBugreport
;
1097 case KIO::ERR_UNKNOWN_INTERRUPT
:
1098 errorName
= i18n( "Unknown Interruption" );
1099 description
= i18n( "The program on your computer which provides access "
1100 "to the <strong>%1</strong> protocol has reported an interruption of "
1101 "an unknown type: %2." , protocol
, errorText
);
1103 solutions
<< sUpdate
<< sBugreport
;
1106 case KIO::ERR_CANNOT_DELETE_ORIGINAL
:
1107 errorName
= i18n( "Could Not Delete Original File" );
1108 description
= i18n( "The requested operation required the deleting of "
1109 "the original file, most likely at the end of a file move operation. "
1110 "The original file <strong>%1</strong> could not be deleted." ,
1113 solutions
<< sAccess
;
1116 case KIO::ERR_CANNOT_DELETE_PARTIAL
:
1117 errorName
= i18n( "Could Not Delete Temporary File" );
1118 description
= i18n( "The requested operation required the creation of "
1119 "a temporary file in which to save the new file while being "
1120 "downloaded. This temporary file <strong>%1</strong> could not be "
1121 "deleted." , errorText
);
1123 solutions
<< sAccess
;
1126 case KIO::ERR_CANNOT_RENAME_ORIGINAL
:
1127 errorName
= i18n( "Could Not Rename Original File" );
1128 description
= i18n( "The requested operation required the renaming of "
1129 "the original file <strong>%1</strong>, however it could not be "
1130 "renamed." , errorText
);
1132 solutions
<< sAccess
;
1135 case KIO::ERR_CANNOT_RENAME_PARTIAL
:
1136 errorName
= i18n( "Could Not Rename Temporary File" );
1137 description
= i18n( "The requested operation required the creation of "
1138 "a temporary file <strong>%1</strong>, however it could not be "
1139 "created." , errorText
);
1141 solutions
<< sAccess
;
1144 case KIO::ERR_CANNOT_SYMLINK
:
1145 errorName
= i18n( "Could Not Create Link" );
1146 techName
= i18n( "Could Not Create Symbolic Link" );
1147 description
= i18n( "The requested symbolic link %1 could not be created." ,
1150 solutions
<< sAccess
;
1153 case KIO::ERR_NO_CONTENT
:
1154 errorName
= i18n( "No Content" );
1155 description
= errorText
;
1158 case KIO::ERR_DISK_FULL
:
1159 errorName
= i18n( "Disk Full" );
1160 description
= i18n( "The requested file <strong>%1</strong> could not be "
1161 "written to as there is inadequate disk space." , errorText
);
1162 solutions
<< i18n( "Free up enough disk space by 1) deleting unwanted and "
1163 "temporary files; 2) archiving files to removable media storage such as "
1164 "CD-Recordable discs; or 3) obtain more storage capacity." )
1168 case KIO::ERR_IDENTICAL_FILES
:
1169 errorName
= i18n( "Source and Destination Files Identical" );
1170 description
= i18n( "The operation could not be completed because the "
1171 "source and destination files are the same file." );
1172 solutions
<< i18n( "Choose a different filename for the destination file." );
1175 // We assume that the slave has all the details
1176 case KIO::ERR_SLAVE_DEFINED
:
1178 description
= errorText
;
1182 // fall back to the plain error...
1183 errorName
= i18n( "Undocumented Error" );
1184 description
= buildErrorString( errorCode
, errorText
);
1188 QDataStream
stream(&ret
, QIODevice::WriteOnly
);
1189 stream
<< errorName
<< techName
<< description
<< causes
<< solutions
;
1193 /***************************************************************
1197 ***************************************************************/
1199 KIO::CacheControl
KIO::parseCacheControl(const QString
&cacheControl
)
1201 QString tmp
= cacheControl
.toLower();
1203 if (tmp
== "cacheonly")
1204 return KIO::CC_CacheOnly
;
1206 return KIO::CC_Cache
;
1207 if (tmp
== "verify")
1208 return KIO::CC_Verify
;
1209 if (tmp
== "refresh")
1210 return KIO::CC_Refresh
;
1211 if (tmp
== "reload")
1212 return KIO::CC_Reload
;
1214 kDebug() << "unrecognized Cache control option:"<<cacheControl
;
1215 return KIO::CC_Verify
;
1218 QString
KIO::getCacheControlString(KIO::CacheControl cacheControl
)
1220 if (cacheControl
== KIO::CC_CacheOnly
)
1222 if (cacheControl
== KIO::CC_Cache
)
1224 if (cacheControl
== KIO::CC_Verify
)
1226 if (cacheControl
== KIO::CC_Refresh
)
1228 if (cacheControl
== KIO::CC_Reload
)
1230 kDebug() << "unrecognized Cache control enum value:"<<cacheControl
;
1234 QPixmap
KIO::pixmapForUrl( const KUrl
& _url
, mode_t _mode
, KIconLoader::Group _group
,
1235 int _force_size
, int _state
, QString
* _path
)
1237 const QString iconName
= KMimeType::iconNameForUrl( _url
, _mode
);
1238 return KIconLoader::global()->loadMimeTypeIcon( iconName
, _group
, _force_size
, _state
, QStringList(), _path
);
1241 KJobTrackerInterface
*KIO::getJobTracker()
1243 return globalJobTracker
;