author | eilers <eilers> | 2003-05-11 12:36:30 (UTC) |
---|---|---|
committer | eilers <eilers> | 2003-05-11 12:36:30 (UTC) |
commit | 37084d3961026893840ef9891132bdf193a312b3 (patch) (unidiff) | |
tree | 342792abd777eb11a378cc5e06e0436ab48f6d89 /core/pim/addressbook/abconfig.cpp | |
parent | b068a42c89af19f5642b68060c1d085afa78e7b1 (diff) | |
download | opie-37084d3961026893840ef9891132bdf193a312b3.zip opie-37084d3961026893840ef9891132bdf193a312b3.tar.gz opie-37084d3961026893840ef9891132bdf193a312b3.tar.bz2 |
Some improvements in handling of organizations:
- If you enter a organization name and no Fullname is entered, the
organization name will be used.
Thus, the organization is shown correctly in the listview..
- The letterpicker now searches for the SaveAs Entry (configurable)
instead for lastname. Ths guarantees that the organization is found
as expected..
This addresses bugreport #590 and #895..
Diffstat (limited to 'core/pim/addressbook/abconfig.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/addressbook/abconfig.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/core/pim/addressbook/abconfig.cpp b/core/pim/addressbook/abconfig.cpp index 0b61614..4a0875b 100644 --- a/core/pim/addressbook/abconfig.cpp +++ b/core/pim/addressbook/abconfig.cpp | |||
@@ -1,198 +1,213 @@ | |||
1 | #include "abconfig.h" | 1 | #include "abconfig.h" |
2 | #include "version.h" | 2 | #include "version.h" |
3 | 3 | ||
4 | #include <qpe/config.h> | 4 | #include <qpe/config.h> |
5 | #include <qpe/recordfields.h> | 5 | #include <qpe/recordfields.h> |
6 | 6 | ||
7 | AbConfig::AbConfig( ): | 7 | AbConfig::AbConfig( ): |
8 | m_useQtMail( true ), | 8 | m_useQtMail( true ), |
9 | m_useOpieMail( false ), | 9 | m_useOpieMail( false ), |
10 | m_useRegExp( false ), | 10 | m_useRegExp( false ), |
11 | m_beCaseSensitive( false ), | 11 | m_beCaseSensitive( false ), |
12 | m_fontSize( 1 ), | 12 | m_fontSize( 1 ), |
13 | m_barPos( QMainWindow::Top ), | 13 | m_barPos( QMainWindow::Top ), |
14 | m_fixedBars( true ), | 14 | m_fixedBars( true ), |
15 | m_lpSearchMode( LastName ), | ||
15 | m_changed( false ) | 16 | m_changed( false ) |
16 | { | 17 | { |
17 | } | 18 | } |
18 | 19 | ||
19 | AbConfig::~AbConfig() | 20 | AbConfig::~AbConfig() |
20 | { | 21 | { |
21 | } | 22 | } |
22 | 23 | ||
23 | bool AbConfig::useRegExp() const | 24 | bool AbConfig::useRegExp() const |
24 | { | 25 | { |
25 | return m_useRegExp; | 26 | return m_useRegExp; |
26 | } | 27 | } |
27 | bool AbConfig::useWildCards() const | 28 | bool AbConfig::useWildCards() const |
28 | { | 29 | { |
29 | return !m_useRegExp; | 30 | return !m_useRegExp; |
30 | } | 31 | } |
31 | bool AbConfig::useQtMail() const | 32 | bool AbConfig::useQtMail() const |
32 | { | 33 | { |
33 | return m_useQtMail; | 34 | return m_useQtMail; |
34 | } | 35 | } |
35 | bool AbConfig::useOpieMail() const | 36 | bool AbConfig::useOpieMail() const |
36 | { | 37 | { |
37 | return m_useOpieMail; | 38 | return m_useOpieMail; |
38 | } | 39 | } |
39 | bool AbConfig::beCaseSensitive() const | 40 | bool AbConfig::beCaseSensitive() const |
40 | { | 41 | { |
41 | return m_beCaseSensitive; | 42 | return m_beCaseSensitive; |
42 | } | 43 | } |
43 | int AbConfig::fontSize() const | 44 | int AbConfig::fontSize() const |
44 | { | 45 | { |
45 | return m_fontSize; | 46 | return m_fontSize; |
46 | } | 47 | } |
47 | 48 | ||
48 | QValueList<int> AbConfig::orderList() const | 49 | QValueList<int> AbConfig::orderList() const |
49 | { | 50 | { |
50 | return m_ordered; | 51 | return m_ordered; |
51 | } | 52 | } |
52 | 53 | ||
53 | QMainWindow::ToolBarDock AbConfig::getToolBarPos() const | 54 | QMainWindow::ToolBarDock AbConfig::getToolBarPos() const |
54 | { | 55 | { |
55 | return (QMainWindow::ToolBarDock) m_barPos; | 56 | return (QMainWindow::ToolBarDock) m_barPos; |
56 | } | 57 | } |
57 | 58 | ||
58 | bool AbConfig::fixedBars() const | 59 | bool AbConfig::fixedBars() const |
59 | { | 60 | { |
60 | return m_fixedBars; | 61 | return m_fixedBars; |
61 | } | 62 | } |
62 | 63 | ||
64 | AbConfig::LPSearchMode AbConfig::letterPickerSearch() const | ||
65 | { | ||
66 | return ( AbConfig::LPSearchMode ) m_lpSearchMode; | ||
67 | } | ||
68 | |||
63 | void AbConfig::setUseRegExp( bool v ) | 69 | void AbConfig::setUseRegExp( bool v ) |
64 | { | 70 | { |
65 | m_useRegExp = v ; | 71 | m_useRegExp = v ; |
66 | m_changed = true; | 72 | m_changed = true; |
67 | } | 73 | } |
68 | void AbConfig::setUseWildCards( bool v ) | 74 | void AbConfig::setUseWildCards( bool v ) |
69 | { | 75 | { |
70 | m_useRegExp = !v; | 76 | m_useRegExp = !v; |
71 | m_changed = true; | 77 | m_changed = true; |
72 | } | 78 | } |
73 | void AbConfig::setBeCaseSensitive( bool v ) | 79 | void AbConfig::setBeCaseSensitive( bool v ) |
74 | { | 80 | { |
75 | m_beCaseSensitive = v; | 81 | m_beCaseSensitive = v; |
76 | m_changed = true; | 82 | m_changed = true; |
77 | } | 83 | } |
78 | void AbConfig::setUseQtMail( bool v ) | 84 | void AbConfig::setUseQtMail( bool v ) |
79 | { | 85 | { |
80 | m_useQtMail = v; | 86 | m_useQtMail = v; |
81 | m_changed = true; | 87 | m_changed = true; |
82 | } | 88 | } |
83 | void AbConfig::setUseOpieMail( bool v ) | 89 | void AbConfig::setUseOpieMail( bool v ) |
84 | { | 90 | { |
85 | m_useOpieMail = v; | 91 | m_useOpieMail = v; |
86 | m_changed = true; | 92 | m_changed = true; |
87 | } | 93 | } |
88 | void AbConfig::setFontSize( int v ) | 94 | void AbConfig::setFontSize( int v ) |
89 | { | 95 | { |
90 | m_fontSize = v; | 96 | m_fontSize = v; |
91 | m_changed = true; | 97 | m_changed = true; |
92 | } | 98 | } |
93 | 99 | ||
94 | void AbConfig::setOrderList( const QValueList<int>& list ) | 100 | void AbConfig::setOrderList( const QValueList<int>& list ) |
95 | { | 101 | { |
96 | m_ordered = list; | 102 | m_ordered = list; |
97 | m_changed = true; | 103 | m_changed = true; |
98 | } | 104 | } |
99 | 105 | ||
100 | void AbConfig::setToolBarDock( const QMainWindow::ToolBarDock v ) | 106 | void AbConfig::setToolBarDock( const QMainWindow::ToolBarDock v ) |
101 | { | 107 | { |
102 | m_barPos = v; | 108 | m_barPos = v; |
103 | m_changed = true; | 109 | m_changed = true; |
104 | } | 110 | } |
105 | 111 | ||
106 | void AbConfig::setFixedBars( const bool fixed ) | 112 | void AbConfig::setFixedBars( const bool fixed ) |
107 | { | 113 | { |
108 | m_fixedBars = fixed; | 114 | m_fixedBars = fixed; |
109 | m_changed = true; | 115 | m_changed = true; |
110 | } | 116 | } |
111 | 117 | ||
118 | void AbConfig::setLetterPickerSearch( const AbConfig::LPSearchMode mode ) | ||
119 | { | ||
120 | m_lpSearchMode = mode; | ||
121 | m_changed = true; | ||
122 | } | ||
123 | |||
112 | void AbConfig::load() | 124 | void AbConfig::load() |
113 | { | 125 | { |
114 | // Read Config settings | 126 | // Read Config settings |
115 | Config cfg("AddressBook"); | 127 | Config cfg("AddressBook"); |
116 | 128 | ||
117 | cfg.setGroup("Font"); | 129 | cfg.setGroup("Font"); |
118 | m_fontSize = cfg.readNumEntry( "fontSize", 1 ); | 130 | m_fontSize = cfg.readNumEntry( "fontSize", 1 ); |
119 | 131 | ||
120 | cfg.setGroup("Search"); | 132 | cfg.setGroup("Search"); |
121 | m_useRegExp = cfg.readBoolEntry( "useRegExp" ); | 133 | m_useRegExp = cfg.readBoolEntry( "useRegExp", false ); |
122 | m_beCaseSensitive = cfg.readBoolEntry( "caseSensitive" ); | 134 | m_beCaseSensitive = cfg.readBoolEntry( "caseSensitive", false ); |
135 | m_lpSearchMode = cfg.readNumEntry( "lpSearchMode", FullName ); | ||
123 | 136 | ||
124 | cfg.setGroup("Mail"); | 137 | cfg.setGroup("Mail"); |
125 | m_useQtMail = cfg.readBoolEntry( "useQtMail", true ); | 138 | m_useQtMail = cfg.readBoolEntry( "useQtMail", true ); |
126 | m_useOpieMail=cfg.readBoolEntry( "useOpieMail" ); | 139 | m_useOpieMail=cfg.readBoolEntry( "useOpieMail" ); |
127 | 140 | ||
128 | cfg.setGroup("ContactOrder"); | 141 | cfg.setGroup("ContactOrder"); |
129 | int ID = 0; | 142 | int ID = 0; |
130 | int i = 0; | 143 | int i = 0; |
131 | ID = cfg.readNumEntry( "ContactID_"+QString::number(i++), 0 ); | 144 | ID = cfg.readNumEntry( "ContactID_"+QString::number(i++), 0 ); |
132 | while ( ID != 0 ){ | 145 | while ( ID != 0 ){ |
133 | m_ordered.append( ID ); | 146 | m_ordered.append( ID ); |
134 | ID = cfg.readNumEntry( "ContactID_"+QString::number(i++), 0 ); | 147 | ID = cfg.readNumEntry( "ContactID_"+QString::number(i++), 0 ); |
135 | } | 148 | } |
136 | 149 | ||
137 | // If no contact order is defined, we set the default | 150 | // If no contact order is defined, we set the default |
138 | if ( m_ordered.count() == 0 ) { | 151 | if ( m_ordered.count() == 0 ) { |
139 | m_ordered.append( Qtopia::DefaultEmail ); | 152 | m_ordered.append( Qtopia::DefaultEmail ); |
140 | m_ordered.append( Qtopia::HomePhone); | 153 | m_ordered.append( Qtopia::HomePhone); |
141 | m_ordered.append( Qtopia::HomeMobile); | 154 | m_ordered.append( Qtopia::HomeMobile); |
142 | m_ordered.append( Qtopia::BusinessPhone); | 155 | m_ordered.append( Qtopia::BusinessPhone); |
143 | } | 156 | } |
144 | 157 | ||
145 | cfg.setGroup("ToolBar"); | 158 | cfg.setGroup("ToolBar"); |
146 | m_barPos = cfg.readNumEntry( "Position", QMainWindow::Top ); | 159 | m_barPos = cfg.readNumEntry( "Position", QMainWindow::Top ); |
147 | m_fixedBars= cfg.readBoolEntry( "fixedBars", true ); | 160 | m_fixedBars= cfg.readBoolEntry( "fixedBars", true ); |
148 | 161 | ||
149 | m_changed = false; | 162 | m_changed = false; |
150 | } | 163 | } |
151 | 164 | ||
152 | void AbConfig::save() | 165 | void AbConfig::save() |
153 | { | 166 | { |
154 | if ( m_changed ){ | 167 | if ( m_changed ){ |
155 | Config cfg("AddressBook"); | 168 | Config cfg("AddressBook"); |
156 | cfg.setGroup("Font"); | 169 | cfg.setGroup("Font"); |
157 | cfg.writeEntry("fontSize", m_fontSize); | 170 | cfg.writeEntry("fontSize", m_fontSize); |
158 | 171 | ||
159 | cfg.setGroup("Search"); | 172 | cfg.setGroup("Search"); |
160 | cfg.writeEntry("useRegExp", m_useRegExp); | 173 | cfg.writeEntry("useRegExp", m_useRegExp); |
161 | cfg.writeEntry("caseSensitive", m_beCaseSensitive); | 174 | cfg.writeEntry("caseSensitive", m_beCaseSensitive); |
175 | cfg.writeEntry("lpSearchMode", m_lpSearchMode ); | ||
162 | 176 | ||
163 | cfg.setGroup("Mail"); | 177 | cfg.setGroup("Mail"); |
164 | cfg.writeEntry( "useQtMail", m_useQtMail ); | 178 | cfg.writeEntry( "useQtMail", m_useQtMail ); |
165 | cfg.writeEntry( "useOpieMail", m_useOpieMail); | 179 | cfg.writeEntry( "useOpieMail", m_useOpieMail); |
166 | 180 | ||
167 | cfg.setGroup("ContactOrder"); | 181 | cfg.setGroup("ContactOrder"); |
168 | cfg.clearGroup(); | 182 | cfg.clearGroup(); |
169 | for ( uint i = 0; i < m_ordered.count(); i++ ){ | 183 | for ( uint i = 0; i < m_ordered.count(); i++ ){ |
170 | cfg.writeEntry( "ContactID_"+QString::number(i), m_ordered[i] ); | 184 | cfg.writeEntry( "ContactID_"+QString::number(i), m_ordered[i] ); |
171 | } | 185 | } |
172 | 186 | ||
173 | cfg.setGroup("ToolBar"); | 187 | cfg.setGroup("ToolBar"); |
174 | cfg.writeEntry( "Position", m_barPos ); | 188 | cfg.writeEntry( "Position", m_barPos ); |
175 | cfg.writeEntry( "fixedBars", m_fixedBars ); | 189 | cfg.writeEntry( "fixedBars", m_fixedBars ); |
176 | 190 | ||
177 | cfg.setGroup("Version"); | 191 | cfg.setGroup("Version"); |
178 | cfg.writeEntry( "AppName", APPNAME + QString(" V" ) + MAINVERSION + QString(".") + SUBVERSION + QString(".") + PATCHVERSION); | 192 | cfg.writeEntry( "AppName", APPNAME + QString(" V" ) + MAINVERSION + QString(".") + SUBVERSION + QString(".") + PATCHVERSION); |
179 | cfg.writeEntry( "Mainversion", MAINVERSION ); | 193 | cfg.writeEntry( "Mainversion", MAINVERSION ); |
180 | cfg.writeEntry( "SubVersion", SUBVERSION ); | 194 | cfg.writeEntry( "SubVersion", SUBVERSION ); |
181 | cfg.writeEntry( "PatchVersion", PATCHVERSION ); | 195 | cfg.writeEntry( "PatchVersion", PATCHVERSION ); |
182 | 196 | ||
183 | } | 197 | } |
184 | 198 | ||
185 | } | 199 | } |
186 | 200 | ||
187 | void AbConfig::operator= ( const AbConfig& cnf ) | 201 | void AbConfig::operator= ( const AbConfig& cnf ) |
188 | { | 202 | { |
189 | m_useQtMail = cnf.m_useQtMail; | 203 | m_useQtMail = cnf.m_useQtMail; |
190 | m_useOpieMail = cnf.m_useOpieMail; | 204 | m_useOpieMail = cnf.m_useOpieMail; |
191 | m_useRegExp = cnf.m_useRegExp; | 205 | m_useRegExp = cnf.m_useRegExp; |
192 | m_beCaseSensitive = cnf.m_beCaseSensitive; | 206 | m_beCaseSensitive = cnf.m_beCaseSensitive; |
193 | m_fontSize = cnf.m_fontSize; | 207 | m_fontSize = cnf.m_fontSize; |
194 | m_ordered = cnf.m_ordered; | 208 | m_ordered = cnf.m_ordered; |
195 | m_barPos = cnf.m_barPos; | 209 | m_barPos = cnf.m_barPos; |
196 | m_fixedBars = cnf.m_fixedBars; | 210 | m_fixedBars = cnf.m_fixedBars; |
211 | m_lpSearchMode = cnf.m_lpSearchMode; | ||
197 | } | 212 | } |
198 | 213 | ||