-rw-r--r-- | library/applnk.cpp | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/library/applnk.cpp b/library/applnk.cpp index 8763eb2..9c60f1a 100644 --- a/library/applnk.cpp +++ b/library/applnk.cpp | |||
@@ -1,89 +1,85 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of the 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 Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** 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 THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #define QTOPIA_INTERNAL_MIMEEXT | 21 | #define QTOPIA_INTERNAL_MIMEEXT |
22 | #define QTOPIA_INTERNAL_PRELOADACCESS | 22 | #define QTOPIA_INTERNAL_PRELOADACCESS |
23 | #define QTOPIA_INTERNAL_APPLNKASSIGN | 23 | #define QTOPIA_INTERNAL_APPLNKASSIGN |
24 | 24 | ||
25 | #include "applnk.h" | 25 | #include "applnk.h" |
26 | 26 | ||
27 | #include <qpe/qpeapplication.h> | 27 | #include <qpe/qpeapplication.h> |
28 | #include <qpe/categories.h> | 28 | #include <qpe/categories.h> |
29 | #include <qpe/categoryselect.h> | 29 | #include <qpe/categoryselect.h> |
30 | #include <qpe/qcopenvelope_qws.h> | 30 | #include <qpe/qcopenvelope_qws.h> |
31 | #include <qpe/global.h> | ||
32 | #include <qpe/mimetype.h> | 31 | #include <qpe/mimetype.h> |
33 | #include <qpe/config.h> | 32 | #include <qpe/config.h> |
34 | #include <qpe/storage.h> | 33 | #include <qpe/storage.h> |
35 | #include <qpe/resource.h> | 34 | #include <qpe/resource.h> |
36 | 35 | ||
37 | #include <qdict.h> | ||
38 | #include <qdir.h> | 36 | #include <qdir.h> |
39 | #include <qregexp.h> | ||
40 | 37 | ||
41 | #include <qgfx_qws.h> | ||
42 | 38 | ||
43 | #include <stdlib.h> | 39 | #include <stdlib.h> |
44 | 40 | ||
45 | int AppLnk::lastId = 5000; | 41 | int AppLnk::lastId = 5000; |
46 | 42 | ||
47 | static int smallSize = 14; | 43 | static int smallSize = 14; |
48 | static int bigSize = 32; | 44 | static int bigSize = 32; |
49 | 45 | ||
50 | static QString safeFileName(const QString& n) | 46 | static QString safeFileName(const QString& n) |
51 | { | 47 | { |
52 | QString safename=n; | 48 | QString safename=n; |
53 | safename.replace(QRegExp("[^0-9A-Za-z.]"),"_"); | 49 | safename.replace(QRegExp("[^0-9A-Za-z.]"),"_"); |
54 | safename.replace(QRegExp("^[^A-Za-z]*"),""); | 50 | safename.replace(QRegExp("^[^A-Za-z]*"),""); |
55 | if ( safename.isEmpty() ) | 51 | if ( safename.isEmpty() ) |
56 | safename = "_"; | 52 | safename = "_"; |
57 | return safename; | 53 | return safename; |
58 | } | 54 | } |
59 | 55 | ||
60 | static bool prepareDirectories(const QString& lf) | 56 | static bool prepareDirectories(const QString& lf) |
61 | { | 57 | { |
62 | if ( !QFile::exists(lf) ) { | 58 | if ( !QFile::exists(lf) ) { |
63 | // May need to create directories | 59 | // May need to create directories |
64 | QFileInfo fi(lf); | 60 | QFileInfo fi(lf); |
65 | if ( system(("mkdir -p "+fi.dirPath(TRUE))) ) | 61 | if ( system(("mkdir -p "+fi.dirPath(TRUE))) ) |
66 | return FALSE; | 62 | return FALSE; |
67 | } | 63 | } |
68 | return TRUE; | 64 | return TRUE; |
69 | } | 65 | } |
70 | 66 | ||
71 | class AppLnkPrivate | 67 | class AppLnkPrivate |
72 | { | 68 | { |
73 | public: | 69 | public: |
74 | /* the size of the Pixmap */ | 70 | /* the size of the Pixmap */ |
75 | enum Size {Normal = 0, Big }; | 71 | enum Size {Normal = 0, Big }; |
76 | AppLnkPrivate() { | 72 | AppLnkPrivate() { |
77 | /* we want one normal and one big item */ | 73 | /* we want one normal and one big item */ |
78 | 74 | ||
79 | QPixmap pix; | 75 | QPixmap pix; |
80 | mPixmaps.insert(0, pix ); | 76 | mPixmaps.insert(0, pix ); |
81 | mPixmaps.insert(1, pix); | 77 | mPixmaps.insert(1, pix); |
82 | } | 78 | } |
83 | 79 | ||
84 | QStringList mCatList; // always correct | 80 | QStringList mCatList; // always correct |
85 | QArray<int> mCat; // cached value; correct if not empty | 81 | QArray<int> mCat; // cached value; correct if not empty |
86 | QMap<int, QPixmap> mPixmaps; | 82 | QMap<int, QPixmap> mPixmaps; |
87 | 83 | ||
88 | void updateCatListFromArray() | 84 | void updateCatListFromArray() |
89 | { | 85 | { |