Diffstat (limited to 'kaddressbook/secrecywidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/secrecywidget.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/kaddressbook/secrecywidget.cpp b/kaddressbook/secrecywidget.cpp index 4a2acc8..1c237c0 100644 --- a/kaddressbook/secrecywidget.cpp +++ b/kaddressbook/secrecywidget.cpp | |||
@@ -1,70 +1,72 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KAddressBook. | 2 | This file is part of KAddressBook. |
3 | Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> | 3 | Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qlayout.h> | 24 | #include <qlayout.h> |
25 | //Added by qt3to4: | ||
26 | #include <Q3VBoxLayout> | ||
25 | 27 | ||
26 | #include <kabc/secrecy.h> | 28 | #include <kabc/secrecy.h> |
27 | #include <kcombobox.h> | 29 | #include <kcombobox.h> |
28 | #include <kdialog.h> | 30 | #include <kdialog.h> |
29 | 31 | ||
30 | #include "secrecywidget.h" | 32 | #include "secrecywidget.h" |
31 | 33 | ||
32 | SecrecyWidget::SecrecyWidget( QWidget *parent, const char *name ) | 34 | SecrecyWidget::SecrecyWidget( QWidget *parent, const char *name ) |
33 | : QWidget( parent, name ) | 35 | : QWidget( parent, name ) |
34 | { | 36 | { |
35 | QVBoxLayout *layout = new QVBoxLayout( this, KDialog::marginHint(), | 37 | Q3VBoxLayout *layout = new Q3VBoxLayout( this, KDialog::marginHint(), |
36 | KDialog::spacingHint() ); | 38 | KDialog::spacingHint() ); |
37 | mSecrecyCombo = new KComboBox( this ); | 39 | mSecrecyCombo = new KComboBox( this ); |
38 | layout->addWidget( mSecrecyCombo ); | 40 | layout->addWidget( mSecrecyCombo ); |
39 | 41 | ||
40 | KABC::Secrecy::TypeList list = KABC::Secrecy::typeList(); | 42 | KABC::Secrecy::TypeList list = KABC::Secrecy::typeList(); |
41 | KABC::Secrecy::TypeList::Iterator it; | 43 | KABC::Secrecy::TypeList::Iterator it; |
42 | for ( it = list.begin(); it != list.end(); ++it ) | 44 | for ( it = list.begin(); it != list.end(); ++it ) |
43 | mSecrecyCombo->insertItem( KABC::Secrecy::typeLabel( *it ), *it ); | 45 | mSecrecyCombo->insertItem( KABC::Secrecy::typeLabel( *it ), *it ); |
44 | 46 | ||
45 | connect( mSecrecyCombo, SIGNAL( activated( const QString& ) ), | 47 | connect( mSecrecyCombo, SIGNAL( activated( const QString& ) ), |
46 | SIGNAL( changed() ) ); | 48 | SIGNAL( changed() ) ); |
47 | } | 49 | } |
48 | 50 | ||
49 | SecrecyWidget::~SecrecyWidget() | 51 | SecrecyWidget::~SecrecyWidget() |
50 | { | 52 | { |
51 | } | 53 | } |
52 | 54 | ||
53 | void SecrecyWidget::setSecrecy( const KABC::Secrecy &secrecy ) | 55 | void SecrecyWidget::setSecrecy( const KABC::Secrecy &secrecy ) |
54 | { | 56 | { |
55 | //US to avoid an indexoutofbounds error if value is invalid | 57 | //US to avoid an indexoutofbounds error if value is invalid |
56 | if (secrecy.isValid()) | 58 | if (secrecy.isValid()) |
57 | mSecrecyCombo->setCurrentItem( secrecy.type() ); | 59 | mSecrecyCombo->setCurrentItem( secrecy.type() ); |
58 | } | 60 | } |
59 | 61 | ||
60 | KABC::Secrecy SecrecyWidget::secrecy() const | 62 | KABC::Secrecy SecrecyWidget::secrecy() const |
61 | { | 63 | { |
62 | KABC::Secrecy secrecy; | 64 | KABC::Secrecy secrecy; |
63 | secrecy.setType( mSecrecyCombo->currentItem() ); | 65 | secrecy.setType( mSecrecyCombo->currentItem() ); |
64 | 66 | ||
65 | return secrecy; | 67 | return secrecy; |
66 | } | 68 | } |
67 | 69 | ||
68 | #ifndef KAB_EMBEDDED | 70 | #ifndef KAB_EMBEDDED_ |
69 | #include "secrecywidget.moc" | 71 | #include "moc_secrecywidget.cpp" |
70 | #endif //KAB_EMBEDDED | 72 | #endif //KAB_EMBEDDED |