summaryrefslogtreecommitdiffabout
path: root/kaddressbook/addresseeconfig.cpp
authorMichael Krelin <hacker@klever.net>2007-07-04 11:23:42 (UTC)
committer Michael Krelin <hacker@klever.net>2007-07-04 11:23:42 (UTC)
commita08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff)
tree8ee90d686081c52e7c69b5ce946e9b1a7d690001 /kaddressbook/addresseeconfig.cpp
parent11edc920afe4f274c0964436633aa632c8288a40 (diff)
downloadkdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip
kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz
kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2
initial public commit of qt4 portp1
Diffstat (limited to 'kaddressbook/addresseeconfig.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/addresseeconfig.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/kaddressbook/addresseeconfig.cpp b/kaddressbook/addresseeconfig.cpp
index ea0436f..81b1bf4 100644
--- a/kaddressbook/addresseeconfig.cpp
+++ b/kaddressbook/addresseeconfig.cpp
@@ -1,94 +1,96 @@
1/* 1/*
2 This file is part of KAddressBook. 2 This file is part of KAddressBook.
3 Copyright (c) 2002 Tobias Koenig <tokoe@kde.org> 3 Copyright (c) 2002 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 "addresseeconfig.h" 24#include "addresseeconfig.h"
25#include "kabprefs.h" 25#include "kabprefs.h"
26//US 26//US
27#include <kstandarddirs.h> 27#include <kstandarddirs.h>
28#include <qfileinfo.h> 28#include <qfileinfo.h>
29//Added by qt3to4:
30#include <Q3ValueList>
29 31
30using namespace KABC; 32using namespace KABC;
31 33
32static AddresseeConfig* extern_AddresseeConfig = 0; 34static AddresseeConfig* extern_AddresseeConfig = 0;
33static KConfig * extern_Config = 0; 35static KConfig * extern_Config = 0;
34 36
35AddresseeConfig::AddresseeConfig() 37AddresseeConfig::AddresseeConfig()
36{ 38{
37 39
38 40
39} 41}
40AddresseeConfig::~AddresseeConfig() 42AddresseeConfig::~AddresseeConfig()
41{ 43{
42 delete AddresseeConfig::config(); 44 delete AddresseeConfig::config();
43} 45}
44 46
45 47
46AddresseeConfig* AddresseeConfig::instance() 48AddresseeConfig* AddresseeConfig::instance()
47{ 49{
48 if ( ! extern_AddresseeConfig ) 50 if ( ! extern_AddresseeConfig )
49 extern_AddresseeConfig = new AddresseeConfig(); 51 extern_AddresseeConfig = new AddresseeConfig();
50 return extern_AddresseeConfig; 52 return extern_AddresseeConfig;
51} 53}
52KConfig* AddresseeConfig::config() 54KConfig* AddresseeConfig::config()
53{ 55{
54 if ( ! extern_Config ) { 56 if ( ! extern_Config ) {
55 QString conf = locateLocal("config", "kaddressrc"); 57 QString conf = locateLocal("config", "kaddressrc");
56 extern_Config= new KConfig( conf ); 58 extern_Config= new KConfig( conf );
57 } 59 }
58 return extern_Config; 60 return extern_Config;
59} 61}
60 62
61 63
62void AddresseeConfig::setUid( const QString & uid ) 64void AddresseeConfig::setUid( const QString & uid )
63{ 65{
64 AddresseeConfig::config()->setGroup( uid ); 66 AddresseeConfig::config()->setGroup( uid );
65 mUid = uid; 67 mUid = uid;
66} 68}
67 69
68void AddresseeConfig::setAutomaticNameParsing( bool value ) 70void AddresseeConfig::setAutomaticNameParsing( bool value )
69{ 71{
70 AddresseeConfig::config()->writeEntry( "AutomaticNameParsing", value ); 72 AddresseeConfig::config()->writeEntry( "AutomaticNameParsing", value );
71} 73}
72 74
73 bool AddresseeConfig::automaticNameParsing() 75 bool AddresseeConfig::automaticNameParsing()
74{ 76{
75 77
76 return AddresseeConfig::config()->readBoolEntry( "AutomaticNameParsing", 78 return AddresseeConfig::config()->readBoolEntry( "AutomaticNameParsing",
77 KABPrefs::instance()->mAutomaticNameParsing ); 79 KABPrefs::instance()->mAutomaticNameParsing );
78} 80}
79 81
80void AddresseeConfig::setNoDefaultAddrTypes( const QValueList<int> &types ) 82void AddresseeConfig::setNoDefaultAddrTypes( const Q3ValueList<int> &types )
81{ 83{
82 AddresseeConfig::config()->writeEntry( "NoDefaultAddrTypes", types ); 84 AddresseeConfig::config()->writeEntry( "NoDefaultAddrTypes", types );
83 AddresseeConfig::config()->sync(); 85 AddresseeConfig::config()->sync();
84} 86}
85 87
86 QValueList<int> AddresseeConfig::noDefaultAddrTypes() const 88 Q3ValueList<int> AddresseeConfig::noDefaultAddrTypes() const
87{ 89{
88 return AddresseeConfig::config()->readIntListEntry( "NoDefaultAddrTypes" ); 90 return AddresseeConfig::config()->readIntListEntry( "NoDefaultAddrTypes" );
89} 91}
90 92
91void AddresseeConfig::remove( const QString & uid ) 93void AddresseeConfig::remove( const QString & uid )
92{ 94{
93 AddresseeConfig::config()->deleteGroup( uid ); 95 AddresseeConfig::config()->deleteGroup( uid );
94} 96}