author | zecke <zecke> | 2004-06-20 19:03:56 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-06-20 19:03:56 (UTC) |
commit | 44d69b04b5257592639d2a494c448202c86978c2 (patch) (unidiff) | |
tree | 9d776e08f6efa53abc6e2658c94b9e0e18324692 | |
parent | 2055cb9e96b27f95720240a2035ade27cb7bc098 (diff) | |
download | opie-44d69b04b5257592639d2a494c448202c86978c2.zip opie-44d69b04b5257592639d2a494c448202c86978c2.tar.gz opie-44d69b04b5257592639d2a494c448202c86978c2.tar.bz2 |
Use A higher prime number in AppLnk
Somehow the Launcher triggers issues with libqpe and MimeType.
Due the mix of calling MimeType::clear, MimeType type(doclnk.linkFile()),
MimeType::clear
the registration of Application was cleared and not reentered due the
inner static variable in MimeType::init which was set.
Now make sure that if we clear that we will reenter the Application in all cases!
-rw-r--r-- | library/applnk.cpp | 2 | ||||
-rw-r--r-- | library/mimetype.cpp | 10 |
2 files changed, 8 insertions, 4 deletions
diff --git a/library/applnk.cpp b/library/applnk.cpp index 5f7da8e..e9d519e 100644 --- a/library/applnk.cpp +++ b/library/applnk.cpp | |||
@@ -1231,97 +1231,97 @@ const AppLnk *AppLnkSet::findExec( const QString& exec ) const | |||
1231 | QListIterator<AppLnk> it( children() ); | 1231 | QListIterator<AppLnk> it( children() ); |
1232 | 1232 | ||
1233 | for ( ; it.current(); ++it ) { | 1233 | for ( ; it.current(); ++it ) { |
1234 | const AppLnk *app = it.current(); | 1234 | const AppLnk *app = it.current(); |
1235 | if ( app->exec() == exec ) | 1235 | if ( app->exec() == exec ) |
1236 | return app; | 1236 | return app; |
1237 | } | 1237 | } |
1238 | 1238 | ||
1239 | return 0; | 1239 | return 0; |
1240 | } | 1240 | } |
1241 | 1241 | ||
1242 | /*! | 1242 | /*! |
1243 | \class DocLnkSet applnk.h | 1243 | \class DocLnkSet applnk.h |
1244 | \brief The DocLnkSet class is a set of DocLnk objects. | 1244 | \brief The DocLnkSet class is a set of DocLnk objects. |
1245 | */ | 1245 | */ |
1246 | 1246 | ||
1247 | /*! | 1247 | /*! |
1248 | \fn const QList<DocLnk>& DocLnkSet::children() const | 1248 | \fn const QList<DocLnk>& DocLnkSet::children() const |
1249 | 1249 | ||
1250 | Returns the members of the set. | 1250 | Returns the members of the set. |
1251 | */ | 1251 | */ |
1252 | 1252 | ||
1253 | /*! | 1253 | /*! |
1254 | Constructs an empty DocLnkSet. | 1254 | Constructs an empty DocLnkSet. |
1255 | 1255 | ||
1256 | \sa appendFrom() | 1256 | \sa appendFrom() |
1257 | */ | 1257 | */ |
1258 | DocLnkSet::DocLnkSet() | 1258 | DocLnkSet::DocLnkSet() |
1259 | { | 1259 | { |
1260 | } | 1260 | } |
1261 | 1261 | ||
1262 | /*! | 1262 | /*! |
1263 | Constructs a DocLnkSet that contains DocLnk objects representing all | 1263 | Constructs a DocLnkSet that contains DocLnk objects representing all |
1264 | the files in the \a directory (and any subdirectories, recursively). | 1264 | the files in the \a directory (and any subdirectories, recursively). |
1265 | 1265 | ||
1266 | If \a mimefilter is not null, | 1266 | If \a mimefilter is not null, |
1267 | only documents with a MIME type matching \a mimefilter are selected. | 1267 | only documents with a MIME type matching \a mimefilter are selected. |
1268 | The value may contain multiple wild-card patterns separated by ";", | 1268 | The value may contain multiple wild-card patterns separated by ";", |
1269 | such as \c{*o/mpeg;audio/x-wav}. | 1269 | such as \c{*o/mpeg;audio/x-wav}. |
1270 | 1270 | ||
1271 | See also \link applnk.html#files-and-links Files and Links\endlink. | 1271 | See also \link applnk.html#files-and-links Files and Links\endlink. |
1272 | 1272 | ||
1273 | */ | 1273 | */ |
1274 | DocLnkSet::DocLnkSet( const QString &directory, const QString& mimefilter ) : | 1274 | DocLnkSet::DocLnkSet( const QString &directory, const QString& mimefilter ) : |
1275 | AppLnkSet() | 1275 | AppLnkSet() |
1276 | { | 1276 | { |
1277 | QDir dir( directory ); | 1277 | QDir dir( directory ); |
1278 | mFile = dir.dirName(); | 1278 | mFile = dir.dirName(); |
1279 | QDict<void> reference; | 1279 | QDict<void> reference(1021); |
1280 | 1280 | ||
1281 | QStringList subFilter = QStringList::split(";", mimefilter); | 1281 | QStringList subFilter = QStringList::split(";", mimefilter); |
1282 | QValueList<QRegExp> mimeFilters; | 1282 | QValueList<QRegExp> mimeFilters; |
1283 | for( QStringList::Iterator it = subFilter.begin(); it != subFilter.end(); ++ it ) | 1283 | for( QStringList::Iterator it = subFilter.begin(); it != subFilter.end(); ++ it ) |
1284 | mimeFilters.append( QRegExp(*it, FALSE, TRUE) ); | 1284 | mimeFilters.append( QRegExp(*it, FALSE, TRUE) ); |
1285 | 1285 | ||
1286 | findChildren(directory, mimeFilters, reference); | 1286 | findChildren(directory, mimeFilters, reference); |
1287 | 1287 | ||
1288 | const QList<DocLnk> &list = children(); | 1288 | const QList<DocLnk> &list = children(); |
1289 | for ( QListIterator<DocLnk> it( list ); it.current(); ++it ) { | 1289 | for ( QListIterator<DocLnk> it( list ); it.current(); ++it ) { |
1290 | reference.remove( (*it)->file() ); | 1290 | reference.remove( (*it)->file() ); |
1291 | } | 1291 | } |
1292 | for ( QDictIterator<void> dit(reference); dit.current(); ++dit ) { | 1292 | for ( QDictIterator<void> dit(reference); dit.current(); ++dit ) { |
1293 | if ( dit.current() == (void*)2 ) { | 1293 | if ( dit.current() == (void*)2 ) { |
1294 | // Unreferenced, make an unwritten link | 1294 | // Unreferenced, make an unwritten link |
1295 | DocLnk* dl = new DocLnk; | 1295 | DocLnk* dl = new DocLnk; |
1296 | QFileInfo fi( dit.currentKey() ); | 1296 | QFileInfo fi( dit.currentKey() ); |
1297 | dl->setFile(fi.filePath()); | 1297 | dl->setFile(fi.filePath()); |
1298 | dl->setName(fi.baseName()); | 1298 | dl->setName(fi.baseName()); |
1299 | // #### default to current path? | 1299 | // #### default to current path? |
1300 | // dl->setCategories( ... ); | 1300 | // dl->setCategories( ... ); |
1301 | bool match = mimefilter.isNull(); | 1301 | bool match = mimefilter.isNull(); |
1302 | if ( !match ) | 1302 | if ( !match ) |
1303 | for( QValueList<QRegExp>::Iterator it = mimeFilters.begin(); it != mimeFilters.end() && !match; ++ it ) | 1303 | for( QValueList<QRegExp>::Iterator it = mimeFilters.begin(); it != mimeFilters.end() && !match; ++ it ) |
1304 | if ( (*it).match(dl->type()) >= 0 ) | 1304 | if ( (*it).match(dl->type()) >= 0 ) |
1305 | match = TRUE; | 1305 | match = TRUE; |
1306 | if ( match /* && dl->type() != "application/octet-stream" */ | 1306 | if ( match /* && dl->type() != "application/octet-stream" */ |
1307 | && !!dl->exec() ) | 1307 | && !!dl->exec() ) |
1308 | add(dl); | 1308 | add(dl); |
1309 | else | 1309 | else |
1310 | delete dl; | 1310 | delete dl; |
1311 | } | 1311 | } |
1312 | } | 1312 | } |
1313 | } | 1313 | } |
1314 | 1314 | ||
1315 | // other becomes empty | 1315 | // other becomes empty |
1316 | /*! | 1316 | /*! |
1317 | Transfers all DocLnk objects from \a other to this set. \a other becomes | 1317 | Transfers all DocLnk objects from \a other to this set. \a other becomes |
1318 | empty. | 1318 | empty. |
1319 | */ | 1319 | */ |
1320 | void DocLnkSet::appendFrom( DocLnkSet& other ) | 1320 | void DocLnkSet::appendFrom( DocLnkSet& other ) |
1321 | { | 1321 | { |
1322 | if ( &other == this ) | 1322 | if ( &other == this ) |
1323 | return; | 1323 | return; |
1324 | QListIterator<AppLnk> it( other.mApps ); | 1324 | QListIterator<AppLnk> it( other.mApps ); |
1325 | for ( ; it.current(); ) { | 1325 | for ( ; it.current(); ) { |
1326 | mApps.append(*it); | 1326 | mApps.append(*it); |
1327 | ++it; | 1327 | ++it; |
diff --git a/library/mimetype.cpp b/library/mimetype.cpp index 23de70b..ec45794 100644 --- a/library/mimetype.cpp +++ b/library/mimetype.cpp | |||
@@ -66,96 +66,97 @@ public: | |||
66 | return bigicon; | 66 | return bigicon; |
67 | } | 67 | } |
68 | 68 | ||
69 | private: | 69 | private: |
70 | void loadPixmaps() | 70 | void loadPixmaps() |
71 | { | 71 | { |
72 | if ( apps.count() ) { | 72 | if ( apps.count() ) { |
73 | QString icon; | 73 | QString icon; |
74 | for (AppLnk* lnk = apps.first(); icon.isNull() && lnk; lnk=apps.next()) { | 74 | for (AppLnk* lnk = apps.first(); icon.isNull() && lnk; lnk=apps.next()) { |
75 | QStringList icons = lnk->mimeTypeIcons(); | 75 | QStringList icons = lnk->mimeTypeIcons(); |
76 | if ( icons.count() ) { | 76 | if ( icons.count() ) { |
77 | QStringList types = lnk->mimeTypes(); | 77 | QStringList types = lnk->mimeTypes(); |
78 | for (QStringList::ConstIterator t=types.begin(),i=icons.begin(); t!=types.end() && i!=icons.end(); ++i,++t) { | 78 | for (QStringList::ConstIterator t=types.begin(),i=icons.begin(); t!=types.end() && i!=icons.end(); ++i,++t) { |
79 | if ( *t == id ) { | 79 | if ( *t == id ) { |
80 | icon = *i; | 80 | icon = *i; |
81 | break; | 81 | break; |
82 | } | 82 | } |
83 | } | 83 | } |
84 | } | 84 | } |
85 | } | 85 | } |
86 | if ( icon.isNull() ) { | 86 | if ( icon.isNull() ) { |
87 | AppLnk* lnk = apps.first(); | 87 | AppLnk* lnk = apps.first(); |
88 | regicon = lnk->pixmap(); | 88 | regicon = lnk->pixmap(); |
89 | bigicon = lnk->bigPixmap(); | 89 | bigicon = lnk->bigPixmap(); |
90 | } else { | 90 | } else { |
91 | QImage unscaledIcon = Resource::loadImage( icon ); | 91 | QImage unscaledIcon = Resource::loadImage( icon ); |
92 | regicon.convertFromImage( unscaledIcon.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); | 92 | regicon.convertFromImage( unscaledIcon.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); |
93 | bigicon.convertFromImage( unscaledIcon.smoothScale( AppLnk::bigIconSize(), AppLnk::bigIconSize() ) ); | 93 | bigicon.convertFromImage( unscaledIcon.smoothScale( AppLnk::bigIconSize(), AppLnk::bigIconSize() ) ); |
94 | } | 94 | } |
95 | } | 95 | } |
96 | } | 96 | } |
97 | 97 | ||
98 | QPixmap regicon; | 98 | QPixmap regicon; |
99 | QPixmap bigicon; | 99 | QPixmap bigicon; |
100 | QString desc; | 100 | QString desc; |
101 | }; | 101 | }; |
102 | 102 | ||
103 | class MimeType::Private : public QDict<MimeTypeData> { | 103 | class MimeType::Private : public QDict<MimeTypeData> { |
104 | public: | 104 | public: |
105 | Private() {} | 105 | Private() {} |
106 | ~Private() {} | 106 | ~Private() {} |
107 | 107 | ||
108 | // ... | 108 | // ... |
109 | }; | 109 | }; |
110 | 110 | ||
111 | MimeType::Private* MimeType::d=0; | 111 | MimeType::Private* MimeType::d=0; |
112 | static QMap<QString,QString> *typeFor = 0; | 112 | static QMap<QString,QString> *typeFor = 0; |
113 | static QMap<QString,QStringList> *extFor = 0; | 113 | static QMap<QString,QStringList> *extFor = 0; |
114 | static bool appsUpdated = FALSE; | ||
114 | 115 | ||
115 | MimeType::Private& MimeType::data() | 116 | MimeType::Private& MimeType::data() |
116 | { | 117 | { |
117 | if ( !d ) { | 118 | if ( !d ) { |
118 | d = new Private; | 119 | d = new Private; |
119 | d->setAutoDelete(TRUE); | 120 | d->setAutoDelete(TRUE); |
120 | static bool setCleanup = FALSE; | 121 | static bool setCleanup = FALSE; |
121 | if ( !setCleanup ) { | 122 | if ( !setCleanup ) { |
122 | qAddPostRoutine( cleanupMime ); | 123 | qAddPostRoutine( cleanupMime ); |
123 | setCleanup = TRUE; | 124 | setCleanup = TRUE; |
124 | } | 125 | } |
125 | } | 126 | } |
126 | return *d; | 127 | return *d; |
127 | } | 128 | } |
128 | 129 | ||
129 | /*! | 130 | /*! |
130 | \class MimeType mimetype.h | 131 | \class MimeType mimetype.h |
131 | \brief The MimeType class provides MIME type information. | 132 | \brief The MimeType class provides MIME type information. |
132 | 133 | ||
133 | A MimeType object is a light-weight value which | 134 | A MimeType object is a light-weight value which |
134 | provides information about a MIME type. | 135 | provides information about a MIME type. |
135 | 136 | ||
136 | \ingroup qtopiaemb | 137 | \ingroup qtopiaemb |
137 | */ | 138 | */ |
138 | 139 | ||
139 | /*! | 140 | /*! |
140 | Constructs a MimeType. | 141 | Constructs a MimeType. |
141 | Normally, \a ext_or_id is a MIME type, | 142 | Normally, \a ext_or_id is a MIME type, |
142 | but if \a ext_or_id starts with / or contains no /, | 143 | but if \a ext_or_id starts with / or contains no /, |
143 | it is interpretted as a filename and the | 144 | it is interpretted as a filename and the |
144 | extension (eg. .txt) is used as the | 145 | extension (eg. .txt) is used as the |
145 | MIME type. | 146 | MIME type. |
146 | */ | 147 | */ |
147 | MimeType::MimeType( const QString& ext_or_id ) | 148 | MimeType::MimeType( const QString& ext_or_id ) |
148 | { | 149 | { |
149 | init(ext_or_id); | 150 | init(ext_or_id); |
150 | } | 151 | } |
151 | 152 | ||
152 | /*! | 153 | /*! |
153 | Constructs a MimeType from the type() of \a lnk. | 154 | Constructs a MimeType from the type() of \a lnk. |
154 | */ | 155 | */ |
155 | MimeType::MimeType( const DocLnk& lnk ) | 156 | MimeType::MimeType( const DocLnk& lnk ) |
156 | { | 157 | { |
157 | init(lnk.type()); | 158 | init(lnk.type()); |
158 | } | 159 | } |
159 | 160 | ||
160 | /*! | 161 | /*! |
161 | Returns the MIME type identifier. | 162 | Returns the MIME type identifier. |
@@ -226,141 +227,144 @@ const AppLnk* MimeType::application() const | |||
226 | { | 227 | { |
227 | MimeTypeData* d = data(i); | 228 | MimeTypeData* d = data(i); |
228 | return d ? d->apps.first() : 0; | 229 | return d ? d->apps.first() : 0; |
229 | } | 230 | } |
230 | 231 | ||
231 | static QString serviceBinding(const QString& service) | 232 | static QString serviceBinding(const QString& service) |
232 | { | 233 | { |
233 | // Copied from qtopiaservices | 234 | // Copied from qtopiaservices |
234 | QString svrc = service; | 235 | QString svrc = service; |
235 | for (int i=0; i<(int)svrc.length(); i++) | 236 | for (int i=0; i<(int)svrc.length(); i++) |
236 | if ( svrc[i]=='/' ) svrc[i] = '-'; | 237 | if ( svrc[i]=='/' ) svrc[i] = '-'; |
237 | return "Service-"+svrc; | 238 | return "Service-"+svrc; |
238 | } | 239 | } |
239 | 240 | ||
240 | /*! | 241 | /*! |
241 | \internal | 242 | \internal |
242 | */ | 243 | */ |
243 | void MimeType::registerApp( const AppLnk& lnk ) | 244 | void MimeType::registerApp( const AppLnk& lnk ) |
244 | { | 245 | { |
245 | QStringList list = lnk.mimeTypes(); | 246 | QStringList list = lnk.mimeTypes(); |
246 | for (QStringList::ConstIterator it = list.begin(); it != list.end(); ++it) { | 247 | for (QStringList::ConstIterator it = list.begin(); it != list.end(); ++it) { |
247 | MimeTypeData* cur = data()[*it]; | 248 | MimeTypeData* cur = data()[*it]; |
248 | AppLnk* l = new AppLnk(lnk); | 249 | AppLnk* l = new AppLnk(lnk); |
249 | if ( !cur ) { | 250 | if ( !cur ) { |
250 | cur = new MimeTypeData( *it ); | 251 | cur = new MimeTypeData( *it ); |
251 | data().insert( *it, cur ); | 252 | data().insert( *it, cur ); |
252 | cur->apps.append(l); | 253 | cur->apps.append(l); |
253 | } else if ( cur->apps.count() ) { | 254 | } else if ( cur->apps.count() ) { |
254 | Config binding(serviceBinding("Open/"+*it)); | 255 | Config binding(serviceBinding("Open/"+*it)); |
255 | binding.setGroup("Service"); | 256 | binding.setGroup("Service"); |
256 | QString def = binding.readEntry("default"); | 257 | QString def = binding.readEntry("default"); |
257 | if ( l->exec() == def ) | 258 | if ( l->exec() == def ) |
258 | cur->apps.prepend(l); | 259 | cur->apps.prepend(l); |
259 | else | 260 | else |
260 | cur->apps.append(l); | 261 | cur->apps.append(l); |
261 | } else { | 262 | } else { |
262 | cur->apps.append(l); | 263 | cur->apps.append(l); |
263 | } | 264 | } |
264 | } | 265 | } |
265 | } | 266 | } |
266 | 267 | ||
267 | /*! | 268 | /*! |
268 | \internal | 269 | \internal |
269 | */ | 270 | */ |
270 | void MimeType::clear() | 271 | void MimeType::clear() |
271 | { | 272 | { |
272 | delete d; | 273 | delete d; |
273 | d = 0; | 274 | d = 0; |
275 | delete typeFor; typeFor = 0; | ||
276 | delete extFor ; extFor = 0; | ||
277 | appsUpdated = FALSE; | ||
274 | } | 278 | } |
275 | 279 | ||
276 | void MimeType::loadExtensions() | 280 | void MimeType::loadExtensions() |
277 | { | 281 | { |
278 | if ( !typeFor ) { | 282 | if ( !typeFor ) { |
279 | extFor = new QMap<QString,QStringList>; | 283 | extFor = new QMap<QString,QStringList>; |
280 | typeFor = new QMap<QString,QString>; | 284 | typeFor = new QMap<QString,QString>; |
281 | loadExtensions("/etc/mime.types"); | 285 | loadExtensions("/etc/mime.types"); |
282 | loadExtensions(QPEApplication::qpeDir()+"etc/mime.types"); | 286 | loadExtensions(QPEApplication::qpeDir()+"etc/mime.types"); |
283 | } | 287 | } |
284 | } | 288 | } |
285 | 289 | ||
286 | void MimeType::loadExtensions(const QString& filename) | 290 | void MimeType::loadExtensions(const QString& filename) |
287 | { | 291 | { |
288 | QFile file(filename); | 292 | QFile file(filename); |
289 | if ( file.open(IO_ReadOnly) ) { | 293 | if ( file.open(IO_ReadOnly) ) { |
290 | QTextStream in(&file); | 294 | QTextStream in(&file); |
291 | QRegExp space("[ \t]+"); | 295 | QRegExp space("[ \t]+"); |
292 | while (!in.atEnd()) { | 296 | while (!in.atEnd()) { |
293 | QStringList tokens = QStringList::split(space, in.readLine()); | 297 | QStringList tokens = QStringList::split(space, in.readLine()); |
294 | QStringList::ConstIterator it = tokens.begin(); | 298 | QStringList::ConstIterator it = tokens.begin(); |
295 | if ( it != tokens.end() ) { | 299 | if ( it != tokens.end() ) { |
296 | QString id = *it; ++it; | 300 | QString id = *it; ++it; |
297 | // new override old (though left overrides right) | 301 | // new override old (though left overrides right) |
298 | QStringList exts = (*extFor)[id]; | 302 | QStringList exts = (*extFor)[id]; |
299 | QStringList newexts; | 303 | QStringList newexts; |
300 | while ( it != tokens.end() ) { | 304 | while ( it != tokens.end() ) { |
301 | exts.remove(*it); | 305 | exts.remove(*it); |
302 | if ( !newexts.contains(*it) ) | 306 | if ( !newexts.contains(*it) ) |
303 | newexts.append(*it); | 307 | newexts.append(*it); |
304 | (*typeFor)[*it] = id; | 308 | (*typeFor)[*it] = id; |
305 | ++it; | 309 | ++it; |
306 | } | 310 | } |
307 | (*extFor)[id] = newexts + exts; | 311 | (*extFor)[id] = newexts + exts; |
308 | } | 312 | } |
309 | } | 313 | } |
310 | } | 314 | } |
311 | } | 315 | } |
312 | 316 | ||
313 | void MimeType::init( const QString& ext_or_id ) | 317 | void MimeType::init( const QString& ext_or_id ) |
314 | { | 318 | { |
315 | if ( ext_or_id[0] != '/' && ext_or_id.contains('/') ) { | 319 | if ( ext_or_id[0] != '/' && ext_or_id.contains('/') ) { |
316 | i = ext_or_id.lower(); | 320 | i = ext_or_id.lower(); |
317 | } else { | 321 | } else { |
318 | loadExtensions(); | 322 | loadExtensions(); |
319 | int dot = ext_or_id.findRev('.'); | 323 | int dot = ext_or_id.findRev('.'); |
320 | QString ext = dot >= 0 ? ext_or_id.mid(dot+1) : ext_or_id; | 324 | QString ext = dot >= 0 ? ext_or_id.mid(dot+1) : ext_or_id; |
321 | i = (*typeFor)[ext.lower()]; | 325 | i = (*typeFor)[ext.lower()]; |
322 | if ( i.isNull() ) | 326 | if ( i.isNull() ) |
323 | i = "application/octet-stream"; | 327 | i = "application/octet-stream"; |
324 | } | 328 | } |
325 | static bool appsUpdated = FALSE; | 329 | |
326 | if ( !appsUpdated ) { | 330 | if ( !appsUpdated ) { |
327 | appsUpdated = TRUE; | ||
328 | updateApplications(); | 331 | updateApplications(); |
329 | } | 332 | } |
330 | } | 333 | } |
331 | 334 | ||
332 | MimeTypeData* MimeType::data(const QString& id) | 335 | MimeTypeData* MimeType::data(const QString& id) |
333 | { | 336 | { |
334 | MimeTypeData* d = data()[id]; | 337 | MimeTypeData* d = data()[id]; |
335 | if ( !d ) { | 338 | if ( !d ) { |
336 | int s = id.find('/'); | 339 | int s = id.find('/'); |
337 | QString idw = id.left(s)+"/*"; | 340 | QString idw = id.left(s)+"/*"; |
338 | d = data()[idw]; | 341 | d = data()[idw]; |
339 | } | 342 | } |
340 | return d; | 343 | return d; |
341 | } | 344 | } |
342 | 345 | ||
343 | /*! | 346 | /*! |
344 | Returns a Qtopia folder containing application definitions. | 347 | Returns a Qtopia folder containing application definitions. |
345 | */ | 348 | */ |
346 | QString MimeType::appsFolderName() | 349 | QString MimeType::appsFolderName() |
347 | { | 350 | { |
348 | return QPEApplication::qpeDir() + "apps"; | 351 | return QPEApplication::qpeDir() + "apps"; |
349 | } | 352 | } |
350 | 353 | ||
351 | /*! | 354 | /*! |
352 | Reloads application definitions. | 355 | Reloads application definitions. |
353 | */ | 356 | */ |
354 | void MimeType::updateApplications() | 357 | void MimeType::updateApplications() |
355 | { | 358 | { |
356 | clear(); | 359 | // clear(); |
360 | appsUpdated = true; | ||
357 | AppLnkSet apps( appsFolderName() ); | 361 | AppLnkSet apps( appsFolderName() ); |
358 | updateApplications(&apps); | 362 | updateApplications(&apps); |
359 | } | 363 | } |
360 | 364 | ||
361 | void MimeType::updateApplications(AppLnkSet* folder) | 365 | void MimeType::updateApplications(AppLnkSet* folder) |
362 | { | 366 | { |
363 | for ( QListIterator<AppLnk> it( folder->children() ); it.current(); ++it ) { | 367 | for ( QListIterator<AppLnk> it( folder->children() ); it.current(); ++it ) { |
364 | registerApp(*it.current()); | 368 | registerApp(*it.current()); |
365 | } | 369 | } |
366 | } | 370 | } |