author | zecke <zecke> | 2004-03-13 21:27:29 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-03-13 21:27:29 (UTC) |
commit | 184a0cd9935d0a249038cdbe05488c181b273d64 (patch) (unidiff) | |
tree | c8f3508ab1be012083d9e2140221cfeb9a9ab83a /core/launcher/documentlist.cpp | |
parent | a3304e23c7f8576a4584475ef0cf49d0e588671e (diff) | |
download | opie-184a0cd9935d0a249038cdbe05488c181b273d64.zip opie-184a0cd9935d0a249038cdbe05488c181b273d64.tar.gz opie-184a0cd9935d0a249038cdbe05488c181b273d64.tar.bz2 |
Fix namespaces in the launcher.. and found a problem with my script
Diffstat (limited to 'core/launcher/documentlist.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/launcher/documentlist.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/core/launcher/documentlist.cpp b/core/launcher/documentlist.cpp index 63f853e..3e0a96c 100644 --- a/core/launcher/documentlist.cpp +++ b/core/launcher/documentlist.cpp | |||
@@ -1,145 +1,146 @@ | |||
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 | #include "documentlist.h" | 20 | #include "documentlist.h" |
21 | #include "serverinterface.h" | 21 | #include "serverinterface.h" |
22 | #include "mediadlg.h" | 22 | #include "mediadlg.h" |
23 | 23 | ||
24 | #include <opie2/oglobal.h> | 24 | #include <opie2/oglobal.h> |
25 | 25 | ||
26 | #include <qtopia/config.h> | 26 | #include <qtopia/config.h> |
27 | #include <qtopia/mimetype.h> | 27 | #include <qtopia/mimetype.h> |
28 | #include <qtopia/resource.h> | 28 | #include <qtopia/resource.h> |
29 | #include <qtopia/private/categories.h> | 29 | #include <qtopia/private/categories.h> |
30 | #include <qtopia/qpeapplication.h> | 30 | #include <qtopia/qpeapplication.h> |
31 | #include <qtopia/applnk.h> | 31 | #include <qtopia/applnk.h> |
32 | #include <qtopia/storage.h> | 32 | #include <qtopia/storage.h> |
33 | #ifdef Q_WS_QWS | 33 | #ifdef Q_WS_QWS |
34 | #include <qtopia/qcopenvelope_qws.h> | 34 | #include <qtopia/qcopenvelope_qws.h> |
35 | #endif | 35 | #endif |
36 | 36 | ||
37 | #include <qtimer.h> | 37 | #include <qtimer.h> |
38 | #include <qfileinfo.h> | 38 | #include <qfileinfo.h> |
39 | #include <qtextstream.h> | 39 | #include <qtextstream.h> |
40 | #include <qfile.h> | 40 | #include <qfile.h> |
41 | #include <qdir.h> | 41 | #include <qdir.h> |
42 | #include <qpainter.h> | 42 | #include <qpainter.h> |
43 | #include <qimage.h> | 43 | #include <qimage.h> |
44 | #include <qcopchannel_qws.h> | 44 | #include <qcopchannel_qws.h> |
45 | #include <qlistview.h> | 45 | #include <qlistview.h> |
46 | #include <qlist.h> | 46 | #include <qlist.h> |
47 | #include <qpixmap.h> | 47 | #include <qpixmap.h> |
48 | 48 | ||
49 | 49 | ||
50 | using namespace Opie::Core; | ||
50 | AppLnkSet *DocumentList::appLnkSet = 0; | 51 | AppLnkSet *DocumentList::appLnkSet = 0; |
51 | 52 | ||
52 | static const int MAX_SEARCH_DEPTH = 10; | 53 | static const int MAX_SEARCH_DEPTH = 10; |
53 | 54 | ||
54 | 55 | ||
55 | class DocumentListPrivate : public QObject { | 56 | class DocumentListPrivate : public QObject { |
56 | Q_OBJECT | 57 | Q_OBJECT |
57 | public: | 58 | public: |
58 | DocumentListPrivate( ServerInterface *gui ); | 59 | DocumentListPrivate( ServerInterface *gui ); |
59 | ~DocumentListPrivate(); | 60 | ~DocumentListPrivate(); |
60 | 61 | ||
61 | void initialize(); | 62 | void initialize(); |
62 | 63 | ||
63 | const QString nextFile(); | 64 | const QString nextFile(); |
64 | const DocLnk *iterate(); | 65 | const DocLnk *iterate(); |
65 | bool store( DocLnk* dl ); | 66 | bool store( DocLnk* dl ); |
66 | void estimatedPercentScanned(); | 67 | void estimatedPercentScanned(); |
67 | void appendDocpath(FileSystem*); | 68 | void appendDocpath(FileSystem*); |
68 | 69 | ||
69 | 70 | ||
70 | DocLnkSet dls; | 71 | DocLnkSet dls; |
71 | QDict<void> reference; | 72 | QDict<void> reference; |
72 | QDictIterator<void> *dit; | 73 | QDictIterator<void> *dit; |
73 | enum { Find, RemoveKnownFiles, MakeUnknownFiles, Done } state; | 74 | enum { Find, RemoveKnownFiles, MakeUnknownFiles, Done } state; |
74 | 75 | ||
75 | QStringList docPaths; | 76 | QStringList docPaths; |
76 | unsigned int docPathsSearched; | 77 | unsigned int docPathsSearched; |
77 | 78 | ||
78 | int searchDepth; | 79 | int searchDepth; |
79 | QDir *listDirs[MAX_SEARCH_DEPTH]; | 80 | QDir *listDirs[MAX_SEARCH_DEPTH]; |
80 | const QFileInfoList *lists[MAX_SEARCH_DEPTH]; | 81 | const QFileInfoList *lists[MAX_SEARCH_DEPTH]; |
81 | unsigned int listPositions[MAX_SEARCH_DEPTH]; | 82 | unsigned int listPositions[MAX_SEARCH_DEPTH]; |
82 | 83 | ||
83 | StorageInfo *storage; | 84 | StorageInfo *storage; |
84 | 85 | ||
85 | int tid; | 86 | int tid; |
86 | 87 | ||
87 | ServerInterface *serverGui; | 88 | ServerInterface *serverGui; |
88 | 89 | ||
89 | bool needToSendAllDocLinks; | 90 | bool needToSendAllDocLinks; |
90 | bool sendAppLnks; | 91 | bool sendAppLnks; |
91 | bool sendDocLnks; | 92 | bool sendDocLnks; |
92 | bool scanDocs; | 93 | bool scanDocs; |
93 | }; | 94 | }; |
94 | 95 | ||
95 | 96 | ||
96 | /* | 97 | /* |
97 | * scandocs will be read from Config | 98 | * scandocs will be read from Config |
98 | */ | 99 | */ |
99 | DocumentList::DocumentList( ServerInterface *serverGui, bool /*scanDocs*/, | 100 | DocumentList::DocumentList( ServerInterface *serverGui, bool /*scanDocs*/, |
100 | QObject *parent, const char *name ) | 101 | QObject *parent, const char *name ) |
101 | : QObject( parent, name ) | 102 | : QObject( parent, name ) |
102 | { | 103 | { |
103 | appLnkSet = new AppLnkSet( MimeType::appsFolderName() ); | 104 | appLnkSet = new AppLnkSet( MimeType::appsFolderName() ); |
104 | d = new DocumentListPrivate( serverGui ); | 105 | d = new DocumentListPrivate( serverGui ); |
105 | d->needToSendAllDocLinks = false; | 106 | d->needToSendAllDocLinks = false; |
106 | 107 | ||
107 | Config cfg( "Launcher" ); | 108 | Config cfg( "Launcher" ); |
108 | cfg.setGroup( "DocTab" ); | 109 | cfg.setGroup( "DocTab" ); |
109 | d->scanDocs = cfg.readBoolEntry( "Enable", true ); | 110 | d->scanDocs = cfg.readBoolEntry( "Enable", true ); |
110 | qDebug( "DocumentList::DocumentList() : scanDocs = %d", d->scanDocs ); | 111 | qDebug( "DocumentList::DocumentList() : scanDocs = %d", d->scanDocs ); |
111 | 112 | ||
112 | QTimer::singleShot( 10, this, SLOT( startInitialScan() ) ); | 113 | QTimer::singleShot( 10, this, SLOT( startInitialScan() ) ); |
113 | } | 114 | } |
114 | 115 | ||
115 | void DocumentList::startInitialScan() | 116 | void DocumentList::startInitialScan() |
116 | { | 117 | { |
117 | reloadAppLnks(); | 118 | reloadAppLnks(); |
118 | reloadDocLnks(); | 119 | reloadDocLnks(); |
119 | } | 120 | } |
120 | 121 | ||
121 | DocumentList::~DocumentList() | 122 | DocumentList::~DocumentList() |
122 | { | 123 | { |
123 | delete appLnkSet; | 124 | delete appLnkSet; |
124 | delete d; | 125 | delete d; |
125 | } | 126 | } |
126 | 127 | ||
127 | 128 | ||
128 | void DocumentList::add( const DocLnk& doc ) | 129 | void DocumentList::add( const DocLnk& doc ) |
129 | { | 130 | { |
130 | if ( d->serverGui && QFile::exists( doc.file() ) ) | 131 | if ( d->serverGui && QFile::exists( doc.file() ) ) |
131 | d->serverGui->documentAdded( doc ); | 132 | d->serverGui->documentAdded( doc ); |
132 | } | 133 | } |
133 | 134 | ||
134 | 135 | ||
135 | void DocumentList::start() | 136 | void DocumentList::start() |
136 | { | 137 | { |
137 | resume(); | 138 | resume(); |
138 | } | 139 | } |
139 | 140 | ||
140 | 141 | ||
141 | void DocumentList::pause() | 142 | void DocumentList::pause() |
142 | { | 143 | { |
143 | //qDebug("pause %i", d->tid); | 144 | //qDebug("pause %i", d->tid); |
144 | killTimer( d->tid ); | 145 | killTimer( d->tid ); |
145 | d->tid = 0; | 146 | d->tid = 0; |