|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
can we finally enable this code?
Hello,
I just stumbled upon the following snippet in khtml_part which was meant to be activated for KDE 3.1 (!). Can anybody remember the cause why it wasn't activated? Could we finally activate it for KDE 4.1 (only 5 years late :-) )? Snippet: void KHTMLPart::htmlError( int errorCode, const QString& text, const KUrl& reqUrl ) { [] return; // following disabled until 3.1 QString errorName, techName, description; QStringList causes, solutions; QByteArray raw = KI::rawErrorDetail( errorCode, text, &reqUrl ); QDataStream stream(raw); stream >errorName >techName >description >causes >solutions; QString url, protocol, datetime; url = reqUrl.prettyUrl(); protocol = reqUrl.protocol(); datetime = KGlobal::locale()->formatDateTime( QDateTime::currentDateTime(), KLocale::LongDate ); QString doc = QLatin1String( "<html><head><title>" ); doc += i18n( "Error: " ); doc += errorName; doc += QString::fromLatin1( " - %1</title></head><body><h1>" ).arg( url ); doc += i18n( "The requested operation could not be completed" ); doc += QLatin1String( "</h1><h2>" ); doc += errorName; doc += QLatin1String( "</h2>" ); if ( !techName.isNull() ) { doc += QLatin1String( "<h2>" ); doc += i18n( "Technical Reason: " ); doc += techName; doc += QLatin1String( "</h2>" ); } doc += QLatin1String( "<h3>" ); doc += i18n( "Details of the Request:" ); doc += QLatin1String( "</h3><ul><li>" ); doc += i18n( "URL: %1" , url ); doc += QLatin1String( "</li><li>" ); if ( !protocol.isNull() ) { // uncomment for 3.1 i18n change // doc += i18n( "Protocol: %1" ).arg( protocol ).arg( protocol ); doc += QLatin1String( "</li><li>" ); } doc += i18n( "Date and Time: %1" , datetime ); doc += QLatin1String( "</li><li>" ); doc += i18n( "Additional Information: %1" , text ); doc += QLatin1String( "</li></ul><h3>" ); doc += i18n( "Description:" ); doc += QLatin1String( "</h3><p>" ); doc += description; doc += QLatin1String( "</p>" ); if ( causes.count() ) { doc += QLatin1String( "<h3>" ); doc += i18n( "Possible Causes:" ); doc += QLatin1String( "</h3><ul><li>" ); doc += causes.join( "</li><li>" ); doc += QLatin1String( "</li></ul>" ); } if ( solutions.count() ) { doc += QLatin1String( "<h3>" ); doc += i18n( "Possible Solutions:" ); doc += QLatin1String( "</h3><ul><li>" ); doc += solutions.join( "</li><li>" ); doc += QLatin1String( "</li></ul>" ); } doc += QLatin1String( "</body></html>" ); write( doc ); end(); } mfg Leo |
|
#2
|
|||
|
|||
|
elaborate kio error messages
Am Mittwoch, 6. Februar 2008 schrieb David Faure:
Could we finally activate it for KDE 4.1 (only 5 years late :-) )? > Yes, I think. We might have to improve the details given by *KI::rawErrorDetail() and make sure that all kio error codes are supported, but the only way we'll do that is if we start seeing that stuff indeed :) Here's a patch. It looks cruel, therefore *_ub contains a diff -ub which makes the changes more obvious. Please check the patch. I currently don't have a working checkout so I don't know whether it works as intended. mfg Leo |
![]() |
| Viewing: Web Development Archives > Mailing Lists > KDE > can we finally enable this code? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|