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(
+ "
\n"
+ "%2" ).arg( QTextCodec::codecForLocale()->name() ).arg( t ) ) );
+}
+
void HelpProtocol::notFound()
{
- data( fromUnicode( i18n("The requested help file could not be found. Check that "
- "you have installed the documentation." ) ) );
+ 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(
- "\n"
- "%2
%3" ).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:
%1" ).arg( file ) );
} else {
data( fromUnicode( mParsed ) );
@@ -244,8 +247,5 @@ void HelpProtocol::get( const KURL& url
if (mParsed.isEmpty()) {
- data(fromUnicode( QString(
- "\n"
- "%2
%3" ).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:
%1" ).arg( file ) );
} else {
QString query = url.query(), anchor;
@@ -315,5 +315,5 @@ void HelpProtocol::emitFile( const KURL&
}
- data(fromUnicode( i18n("Couldn't find filename %1 in %2").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;