author | zautrix <zautrix> | 2005-01-14 11:37:40 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-14 11:37:40 (UTC) |
commit | 61c95ce0295f1397db6499c5b468a9fb3d32a0f4 (patch) (unidiff) | |
tree | 2bceecc46d42a572adfad7d8e5000d1534642cbd | |
parent | a46ecf5ed81460ec9a4e457798e1bf0fb74c5624 (diff) | |
download | kdepimpi-61c95ce0295f1397db6499c5b468a9fb3d32a0f4.zip kdepimpi-61c95ce0295f1397db6499c5b468a9fb3d32a0f4.tar.gz kdepimpi-61c95ce0295f1397db6499c5b468a9fb3d32a0f4.tar.bz2 |
made kapi saving faster
-rw-r--r-- | bin/kdepim/WhatsNew.txt | 14 | ||||
-rw-r--r-- | kabc/addressee.cpp | 2 | ||||
-rw-r--r-- | kabc/picture.cpp | 38 | ||||
-rw-r--r-- | kabc/vcard/ContentLine.cpp | 30 | ||||
-rw-r--r-- | kabc/vcard/VCardv.cpp | 77 | ||||
-rw-r--r-- | kaddressbook/details/detailsviewcontainer.cpp | 11 | ||||
-rw-r--r-- | kaddressbook/details/detailsviewcontainer.h | 1 | ||||
-rw-r--r-- | kaddressbook/imagewidget.cpp | 7 | ||||
-rw-r--r-- | kaddressbook/kabcore.cpp | 9 | ||||
-rw-r--r-- | kaddressbook/kabcore.h | 9 | ||||
-rw-r--r-- | kaddressbook/viewmanager.cpp | 1 | ||||
-rw-r--r-- | kde2file/abdump/main.cpp | 2 | ||||
-rw-r--r-- | kde2file/caldump/main.cpp | 2 | ||||
-rw-r--r-- | korganizer/kolistview.cpp | 16 | ||||
-rw-r--r-- | version | 2 |
15 files changed, 133 insertions, 88 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index 2fd63e7..ff87423 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -1,22 +1,36 @@ | |||
1 | Info about the changes in new versions of KDE-Pim/Pi | 1 | Info about the changes in new versions of KDE-Pim/Pi |
2 | 2 | ||
3 | ********** VERSION 1.9.17 ************ | 3 | ********** VERSION 1.9.17 ************ |
4 | 4 | ||
5 | KO/Pi: | 5 | KO/Pi: |
6 | Fixed that tooltips were not updated after moving an item in agenda view. | 6 | Fixed that tooltips were not updated after moving an item in agenda view. |
7 | Fixed a bug in sorting start date for recurring events in list view. | ||
7 | 8 | ||
8 | KA/Pi: | 9 | KA/Pi: |
9 | All fields search does now actually search all the (possible) fields, | 10 | All fields search does now actually search all the (possible) fields, |
10 | not only those listed in the contact list. | 11 | not only those listed in the contact list. |
12 | Made is possible to inline a picture in a vcard on the Z. | ||
13 | This was only possible on the desktop, now is it possible on the Z as well. | ||
14 | Fixed of missing save settings after filter configuration. | ||
15 | Made saving of addressbook much faster. | ||
16 | |||
17 | QWhatsThis was not working on the Z ( only black rectangle was shown). | ||
18 | This is Fixed. | ||
19 | |||
20 | KDE-Sync: | ||
21 | Now readonly KDE resources are synced as well. | ||
22 | (They are not changed in KDE itself, of course). | ||
23 | |||
24 | |||
11 | 25 | ||
12 | ********** VERSION 1.9.16 ************ | 26 | ********** VERSION 1.9.16 ************ |
13 | 27 | ||
14 | KO/Pi: | 28 | KO/Pi: |
15 | Fixed search dialog size on Z 6000 (480x640 display). | 29 | Fixed search dialog size on Z 6000 (480x640 display). |
16 | Added setting to hide/show time in agenda items. | 30 | Added setting to hide/show time in agenda items. |
17 | Added setting to hide not running todos in todo view. | 31 | Added setting to hide not running todos in todo view. |
18 | Added columns for start date/time in todo view. | 32 | Added columns for start date/time in todo view. |
19 | Replaced the solid half-hour lines in agenda view by dot lines. | 33 | Replaced the solid half-hour lines in agenda view by dot lines. |
20 | Added possibility of printing the What's Next View on the desktop | 34 | Added possibility of printing the What's Next View on the desktop |
21 | (i.e. Windows and Linux). | 35 | (i.e. Windows and Linux). |
22 | Fixed a crash in KO/Pi when starting KO/Pi with What's Next view. | 36 | Fixed a crash in KO/Pi when starting KO/Pi with What's Next view. |
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp index 3ce733d..568dfc4 100644 --- a/kabc/addressee.cpp +++ b/kabc/addressee.cpp | |||
@@ -1674,24 +1674,25 @@ Key Addressee::findKey( const QString &id ) const | |||
1674 | } | 1674 | } |
1675 | return Key(); | 1675 | return Key(); |
1676 | } | 1676 | } |
1677 | 1677 | ||
1678 | QString Addressee::asString() const | 1678 | QString Addressee::asString() const |
1679 | { | 1679 | { |
1680 | return "Smith, agent Smith..."; | 1680 | return "Smith, agent Smith..."; |
1681 | } | 1681 | } |
1682 | 1682 | ||
1683 | void Addressee::dump() const | 1683 | void Addressee::dump() const |
1684 | { | 1684 | { |
1685 | return; | 1685 | return; |
1686 | #if 0 | ||
1686 | kdDebug(5700) << "Addressee {" << endl; | 1687 | kdDebug(5700) << "Addressee {" << endl; |
1687 | 1688 | ||
1688 | kdDebug(5700) << " Uid: '" << uid() << "'" << endl; | 1689 | kdDebug(5700) << " Uid: '" << uid() << "'" << endl; |
1689 | 1690 | ||
1690 | kdDebug(5700) << " Name: '" << name() << "'" << endl; | 1691 | kdDebug(5700) << " Name: '" << name() << "'" << endl; |
1691 | kdDebug(5700) << " FormattedName: '" << formattedName() << "'" << endl; | 1692 | kdDebug(5700) << " FormattedName: '" << formattedName() << "'" << endl; |
1692 | kdDebug(5700) << " FamilyName: '" << familyName() << "'" << endl; | 1693 | kdDebug(5700) << " FamilyName: '" << familyName() << "'" << endl; |
1693 | kdDebug(5700) << " GivenName: '" << givenName() << "'" << endl; | 1694 | kdDebug(5700) << " GivenName: '" << givenName() << "'" << endl; |
1694 | kdDebug(5700) << " AdditionalName: '" << additionalName() << "'" << endl; | 1695 | kdDebug(5700) << " AdditionalName: '" << additionalName() << "'" << endl; |
1695 | kdDebug(5700) << " Prefix: '" << prefix() << "'" << endl; | 1696 | kdDebug(5700) << " Prefix: '" << prefix() << "'" << endl; |
1696 | kdDebug(5700) << " Suffix: '" << suffix() << "'" << endl; | 1697 | kdDebug(5700) << " Suffix: '" << suffix() << "'" << endl; |
1697 | kdDebug(5700) << " NickName: '" << nickName() << "'" << endl; | 1698 | kdDebug(5700) << " NickName: '" << nickName() << "'" << endl; |
@@ -1737,24 +1738,25 @@ void Addressee::dump() const | |||
1737 | 1738 | ||
1738 | kdDebug(5700) << " Keys {" << endl; | 1739 | kdDebug(5700) << " Keys {" << endl; |
1739 | Key::List k = keys(); | 1740 | Key::List k = keys(); |
1740 | Key::List::ConstIterator it4; | 1741 | Key::List::ConstIterator it4; |
1741 | for( it4 = k.begin(); it4 != k.end(); ++it4 ) { | 1742 | for( it4 = k.begin(); it4 != k.end(); ++it4 ) { |
1742 | kdDebug(5700) << " Type: " << int((*it4).type()) << | 1743 | kdDebug(5700) << " Type: " << int((*it4).type()) << |
1743 | " Key: " << (*it4).textData() << | 1744 | " Key: " << (*it4).textData() << |
1744 | " CustomString: " << (*it4).customTypeString() << endl; | 1745 | " CustomString: " << (*it4).customTypeString() << endl; |
1745 | } | 1746 | } |
1746 | kdDebug(5700) << " }" << endl; | 1747 | kdDebug(5700) << " }" << endl; |
1747 | 1748 | ||
1748 | kdDebug(5700) << "}" << endl; | 1749 | kdDebug(5700) << "}" << endl; |
1750 | #endif | ||
1749 | } | 1751 | } |
1750 | 1752 | ||
1751 | 1753 | ||
1752 | void Addressee::insertAddress( const Address &address ) | 1754 | void Addressee::insertAddress( const Address &address ) |
1753 | { | 1755 | { |
1754 | detach(); | 1756 | detach(); |
1755 | mData->empty = false; | 1757 | mData->empty = false; |
1756 | 1758 | ||
1757 | Address::List::Iterator it; | 1759 | Address::List::Iterator it; |
1758 | for( it = mData->addresses.begin(); it != mData->addresses.end(); ++it ) { | 1760 | for( it = mData->addresses.begin(); it != mData->addresses.end(); ++it ) { |
1759 | if ( (*it).id() == address.id() ) { | 1761 | if ( (*it).id() == address.id() ) { |
1760 | *it = address; | 1762 | *it = address; |
diff --git a/kabc/picture.cpp b/kabc/picture.cpp index 6a34b98..57aa297 100644 --- a/kabc/picture.cpp +++ b/kabc/picture.cpp | |||
@@ -44,34 +44,60 @@ Picture::Picture( const QString &url ) | |||
44 | Picture::Picture( const QImage &data ) | 44 | Picture::Picture( const QImage &data ) |
45 | : mData( data ), mIntern( true ) | 45 | : mData( data ), mIntern( true ) |
46 | { | 46 | { |
47 | mUndefined = false; | 47 | mUndefined = false; |
48 | } | 48 | } |
49 | 49 | ||
50 | Picture::~Picture() | 50 | Picture::~Picture() |
51 | { | 51 | { |
52 | } | 52 | } |
53 | 53 | ||
54 | bool Picture::operator==( const Picture &p ) const | 54 | bool Picture::operator==( const Picture &p ) const |
55 | { | 55 | { |
56 | if ( mIntern != p.mIntern ) return false; | 56 | //qDebug("compare PIC "); |
57 | 57 | if ( mUndefined && p.mUndefined ) { | |
58 | //qDebug("compare PIC true 1 "); | ||
59 | return true; | ||
60 | } | ||
61 | if ( mUndefined || p.mUndefined ) { | ||
62 | //qDebug("compare PIC false 1"); | ||
63 | return false; | ||
64 | } | ||
65 | // now we should deal with two defined pics! | ||
66 | if ( mIntern != p.mIntern ) { | ||
67 | //qDebug("compare PIC false 2"); | ||
68 | return false; | ||
69 | } | ||
58 | if ( mIntern ) { | 70 | if ( mIntern ) { |
59 | if ( mData != p.mData ) | 71 | //qDebug("mIntern "); |
72 | if ( mData.isNull() && p.mData.isNull() ) { | ||
73 | //qDebug("compare PIC true 2 "); | ||
74 | return true; | ||
75 | } | ||
76 | if ( mData.isNull() || p.mData.isNull() ){ | ||
77 | //qDebug("compare PIC false 3-1"); | ||
78 | |||
79 | return false; | ||
80 | } | ||
81 | if ( mData != p.mData ) { | ||
82 | //qDebug("compare PIC false 3"); | ||
60 | return false; | 83 | return false; |
84 | } | ||
61 | } else { | 85 | } else { |
62 | if ( mUrl != p.mUrl ) | 86 | if ( mUrl != p.mUrl ) { |
63 | return false; | 87 | //qDebug("compare PIC false 4"); |
88 | return false; | ||
89 | } | ||
64 | } | 90 | } |
65 | 91 | //qDebug("compare PIC true "); | |
66 | return true; | 92 | return true; |
67 | } | 93 | } |
68 | 94 | ||
69 | bool Picture::operator!=( const Picture &p ) const | 95 | bool Picture::operator!=( const Picture &p ) const |
70 | { | 96 | { |
71 | return !( p == *this ); | 97 | return !( p == *this ); |
72 | } | 98 | } |
73 | 99 | ||
74 | void Picture::setUrl( const QString &url ) | 100 | void Picture::setUrl( const QString &url ) |
75 | { | 101 | { |
76 | mUrl = url; | 102 | mUrl = url; |
77 | mIntern = false; | 103 | mIntern = false; |
diff --git a/kabc/vcard/ContentLine.cpp b/kabc/vcard/ContentLine.cpp index c368172..2f88cde 100644 --- a/kabc/vcard/ContentLine.cpp +++ b/kabc/vcard/ContentLine.cpp | |||
@@ -264,24 +264,51 @@ ContentLine::_parse() | |||
264 | case ValueGeo: value_ = new GeoValue; break; | 264 | case ValueGeo: value_ = new GeoValue; break; |
265 | case ValueText: | 265 | case ValueText: |
266 | case ValueUnknown: | 266 | case ValueUnknown: |
267 | default: value_ = new TextValue; break; | 267 | default: value_ = new TextValue; break; |
268 | } | 268 | } |
269 | 269 | ||
270 | *value_ = valuePart; | 270 | *value_ = valuePart; |
271 | } | 271 | } |
272 | 272 | ||
273 | void | 273 | void |
274 | ContentLine::_assemble() | 274 | ContentLine::_assemble() |
275 | { | 275 | { |
276 | //strRep_.truncate(0); | ||
277 | QString line; | ||
278 | if (!group_.isEmpty()) | ||
279 | line = group_ + '.'; | ||
280 | line += name_; | ||
281 | ParamListIterator it(paramList_); | ||
282 | for (; it.current(); ++it) | ||
283 | line += ";" + it.current()->asString(); | ||
284 | |||
285 | if (value_ != 0) | ||
286 | line += ":" + value_->asString(); | ||
287 | |||
288 | line = line.replace( QRegExp( "\n" ), "\\n" ); | ||
289 | |||
290 | // Fold lines longer than 72 chars | ||
291 | const int maxLen = 72; | ||
292 | uint cursor = 0; | ||
293 | QString cut; | ||
294 | while( line.length() > ( cursor + 1 ) * maxLen ) { | ||
295 | cut += line.mid( cursor * maxLen, maxLen ); | ||
296 | cut += "\r\n "; | ||
297 | ++cursor; | ||
298 | } | ||
299 | cut += line.mid( cursor * maxLen ); | ||
300 | strRep_ = cut.latin1(); | ||
301 | //qDebug("ContentLine::_assemble()\n%s*****", strRep_.data()); | ||
302 | #if 0 | ||
276 | vDebug("Assemble (argl) - my name is \"" + name_ + "\""); | 303 | vDebug("Assemble (argl) - my name is \"" + name_ + "\""); |
277 | strRep_.truncate(0); | 304 | strRep_.truncate(0); |
278 | 305 | ||
279 | QCString line; | 306 | QCString line; |
280 | 307 | ||
281 | if (!group_.isEmpty()) | 308 | if (!group_.isEmpty()) |
282 | line += group_ + '.'; | 309 | line += group_ + '.'; |
283 | 310 | ||
284 | line += name_; | 311 | line += name_; |
285 | 312 | ||
286 | vDebug("Adding parameters"); | 313 | vDebug("Adding parameters"); |
287 | ParamListIterator it(paramList_); | 314 | ParamListIterator it(paramList_); |
@@ -298,24 +325,25 @@ ContentLine::_assemble() | |||
298 | // Quote newlines | 325 | // Quote newlines |
299 | line = line.replace( QRegExp( "\n" ), "\\n" ); | 326 | line = line.replace( QRegExp( "\n" ), "\\n" ); |
300 | 327 | ||
301 | // Fold lines longer than 72 chars | 328 | // Fold lines longer than 72 chars |
302 | const int maxLen = 72; | 329 | const int maxLen = 72; |
303 | uint cursor = 0; | 330 | uint cursor = 0; |
304 | while( line.length() > ( cursor + 1 ) * maxLen ) { | 331 | while( line.length() > ( cursor + 1 ) * maxLen ) { |
305 | strRep_ += line.mid( cursor * maxLen, maxLen ); | 332 | strRep_ += line.mid( cursor * maxLen, maxLen ); |
306 | strRep_ += "\r\n "; | 333 | strRep_ += "\r\n "; |
307 | ++cursor; | 334 | ++cursor; |
308 | } | 335 | } |
309 | strRep_ += line.mid( cursor * maxLen ); | 336 | strRep_ += line.mid( cursor * maxLen ); |
310 | //qDebug("ContentLine::_assemble()\n%s*****", strRep_.data()); | 337 | qDebug("ContentLine::_assemble()\n%s*****", strRep_.data()); |
338 | #endif | ||
311 | } | 339 | } |
312 | 340 | ||
313 | void | 341 | void |
314 | ContentLine::clear() | 342 | ContentLine::clear() |
315 | { | 343 | { |
316 | group_.truncate(0); | 344 | group_.truncate(0); |
317 | name_.truncate(0); | 345 | name_.truncate(0); |
318 | paramList_.clear(); | 346 | paramList_.clear(); |
319 | delete value_; | 347 | delete value_; |
320 | value_ = 0; | 348 | value_ = 0; |
321 | } | 349 | } |
diff --git a/kabc/vcard/VCardv.cpp b/kabc/vcard/VCardv.cpp index bc80707..49bfe43 100644 --- a/kabc/vcard/VCardv.cpp +++ b/kabc/vcard/VCardv.cpp | |||
@@ -14,24 +14,27 @@ | |||
14 | all copies or substantial portions of the Software. | 14 | all copies or substantial portions of the Software. |
15 | 15 | ||
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
19 | AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | 19 | AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
20 | ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | 20 | ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
21 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | 21 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qcstring.h> | 24 | #include <qcstring.h> |
25 | #include <qstrlist.h> | 25 | #include <qstrlist.h> |
26 | #include <qstringlist.h> | ||
27 | #include <qstring.h> | ||
28 | #include <qvaluelist.h> | ||
26 | 29 | ||
27 | #include <VCardEntity.h> | 30 | #include <VCardEntity.h> |
28 | #include <VCardVCard.h> | 31 | #include <VCardVCard.h> |
29 | #include <VCardContentLine.h> | 32 | #include <VCardContentLine.h> |
30 | #include <VCardRToken.h> | 33 | #include <VCardRToken.h> |
31 | 34 | ||
32 | #include <VCardDefines.h> | 35 | #include <VCardDefines.h> |
33 | 36 | ||
34 | using namespace VCARD; | 37 | using namespace VCARD; |
35 | 38 | ||
36 | VCard::VCard() | 39 | VCard::VCard() |
37 | :Entity() | 40 | :Entity() |
@@ -87,152 +90,144 @@ VCard::operator == (VCard & x) | |||
87 | { | 90 | { |
88 | x.parse(); | 91 | x.parse(); |
89 | return false; | 92 | return false; |
90 | } | 93 | } |
91 | 94 | ||
92 | VCard::~VCard() | 95 | VCard::~VCard() |
93 | { | 96 | { |
94 | } | 97 | } |
95 | 98 | ||
96 | void | 99 | void |
97 | VCard::_parse() | 100 | VCard::_parse() |
98 | { | 101 | { |
99 | vDebug("parse() called"); | 102 | |
100 | QStrList l; | 103 | QStringList l; |
104 | QStrList sl; | ||
101 | 105 | ||
102 | RTokenise(strRep_, "\r\n", l); | 106 | RTokenise(strRep_, "\r\n", sl); |
103 | 107 | ||
104 | if (l.count() < 3) { // Invalid VCARD ! | 108 | if (sl.count() < 3) { // Invalid VCARD ! |
105 | vDebug("Invalid vcard"); | 109 | //qDebug("invalid vcard "); |
106 | return; | 110 | return; |
107 | } | 111 | } |
108 | 112 | l = QStringList::fromStrList( sl ); | |
109 | // Get the first line | 113 | // Get the first line |
110 | QCString beginLine = QCString(l.at(0)).stripWhiteSpace(); | 114 | QString beginLine = l[0].stripWhiteSpace(); |
111 | |||
112 | vDebug("Begin line == \"" + beginLine + "\""); | ||
113 | 115 | ||
114 | // Remove extra blank lines | 116 | // Remove extra blank lines |
115 | while (QCString(l.last()).isEmpty()) | 117 | while (l.last().isEmpty()) |
116 | l.remove(l.last()); | 118 | l.remove(l.last()); |
117 | 119 | ||
118 | // Now we know this is the last line | 120 | // Now we know this is the last line |
119 | QCString endLine = l.last(); | 121 | QString endLine = l.last(); |
120 | 122 | ||
121 | // Trash the first and last lines as we have seen them. | 123 | // Trash the first and last lines as we have seen them. |
122 | l.remove(0u); | 124 | l.remove(l.first()); |
123 | l.remove(l.last()); | 125 | l.remove(l.last()); |
124 | 126 | ||
125 | /////////////////////////////////////////////////////////////// | 127 | /////////////////////////////////////////////////////////////// |
126 | // FIRST LINE | 128 | // FIRST LINE |
127 | 129 | ||
128 | int split = beginLine.find(':'); | 130 | int split = beginLine.find(':'); |
129 | 131 | ||
130 | if (split == -1) { // invalid, no BEGIN | 132 | if (split == -1) { // invalid, no BEGIN |
131 | vDebug("No split"); | 133 | vDebug("No split"); |
132 | return; | 134 | return; |
133 | } | 135 | } |
134 | 136 | ||
135 | QCString firstPart(beginLine.left(split)); | 137 | QString firstPart(beginLine.left(split)); |
136 | QCString valuePart(beginLine.mid(split + 1)); | 138 | QString valuePart(beginLine.mid(split + 1)); |
137 | 139 | ||
138 | split = firstPart.find('.'); | 140 | split = firstPart.find('.'); |
139 | 141 | ||
140 | if (split != -1) { | 142 | if (split != -1) { |
141 | group_ = firstPart.left(split); | 143 | group_ = firstPart.left(split); |
142 | firstPart= firstPart.right(firstPart.length() - split - 1); | 144 | firstPart= firstPart.right(firstPart.length() - split - 1); |
143 | } | 145 | } |
144 | 146 | ||
145 | if (qstrnicmp(firstPart, "BEGIN", 5) != 0) { // No BEGIN ! | 147 | if (firstPart.left(5) != "BEGIN" ) { // No BEGIN ! |
146 | vDebug("No BEGIN"); | 148 | qDebug("no BEGIN in vcard "); |
147 | return; | 149 | return; |
148 | } | 150 | } |
149 | 151 | ||
150 | if (qstrnicmp(valuePart, "VCARD", 5) != 0) { // Not a vcard ! | 152 | if (valuePart.left(5) != "VCARD") { // Not a vcard ! |
151 | vDebug("No VCARD"); | 153 | qDebug("not a VCARD "); |
152 | return; | 154 | return; |
153 | } | 155 | } |
154 | 156 | ||
155 | /////////////////////////////////////////////////////////////// | 157 | /////////////////////////////////////////////////////////////// |
156 | // CONTENT LINES | 158 | // CONTENT LINES |
157 | // | 159 | // |
158 | vDebug("Content lines"); | 160 | vDebug("Content lines"); |
159 | 161 | ||
160 | // Handle folded lines. | 162 | // Handle folded lines. |
161 | 163 | ||
162 | QStrList refolded; | 164 | QStringList refolded; |
163 | |||
164 | QStrListIterator it(l); | ||
165 | 165 | ||
166 | QCString cur; | ||
167 | 166 | ||
168 | for (; it.current(); ++it) { | 167 | QStringList::Iterator it = l.begin(); |
169 | 168 | ||
170 | cur = it.current(); | 169 | QString cur; |
171 | 170 | ||
171 | for (; it != l.end(); ++it) { | ||
172 | cur = (*it); | ||
172 | ++it; | 173 | ++it; |
173 | 174 | while ( it!= l.end() && (*it).at(0) == ' '&& (*it).length()!= 1) { | |
174 | while ( | 175 | cur += (*it) ; |
175 | it.current() && | ||
176 | it.current()[0] == ' '&& | ||
177 | strlen(it.current()) != 1) | ||
178 | { | ||
179 | cur += it.current() + 1; | ||
180 | ++it; | 176 | ++it; |
181 | } | 177 | } |
182 | |||
183 | --it; | 178 | --it; |
184 | |||
185 | refolded.append(cur); | 179 | refolded.append(cur); |
186 | } | 180 | } |
187 | 181 | QStringList::Iterator it2 = refolded.begin(); | |
188 | QStrListIterator it2(refolded); | 182 | for (; it2 != refolded.end(); ++it2) { |
189 | 183 | ContentLine * cl = new ContentLine(QCString((*it2).latin1())); | |
190 | for (; it2.current(); ++it2) { | ||
191 | vDebug("New contentline using \"" + QCString(it2.current()) + "\""); | ||
192 | ContentLine * cl = new ContentLine(it2.current()); | ||
193 | |||
194 | cl->parse(); | 184 | cl->parse(); |
195 | if (cl->value() == 0) | 185 | if (cl->value() == 0) |
196 | { | 186 | { |
197 | qDebug("Content line could not be parsed. Discarded: %s", it2.current()); | 187 | qDebug("Content line could not be parsed. Discarded: %s", (*it2).latin1()); |
198 | delete cl; | 188 | delete cl; |
199 | } | 189 | } |
200 | else | 190 | else |
201 | contentLineList_.append(cl); | 191 | contentLineList_.append(cl); |
202 | } | 192 | } |
203 | 193 | ||
204 | /////////////////////////////////////////////////////////////// | 194 | /////////////////////////////////////////////////////////////// |
205 | // LAST LINE | 195 | // LAST LINE |
206 | 196 | ||
197 | |||
198 | // LR: sorry, but the remaining code in this method makes no sense | ||
199 | |||
200 | #if 0 | ||
207 | split = endLine.find(':'); | 201 | split = endLine.find(':'); |
208 | 202 | ||
209 | if (split == -1) // invalid, no END | 203 | if (split == -1) // invalid, no END |
210 | return; | 204 | return; |
211 | 205 | ||
212 | firstPart = endLine.left(split); | 206 | firstPart = endLine.left(split); |
213 | valuePart = endLine.right(firstPart.length() - split - 1); | 207 | valuePart = endLine.right(firstPart.length() - split - 1); |
214 | 208 | ||
215 | split = firstPart.find('.'); | 209 | split = firstPart.find('.'); |
216 | 210 | ||
217 | if (split != -1) { | 211 | if (split != -1) { |
218 | group_ = firstPart.left(split); | 212 | group_ = firstPart.left(split); |
219 | firstPart= firstPart.right(firstPart.length() - split - 1); | 213 | firstPart= firstPart.right(firstPart.length() - split - 1); |
220 | } | 214 | } |
221 | 215 | ||
222 | if (qstricmp(firstPart, "END") != 0) // No END ! | 216 | if (qstricmp(firstPart, "END") != 0) // No END ! |
223 | return; | 217 | return; |
224 | 218 | ||
225 | if (qstricmp(valuePart, "VCARD") != 0) // Not a vcard ! | 219 | if (qstricmp(valuePart, "VCARD") != 0) // Not a vcard ! |
226 | return; | 220 | return; |
221 | #endif | ||
227 | } | 222 | } |
228 | 223 | ||
229 | void | 224 | void |
230 | VCard::_assemble() | 225 | VCard::_assemble() |
231 | { | 226 | { |
232 | vDebug("Assembling vcard"); | 227 | vDebug("Assembling vcard"); |
233 | strRep_ = "BEGIN:VCARD\r\n"; | 228 | strRep_ = "BEGIN:VCARD\r\n"; |
234 | strRep_ += "VERSION:3.0\r\n"; | 229 | strRep_ += "VERSION:3.0\r\n"; |
235 | 230 | ||
236 | QPtrListIterator<ContentLine> it(contentLineList_); | 231 | QPtrListIterator<ContentLine> it(contentLineList_); |
237 | 232 | ||
238 | for (; it.current(); ++it) | 233 | for (; it.current(); ++it) |
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 | } |
132 | void ViewContainer::refreshView() | ||
133 | { | ||
134 | if ( mCurrentLook ) { | ||
135 | mCurrentLook->setAddressee( mCurrentAddressee ); | ||
136 | } | ||
137 | } | ||
138 | 132 | ||
139 | void ViewContainer::setAddressee( const KABC::Addressee& addressee ) | 133 | void 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 | ||
151 | KABC::Addressee ViewContainer::addressee() | 142 | KABC::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 | /** |
diff --git a/kaddressbook/imagewidget.cpp b/kaddressbook/imagewidget.cpp index 49d456b..48370e3 100644 --- a/kaddressbook/imagewidget.cpp +++ b/kaddressbook/imagewidget.cpp | |||
@@ -122,28 +122,24 @@ ImageWidget::ImageWidget( QWidget *parent, const char *name ) | |||
122 | SLOT( loadLogo() ) ); | 122 | SLOT( loadLogo() ) ); |
123 | connect( mLogoUrl, SIGNAL( urlSelected( const QString& ) ), | 123 | connect( mLogoUrl, SIGNAL( urlSelected( const QString& ) ), |
124 | SIGNAL( changed() ) ); | 124 | SIGNAL( changed() ) ); |
125 | connect( mLogoUrl, SIGNAL( urlSelected( const QString& ) ), | 125 | connect( mLogoUrl, SIGNAL( urlSelected( const QString& ) ), |
126 | SLOT( updateGUI() ) ); | 126 | SLOT( updateGUI() ) ); |
127 | connect( mUseLogoUrl, SIGNAL( toggled( bool ) ), | 127 | connect( mUseLogoUrl, SIGNAL( toggled( bool ) ), |
128 | SIGNAL( changed() ) ); | 128 | SIGNAL( changed() ) ); |
129 | 129 | ||
130 | #ifndef KAB_EMBEDDED | 130 | #ifndef KAB_EMBEDDED |
131 | KAcceleratorManager::manage( this ); | 131 | KAcceleratorManager::manage( this ); |
132 | #endif //KAB_EMBEDDED | 132 | #endif //KAB_EMBEDDED |
133 | 133 | ||
134 | #ifndef DESKTOP_VERSION | ||
135 | mUsePhotoUrl->setChecked( true ); | ||
136 | mUseLogoUrl->setChecked( true ); | ||
137 | #endif | ||
138 | } | 134 | } |
139 | 135 | ||
140 | ImageWidget::~ImageWidget() | 136 | ImageWidget::~ImageWidget() |
141 | { | 137 | { |
142 | } | 138 | } |
143 | 139 | ||
144 | void ImageWidget::setPhoto( const KABC::Picture &photo ) | 140 | void ImageWidget::setPhoto( const KABC::Picture &photo ) |
145 | { | 141 | { |
146 | bool blocked = signalsBlocked(); | 142 | bool blocked = signalsBlocked(); |
147 | blockSignals( true ); | 143 | blockSignals( true ); |
148 | 144 | ||
149 | if ( photo.isIntern() ) { | 145 | if ( photo.isIntern() ) { |
@@ -251,30 +247,29 @@ void ImageWidget::loadPhoto() | |||
251 | mPhotoLabel->setPixmap( loadPixmap( mPhotoUrl->url() ) ); | 247 | mPhotoLabel->setPixmap( loadPixmap( mPhotoUrl->url() ) ); |
252 | } | 248 | } |
253 | 249 | ||
254 | void ImageWidget::loadLogo() | 250 | void ImageWidget::loadLogo() |
255 | { | 251 | { |
256 | mLogoLabel->setPixmap( loadPixmap( mLogoUrl->url() ) ); | 252 | mLogoLabel->setPixmap( loadPixmap( mLogoUrl->url() ) ); |
257 | } | 253 | } |
258 | 254 | ||
259 | void ImageWidget::updateGUI() | 255 | void ImageWidget::updateGUI() |
260 | { | 256 | { |
261 | KURLRequester *ptr = (KURLRequester*)sender(); | 257 | KURLRequester *ptr = (KURLRequester*)sender(); |
262 | 258 | ||
263 | #ifdef DESKTOP_VERSION | 259 | |
264 | if ( ptr == mPhotoUrl ) | 260 | if ( ptr == mPhotoUrl ) |
265 | mUsePhotoUrl->setEnabled( true ); | 261 | mUsePhotoUrl->setEnabled( true ); |
266 | else if ( ptr == mLogoUrl ) | 262 | else if ( ptr == mLogoUrl ) |
267 | mUseLogoUrl->setEnabled( true ); | 263 | mUseLogoUrl->setEnabled( true ); |
268 | #endif | ||
269 | } | 264 | } |
270 | 265 | ||
271 | QPixmap ImageWidget::loadPixmap( const KURL &url ) | 266 | QPixmap ImageWidget::loadPixmap( const KURL &url ) |
272 | { | 267 | { |
273 | QString tempFile; | 268 | QString tempFile; |
274 | QPixmap pixmap; | 269 | QPixmap pixmap; |
275 | 270 | ||
276 | if ( url.isEmpty() ) | 271 | if ( url.isEmpty() ) |
277 | return pixmap; | 272 | return pixmap; |
278 | 273 | ||
279 | if ( url.isLocalFile() ) | 274 | if ( url.isLocalFile() ) |
280 | pixmap = QPixmap( url.path() ); | 275 | pixmap = QPixmap( url.path() ); |
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index f6bdda4..e14e579 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -1117,39 +1117,36 @@ void KABCore::incrementalSearch( const QString& text ) | |||
1117 | } | 1117 | } |
1118 | 1118 | ||
1119 | void KABCore::setModified() | 1119 | void KABCore::setModified() |
1120 | { | 1120 | { |
1121 | setModified( true ); | 1121 | setModified( true ); |
1122 | } | 1122 | } |
1123 | 1123 | ||
1124 | void KABCore::setModifiedWOrefresh() | 1124 | void KABCore::setModifiedWOrefresh() |
1125 | { | 1125 | { |
1126 | // qDebug("KABCore::setModifiedWOrefresh() "); | 1126 | // qDebug("KABCore::setModifiedWOrefresh() "); |
1127 | mModified = true; | 1127 | mModified = true; |
1128 | mActionSave->setEnabled( mModified ); | 1128 | mActionSave->setEnabled( mModified ); |
1129 | #ifdef DESKTOP_VERSION | 1129 | |
1130 | mDetails->refreshView(); | ||
1131 | #endif | ||
1132 | 1130 | ||
1133 | } | 1131 | } |
1134 | void KABCore::setModified( bool modified ) | 1132 | void KABCore::setModified( bool modified ) |
1135 | { | 1133 | { |
1136 | mModified = modified; | 1134 | mModified = modified; |
1137 | mActionSave->setEnabled( mModified ); | 1135 | mActionSave->setEnabled( mModified ); |
1138 | 1136 | ||
1139 | if ( modified ) | 1137 | if ( modified ) |
1140 | mJumpButtonBar->recreateButtons(); | 1138 | mJumpButtonBar->recreateButtons(); |
1141 | 1139 | ||
1142 | mViewManager->refreshView(); | 1140 | mViewManager->refreshView(); |
1143 | mDetails->refreshView(); | ||
1144 | 1141 | ||
1145 | } | 1142 | } |
1146 | 1143 | ||
1147 | bool KABCore::modified() const | 1144 | bool KABCore::modified() const |
1148 | { | 1145 | { |
1149 | return mModified; | 1146 | return mModified; |
1150 | } | 1147 | } |
1151 | 1148 | ||
1152 | void KABCore::contactModified( const KABC::Addressee &addr ) | 1149 | void KABCore::contactModified( const KABC::Addressee &addr ) |
1153 | { | 1150 | { |
1154 | 1151 | ||
1155 | Command *command = 0; | 1152 | Command *command = 0; |
@@ -1157,25 +1154,25 @@ void KABCore::contactModified( const KABC::Addressee &addr ) | |||
1157 | 1154 | ||
1158 | // check if it exists already | 1155 | // check if it exists already |
1159 | KABC::Addressee origAddr = mAddressBook->findByUid( addr.uid() ); | 1156 | KABC::Addressee origAddr = mAddressBook->findByUid( addr.uid() ); |
1160 | if ( origAddr.isEmpty() ) | 1157 | if ( origAddr.isEmpty() ) |
1161 | command = new PwNewCommand( mAddressBook, addr ); | 1158 | command = new PwNewCommand( mAddressBook, addr ); |
1162 | else { | 1159 | else { |
1163 | command = new PwEditCommand( mAddressBook, origAddr, addr ); | 1160 | command = new PwEditCommand( mAddressBook, origAddr, addr ); |
1164 | uid = addr.uid(); | 1161 | uid = addr.uid(); |
1165 | } | 1162 | } |
1166 | 1163 | ||
1167 | UndoStack::instance()->push( command ); | 1164 | UndoStack::instance()->push( command ); |
1168 | RedoStack::instance()->clear(); | 1165 | RedoStack::instance()->clear(); |
1169 | 1166 | mDetails->setAddressee( addr ); | |
1170 | setModified( true ); | 1167 | setModified( true ); |
1171 | } | 1168 | } |
1172 | 1169 | ||
1173 | void KABCore::newContact() | 1170 | void KABCore::newContact() |
1174 | { | 1171 | { |
1175 | 1172 | ||
1176 | 1173 | ||
1177 | QPtrList<KABC::Resource> kabcResources = mAddressBook->resources(); | 1174 | QPtrList<KABC::Resource> kabcResources = mAddressBook->resources(); |
1178 | 1175 | ||
1179 | QPtrList<KRES::Resource> kresResources; | 1176 | QPtrList<KRES::Resource> kresResources; |
1180 | QPtrListIterator<KABC::Resource> it( kabcResources ); | 1177 | QPtrListIterator<KABC::Resource> it( kabcResources ); |
1181 | KABC::Resource *resource; | 1178 | KABC::Resource *resource; |
@@ -1624,25 +1621,24 @@ void KABCore::addressBookChanged() | |||
1624 | if (mEditorDialog) | 1621 | if (mEditorDialog) |
1625 | { | 1622 | { |
1626 | if (mEditorDialog->dirty()) | 1623 | if (mEditorDialog->dirty()) |
1627 | { | 1624 | { |
1628 | QString text = i18n( "Data has been changed externally. Unsaved " | 1625 | QString text = i18n( "Data has been changed externally. Unsaved " |
1629 | "changes will be lost." ); | 1626 | "changes will be lost." ); |
1630 | KMessageBox::information( this, text ); | 1627 | KMessageBox::information( this, text ); |
1631 | } | 1628 | } |
1632 | QString currentuid = mEditorDialog->addressee().uid(); | 1629 | QString currentuid = mEditorDialog->addressee().uid(); |
1633 | mEditorDialog->setAddressee( mAddressBook->findByUid( currentuid ) ); | 1630 | mEditorDialog->setAddressee( mAddressBook->findByUid( currentuid ) ); |
1634 | } | 1631 | } |
1635 | mViewManager->refreshView(); | 1632 | mViewManager->refreshView(); |
1636 | // mDetails->refreshView(); | ||
1637 | 1633 | ||
1638 | 1634 | ||
1639 | } | 1635 | } |
1640 | 1636 | ||
1641 | AddresseeEditorDialog *KABCore::createAddresseeEditorDialog( QWidget *parent, | 1637 | AddresseeEditorDialog *KABCore::createAddresseeEditorDialog( QWidget *parent, |
1642 | const char *name ) | 1638 | const char *name ) |
1643 | { | 1639 | { |
1644 | 1640 | ||
1645 | if ( mEditorDialog == 0 ) { | 1641 | if ( mEditorDialog == 0 ) { |
1646 | mEditorDialog = new AddresseeEditorDialog( this, parent, | 1642 | mEditorDialog = new AddresseeEditorDialog( this, parent, |
1647 | name ? name : "editorDialog" ); | 1643 | name ? name : "editorDialog" ); |
1648 | 1644 | ||
@@ -2280,25 +2276,24 @@ void KABCore::manageCategories( ) | |||
2280 | for( i = 0; i< catIncList.count(); ++i ) { | 2276 | for( i = 0; i< catIncList.count(); ++i ) { |
2281 | if ( catList.contains (catIncList[i])) { | 2277 | if ( catList.contains (catIncList[i])) { |
2282 | newCatList.append( catIncList[i] ); | 2278 | newCatList.append( catIncList[i] ); |
2283 | } | 2279 | } |
2284 | } | 2280 | } |
2285 | newCatList.sort(); | 2281 | newCatList.sort(); |
2286 | (*it).setCategories( newCatList ); | 2282 | (*it).setCategories( newCatList ); |
2287 | mAddressBook->insertAddressee( (*it) ); | 2283 | mAddressBook->insertAddressee( (*it) ); |
2288 | } | 2284 | } |
2289 | } | 2285 | } |
2290 | setModified( true ); | 2286 | setModified( true ); |
2291 | mViewManager->refreshView(); | 2287 | mViewManager->refreshView(); |
2292 | mDetails->refreshView(); | ||
2293 | message( i18n("Removing categories done!")); | 2288 | message( i18n("Removing categories done!")); |
2294 | } | 2289 | } |
2295 | delete cp; | 2290 | delete cp; |
2296 | } | 2291 | } |
2297 | void KABCore::removeVoice() | 2292 | void KABCore::removeVoice() |
2298 | { | 2293 | { |
2299 | if ( KMessageBox::questionYesNo( this, i18n("After importing, phone numbers\nmay have two or more types.\n(E.g. work+voice)\nThese numbers are shown as \"other\".\nClick Yes to remove the voice type\nfrom numbers with more than one type.\n\nRemove voice type?") ) == KMessageBox::No ) | 2294 | if ( KMessageBox::questionYesNo( this, i18n("After importing, phone numbers\nmay have two or more types.\n(E.g. work+voice)\nThese numbers are shown as \"other\".\nClick Yes to remove the voice type\nfrom numbers with more than one type.\n\nRemove voice type?") ) == KMessageBox::No ) |
2300 | return; | 2295 | return; |
2301 | KABC::Addressee::List list; | 2296 | KABC::Addressee::List list; |
2302 | XXPortSelectDialog dlg( this, false, this ); | 2297 | XXPortSelectDialog dlg( this, false, this ); |
2303 | if ( dlg.exec() ) | 2298 | if ( dlg.exec() ) |
2304 | list = dlg.contacts(); | 2299 | list = dlg.contacts(); |
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h index c7c12ff..85ffbdb 100644 --- a/kaddressbook/kabcore.h +++ b/kaddressbook/kabcore.h | |||
@@ -86,28 +86,25 @@ class KABCore : public QWidget, public KSyncInterface | |||
86 | #ifdef KAB_EMBEDDED | 86 | #ifdef KAB_EMBEDDED |
87 | //US added functionality | 87 | //US added functionality |
88 | QPopupMenu* getViewMenu() {return viewMenu;} | 88 | QPopupMenu* getViewMenu() {return viewMenu;} |
89 | QPopupMenu* getFilterMenu() {return filterMenu;} | 89 | QPopupMenu* getFilterMenu() {return filterMenu;} |
90 | QPopupMenu* getSettingsMenu() {return settingsMenu;} | 90 | QPopupMenu* getSettingsMenu() {return settingsMenu;} |
91 | void addActionsManually(); | 91 | void addActionsManually(); |
92 | #endif //KAB_EMBEDDED | 92 | #endif //KAB_EMBEDDED |
93 | /** | 93 | /** |
94 | Restores the global settings. | 94 | Restores the global settings. |
95 | */ | 95 | */ |
96 | void restoreSettings(); | 96 | void restoreSettings(); |
97 | 97 | ||
98 | /** | 98 | |
99 | Saves the global settings. | ||
100 | */ | ||
101 | void saveSettings(); | ||
102 | 99 | ||
103 | /** | 100 | /** |
104 | Returns a pointer to the StdAddressBook of the application. | 101 | Returns a pointer to the StdAddressBook of the application. |
105 | */ | 102 | */ |
106 | KABC::AddressBook *addressBook() const; | 103 | KABC::AddressBook *addressBook() const; |
107 | 104 | ||
108 | /** | 105 | /** |
109 | Returns a pointer to the KConfig object of the application. | 106 | Returns a pointer to the KConfig object of the application. |
110 | */ | 107 | */ |
111 | static KConfig *config(); | 108 | static KConfig *config(); |
112 | 109 | ||
113 | /** | 110 | /** |
@@ -349,25 +346,27 @@ class KABCore : public QWidget, public KSyncInterface | |||
349 | void requestForBirthdayList(const QString& sourceChannel, const QString& sessionuid); | 346 | void requestForBirthdayList(const QString& sourceChannel, const QString& sessionuid); |
350 | 347 | ||
351 | 348 | ||
352 | signals: | 349 | signals: |
353 | void contactSelected( const QString &name ); | 350 | void contactSelected( const QString &name ); |
354 | void contactSelected( const QPixmap &pixmap ); | 351 | void contactSelected( const QPixmap &pixmap ); |
355 | public slots: | 352 | public slots: |
356 | void recieve(QString cmsg ); | 353 | void recieve(QString cmsg ); |
357 | void getFile( bool success ); | 354 | void getFile( bool success ); |
358 | void syncFileRequest(); | 355 | void syncFileRequest(); |
359 | void setDetailsVisible( bool visible ); | 356 | void setDetailsVisible( bool visible ); |
360 | void setDetailsToState(); | 357 | void setDetailsToState(); |
361 | // void slotSyncMenu( int ); | 358 | |
359 | void saveSettings(); | ||
360 | |||
362 | private slots: | 361 | private slots: |
363 | void updateToolBar(); | 362 | void updateToolBar(); |
364 | void updateMainWindow(); | 363 | void updateMainWindow(); |
365 | void receive( const QCString& cmsg, const QByteArray& data ); | 364 | void receive( const QCString& cmsg, const QByteArray& data ); |
366 | void toggleBeamReceive( ); | 365 | void toggleBeamReceive( ); |
367 | void disableBR(bool); | 366 | void disableBR(bool); |
368 | void setJumpButtonBarVisible( bool visible ); | 367 | void setJumpButtonBarVisible( bool visible ); |
369 | void setCaptionBack(); | 368 | void setCaptionBack(); |
370 | void importFromOL(); | 369 | void importFromOL(); |
371 | void extensionModified( const KABC::Addressee::List &list ); | 370 | void extensionModified( const KABC::Addressee::List &list ); |
372 | void extensionChanged( int id ); | 371 | void extensionChanged( int id ); |
373 | void clipboardDataChanged(); | 372 | void clipboardDataChanged(); |
diff --git a/kaddressbook/viewmanager.cpp b/kaddressbook/viewmanager.cpp index 33bef5a..59bddd9 100644 --- a/kaddressbook/viewmanager.cpp +++ b/kaddressbook/viewmanager.cpp | |||
@@ -596,24 +596,25 @@ void ViewManager::configureFilters() | |||
596 | 596 | ||
597 | if ( dlg.exec() ) | 597 | if ( dlg.exec() ) |
598 | mFilterList = dlg.filters(); | 598 | mFilterList = dlg.filters(); |
599 | 599 | ||
600 | uint pos = mActionSelectFilter->currentItem(); | 600 | uint pos = mActionSelectFilter->currentItem(); |
601 | mActionSelectFilter->setItems( filterNames() ); | 601 | mActionSelectFilter->setItems( filterNames() ); |
602 | mActionSelectFilter->setCurrentItem( pos ); | 602 | mActionSelectFilter->setCurrentItem( pos ); |
603 | setActiveFilter( pos ); | 603 | setActiveFilter( pos ); |
604 | int cw = 150; | 604 | int cw = 150; |
605 | if (QApplication::desktop()->width() == 480 ) | 605 | if (QApplication::desktop()->width() == 480 ) |
606 | cw = 0; | 606 | cw = 0; |
607 | mActionSelectFilter->setComboWidth( cw ); | 607 | mActionSelectFilter->setComboWidth( cw ); |
608 | saveSettings(); | ||
608 | } | 609 | } |
609 | 610 | ||
610 | QStringList ViewManager::filterNames() const | 611 | QStringList ViewManager::filterNames() const |
611 | { | 612 | { |
612 | QStringList names( i18n( "No Filter" ) ); | 613 | QStringList names( i18n( "No Filter" ) ); |
613 | 614 | ||
614 | Filter::List::ConstIterator it; | 615 | Filter::List::ConstIterator it; |
615 | for ( it = mFilterList.begin(); it != mFilterList.end(); ++it ) | 616 | for ( it = mFilterList.begin(); it != mFilterList.end(); ++it ) |
616 | names.append( (*it).name() ); | 617 | names.append( (*it).name() ); |
617 | 618 | ||
618 | return names; | 619 | return names; |
619 | } | 620 | } |
diff --git a/kde2file/abdump/main.cpp b/kde2file/abdump/main.cpp index 1ee64f5..9ad78e5 100644 --- a/kde2file/abdump/main.cpp +++ b/kde2file/abdump/main.cpp | |||
@@ -95,26 +95,24 @@ int main( int argc, char *argv[] ) | |||
95 | KABC::StdAddressBook* standardAddressBook = KABC::StdAddressBook::self(); | 95 | KABC::StdAddressBook* standardAddressBook = KABC::StdAddressBook::self(); |
96 | standardAddressBook->setAutomaticSave( false ); | 96 | standardAddressBook->setAutomaticSave( false ); |
97 | qDebug("************************************* "); | 97 | qDebug("************************************* "); |
98 | qDebug("***************kdeABdump************* "); | 98 | qDebug("***************kdeABdump************* "); |
99 | qDebug("************************************* "); | 99 | qDebug("************************************* "); |
100 | if ( !read ) { | 100 | if ( !read ) { |
101 | KABC::AddressBook::Iterator it; | 101 | KABC::AddressBook::Iterator it; |
102 | KABC::VCardConverter converter; | 102 | KABC::VCardConverter converter; |
103 | QString datastream; | 103 | QString datastream; |
104 | for( it = standardAddressBook->begin(); it != standardAddressBook->end(); ++it ) { | 104 | for( it = standardAddressBook->begin(); it != standardAddressBook->end(); ++it ) { |
105 | if ( (*it).isEmpty() || ! (*it).resource() ) | 105 | if ( (*it).isEmpty() || ! (*it).resource() ) |
106 | continue; | 106 | continue; |
107 | if ( (*it).resource()->readOnly() ) | ||
108 | continue; | ||
109 | KABC::Addressee a = ( *it ); | 107 | KABC::Addressee a = ( *it ); |
110 | QString vcard = converter.createVCard( a ); | 108 | QString vcard = converter.createVCard( a ); |
111 | vcard += QString("\r\n"); | 109 | vcard += QString("\r\n"); |
112 | datastream += vcard; | 110 | datastream += vcard; |
113 | } | 111 | } |
114 | QFile outFile(fileName); | 112 | QFile outFile(fileName); |
115 | if ( outFile.open(IO_WriteOnly) ) { | 113 | if ( outFile.open(IO_WriteOnly) ) { |
116 | QTextStream t( &outFile ); // use a text stream | 114 | QTextStream t( &outFile ); // use a text stream |
117 | t.setEncoding( QTextStream::UnicodeUTF8 ); | 115 | t.setEncoding( QTextStream::UnicodeUTF8 ); |
118 | t <<datastream; | 116 | t <<datastream; |
119 | t << "\r\n\r\n"; | 117 | t << "\r\n\r\n"; |
120 | outFile.close(); | 118 | outFile.close(); |
diff --git a/kde2file/caldump/main.cpp b/kde2file/caldump/main.cpp index be1735b..08ccafb 100644 --- a/kde2file/caldump/main.cpp +++ b/kde2file/caldump/main.cpp | |||
@@ -120,25 +120,25 @@ int main( int argc, char *argv[] ) | |||
120 | qDebug("**************kdecaldump************* "); | 120 | qDebug("**************kdecaldump************* "); |
121 | qDebug("************************************* "); | 121 | qDebug("************************************* "); |
122 | qDebug("Using timezone ID: %s", calendarResource->timeZoneId().latin1()); | 122 | qDebug("Using timezone ID: %s", calendarResource->timeZoneId().latin1()); |
123 | 123 | ||
124 | if ( !read ) { | 124 | if ( !read ) { |
125 | localCalendar = new CalendarLocal(); | 125 | localCalendar = new CalendarLocal(); |
126 | localCalendar->setTimeZoneId( calendarResource->timeZoneId()); | 126 | localCalendar->setTimeZoneId( calendarResource->timeZoneId()); |
127 | KCal::Incidence::List allInc = calendarResource->rawIncidences(); | 127 | KCal::Incidence::List allInc = calendarResource->rawIncidences(); |
128 | Incidence::List::ConstIterator it; | 128 | Incidence::List::ConstIterator it; |
129 | int num = 0; | 129 | int num = 0; |
130 | for( it = allInc.begin(); it != allInc.end(); ++it ) { | 130 | for( it = allInc.begin(); it != allInc.end(); ++it ) { |
131 | ResourceCalendar * re = calendarResource->resource( (*it) ); | 131 | ResourceCalendar * re = calendarResource->resource( (*it) ); |
132 | if ( re && !re->readOnly() ) { | 132 | if ( re && /*!re->readOnly() now readonly syncing possible */) { |
133 | ++num; | 133 | ++num; |
134 | Incidence* cl = (*it)->clone(); | 134 | Incidence* cl = (*it)->clone(); |
135 | cl->setLastModified( (*it)->lastModified() ); | 135 | cl->setLastModified( (*it)->lastModified() ); |
136 | if ( cl->type() == "Journal" ) | 136 | if ( cl->type() == "Journal" ) |
137 | localCalendar->addJournal( (Journal *) cl ); | 137 | localCalendar->addJournal( (Journal *) cl ); |
138 | else if ( cl->type() == "Todo" ) | 138 | else if ( cl->type() == "Todo" ) |
139 | localCalendar->addTodo( (Todo *) cl ); | 139 | localCalendar->addTodo( (Todo *) cl ); |
140 | else if ( cl->type() == "Event" ) | 140 | else if ( cl->type() == "Event" ) |
141 | localCalendar->addEvent( (Event *) cl ); | 141 | localCalendar->addEvent( (Event *) cl ); |
142 | } | 142 | } |
143 | } | 143 | } |
144 | 144 | ||
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index 3d4acb7..f8bfc8b 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp | |||
@@ -68,58 +68,60 @@ ListItemVisitor::ListItemVisitor(KOListViewItem *item, QDate date ) | |||
68 | mDate = date; | 68 | mDate = date; |
69 | } | 69 | } |
70 | 70 | ||
71 | ListItemVisitor::~ListItemVisitor() | 71 | ListItemVisitor::~ListItemVisitor() |
72 | { | 72 | { |
73 | } | 73 | } |
74 | 74 | ||
75 | bool ListItemVisitor::visit(Event *e) | 75 | bool ListItemVisitor::visit(Event *e) |
76 | { | 76 | { |
77 | 77 | ||
78 | bool ok = false; | 78 | bool ok = false; |
79 | QString start, end; | 79 | QString start, end; |
80 | QDate ds, de; | ||
80 | if ( e->doesRecur() ) { | 81 | if ( e->doesRecur() ) { |
81 | QDate d = e->getNextOccurence( QDateTime( mDate, QTime(0,0,0)), &ok ).date(); | 82 | ds = e->getNextOccurence( QDateTime( mDate, QTime(0,0,0)), &ok ).date(); |
82 | if ( ok ) { | 83 | if ( ok ) { |
83 | int days = e->dtStart().date().daysTo(e->dtEnd().date() ); | 84 | int days = e->dtStart().date().daysTo(e->dtEnd().date() ); |
84 | start = KGlobal::locale()->formatDate(d,true); | 85 | start = KGlobal::locale()->formatDate(ds,true); |
85 | end = KGlobal::locale()->formatDate(d.addDays( days),true); | 86 | de = ds.addDays( days); |
87 | end = KGlobal::locale()->formatDate(de,true); | ||
86 | } | 88 | } |
87 | 89 | ||
88 | } | 90 | } |
89 | if ( ! ok ) { | 91 | if ( ! ok ) { |
90 | start =e->dtStartDateStr(); | 92 | start =e->dtStartDateStr(); |
91 | end = e->dtEndDateStr(); | 93 | end = e->dtEndDateStr(); |
94 | ds = e->dtStart().date(); | ||
95 | de = e->dtEnd().date(); | ||
92 | } | 96 | } |
93 | mItem->setText(0,e->summary()); | 97 | mItem->setText(0,e->summary()); |
94 | mItem->setText(1,start); | 98 | mItem->setText(1,start); |
95 | mItem->setText(2,e->dtStartTimeStr()); | 99 | mItem->setText(2,e->dtStartTimeStr()); |
96 | mItem->setText(3,end); | 100 | mItem->setText(3,end); |
97 | mItem->setText(4,e->dtEndTimeStr()); | 101 | mItem->setText(4,e->dtEndTimeStr()); |
98 | mItem->setText(5,e->isAlarmEnabled() ? i18n("Yes") : i18n("No")); | 102 | mItem->setText(5,e->isAlarmEnabled() ? i18n("Yes") : i18n("No")); |
99 | mItem->setText(6, e->recurrence()->recurrenceText()); | 103 | mItem->setText(6, e->recurrence()->recurrenceText()); |
100 | mItem->setText(7,"---"); | 104 | mItem->setText(7,"---"); |
101 | mItem->setText(8,"---"); | 105 | mItem->setText(8,"---"); |
102 | mItem->setText(9, e->cancelled() ? i18n("Yes") : i18n("No")); | 106 | mItem->setText(9, e->cancelled() ? i18n("Yes") : i18n("No")); |
103 | mItem->setText(10,e->categoriesStr()); | 107 | mItem->setText(10,e->categoriesStr()); |
104 | 108 | ||
105 | QString key; | 109 | QString key; |
106 | QDate d = e->dtStart().date(); | ||
107 | QTime t = e->doesFloat() ? QTime(0,0) : e->dtStart().time(); | 110 | QTime t = e->doesFloat() ? QTime(0,0) : e->dtStart().time(); |
108 | key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute()); | 111 | key.sprintf("%04d%02d%02d%02d%02d",ds.year(),ds.month(),ds.day(),t.hour(),t.minute()); |
109 | mItem->setSortKey(1,key); | 112 | mItem->setSortKey(1,key); |
110 | 113 | ||
111 | d = e->dtEnd().date(); | ||
112 | t = e->doesFloat() ? QTime(0,0) : e->dtEnd().time(); | 114 | t = e->doesFloat() ? QTime(0,0) : e->dtEnd().time(); |
113 | key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute()); | 115 | key.sprintf("%04d%02d%02d%02d%02d",de.year(),de.month(),de.day(),t.hour(),t.minute()); |
114 | mItem->setSortKey(3,key); | 116 | mItem->setSortKey(3,key); |
115 | 117 | ||
116 | return true; | 118 | return true; |
117 | } | 119 | } |
118 | 120 | ||
119 | bool ListItemVisitor::visit(Todo *t) | 121 | bool ListItemVisitor::visit(Todo *t) |
120 | { | 122 | { |
121 | mItem->setText(0,i18n("To-Do: %1").arg(t->summary())); | 123 | mItem->setText(0,i18n("To-Do: %1").arg(t->summary())); |
122 | if (t->hasStartDate()) { | 124 | if (t->hasStartDate()) { |
123 | mItem->setText(1,t->dtStartDateStr()); | 125 | mItem->setText(1,t->dtStartDateStr()); |
124 | if (t->doesFloat()) { | 126 | if (t->doesFloat()) { |
125 | mItem->setText(2,"---"); | 127 | mItem->setText(2,"---"); |
@@ -1 +1 @@ | |||
version = "1.9.16"; | version = "1.9.17"; | ||