[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdelibs/kdoctools
From:       Stephan Kulow <coolo () kde ! org>
Date:       2004-03-23 13:55:55
Message-ID: 20040323135555.E33CB999B () office ! kde ! org
[Download RAW message or body]

CVS commit by coolo: 

always transfer a charset with the error message


  M +11 -11    kio_help.cpp   1.54
  M +2 -1      kio_help.h   1.13


--- kdelibs/kdoctools/kio_help.cpp  #1.53:1.54
@@ -131,8 +131,14 @@ QString HelpProtocol::lookupFile(const Q
 
 
+void HelpProtocol::unicodeError( const QString &t )
+{
+   data(fromUnicode( QString(
+        "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; \
charset=%1\"></head>\n" +        "%2</html>" ).arg( \
QTextCodec::codecForLocale()->name() ).arg( t ) ) ); +}
+
 void HelpProtocol::notFound()
 {
-    data( fromUnicode( i18n("<html>The requested help file could not be found. Check \
                that "
-                                                          "you have installed the \
documentation.</html>" ) ) ); +    unicodeError( i18n("The requested help file could \
not be found. Check that you have installed the documentation." ) );  finished();
 }
@@ -215,8 +221,5 @@ void HelpProtocol::get( const KURL& url 
 
         if (mParsed.isEmpty()) {
-            data(fromUnicode( QString(
-                "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; \
                charset=%1\"></head>\n"
-                "%2<br>%3</html>" ).arg( QTextCodec::codecForLocale()->name() ).
-                                                            arg( i18n( "The \
requested help file could not be parsed:" ) ).arg( file ) ) ); +            \
unicodeError( i18n( "The requested help file could not be parsed:<br>%1" ).arg( file \
) );  } else {
             data( fromUnicode( mParsed ) );
@@ -244,8 +247,5 @@ void HelpProtocol::get( const KURL& url 
 
         if (mParsed.isEmpty()) {
-            data(fromUnicode( QString(
-                "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; \
                charset=%1\"></head>\n"
-                "%2<br>%3</html>" ).arg( QTextCodec::codecForLocale()->name() ).
-                                                            arg( i18n( "The \
requested help file could not be parsed:" ) ).arg( file ) ) ); +            \
unicodeError( i18n( "The requested help file could not be parsed:<br>%1" ).arg( file \
) );  } else {
             QString query = url.query(), anchor;
@@ -315,5 +315,5 @@ void HelpProtocol::emitFile( const KURL&
         }
 
-        data(fromUnicode( i18n("<html>Couldn't find filename %1 in \
%2</html>").arg(filename).arg(url.url() ) ) ); +        unicodeError( i18n("Couldn't \
find filename %1 in %2.").arg(filename).arg( url.url() ) );  return;
     }

--- kdelibs/kdoctools/kio_help.h  #1.12:1.13
@@ -39,4 +39,5 @@ private:
 
     void notFound();
+    void unicodeError( const QString &t );
 
     QString mParsed;    


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic