Diffstat (limited to 'library/backend/palmtoprecord.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | library/backend/palmtoprecord.cpp | 42 |
1 files changed, 28 insertions, 14 deletions
diff --git a/library/backend/palmtoprecord.cpp b/library/backend/palmtoprecord.cpp index 0d57699..3cfa874 100644 --- a/library/backend/palmtoprecord.cpp +++ b/library/backend/palmtoprecord.cpp | |||
@@ -1,16 +1,15 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of the Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Software Foundation and appearing in the file LICENSE.GPL included | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** in the packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** PARTICULAR PURPOSE. | ||
14 | ** | 13 | ** |
15 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
16 | ** | 15 | ** |
@@ -18,12 +17,24 @@ | |||
18 | ** not clear to you. | 17 | ** not clear to you. |
19 | ** | 18 | ** |
20 | **********************************************************************/ | 19 | **********************************************************************/ |
21 | #include "palmtoprecord.h" | 20 | #include <qtopia/private/palmtoprecord.h> |
22 | #include "stringutil.h" | 21 | #include <qtopia/stringutil.h> |
23 | #include <qstringlist.h> | 22 | #include <qstringlist.h> |
24 | 23 | ||
24 | /*! \class Qtopia::PalmtopRecord palmtoprecord.h | ||
25 | \brief The Qtopia::PalmtopRecord class is the base class for all PIM records. | ||
26 | |||
27 | Provides unique id and category support for all PIM records. | ||
28 | |||
29 | \ingroup qtopiaemb | ||
30 | \ingroup qtopiadesktop | ||
31 | */ | ||
32 | |||
33 | |||
25 | namespace Qtopia { | 34 | namespace Qtopia { |
26 | 35 | ||
36 | |||
37 | |||
27 | Record &Record::operator=( const Record &c ) | 38 | Record &Record::operator=( const Record &c ) |
28 | { | 39 | { |
29 | mUid = c.mUid; | 40 | mUid = c.mUid; |
@@ -41,8 +52,11 @@ void Record::setCategories( int single ) | |||
41 | } | 52 | } |
42 | 53 | ||
43 | // convenience methods provided for loading and saving to xml | 54 | // convenience methods provided for loading and saving to xml |
44 | QString Record::idsToString( const QArray<int> &cats ) | 55 | QString Record::idsToString( const QArray<int> &catsUnsorted ) |
45 | { | 56 | { |
57 | QArray<int> cats = catsUnsorted; | ||
58 | cats.sort(); | ||
59 | |||
46 | QString str; | 60 | QString str; |
47 | for ( uint i = 0; i < cats.size(); i++ ) | 61 | for ( uint i = 0; i < cats.size(); i++ ) |
48 | if ( i == 0 ) | 62 | if ( i == 0 ) |
@@ -84,13 +98,13 @@ QString Record::customField( const QString &key) const | |||
84 | */ | 98 | */ |
85 | void Record::setCustomField( const QString &key, const QString &value) | 99 | void Record::setCustomField( const QString &key, const QString &value) |
86 | { | 100 | { |
87 | qWarning("setting custom " + key + " to " + value); | 101 | // qWarning("setting custom " + key + " to " + value); |
88 | if (customMap.contains(key)) | 102 | if (customMap.contains(key)) |
89 | customMap.replace(key, value); | 103 | customMap.replace(key, value); |
90 | else | 104 | else |
91 | customMap.insert(key, value); | 105 | customMap.insert(key, value); |
92 | 106 | ||
93 | qWarning(QString("custom size %1").arg(customMap.count())); | 107 | // qWarning(QString("custom size %1").arg(customMap.count())); |
94 | } | 108 | } |
95 | 109 | ||
96 | /*! | 110 | /*! |
@@ -107,7 +121,7 @@ QString Record::customToXml() const | |||
107 | QString buf(" "); | 121 | QString buf(" "); |
108 | for ( QMap<QString, QString>::ConstIterator cit = customMap.begin(); | 122 | for ( QMap<QString, QString>::ConstIterator cit = customMap.begin(); |
109 | cit != customMap.end(); ++cit) { | 123 | cit != customMap.end(); ++cit) { |
110 | qWarning(".ITEM."); | 124 | // qWarning(".ITEM."); |
111 | buf += cit.key(); | 125 | buf += cit.key(); |
112 | buf += "=\""; | 126 | buf += "=\""; |
113 | buf += escapeString(cit.data()); | 127 | buf += escapeString(cit.data()); |