Diffstat (limited to 'core/launcher/documentlist.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/launcher/documentlist.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/core/launcher/documentlist.cpp b/core/launcher/documentlist.cpp index 9736e65..39dc7c9 100644 --- a/core/launcher/documentlist.cpp +++ b/core/launcher/documentlist.cpp | |||
@@ -1,45 +1,46 @@ | |||
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 | 23 | ||
23 | #include <opie2/oglobal.h> | 24 | #include <opie2/oglobal.h> |
24 | 25 | ||
25 | #include <qtopia/config.h> | 26 | #include <qtopia/config.h> |
26 | #include <qtopia/mimetype.h> | 27 | #include <qtopia/mimetype.h> |
27 | #include <qtopia/resource.h> | 28 | #include <qtopia/resource.h> |
28 | #include <qtopia/private/categories.h> | 29 | #include <qtopia/private/categories.h> |
29 | #include <qtopia/qpeapplication.h> | 30 | #include <qtopia/qpeapplication.h> |
30 | #include <qtopia/applnk.h> | 31 | #include <qtopia/applnk.h> |
31 | #include <qtopia/storage.h> | 32 | #include <qtopia/storage.h> |
32 | #ifdef Q_WS_QWS | 33 | #ifdef Q_WS_QWS |
33 | #include <qtopia/qcopenvelope_qws.h> | 34 | #include <qtopia/qcopenvelope_qws.h> |
34 | #endif | 35 | #endif |
35 | 36 | ||
36 | #include <qtimer.h> | 37 | #include <qtimer.h> |
37 | #include <qfileinfo.h> | 38 | #include <qfileinfo.h> |
38 | #include <qtextstream.h> | 39 | #include <qtextstream.h> |
39 | #include <qfile.h> | 40 | #include <qfile.h> |
40 | #include <qdir.h> | 41 | #include <qdir.h> |
41 | #include <qpainter.h> | 42 | #include <qpainter.h> |
42 | #include <qimage.h> | 43 | #include <qimage.h> |
43 | #include <qcopchannel_qws.h> | 44 | #include <qcopchannel_qws.h> |
44 | #include <qlistview.h> | 45 | #include <qlistview.h> |
45 | #include <qlist.h> | 46 | #include <qlist.h> |
@@ -413,52 +414,52 @@ DocumentListPrivate::DocumentListPrivate( ServerInterface *gui ) | |||
413 | { | 414 | { |
414 | storage = new StorageInfo( this ); | 415 | storage = new StorageInfo( this ); |
415 | serverGui = gui; | 416 | serverGui = gui; |
416 | if ( serverGui ) { | 417 | if ( serverGui ) { |
417 | sendAppLnks = serverGui->requiresApplications(); | 418 | sendAppLnks = serverGui->requiresApplications(); |
418 | sendDocLnks = serverGui->requiresDocuments(); | 419 | sendDocLnks = serverGui->requiresDocuments(); |
419 | } else { | 420 | } else { |
420 | sendAppLnks = false; | 421 | sendAppLnks = false; |
421 | sendDocLnks = false; | 422 | sendDocLnks = false; |
422 | } | 423 | } |
423 | for ( int i = 0; i < MAX_SEARCH_DEPTH; i++ ) { | 424 | for ( int i = 0; i < MAX_SEARCH_DEPTH; i++ ) { |
424 | listDirs[i] = 0; | 425 | listDirs[i] = 0; |
425 | lists[i] = 0; | 426 | lists[i] = 0; |
426 | listPositions[i] = 0; | 427 | listPositions[i] = 0; |
427 | } | 428 | } |
428 | initialize(); | 429 | initialize(); |
429 | tid = 0; | 430 | tid = 0; |
430 | } | 431 | } |
431 | 432 | ||
432 | void DocumentListPrivate::appendDocpath(FileSystem*fs) | 433 | void DocumentListPrivate::appendDocpath(FileSystem*fs) |
433 | { | 434 | { |
434 | QDir defPath(fs->path()+"/Documents"); | 435 | QDir defPath(fs->path()+"/Documents"); |
435 | QFileInfo f(fs->path()+"/.opiestorage.cf"); | 436 | QFileInfo f(fs->path()+"/.opiestorage.cf"); |
436 | if (!f.exists()) { | 437 | if (!f.exists()) { |
437 | if (defPath.exists()) { | 438 | Mediadlg dlg(fs); |
438 | docPaths+=defPath.path(); | 439 | if (QDialog::Accepted != QPEApplication::execDialog( &dlg )) { |
440 | return; | ||
439 | } | 441 | } |
440 | return; | ||
441 | } | 442 | } |
442 | Config conf(f.filePath(), Config::File ); | 443 | Config conf(f.filePath(), Config::File ); |
443 | conf.setGroup("subdirs"); | 444 | conf.setGroup("subdirs"); |
444 | bool read_all = conf.readBoolEntry("wholemedia",true); | 445 | bool read_all = conf.readBoolEntry("wholemedia",true); |
445 | if (read_all) { | 446 | if (read_all) { |
446 | docPaths+=fs->path(); | 447 | docPaths+=fs->path(); |
447 | return; | 448 | return; |
448 | } | 449 | } |
449 | QStringList subDirs = conf.readListEntry("subdirs",':'); | 450 | QStringList subDirs = conf.readListEntry("subdirs",':'); |
450 | if (subDirs.isEmpty()) { | 451 | if (subDirs.isEmpty()) { |
451 | if (defPath.exists()) { | 452 | if (defPath.exists()) { |
452 | docPaths+=defPath.path(); | 453 | docPaths+=defPath.path(); |
453 | } | 454 | } |
454 | return; | 455 | return; |
455 | } | 456 | } |
456 | for (unsigned c = 0; c < subDirs.count();++c) { | 457 | for (unsigned c = 0; c < subDirs.count();++c) { |
457 | QDir docDir(QString(fs->path()+"/"+subDirs[c])); | 458 | QDir docDir(QString(fs->path()+"/"+subDirs[c])); |
458 | if (docDir.exists()) { | 459 | if (docDir.exists()) { |
459 | docPaths+=docDir.path(); | 460 | docPaths+=docDir.path(); |
460 | } | 461 | } |
461 | } | 462 | } |
462 | } | 463 | } |
463 | 464 | ||
464 | void DocumentListPrivate::initialize() | 465 | void DocumentListPrivate::initialize() |