Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Evergreen:11.1:kernel-2.6.32
kdepim4
r895000.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File r895000.diff of Package kdepim4
Subject: knode: fix incorrect charset header From: wstephenson@suse.de Bug: kde:169411 Patch-upstream: 895000 --- knode/kncomposer.h (revision 894999) +++ knode/kncomposer.h (revision 895000) @@ -214,7 +214,12 @@ class KNComposer : public KXmlGuiWindow private: bool mFirstEdit; - + /** + * Temporary hack for bug 169411 stolen from KMail (kmmsgbase.{h,cpp}) + * Fixes an encoding received by a KDE function and returns the proper, + * MIME-compilant encoding name instead. + */ + QByteArray fixEncoding( const QByteArray &encoding ); }; #if 0 --- knode/kncomposer.cpp (revision 894999) +++ knode/kncomposer.cpp (revision 895000) @@ -927,6 +927,18 @@ bool KNComposer::applyChanges() return true; } +QByteArray KNComposer::fixEncoding( const QByteArray &encoding ) +{ + QString returnEncoding = encoding; + // According to http://www.iana.org/assignments/character-sets, uppercase is + // preferred in MIME headers + if ( returnEncoding.toUpper().contains( "ISO " ) ) { + returnEncoding = returnEncoding.toUpper(); + returnEncoding.replace( "ISO ", "ISO-" ); + } + return returnEncoding.toLatin1(); +} + void KNComposer::closeEvent(QCloseEvent *e) { @@ -994,6 +1006,8 @@ void KNComposer::initData(const QString else c_harset = knGlobals.settings()->charset().toLatin1(); + c_harset = fixEncoding(c_harset); // workaround previous wrong configuration + a_ctSetCharset->setCurrentItem( a_ctSetCharset->items().indexOf( c_harset ) ); // initialize the message type select action @@ -1263,7 +1277,7 @@ void KNComposer::slotSetCharset(const QS if(s.isEmpty()) return; - c_harset = s.toLatin1(); + c_harset = fixEncoding(s.toLatin1()); setConfig(true); //adjust fonts } Index: knode/kncomposer.h =================================================================== Index: knode/kncomposer.cpp ===================================================================
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor