KDE
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   Web Development Archives Mailing Lists KDE

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Web Development Archives Sponsor:
  #1  
Old January 31st, 2008, 01:20 PM
Leo Savernik
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
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

Reply With Quote
  #2  
Old February 7th, 2008, 01:02 PM
Leo Savernik
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
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

Reply With Quote
Reply

Viewing: Web Development Archives Mailing Lists KDE > can we finally enable this code?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT