-rw-r--r-- | kaddressbook/details/detailsviewcontainer.cpp | 11 | ||||
-rw-r--r-- | kaddressbook/details/detailsviewcontainer.h | 1 |
2 files changed, 1 insertions, 11 deletions
diff --git a/kaddressbook/details/detailsviewcontainer.cpp b/kaddressbook/details/detailsviewcontainer.cpp index ceffc77..229cce0 100644 --- a/kaddressbook/details/detailsviewcontainer.cpp +++ b/kaddressbook/details/detailsviewcontainer.cpp | |||
@@ -116,48 +116,39 @@ void ViewContainer::slotStyleSelected( int index ) | |||
116 | } | 116 | } |
117 | 117 | ||
118 | KABLookFactory *factory = mLookFactories.at( index ); | 118 | KABLookFactory *factory = mLookFactories.at( index ); |
119 | 119 | ||
120 | mCurrentLook = factory->create(); | 120 | mCurrentLook = factory->create(); |
121 | mDetailsStack->raiseWidget( mCurrentLook ); | 121 | mDetailsStack->raiseWidget( mCurrentLook ); |
122 | 122 | ||
123 | connect( mCurrentLook, SIGNAL( sendEmail( const QString& ) ), this, | 123 | connect( mCurrentLook, SIGNAL( sendEmail( const QString& ) ), this, |
124 | SIGNAL( sendEmail( const QString& ) ) ); | 124 | SIGNAL( sendEmail( const QString& ) ) ); |
125 | connect( mCurrentLook, SIGNAL( browse( const QString& ) ), this, | 125 | connect( mCurrentLook, SIGNAL( browse( const QString& ) ), this, |
126 | SIGNAL( browse( const QString& ) ) ); | 126 | SIGNAL( browse( const QString& ) ) ); |
127 | } | 127 | } |
128 | 128 | ||
129 | mCurrentLook->restoreSettings( config ); | 129 | mCurrentLook->restoreSettings( config ); |
130 | mCurrentLook->setAddressee( addr ); | 130 | mCurrentLook->setAddressee( addr ); |
131 | } | 131 | } |
132 | void ViewContainer::refreshView() | ||
133 | { | ||
134 | if ( mCurrentLook ) { | ||
135 | mCurrentLook->setAddressee( mCurrentAddressee ); | ||
136 | } | ||
137 | } | ||
138 | 132 | ||
139 | void ViewContainer::setAddressee( const KABC::Addressee& addressee ) | 133 | void ViewContainer::setAddressee( const KABC::Addressee& addressee ) |
140 | { | 134 | { |
141 | if ( mCurrentLook != 0 ) { | 135 | if ( mCurrentLook != 0 ) { |
142 | if ( addressee == mCurrentAddressee ) | ||
143 | return; | ||
144 | else { | ||
145 | mCurrentAddressee = addressee; | 136 | mCurrentAddressee = addressee; |
146 | mCurrentLook->setAddressee( mCurrentAddressee ); | 137 | mCurrentLook->setAddressee( mCurrentAddressee ); |
147 | } | 138 | |
148 | } | 139 | } |
149 | } | 140 | } |
150 | 141 | ||
151 | KABC::Addressee ViewContainer::addressee() | 142 | KABC::Addressee ViewContainer::addressee() |
152 | { | 143 | { |
153 | static KABC::Addressee empty; // do not use! | 144 | static KABC::Addressee empty; // do not use! |
154 | 145 | ||
155 | if ( !mCurrentLook ) | 146 | if ( !mCurrentLook ) |
156 | return empty; | 147 | return empty; |
157 | else | 148 | else |
158 | return mCurrentLook->addressee(); | 149 | return mCurrentLook->addressee(); |
159 | } | 150 | } |
160 | 151 | ||
161 | void ViewContainer::setReadOnly( bool state ) | 152 | void ViewContainer::setReadOnly( bool state ) |
162 | { | 153 | { |
163 | if ( mCurrentLook ) | 154 | if ( mCurrentLook ) |
diff --git a/kaddressbook/details/detailsviewcontainer.h b/kaddressbook/details/detailsviewcontainer.h index b561d12..667f0cb 100644 --- a/kaddressbook/details/detailsviewcontainer.h +++ b/kaddressbook/details/detailsviewcontainer.h | |||
@@ -32,33 +32,32 @@ class QComboBox; | |||
32 | class QWidgetStack; | 32 | class QWidgetStack; |
33 | 33 | ||
34 | class ViewContainer : public QWidget | 34 | class ViewContainer : public QWidget |
35 | { | 35 | { |
36 | Q_OBJECT | 36 | Q_OBJECT |
37 | 37 | ||
38 | public: | 38 | public: |
39 | ViewContainer( QWidget *parent = 0, const char* name = 0 ); | 39 | ViewContainer( QWidget *parent = 0, const char* name = 0 ); |
40 | 40 | ||
41 | /** | 41 | /** |
42 | Return the look currently selected. If there is none, it | 42 | Return the look currently selected. If there is none, it |
43 | returns zero. Do not use this pointer to store a reference | 43 | returns zero. Do not use this pointer to store a reference |
44 | to a look, the user might select another one (e.g., create | 44 | to a look, the user might select another one (e.g., create |
45 | a new object) at any time. | 45 | a new object) at any time. |
46 | */ | 46 | */ |
47 | KABBasicLook *currentLook(); | 47 | KABBasicLook *currentLook(); |
48 | void refreshView(); | ||
49 | /** | 48 | /** |
50 | Return the contact currently displayed. | 49 | Return the contact currently displayed. |
51 | */ | 50 | */ |
52 | KABC::Addressee addressee(); | 51 | KABC::Addressee addressee(); |
53 | 52 | ||
54 | public slots: | 53 | public slots: |
55 | /** | 54 | /** |
56 | Set the contact currently displayed. | 55 | Set the contact currently displayed. |
57 | */ | 56 | */ |
58 | void setAddressee( const KABC::Addressee& addressee ); | 57 | void setAddressee( const KABC::Addressee& addressee ); |
59 | 58 | ||
60 | /** | 59 | /** |
61 | Set read-write state. | 60 | Set read-write state. |
62 | */ | 61 | */ |
63 | void setReadOnly( bool state ); | 62 | void setReadOnly( bool state ); |
64 | 63 | ||