Diffstat (limited to 'kabc/plugins/qtopia/qtopiaconverter.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kabc/plugins/qtopia/qtopiaconverter.cpp | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/kabc/plugins/qtopia/qtopiaconverter.cpp b/kabc/plugins/qtopia/qtopiaconverter.cpp index 106596f..39d366b 100644 --- a/kabc/plugins/qtopia/qtopiaconverter.cpp +++ b/kabc/plugins/qtopia/qtopiaconverter.cpp | |||
@@ -1,90 +1,88 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of libkabc. | 2 | This file is part of libkabc. |
3 | Copyright (c) 2002 Tobias Koenig <tokoe@kde.org> | 3 | Copyright (c) 2002 Tobias Koenig <tokoe@kde.org> |
4 | 4 | ||
5 | This library is free software; you can redistribute it and/or | 5 | This library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Library General Public | 6 | modify it under the terms of the GNU Library General Public |
7 | License as published by the Free Software Foundation; either | 7 | License as published by the Free Software Foundation; either |
8 | version 2 of the License, or (at your option) any later version. | 8 | version 2 of the License, or (at your option) any later version. |
9 | 9 | ||
10 | This library is distributed in the hope that it will be useful, | 10 | This library 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 GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Library General Public License for more details. | 13 | Library General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /* | 21 | /* |
22 | Enhanced Version of the file for platform independent KDE tools. | 22 | Enhanced Version of the file for platform independent KDE tools. |
23 | Copyright (c) 2004 Ulf Schenk | 23 | Copyright (c) 2004 Ulf Schenk |
24 | 24 | ||
25 | $Id$ | 25 | $Id$ |
26 | */ | 26 | */ |
27 | 27 | ||
28 | //US | 28 | //US |
29 | #include "kglobal.h" | 29 | #include "kglobal.h" |
30 | #include "klocale.h" | 30 | #include "klocale.h" |
31 | 31 | ||
32 | 32 | ||
33 | #include "qtopiaconverter.h" | 33 | #include "qtopiaconverter.h" |
34 | 34 | ||
35 | #include <qfile.h> | 35 | #include <qfile.h> |
36 | #include <qdir.h> | 36 | #include <qdir.h> |
37 | #include <qtextstream.h> | 37 | #include <qtextstream.h> |
38 | //#include <.h> | 38 | //#include <.h> |
39 | 39 | ||
40 | //#include <qpe/categories.h> | ||
41 | #include <libkdepim/ksyncprofile.h> | 40 | #include <libkdepim/ksyncprofile.h> |
42 | //US #include <qpe/categoryselect.h> | ||
43 | 41 | ||
44 | 42 | ||
45 | using namespace KABC; | 43 | using namespace KABC; |
46 | 44 | ||
47 | QtopiaConverter::QtopiaConverter() | 45 | QtopiaConverter::QtopiaConverter() |
48 | { | 46 | { |
49 | m_edit = 0; | 47 | m_edit = 0; |
50 | } | 48 | } |
51 | 49 | ||
52 | QtopiaConverter::~QtopiaConverter() | 50 | QtopiaConverter::~QtopiaConverter() |
53 | { | 51 | { |
54 | deinit(); | 52 | deinit(); |
55 | } | 53 | } |
56 | 54 | ||
57 | bool QtopiaConverter::init() | 55 | bool QtopiaConverter::init() |
58 | { | 56 | { |
59 | QString fn = QDir::homeDirPath() +"/Settings/Categories.xml"; | 57 | QString fn = QDir::homeDirPath() +"/Settings/Categories.xml"; |
60 | m_edit = new CategoryEdit( fn); | 58 | m_edit = new CategoryEdit( fn); |
61 | return true; | 59 | return true; |
62 | } | 60 | } |
63 | 61 | ||
64 | void QtopiaConverter::deinit() | 62 | void QtopiaConverter::deinit() |
65 | { | 63 | { |
66 | if (m_edit) | 64 | if (m_edit) |
67 | { | 65 | { |
68 | delete m_edit; | 66 | delete m_edit; |
69 | m_edit = 0; | 67 | m_edit = 0; |
70 | } | 68 | } |
71 | } | 69 | } |
72 | QString QtopiaConverter::categoriesToNumber( const QStringList &list, const QString &app ) | 70 | QString QtopiaConverter::categoriesToNumber( const QStringList &list, const QString &app ) |
73 | { | 71 | { |
74 | startover: | 72 | startover: |
75 | QStringList dummy; | 73 | QStringList dummy; |
76 | QValueList<OpieCategories>::ConstIterator catIt; | 74 | QValueList<OpieCategories>::ConstIterator catIt; |
77 | QValueList<OpieCategories> categories = m_edit->categories(); | 75 | QValueList<OpieCategories> categories = m_edit->categories(); |
78 | bool found = false; | 76 | bool found = false; |
79 | for ( QStringList::ConstIterator listIt = list.begin(); listIt != list.end(); ++listIt ) { | 77 | for ( QStringList::ConstIterator listIt = list.begin(); listIt != list.end(); ++listIt ) { |
80 | /* skip empty category name */ | 78 | /* skip empty category name */ |
81 | if ( (*listIt).isEmpty() ) continue; | 79 | if ( (*listIt).isEmpty() ) continue; |
82 | 80 | ||
83 | found = false; | 81 | found = false; |
84 | for ( catIt = categories.begin(); catIt != categories.end(); ++catIt ) { | 82 | for ( catIt = categories.begin(); catIt != categories.end(); ++catIt ) { |
85 | /* | 83 | /* |
86 | * We currently do not take app into account | 84 | * We currently do not take app into account |
87 | * if name matches and the id isn't already in dummy we'll add it | 85 | * if name matches and the id isn't already in dummy we'll add it |
88 | */ | 86 | */ |
89 | if ( (*catIt).name() == (*listIt) && !dummy.contains(( *catIt).id() ) ) { // the same name | 87 | if ( (*catIt).name() == (*listIt) && !dummy.contains(( *catIt).id() ) ) { // the same name |
90 | found= true; | 88 | found= true; |