summaryrefslogtreecommitdiffabout
path: root/kabc
Unidiff
Diffstat (limited to 'kabc') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/phonenumber.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/kabc/phonenumber.cpp b/kabc/phonenumber.cpp
index 3f641d1..4ad608d 100644
--- a/kabc/phonenumber.cpp
+++ b/kabc/phonenumber.cpp
@@ -84,117 +84,117 @@ void PhoneNumber::setNumber( const QString &number )
84QString PhoneNumber::number() const 84QString PhoneNumber::number() const
85{ 85{
86 return mNumber; 86 return mNumber;
87} 87}
88 88
89void PhoneNumber::setType( int type ) 89void PhoneNumber::setType( int type )
90{ 90{
91 mType = type; 91 mType = type;
92} 92}
93 93
94int PhoneNumber::type() const 94int PhoneNumber::type() const
95{ 95{
96 return mType; 96 return mType;
97} 97}
98 98
99QString PhoneNumber::typeLabel() const 99QString PhoneNumber::typeLabel() const
100{ 100{
101 QString label; 101 QString label;
102 bool first = true; 102 bool first = true;
103 103
104 TypeList list = typeList(); 104 TypeList list = typeList();
105 105
106 TypeList::Iterator it; 106 TypeList::Iterator it;
107 for ( it = list.begin(); it != list.end(); ++it ) { 107 for ( it = list.begin(); it != list.end(); ++it ) {
108 if ( ( type() & (*it) ) && ( (*it) != Pref ) ) { 108 if ( ( type() & (*it) ) && ( (*it) != Pref ) ) {
109 label.append( ( first ? "" : "/" ) + typeLabel( *it ) ); 109 label.append( ( first ? "" : "/" ) + typeLabel( *it ) );
110 if ( first ) 110 if ( first )
111 first = false; 111 first = false;
112 } 112 }
113 } 113 }
114 114
115 return label; 115 return label;
116} 116}
117 117
118QString PhoneNumber::label() const 118QString PhoneNumber::label() const
119{ 119{
120 return typeLabel( type() ); 120 return typeLabel( type() );
121} 121}
122 122
123PhoneNumber::TypeList PhoneNumber::typeList() 123PhoneNumber::TypeList PhoneNumber::typeList()
124{ 124{
125 TypeList list; 125 TypeList list;
126 126
127 list << Home << Work << Msg << Pref << Voice << Fax << Cell << Video 127 list << Home << Work << Msg << Pref << Voice << Fax << Cell << Video
128 << Bbs << Modem << Car << Isdn << Pcs << Pager; 128 << Bbs << Modem << Car << Isdn << Pcs << Pager;
129 129
130 return list; 130 return list;
131} 131}
132 132
133QString PhoneNumber::label( int type ) 133QString PhoneNumber::label( int type )
134{ 134{
135 return typeLabel( type ); 135 return typeLabel( type );
136} 136}
137 137
138QString PhoneNumber::typeLabel( int type ) 138QString PhoneNumber::typeLabel( int type )
139{ 139{
140 QString typeString; 140 QString typeString;
141 141
142 if ((type & Home) == Home) 142 if ((type & Home) == Home)
143 typeString += i18n("Home"); 143 typeString += i18n("Home");
144 else if ((type & Work) == Work) 144 else if ((type & Work) == Work)
145 typeString += i18n("Work"); 145 typeString += i18n("Work");
146 146
147 if (!typeString.isEmpty()) 147 if (!typeString.isEmpty())
148 typeString += " "; 148 typeString += " ";
149 149
150 if ((type & Cell) == Cell) 150 if ((type & Cell) == Cell)
151 typeString += i18n("Mobile"); 151 typeString += i18n("Mobile");
152 else if ((type & Fax) == Fax) 152 else if ((type & Fax) == Fax)
153 typeString += i18n("Fax"); 153 typeString += i18n("Fax");
154 else if ((type & Msg) == Msg) 154 else if ((type & Msg) == Msg)
155 typeString += i18n("Messenger"); 155 typeString += i18n("Messenger");
156 else if ((type & Voice) == Voice) { 156 else if ((type & Voice) == Voice) {
157// add nothing in case of the Voice flag 157// add nothing in case of the Voice flag
158// typeString += i18n("Voice"); 158// typeString += i18n("Voice");
159 } 159 }
160 else if ((type & Video) == Video) 160 else if ((type & Video) == Video)
161 typeString += i18n("Video"); 161 typeString += i18n("Video");
162 else if ((type & Bbs) == Bbs) 162 else if ((type & Bbs) == Bbs)
163 typeString += i18n("Mailbox"); 163 typeString += i18n("Mailbox");
164 else if ((type & Modem) == Modem) 164 else if ((type & Modem) == Modem)
165 typeString += i18n("Modem"); 165 typeString += i18n("Modem");
166 else if ((type & Car) == Car) 166 else if ((type & Car) == Car)
167 typeString += i18n("Car"); 167 typeString += i18n("Car");
168 else if ((type & Isdn) == Isdn) 168 else if ((type & Isdn) == Isdn)
169 typeString += i18n("ISDN"); 169 typeString += i18n("ISDN");
170 else if ((type & Pcs) == Pcs) 170 else if ((type & Pcs) == Pcs)
171 typeString += i18n("PCS"); 171 typeString += i18n("PCS");
172 else if ((type & Pager) == Pager) 172 else if ((type & Pager) == Pager)
173 typeString += i18n("Pager"); 173 typeString += i18n("Pager");
174 174
175 // add the prefered flag 175 // add the prefered flag
176 if (!typeString.isEmpty()) 176 if (!typeString.isEmpty())
177 typeString += " "; 177 typeString += " ";
178 178
179 if ((type & Pref) == Pref) 179 if ((type & Pref) == Pref)
180 typeString += i18n("(Preferred)"); 180 typeString += i18n("(p)");
181 181
182 //if we still have no match, return "other" 182 //if we still have no match, return "other"
183 if (typeString.isEmpty()) 183 if (typeString.isEmpty())
184 return i18n("Other"); 184 return i18n("Other");
185 185
186 186
187 return typeString; 187 return typeString;
188} 188}
189 189
190QDataStream &KABC::operator<<( QDataStream &s, const PhoneNumber &phone ) 190QDataStream &KABC::operator<<( QDataStream &s, const PhoneNumber &phone )
191{ 191{
192 return s << phone.mId << phone.mType << phone.mNumber; 192 return s << phone.mId << phone.mType << phone.mNumber;
193} 193}
194 194
195QDataStream &KABC::operator>>( QDataStream &s, PhoneNumber &phone ) 195QDataStream &KABC::operator>>( QDataStream &s, PhoneNumber &phone )
196{ 196{
197 s >> phone.mId >> phone.mType >> phone.mNumber; 197 s >> phone.mId >> phone.mType >> phone.mNumber;
198 198
199 return s; 199 return s;
200} 200}