[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdepim/plugins/kmail/bodypartformatter
From: Till Adam <adam () kde ! org>
Date: 2005-04-10 18:16:26
Message-ID: 20050410181626.37998495 () office ! kde ! org
[Download RAW message or body]
CVS commit by tilladam:
Make the secondary subtype actually work.
M +7 -3 text_vcard.cpp 1.16
--- kdepim/plugins/kmail/bodypartformatter/text_vcard.cpp #1.15:1.16
@@ -139,8 +139,8 @@ namespace {
public:
const KMail::Interface::BodyPartFormatter * bodyPartFormatter( int idx ) const {
- return idx == 0 ? new Formatter() : 0 ;
+ return validIndex( idx ) ? new Formatter() : 0 ;
}
const char * type( int idx ) const {
- return idx == 0 ? "text" : 0 ;
+ return validIndex( idx ) ? "text" : 0 ;
}
const char * subtype( int idx ) const {
@@ -149,5 +149,9 @@ namespace {
const KMail::Interface::BodyPartURLHandler * urlHandler( int idx ) const {
- return idx == 0 ? new UrlHandler() : 0 ;
+ return validIndex( idx ) ? new UrlHandler() : 0 ;
+ }
+ private:
+ bool validIndex( int idx ) const {
+ return ( idx >= 0 && idx <= 1 );
}
};
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic