summaryrefslogtreecommitdiffabout
path: root/kaddressbook/details
Unidiff
Diffstat (limited to 'kaddressbook/details') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/details/detailsviewcontainer.cpp11
-rw-r--r--kaddressbook/details/detailsviewcontainer.h1
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
@@ -120,40 +120,31 @@ void ViewContainer::slotStyleSelected( int index )
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}
132void ViewContainer::refreshView()
133{
134 if ( mCurrentLook ) {
135 mCurrentLook->setAddressee( mCurrentAddressee );
136 }
137}
138 132
139void ViewContainer::setAddressee( const KABC::Addressee& addressee ) 133void 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
151KABC::Addressee ViewContainer::addressee() 142KABC::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}
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
@@ -36,25 +36,24 @@ class ViewContainer : public QWidget
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 /**