From kde-commits Tue Mar 23 13:55:55 2004 From: Stephan Kulow Date: Tue, 23 Mar 2004 13:55:55 +0000 To: kde-commits Subject: kdelibs/kdoctools Message-Id: <20040323135555.E33CB999B () office ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=108005016126890 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;