32 #include <QtCore/QByteArray> 
   33 #include <QtCore/QDate> 
   34 #include <QtGui/QTextDocument> 
   36 #include <sys/types.h> 
   66     sprintf(charbuf, 
"%lld", size);
 
   67     return QLatin1String(charbuf);
 
   73   if ( (speed != 0) && (totalSize != 0) )
 
   74     return ( totalSize - processedSize ) / speed;
 
   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);
 
   89     return i18np(
"1 day %2", 
"%1 days %2", days, timeStr);
 
   94 #ifndef KDE_NO_DEPRECATED 
  101     if ( totalSize == 0 ) {
 
  104       secs = ( totalSize - processedSize ) / speed;
 
  106     if (secs >= (24*60*60)) 
 
  108     int hr = secs / ( 60 * 60 );
 
  109     int mn = ( secs - hr * 60 * 60 ) / 60;
 
  110     int sc = ( secs - hr * 60 * 60 - mn * 60 );
 
  112     remainingTime.setHMS( hr, mn, sc );
 
  115   return remainingTime;
 
  121     if ( files == 0 && dirs == 0 && items == 0 ) {
 
  122         return i18np( 
"%1 Item", 
"%1 Items", 0 );
 
  126     const QString foldersText = 
i18np( 
"1 Folder", 
"%1 Folders", dirs );
 
  127     const QString filesText = 
i18np( 
"1 File", 
"%1 Files", files );
 
  128     if ( files > 0 && dirs > 0 ) {
 
  131                   i18nc( 
"folders, files", 
"%1, %2", foldersText, filesText );
 
  132     } 
else if ( files > 0 ) {
 
  133         summary = showSize ? 
i18nc( 
"files (size)", 
"%1 (%2)", filesText, 
KIO::convertSize( size ) ) : filesText;
 
  134     } 
else if ( dirs > 0 ) {
 
  135         summary = foldersText;
 
  138     if ( items > dirs + files ) {
 
  139         const QString itemsText = 
i18np( 
"%1 Item", 
"%1 Items", items );
 
  140         summary = summary.isEmpty() ? itemsText : 
i18nc( 
"items: folders, files (size)", 
"%1: %2", itemsText, summary );
 
  149     str.replace(
'/', QChar(0x2044)); 
 
  171       result = 
i18n( 
"Could not read %1." ,  errorText );
 
  174       result = 
i18n( 
"Could not write to %1." ,  errorText );
 
  177       result = 
i18n( 
"Could not start process %1." ,  errorText );
 
  180       result = 
i18n( 
"Internal Error\nPlease send a full bug report at http://bugs.kde.org\n%1" ,  errorText );
 
  183       result = 
i18n( 
"Malformed URL %1." ,  errorText );
 
  186       result = 
i18n( 
"The protocol %1 is not supported." ,  errorText );
 
  189       result = 
i18n( 
"The protocol %1 is only a filter protocol.",  errorText );
 
  196       result = 
i18n( 
"%1 is a folder, but a file was expected." ,  errorText );
 
  199       result = 
i18n( 
"%1 is a file, but a folder was expected." ,  errorText );
 
  202       result = 
i18n( 
"The file or folder %1 does not exist." ,  errorText );
 
  205       result = 
i18n( 
"A file named %1 already exists." ,  errorText );
 
  208       result = 
i18n( 
"A folder named %1 already exists." ,  errorText );
 
  211       result = errorText.isEmpty() ? 
i18n( 
"No hostname specified." ) : 
i18n( 
"Unknown host %1" ,  errorText );
 
  214       result = 
i18n( 
"Access denied to %1." ,  errorText );
 
  217       result = 
i18n( 
"Access denied.\nCould not write to %1." ,  errorText );
 
  220       result = 
i18n( 
"Could not enter folder %1." ,  errorText );
 
  223       result = 
i18n( 
"The protocol %1 does not implement a folder service." ,  errorText );
 
  226       result = 
i18n( 
"Found a cyclic link in %1." ,  errorText );
 
  232       result = 
i18n( 
"Found a cyclic link while copying %1." ,  errorText );
 
  235       result = 
i18n( 
"Could not create socket for accessing %1." ,  errorText );
 
  238       result = 
i18n( 
"Could not connect to host %1." ,  errorText.isEmpty() ? QLatin1String(
"localhost") : errorText );
 
  241       result = 
i18n( 
"Connection to host %1 is broken." ,  errorText );
 
  244       result = 
i18n( 
"The protocol %1 is not a filter protocol." ,  errorText );
 
  247       result = 
i18n( 
"Could not mount device.\nThe reported error was:\n%1" ,  errorText );
 
  250       result = 
i18n( 
"Could not unmount device.\nThe reported error was:\n%1" ,  errorText );
 
  253       result = 
i18n( 
"Could not read file %1." ,  errorText );
 
  256       result = 
i18n( 
"Could not write to file %1." ,  errorText );
 
  259       result = 
i18n( 
"Could not bind %1." ,  errorText );
 
  262       result = 
i18n( 
"Could not listen %1." ,  errorText );
 
  265       result = 
i18n( 
"Could not accept %1." ,  errorText );
 
  271       result = 
i18n( 
"Could not access %1." ,  errorText );
 
  274       result = 
i18n( 
"Could not terminate listing %1." ,  errorText );
 
  277       result = 
i18n( 
"Could not make folder %1." ,  errorText );
 
  280       result = 
i18n( 
"Could not remove folder %1." ,  errorText );
 
  283       result = 
i18n( 
"Could not resume file %1." ,  errorText );
 
  286       result = 
i18n( 
"Could not rename file %1." ,  errorText );
 
  289       result = 
i18n( 
"Could not change permissions for %1." ,  errorText );
 
  292       result = 
i18n( 
"Could not change ownership for %1." ,  errorText );
 
  295       result = 
i18n( 
"Could not delete file %1." ,  errorText );
 
  298       result = 
i18n( 
"The process for the %1 protocol died unexpectedly." ,  errorText );
 
  301       result = 
i18n( 
"Error. Out of memory.\n%1" ,  errorText );
 
  304       result = 
i18n( 
"Unknown proxy host\n%1" ,  errorText );
 
  307       result = 
i18n( 
"Authorization failed, %1 authentication not supported" ,  errorText );
 
  310       result = 
i18n( 
"User canceled action\n%1" ,  errorText );
 
  313       result = 
i18n( 
"Internal error in server\n%1" ,  errorText );
 
  316       result = 
i18n( 
"Timeout on server\n%1" ,  errorText );
 
  319       result = 
i18n( 
"Unknown error\n%1" ,  errorText );
 
  322       result = 
i18n( 
"Unknown interrupt\n%1" ,  errorText );
 
  333       result = 
i18n( 
"Could not delete original file %1.\nPlease check permissions." ,  errorText );
 
  336       result = 
i18n( 
"Could not delete partial file %1.\nPlease check permissions." ,  errorText );
 
  339       result = 
i18n( 
"Could not rename original file %1.\nPlease check permissions." ,  errorText );
 
  342       result = 
i18n( 
"Could not rename partial file %1.\nPlease check permissions." ,  errorText );
 
  345       result = 
i18n( 
"Could not create symlink %1.\nPlease check permissions." ,  errorText );
 
  351       result = 
i18n( 
"Could not write file %1.\nDisk full." ,  errorText );
 
  354       result = 
i18n( 
"The source and destination are the same file.\n%1" ,  errorText );
 
  360       result = 
i18n( 
"%1 is required by the server, but is not available." , errorText);
 
  363       result = 
i18n( 
"Access to restricted port in POST denied.");
 
  366       result = 
i18n( 
"The required content size information was not provided for a POST operation.");
 
  369       result = 
i18n( 
"Unknown error code %1\n%2\nPlease send a full bug report at http://bugs.kde.org." ,  errorCode ,  errorText );
 
  379       return i18n(
"Opening connections is not supported with the protocol %1." , protocol);
 
  381       return i18n(
"Closing connections is not supported with the protocol %1." , protocol);
 
  383       return i18n(
"Accessing files is not supported with the protocol %1.", protocol);
 
  385       return i18n(
"Writing to %1 is not supported.", protocol);
 
  387       return i18n(
"There are no special actions available for protocol %1.", protocol);
 
  389       return i18n(
"Listing folders is not supported for protocol %1.", protocol);
 
  391       return i18n(
"Retrieving data from %1 is not supported.", protocol);
 
  393       return i18n(
"Retrieving mime type information from %1 is not supported.", protocol);
 
  395       return i18n(
"Renaming or moving files within %1 is not supported.", protocol);
 
  397       return i18n(
"Creating symlinks is not supported with protocol %1.", protocol);
 
  399       return i18n(
"Copying files within %1 is not supported.", protocol);
 
  401       return i18n(
"Deleting files from %1 is not supported.", protocol);
 
  403       return i18n(
"Creating folders is not supported with protocol %1.", protocol);
 
  405       return i18n(
"Changing the attributes of files is not supported with protocol %1.", protocol);
 
  407       return i18n(
"Changing the ownership of files is not supported with protocol %1.", protocol);
 
  409       return i18n(
"Using sub-URLs with %1 is not supported.", protocol);
 
  411       return i18n(
"Multiple get is not supported with protocol %1.", protocol);
 
  413       return i18n(
"Opening files is not supported with protocol %1.", protocol);
 
  415       return i18n(
"Protocol %1 does not support action %2.", protocol, cmd);
 
  422   QString errorName, techName, description, ret2;
 
  425   QByteArray raw = 
rawErrorDetail( error(), errorText(), reqUrl, method );
 
  426   QDataStream stream(raw);
 
  428   stream >> errorName >> techName >> description >> causes >> solutions;
 
  430   QString url, protocol, datetime;
 
  435     url = 
i18nc(
"@info url", 
"(unknown)" );
 
  442   ret << 
i18nc( 
"@info %1 error name, %2 description",
 
  443                 "<qt><p><b>%1</b></p><p>%2</p></qt>", errorName, description);
 
  445   ret2 = QLatin1String( 
"<qt>" );
 
  446   if ( !techName.isEmpty() )
 
  447     ret2 += QLatin1String( 
"<p>" ) + 
i18n( 
"<b>Technical reason</b>: " ) +
 
  448             techName + QLatin1String( 
"</p>" );
 
  449   ret2 += QLatin1String( 
"<p>" ) + 
i18n( 
"<b>Details of the request</b>:" ) +
 
  450           QLatin1String( 
"</p><ul>" ) + 
i18n( 
"<li>URL: %1</li>", url );
 
  451   if ( !protocol.isEmpty() ) {
 
  452     ret2 += 
i18n( 
"<li>Protocol: %1</li>" , protocol );
 
  454   ret2 += 
i18n( 
"<li>Date and time: %1</li>", datetime ) +
 
  455           i18n( 
"<li>Additional information: %1</li>" ,  errorText() ) +
 
  456           QLatin1String( 
"</ul>" );
 
  457   if ( !causes.isEmpty() ) {
 
  458     ret2 += QLatin1String( 
"<p>" ) + 
i18n( 
"<b>Possible causes</b>:" ) +
 
  459             QLatin1String( 
"</p><ul><li>" ) + causes.join( 
"</li><li>" ) +
 
  460             QLatin1String( 
"</li></ul>" );
 
  462   if ( !solutions.isEmpty() ) {
 
  463     ret2 += QLatin1String( 
"<p>" ) + 
i18n( 
"<b>Possible solutions</b>:" ) +
 
  464             QLatin1String( 
"</p><ul><li>" ) + solutions.join( 
"</li><li>" ) +
 
  465             QLatin1String( 
"</li></ul>" );
 
  467   ret2 += QLatin1String( 
"</qt>" );
 
  474                                const KUrl *reqUrl , 
int  )
 
  476   QString url, host, protocol, datetime, domain, path, filename;
 
  477   bool isSlaveNetwork = 
false;
 
  480     host = reqUrl->host();
 
  483     if ( host.startsWith( QLatin1String( 
"www." ) ) )
 
  484       domain = host.mid(4);
 
  489     path = reqUrl->
path();
 
  495     url = host = domain = path = filename = errorText;
 
  496     protocol = 
i18nc(
"@info protocol", 
"(unknown)" );
 
  502   QString errorName, techName, description;
 
  506   QString sSysadmin = 
i18n( 
"Contact your appropriate computer support system, " 
  507     "whether the system administrator, or technical support group for further " 
  509   QString sServeradmin = 
i18n( 
"Contact the administrator of the server " 
  510     "for further assistance." );
 
  512   QString sAccess = 
i18n( 
"Check your access permissions on this resource." );
 
  513   QString cAccess = 
i18n( 
"Your access permissions may be inadequate to " 
  514     "perform the requested operation on this resource." );
 
  515   QString cLocked = 
i18n( 
"The file may be in use (and thus locked) by " 
  516     "another user or application." );
 
  517   QString sQuerylock = 
i18n( 
"Check to make sure that no other " 
  518     "application or user is using the file or has locked the file." );
 
  519   QString cHardware = 
i18n( 
"Although unlikely, a hardware error may have " 
  521   QString cBug = 
i18n( 
"You may have encountered a bug in the program." );
 
  522   QString cBuglikely = 
i18n( 
"This is most likely to be caused by a bug in the " 
  523     "program. Please consider submitting a full bug report as detailed below." );
 
  524   QString sUpdate = 
i18n( 
"Update your software to the latest version. " 
  525     "Your distribution should provide tools to update your software." );
 
  526   QString sBugreport = 
i18n( 
"When all else fails, please consider helping the " 
  527     "KDE team or the third party maintainer of this software by submitting a " 
  528     "high quality bug report. If the software is provided by a third party, " 
  529     "please contact them directly. Otherwise, first look to see if " 
  530     "the same bug has been submitted by someone else by searching at the " 
  531     "<a href=\"http://bugs.kde.org/\">KDE bug reporting website</a>. If not, take " 
  532     "note of the details given above, and include them in your bug report, along " 
  533     "with as many other details as you think might help." );
 
  534   QString cNetwork = 
i18n( 
"There may have been a problem with your network " 
  537   QString cNetconf = 
i18n( 
"There may have been a problem with your network " 
  538     "configuration. If you have been accessing the Internet with no problems " 
  539     "recently, this is unlikely." );
 
  540   QString cNetpath = 
i18n( 
"There may have been a problem at some point along " 
  541     "the network path between the server and this computer." );
 
  542   QString sTryagain = 
i18n( 
"Try again, either now or at a later time." );
 
  543   QString cProtocol = 
i18n( 
"A protocol error or incompatibility may have occurred." );
 
  544   QString sExists = 
i18n( 
"Ensure that the resource exists, and try again." );
 
  545   QString cExists = 
i18n( 
"The specified resource may not exist." );
 
  546   QString cTypo = 
i18n( 
"You may have incorrectly typed the location." );
 
  547   QString sTypo = 
i18n( 
"Double-check that you have entered the correct location " 
  549   QString sNetwork = 
i18n( 
"Check your network connection status." );
 
  551   switch( errorCode ) {
 
  553       errorName = 
i18n( 
"Cannot Open Resource For Reading" );
 
  554       description = 
i18n( 
"This means that the contents of the requested file " 
  555         "or folder <strong>%1</strong> could not be retrieved, as read " 
  556         "access could not be obtained.", path );
 
  557       causes << 
i18n( 
"You may not have permissions to read the file or open " 
  558         "the folder.") << cLocked << cHardware;
 
  559       solutions << sAccess << sQuerylock << sSysadmin;
 
  563       errorName = 
i18n( 
"Cannot Open Resource For Writing" );
 
  564       description = 
i18n( 
"This means that the file, <strong>%1</strong>, could " 
  565         "not be written to as requested, because access with permission to " 
  566         "write could not be obtained." ,  filename );
 
  567       causes << cAccess << cLocked << cHardware;
 
  568       solutions << sAccess << sQuerylock << sSysadmin;
 
  572       errorName = 
i18n( 
"Cannot Initiate the %1 Protocol" ,  protocol );
 
  573       techName = 
i18n( 
"Unable to Launch Process" );
 
  574       description = 
i18n( 
"The program on your computer which provides access " 
  575         "to the <strong>%1</strong> protocol could not be started. This is " 
  576         "usually due to technical reasons." ,  protocol );
 
  577       causes << 
i18n( 
"The program which provides compatibility with this " 
  578         "protocol may not have been updated with your last update of KDE. " 
  579         "This can cause the program to be incompatible with the current version " 
  580         "and thus not start." ) << cBug;
 
  581       solutions << sUpdate << sSysadmin;
 
  585       errorName = 
i18n( 
"Internal Error" );
 
  586       description = 
i18n( 
"The program on your computer which provides access " 
  587         "to the <strong>%1</strong> protocol has reported an internal error." ,
 
  589       causes << cBuglikely;
 
  590       solutions << sUpdate << sBugreport;
 
  594       errorName = 
i18n( 
"Improperly Formatted URL" );
 
  595       description = 
i18n( 
"The <strong>U</strong>niform <strong>R</strong>esource " 
  596         "<strong>L</strong>ocator (URL) that you entered was not properly " 
  597         "formatted. The format of a URL is generally as follows:" 
  598         "<blockquote><strong>protocol://user:password@www.example.org:port/folder/" 
  599         "filename.extension?query=value</strong></blockquote>" );
 
  604       errorName = 
i18n( 
"Unsupported Protocol %1" ,  protocol );
 
  605       description = 
i18n( 
"The protocol <strong>%1</strong> is not supported " 
  606         "by the KDE programs currently installed on this computer." ,
 
  608       causes << 
i18n( 
"The requested protocol may not be supported." )
 
  609         << 
i18n( 
"The versions of the %1 protocol supported by this computer and " 
  610         "the server may be incompatible." ,  protocol );
 
  611       solutions << i18n( 
"You may perform a search on the Internet for a KDE " 
  612         "program (called a kioslave or ioslave) which supports this protocol. " 
  613         "Places to search include <a href=\"http://kde-apps.org/\">" 
  614         "http://kde-apps.org/</a> and <a href=\"http://freshmeat.net/\">" 
  615         "http://freshmeat.net/</a>." )
 
  616         << sUpdate << sSysadmin;
 
  620       errorName = i18n( 
"URL Does Not Refer to a Resource." );
 
  621       techName = i18n( 
"Protocol is a Filter Protocol" );
 
  622       description = i18n( 
"The <strong>U</strong>niform <strong>R</strong>esource " 
  623         "<strong>L</strong>ocator (URL) that you entered did not refer to a " 
  624         "specific resource." );
 
  625       causes << i18n( 
"KDE is able to communicate through a protocol within a " 
  626         "protocol; the protocol specified is only for use in such situations, " 
  627         "however this is not one of these situations. This is a rare event, and " 
  628         "is likely to indicate a programming error." );
 
  633       errorName = i18n( 
"Unsupported Action: %1" ,  errorText );
 
  634       description = i18n( 
"The requested action is not supported by the KDE " 
  635         "program which is implementing the <strong>%1</strong> protocol." ,
 
  637       causes << i18n( 
"This error is very much dependent on the KDE program. The " 
  638         "additional information should give you more information than is available " 
  639         "to the KDE input/output architecture." );
 
  640       solutions << i18n( 
"Attempt to find another way to accomplish the same " 
  645       errorName = i18n( 
"File Expected" );
 
  646       description = i18n( 
"The request expected a file, however the " 
  647         "folder <strong>%1</strong> was found instead." , path );
 
  648       causes << i18n( 
"This may be an error on the server side." ) << cBug;
 
  649       solutions << sUpdate << sSysadmin;
 
  653       errorName = i18n( 
"Folder Expected" );
 
  654       description = i18n( 
"The request expected a folder, however " 
  655         "the file <strong>%1</strong> was found instead." , filename );
 
  657       solutions << sUpdate << sSysadmin;
 
  661       errorName = i18n( 
"File or Folder Does Not Exist" );
 
  662       description = i18n( 
"The specified file or folder <strong>%1</strong> " 
  663         "does not exist." , path );
 
  665       solutions << sExists;
 
  669       errorName = i18n( 
"File Already Exists" );
 
  670       description = i18n( 
"The requested file could not be created because a " 
  671         "file with the same name already exists." );
 
  672       solutions << i18n ( 
"Try moving the current file out of the way first, " 
  673         "and then try again." )
 
  674         << i18n ( 
"Delete the current file and try again." )
 
  675         << i18n( 
"Choose an alternate filename for the new file." );
 
  679       errorName = i18n( 
"Folder Already Exists" );
 
  680       description = i18n( 
"The requested folder could not be created because " 
  681         "a folder with the same name already exists." );
 
  682       solutions << i18n( 
"Try moving the current folder out of the way first, " 
  683         "and then try again." )
 
  684         << i18n( 
"Delete the current folder and try again." )
 
  685         << i18n( 
"Choose an alternate name for the new folder." );
 
  689       errorName = i18n( 
"Unknown Host" );
 
  690       description = i18n( 
"An unknown host error indicates that the server with " 
  691         "the requested name, <strong>%1</strong>, could not be " 
  692         "located on the Internet." ,  host );
 
  693       causes << i18n( 
"The name that you typed, %1, may not exist: it may be " 
  694         "incorrectly typed." ,  host )
 
  695         << cNetwork << cNetconf;
 
  696       solutions << sNetwork << sSysadmin;
 
  700       errorName = i18n( 
"Access Denied" );
 
  701       description = i18n( 
"Access was denied to the specified resource, " 
  702         "<strong>%1</strong>." ,  url );
 
  703       causes << i18n( 
"You may have supplied incorrect authentication details or " 
  705         << i18n( 
"Your account may not have permission to access the " 
  706         "specified resource." );
 
  707       solutions << i18n( 
"Retry the request and ensure your authentication details " 
  708         "are entered correctly." ) << sSysadmin;
 
  709       if ( !isSlaveNetwork ) solutions << sServeradmin;
 
  713       errorName = i18n( 
"Write Access Denied" );
 
  714       description = i18n( 
"This means that an attempt to write to the file " 
  715         "<strong>%1</strong> was rejected." ,  filename );
 
  716       causes << cAccess << cLocked << cHardware;
 
  717       solutions << sAccess << sQuerylock << sSysadmin;
 
  721       errorName = i18n( 
"Unable to Enter Folder" );
 
  722       description = i18n( 
"This means that an attempt to enter (in other words, " 
  723         "to open) the requested folder <strong>%1</strong> was rejected." ,
 
  725       causes << cAccess << cLocked;
 
  726       solutions << sAccess << sQuerylock << sSysadmin;
 
  730       errorName = i18n( 
"Folder Listing Unavailable" );
 
  731       techName = i18n( 
"Protocol %1 is not a Filesystem" ,  protocol );
 
  732       description = i18n( 
"This means that a request was made which requires " 
  733         "determining the contents of the folder, and the KDE program supporting " 
  734         "this protocol is unable to do so." );
 
  736       solutions << sUpdate << sBugreport;
 
  740       errorName = i18n( 
"Cyclic Link Detected" );
 
  741       description = i18n( 
"UNIX environments are commonly able to link a file or " 
  742         "folder to a separate name and/or location. KDE detected a link or " 
  743         "series of links that results in an infinite loop - i.e. the file was " 
  744         "(perhaps in a roundabout way) linked to itself." );
 
  745       solutions << i18n( 
"Delete one part of the loop in order that it does not " 
  746         "cause an infinite loop, and try again." ) << sSysadmin;
 
  754       errorName = i18n( 
"Request Aborted By User" );
 
  755       description = i18n( 
"The request was not completed because it was " 
  757       solutions << i18n( 
"Retry the request." );
 
  761       errorName = i18n( 
"Cyclic Link Detected During Copy" );
 
  762       description = i18n( 
"UNIX environments are commonly able to link a file or " 
  763         "folder to a separate name and/or location. During the requested copy " 
  764         "operation, KDE detected a link or series of links that results in an " 
  765         "infinite loop - i.e. the file was (perhaps in a roundabout way) linked " 
  767       solutions << i18n( 
"Delete one part of the loop in order that it does not " 
  768         "cause an infinite loop, and try again." ) << sSysadmin;
 
  772       errorName = i18n( 
"Could Not Create Network Connection" );
 
  773       techName = i18n( 
"Could Not Create Socket" );
 
  774       description = i18n( 
"This is a fairly technical error in which a required " 
  775         "device for network communications (a socket) could not be created." );
 
  776       causes << i18n( 
"The network connection may be incorrectly configured, or " 
  777         "the network interface may not be enabled." );
 
  778       solutions << sNetwork << sSysadmin;
 
  782       errorName = i18n( 
"Connection to Server Refused" );
 
  783       description = i18n( 
"The server <strong>%1</strong> refused to allow this " 
  784         "computer to make a connection." ,  host );
 
  785       causes << i18n( 
"The server, while currently connected to the Internet, " 
  786         "may not be configured to allow requests." )
 
  787         << i18n( 
"The server, while currently connected to the Internet, " 
  788         "may not be running the requested service (%1)." ,  protocol )
 
  789         << i18n( 
"A network firewall (a device which restricts Internet " 
  790         "requests), either protecting your network or the network of the server, " 
  791         "may have intervened, preventing this request." );
 
  792       solutions << sTryagain << sServeradmin << sSysadmin;
 
  796       errorName = i18n( 
"Connection to Server Closed Unexpectedly" );
 
  797       description = i18n( 
"Although a connection was established to " 
  798         "<strong>%1</strong>, the connection was closed at an unexpected point " 
  799         "in the communication." ,  host );
 
  800       causes << cNetwork << cNetpath << i18n( 
"A protocol error may have occurred, " 
  801         "causing the server to close the connection as a response to the error." );
 
  802       solutions << sTryagain << sServeradmin << sSysadmin;
 
  806       errorName = i18n( 
"URL Resource Invalid" );
 
  807       techName = i18n( 
"Protocol %1 is not a Filter Protocol" ,  protocol );
 
  808       description = i18n( 
"The <strong>U</strong>niform <strong>R</strong>esource " 
  809         "<strong>L</strong>ocator (URL) that you entered did not refer to " 
  810         "a valid mechanism of accessing the specific resource, " 
  811         "<strong>%1%2</strong>." ,
 
  812           !host.isNull() ? host + 
'/' : 
QString() , path );
 
  813       causes << i18n( 
"KDE is able to communicate through a protocol within a " 
  814         "protocol. This request specified a protocol be used as such, however " 
  815         "this protocol is not capable of such an action. This is a rare event, " 
  816         "and is likely to indicate a programming error." );
 
  817       solutions << sTypo << sSysadmin;
 
  821       errorName = i18n( 
"Unable to Initialize Input/Output Device" );
 
  822       techName = i18n( 
"Could Not Mount Device" );
 
  823       description = i18n( 
"The requested device could not be initialized " 
  824         "(\"mounted\"). The reported error was: <strong>%1</strong>" ,
 
  826       causes << i18n( 
"The device may not be ready, for example there may be " 
  827         "no media in a removable media device (i.e. no CD-ROM in a CD drive), " 
  828         "or in the case of a peripheral/portable device, the device may not " 
  829         "be correctly connected." )
 
  830         << i18n( 
"You may not have permissions to initialize (\"mount\") the " 
  831         "device. On UNIX systems, often system administrator privileges are " 
  832         "required to initialize a device." )
 
  834       solutions << i18n( 
"Check that the device is ready; removable drives " 
  835         "must contain media, and portable devices must be connected and powered " 
  836         "on.; and try again." ) << sAccess << sSysadmin;
 
  840       errorName = i18n( 
"Unable to Uninitialize Input/Output Device" );
 
  841       techName = i18n( 
"Could Not Unmount Device" );
 
  842       description = i18n( 
"The requested device could not be uninitialized " 
  843         "(\"unmounted\"). The reported error was: <strong>%1</strong>" ,
 
  845       causes << i18n( 
"The device may be busy, that is, still in use by " 
  846         "another application or user. Even such things as having an open " 
  847         "browser window on a location on this device may cause the device to " 
  849         << i18n( 
"You may not have permissions to uninitialize (\"unmount\") " 
  850         "the device. On UNIX systems, system administrator privileges are " 
  851         "often required to uninitialize a device." )
 
  853       solutions << i18n( 
"Check that no applications are accessing the device, " 
  854         "and try again." ) << sAccess << sSysadmin;
 
  858       errorName = i18n( 
"Cannot Read From Resource" );
 
  859       description = i18n( 
"This means that although the resource, " 
  860         "<strong>%1</strong>, was able to be opened, an error occurred while " 
  861         "reading the contents of the resource." ,  url );
 
  862       causes << i18n( 
"You may not have permissions to read from the resource." );
 
  863       if ( !isSlaveNetwork ) causes << cNetwork;
 
  865       solutions << sAccess;
 
  866       if ( !isSlaveNetwork ) solutions << sNetwork;
 
  867       solutions << sSysadmin;
 
  871       errorName = i18n( 
"Cannot Write to Resource" );
 
  872       description = i18n( 
"This means that although the resource, <strong>%1</strong>" 
  873         ", was able to be opened, an error occurred while writing to the resource." ,
 
  875       causes << i18n( 
"You may not have permissions to write to the resource." );
 
  876       if ( !isSlaveNetwork ) causes << cNetwork;
 
  878       solutions << sAccess;
 
  879       if ( !isSlaveNetwork ) solutions << sNetwork;
 
  880       solutions << sSysadmin;
 
  884       errorName = i18n( 
"Could Not Listen for Network Connections" );
 
  885       techName = i18n( 
"Could Not Bind" );
 
  886       description = i18n( 
"This is a fairly technical error in which a required " 
  887         "device for network communications (a socket) could not be established " 
  888         "to listen for incoming network connections." );
 
  889       causes << i18n( 
"The network connection may be incorrectly configured, or " 
  890         "the network interface may not be enabled." );
 
  891       solutions << sNetwork << sSysadmin;
 
  895       errorName = i18n( 
"Could Not Listen for Network Connections" );
 
  896       techName = i18n( 
"Could Not Listen" );
 
  897       description = i18n( 
"This is a fairly technical error in which a required " 
  898         "device for network communications (a socket) could not be established " 
  899         "to listen for incoming network connections." );
 
  900       causes << i18n( 
"The network connection may be incorrectly configured, or " 
  901         "the network interface may not be enabled." );
 
  902       solutions << sNetwork << sSysadmin;
 
  906       errorName = i18n( 
"Could Not Accept Network Connection" );
 
  907       description = i18n( 
"This is a fairly technical error in which an error " 
  908         "occurred while attempting to accept an incoming network connection." );
 
  909       causes << i18n( 
"The network connection may be incorrectly configured, or " 
  910         "the network interface may not be enabled." )
 
  911         << i18n( 
"You may not have permissions to accept the connection." );
 
  912       solutions << sNetwork << sSysadmin;
 
  916       errorName = i18n( 
"Could Not Login: %1" ,  errorText );
 
  917       description = i18n( 
"An attempt to login to perform the requested " 
  918         "operation was unsuccessful." );
 
  919       causes << i18n( 
"You may have supplied incorrect authentication details or " 
  921         << i18n( 
"Your account may not have permission to access the " 
  922         "specified resource." ) << cProtocol;
 
  923       solutions << i18n( 
"Retry the request and ensure your authentication details " 
  924         "are entered correctly." ) << sServeradmin << sSysadmin;
 
  928       errorName = i18n( 
"Could Not Determine Resource Status" );
 
  929       techName = i18n( 
"Could Not Stat Resource" );
 
  930       description = i18n( 
"An attempt to determine information about the status " 
  931         "of the resource <strong>%1</strong>, such as the resource name, type, " 
  932         "size, etc., was unsuccessful." ,  url );
 
  933       causes << i18n( 
"The specified resource may not have existed or may " 
  934         "not be accessible." ) << cProtocol << cHardware;
 
  935       solutions << i18n( 
"Retry the request and ensure your authentication details " 
  936         "are entered correctly." ) << sSysadmin;
 
  941       errorName = i18n( 
"Could Not Cancel Listing" );
 
  942       techName = i18n( 
"FIXME: Document this" );
 
  946       errorName = i18n( 
"Could Not Create Folder" );
 
  947       description = i18n( 
"An attempt to create the requested folder failed." );
 
  948       causes << cAccess << i18n( 
"The location where the folder was to be created " 
  950       if ( !isSlaveNetwork ) causes << cProtocol;
 
  951       solutions << i18n( 
"Retry the request." ) << sAccess;
 
  955       errorName = i18n( 
"Could Not Remove Folder" );
 
  956       description = i18n( 
"An attempt to remove the specified folder, " 
  957         "<strong>%1</strong>, failed." , path );
 
  958       causes << i18n( 
"The specified folder may not exist." )
 
  959         << i18n( 
"The specified folder may not be empty." )
 
  961       if ( !isSlaveNetwork ) causes << cProtocol;
 
  962       solutions << i18n( 
"Ensure that the folder exists and is empty, and try " 
  963         "again." ) << sAccess;
 
  967       errorName = i18n( 
"Could Not Resume File Transfer" );
 
  968       description = i18n( 
"The specified request asked that the transfer of " 
  969         "file <strong>%1</strong> be resumed at a certain point of the " 
  970         "transfer. This was not possible." ,  filename );
 
  971       causes << i18n( 
"The protocol, or the server, may not support file " 
  973       solutions << i18n( 
"Retry the request without attempting to resume " 
  978       errorName = i18n( 
"Could Not Rename Resource" );
 
  979       description = i18n( 
"An attempt to rename the specified resource " 
  980         "<strong>%1</strong> failed." ,  url );
 
  981       causes << cAccess << cExists;
 
  982       if ( !isSlaveNetwork ) causes << cProtocol;
 
  983       solutions << sAccess << sExists;
 
  987       errorName = i18n( 
"Could Not Alter Permissions of Resource" );
 
  988       description = i18n( 
"An attempt to alter the permissions on the specified " 
  989         "resource <strong>%1</strong> failed." ,  url );
 
  990       causes << cAccess << cExists;
 
  991       solutions << sAccess << sExists;
 
  995       errorName = i18n( 
"Could Not Change Ownership of Resource" );
 
  996       description = i18n( 
"An attempt to change the ownership of the specified " 
  997         "resource <strong>%1</strong> failed." ,  url );
 
  998       causes << cAccess << cExists;
 
  999       solutions << sAccess << sExists;
 
 1003       errorName = i18n( 
"Could Not Delete Resource" );
 
 1004       description = i18n( 
"An attempt to delete the specified resource " 
 1005         "<strong>%1</strong> failed." ,  url );
 
 1006       causes << cAccess << cExists;
 
 1007       solutions << sAccess << sExists;
 
 1011       errorName = i18n( 
"Unexpected Program Termination" );
 
 1012       description = i18n( 
"The program on your computer which provides access " 
 1013         "to the <strong>%1</strong> protocol has unexpectedly terminated." ,
 
 1015       causes << cBuglikely;
 
 1016       solutions << sUpdate << sBugreport;
 
 1020       errorName = i18n( 
"Out of Memory" );
 
 1021       description = i18n( 
"The program on your computer which provides access " 
 1022         "to the <strong>%1</strong> protocol could not obtain the memory " 
 1023         "required to continue." ,  protocol );
 
 1024       causes << cBuglikely;
 
 1025       solutions << sUpdate << sBugreport;
 
 1029       errorName = i18n( 
"Unknown Proxy Host" );
 
 1030       description = i18n( 
"While retrieving information about the specified " 
 1031         "proxy host, <strong>%1</strong>, an Unknown Host error was encountered. " 
 1032         "An unknown host error indicates that the requested name could not be " 
 1033         "located on the Internet." ,  errorText );
 
 1034       causes << i18n( 
"There may have been a problem with your network " 
 1035         "configuration, specifically your proxy's hostname. If you have been " 
 1036         "accessing the Internet with no problems recently, this is unlikely." )
 
 1038       solutions << i18n( 
"Double-check your proxy settings and try again." )
 
 1043       errorName = i18n( 
"Authentication Failed: Method %1 Not Supported" ,
 
 1045       description = i18n( 
"Although you may have supplied the correct " 
 1046         "authentication details, the authentication failed because the " 
 1047         "method that the server is using is not supported by the KDE " 
 1048         "program implementing the protocol %1." ,  protocol );
 
 1049       solutions << i18n( 
"Please file a bug at <a href=\"http://bugs.kde.org/\">" 
 1050         "http://bugs.kde.org/</a> to inform the KDE team of the unsupported " 
 1051         "authentication method." ) << sSysadmin;
 
 1055       errorName = i18n( 
"Request Aborted" );
 
 1056       description = i18n( 
"The request was not completed because it was " 
 1058       solutions << i18n( 
"Retry the request." );
 
 1062       errorName = i18n( 
"Internal Error in Server" );
 
 1063       description = i18n( 
"The program on the server which provides access " 
 1064         "to the <strong>%1</strong> protocol has reported an internal error: " 
 1065         "%2." ,  protocol, errorText );
 
 1066       causes << i18n( 
"This is most likely to be caused by a bug in the " 
 1067         "server program. Please consider submitting a full bug report as " 
 1068         "detailed below." );
 
 1069       solutions << i18n( 
"Contact the administrator of the server " 
 1070         "to advise them of the problem." )
 
 1071         << i18n( 
"If you know who the authors of the server software are, " 
 1072         "submit the bug report directly to them." );
 
 1076       errorName = i18n( 
"Timeout Error" );
 
 1077       description = i18n( 
"Although contact was made with the server, a " 
 1078         "response was not received within the amount of time allocated for " 
 1079         "the request as follows:<ul>" 
 1080         "<li>Timeout for establishing a connection: %1 seconds</li>" 
 1081         "<li>Timeout for receiving a response: %2 seconds</li>" 
 1082         "<li>Timeout for accessing proxy servers: %3 seconds</li></ul>" 
 1083         "Please note that you can alter these timeout settings in the KDE " 
 1084         "System Settings, by selecting Network Settings -> Connection Preferences." ,
 
 1088       causes << cNetpath << i18n( 
"The server was too busy responding to other " 
 1089         "requests to respond." );
 
 1090       solutions << sTryagain << sServeradmin;
 
 1094       errorName = i18n( 
"Unknown Error" );
 
 1095       description = i18n( 
"The program on your computer which provides access " 
 1096         "to the <strong>%1</strong> protocol has reported an unknown error: " 
 1097         "%2." ,  protocol ,  errorText );
 
 1099       solutions << sUpdate << sBugreport;
 
 1103       errorName = i18n( 
"Unknown Interruption" );
 
 1104       description = i18n( 
"The program on your computer which provides access " 
 1105         "to the <strong>%1</strong> protocol has reported an interruption of " 
 1106         "an unknown type: %2." ,  protocol ,  errorText );
 
 1108       solutions << sUpdate << sBugreport;
 
 1112       errorName = i18n( 
"Could Not Delete Original File" );
 
 1113       description = i18n( 
"The requested operation required the deleting of " 
 1114         "the original file, most likely at the end of a file move operation. " 
 1115         "The original file <strong>%1</strong> could not be deleted." ,
 
 1118       solutions << sAccess;
 
 1122       errorName = i18n( 
"Could Not Delete Temporary File" );
 
 1123       description = i18n( 
"The requested operation required the creation of " 
 1124         "a temporary file in which to save the new file while being " 
 1125         "downloaded. This temporary file <strong>%1</strong> could not be " 
 1126         "deleted." ,  errorText );
 
 1128       solutions << sAccess;
 
 1132       errorName = i18n( 
"Could Not Rename Original File" );
 
 1133       description = i18n( 
"The requested operation required the renaming of " 
 1134         "the original file <strong>%1</strong>, however it could not be " 
 1135         "renamed." ,  errorText );
 
 1137       solutions << sAccess;
 
 1141       errorName = i18n( 
"Could Not Rename Temporary File" );
 
 1142       description = i18n( 
"The requested operation required the creation of " 
 1143         "a temporary file <strong>%1</strong>, however it could not be " 
 1144         "created." ,  errorText );
 
 1146       solutions << sAccess;
 
 1150       errorName = i18n( 
"Could Not Create Link" );
 
 1151       techName = i18n( 
"Could Not Create Symbolic Link" );
 
 1152       description = i18n( 
"The requested symbolic link %1 could not be created." ,
 
 1155       solutions << sAccess;
 
 1159       errorName = i18n( 
"No Content" );
 
 1160       description = errorText;
 
 1164       errorName = i18n( 
"Disk Full" );
 
 1165       description = i18n( 
"The requested file <strong>%1</strong> could not be " 
 1166         "written to as there is inadequate disk space." ,  errorText );
 
 1167       solutions << i18n( 
"Free up enough disk space by 1) deleting unwanted and " 
 1168         "temporary files; 2) archiving files to removable media storage such as " 
 1169         "CD-Recordable discs; or 3) obtain more storage capacity." )
 
 1174       errorName = i18n( 
"Source and Destination Files Identical" );
 
 1175       description = i18n( 
"The operation could not be completed because the " 
 1176         "source and destination files are the same file." );
 
 1177       solutions << i18n( 
"Choose a different filename for the destination file." );
 
 1183       description = errorText;
 
 1188       errorName = i18n( 
"Undocumented Error" );
 
 1193   QDataStream stream(&ret, QIODevice::WriteOnly);
 
 1194   stream << errorName << techName << description << causes << solutions;
 
 1206   QString tmp = cacheControl.toLower();
 
 1208   if (tmp == QLatin1String(
"cacheonly"))
 
 1210   if (tmp == QLatin1String(
"cache"))
 
 1212   if (tmp == QLatin1String(
"verify"))
 
 1214   if (tmp == QLatin1String(
"refresh"))
 
 1216   if (tmp == QLatin1String(
"reload"))
 
 1219   kDebug() << 
"unrecognized Cache control option:"<<cacheControl;
 
 1235     kDebug() << 
"unrecognized Cache control enum value:"<<cacheControl;
 
 1240                            int _force_size, 
int _state, 
QString * _path )
 
 1242     const QString iconName = KMimeType::iconNameForUrl( _url, _mode );
 
 1248     return globalJobTracker;
 
 1253   QFile::Permissions qPermissions(0);
 
 1255   if (permissions > 0) {
 
 1256     if (permissions & S_IRUSR) {
 
 1257       qPermissions |= QFile::ReadOwner;
 
 1259     if (permissions & S_IWUSR) {
 
 1260       qPermissions |= QFile::WriteOwner;
 
 1262     if (permissions & S_IXUSR) {
 
 1263       qPermissions |= QFile::ExeOwner;
 
 1266     if (permissions & S_IRGRP) {
 
 1267       qPermissions |= QFile::ReadGroup;
 
 1269     if (permissions & S_IWGRP) {
 
 1270       qPermissions |= QFile::WriteGroup;
 
 1272     if (permissions & S_IXGRP) {
 
 1273       qPermissions |= QFile::ExeGroup;
 
 1276     if (permissions & S_IROTH) {
 
 1277       qPermissions |= QFile::ReadOther;
 
 1279     if (permissions & S_IWOTH) {
 
 1280       qPermissions |= QFile::WriteOther;
 
 1282     if (permissions & S_IXOTH) {
 
 1283       qPermissions |= QFile::ExeOther;
 
 1287   return qPermissions;
 
 1304   QMapIterator<QString,QVariant> it (metaData);
 
 1306   while(it.hasNext()) {
 
 1308      insert(it.key(), it.value().toString());
 
 1317   return (*
this += metaData);
 
 1323   QMapIterator <QString,QString> it (*
this);
 
 1325  while (it.hasNext()) {
 
 1327    map.insert(it.key(), it.value());
 
QString unsupportedActionErrorString(const QString &protocol, int cmd)
Returns an appropriate error message if the given command cmd is an unsupported action (ERR_UNSUPPORT...
QString i18n(const char *text)
Fail request if not in cache. 
QString getCacheControlString(KIO::CacheControl cacheControl)
Returns a string representation of the given cache control method. 
qulonglong filesize_t
64-bit file size 
static KIconLoader * global()
QString i18np(const char *sing, const char *plur, const A1 &a1)
#define K_GLOBAL_STATIC(TYPE, NAME)
QString decodeFileName(const QString &str)
Decodes (from the filename to the text displayed) This doesn't do anything anymore, it used to do the opposite of encodeFileName when encodeFileName was using %2F for '/'. 
Always fetch from remote site. 
QPixmap pixmapForUrl(const KUrl &_url, mode_t _mode=0, KIconLoader::Group _group=KIconLoader::Desktop, int _force_size=0, int _state=0, QString *_path=0)
Convenience method to find the pixmap for a URL. 
QString convertSeconds(unsigned int seconds)
Convert seconds to a string representing number of days, hours, minutes and seconds. 
static QDebug kDebug(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
QStringList detailedErrorStrings(const KUrl *reqUrl=0L, int method=-1) const 
Converts an error code and a non-i18n error message into i18n strings suitable for presentation in a ...
QString i18nc(const char *ctxt, const char *text)
This class implements a simple job tracker which registers any job to the KWidgetJobTracker if a kuis...
static int responseTimeout()
Returns the preferred response timeout value for remote connecting in seconds. 
QString encodeFileName(const QString &str)
Encodes (from the text displayed to the real filename) This translates '/' into a "unicode fraction s...
QString buildErrorString(int errorCode, const QString &errorText)
Returns a translated error message for errorCode using the additional error information provided by e...
QString itemsSummaryString(uint items, uint files, uint dirs, KIO::filesize_t size, bool showSize)
Helper for showing information about a set of files and directories. 
QPixmap loadMimeTypeIcon(const QString &iconName, KIconLoader::Group group, int size=0, int state=KIconLoader::DefaultState, const QStringList &overlays=QStringList(), QString *path_store=0) const 
CacheControl
Specifies how to use the cache. 
QString formatByteSize(double size) const 
KAction * clear(const QObject *recvr, const char *slot, QObject *parent)
KJobTrackerInterface * getJobTracker()
static QString protocolClass(const QString &protocol)
QString path(AdjustPathOption trailing=LeaveTrailingSlash) const 
static int connectTimeout()
Returns the preferred timeout value for remote connections in seconds. 
KIO::CacheControl parseCacheControl(const QString &cacheControl)
Parses the string representation of the cache control option. 
QString convertSizeFromKiB(KIO::filesize_t kibSize)
Converts size from kibi-bytes (2^10) to the string representation. 
QString formatDateTime(const QDateTime &dateTime, DateFormat format=ShortDate, bool includeSecs=false) const 
Use cached entry if available. 
Always validate cached entry with remote site. 
QString errorString() const 
Converts an error code and a non-i18n error message into an error message in the current language...
QString fileName(const DirectoryOptions &options=IgnoreTrailingSlash) const 
Validate cached entry with remote site if expired. 
QTime calculateRemaining(KIO::filesize_t totalSize, KIO::filesize_t processedSize, KIO::filesize_t speed)
Calculates remaining time from total size, processed size and speed. 
static int proxyConnectTimeout()
Returns the preferred timeout value for proxy connections in seconds. 
unsigned int calculateRemainingSeconds(KIO::filesize_t totalSize, KIO::filesize_t processedSize, KIO::filesize_t speed)
Calculates remaining time in seconds from total size, processed size and speed. 
QByteArray rawErrorDetail(int errorCode, const QString &errorText, const KUrl *reqUrl=0L, int method=-1)
Returns translated error details for errorCode using the additional error information provided by err...
QString convertSize(KIO::filesize_t size)
Converts size from bytes to the string representation. 
QString prettyUrl(AdjustPathOption trailing=LeaveTrailingSlash) const 
QString errorText() const 
QFile::Permissions convertPermissions(int permissions)
Converts KIO file permissions from mode_t to QFile::Permissions format. 
QString number(KIO::filesize_t size)
Converts a size to a string representation Not unlike QString::number(...)