-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | core/launcher/documentlist.cpp | 4 |
2 files changed, 5 insertions, 2 deletions
@@ -1,107 +1,108 @@ | |||
1 | 2005-??-??Opie 1.2.0 | 1 | 2005-??-??Opie 1.2.0 |
2 | 2 | ||
3 | New Features | 3 | New Features |
4 | ------------ | 4 | ------------ |
5 | * Number of icon columns in Launcher is customizable through Launcher.conf (hrw,zecke,mickeyl) | 5 | * Number of icon columns in Launcher is customizable through Launcher.conf (hrw,zecke,mickeyl) |
6 | * Number of icon columns in Launcher is customizable through LauncherSettings (mickeyl) | 6 | * Number of icon columns in Launcher is customizable through LauncherSettings (mickeyl) |
7 | 7 | ||
8 | Fixed Bugs | 8 | Fixed Bugs |
9 | ---------- | 9 | ---------- |
10 | * #1501 - Fixed bug in todo sql backend (eilers) | 10 | * #1501 - Fixed bug in todo sql backend (eilers) |
11 | * n.a - Removed hard coded font sizes in a couple of inputmethods (mickeyl) | 11 | * n.a. - Removed hard coded font sizes in a couple of inputmethods (mickeyl) |
12 | * n.a. - Removed MediumDlg appearing prior to FirstUsage wizard (i.e. calibration) (mickeyl) | ||
12 | 13 | ||
13 | Internal | 14 | Internal |
14 | -------- | 15 | -------- |
15 | * Added the Qtopia 1.7 SDK macros for quick-apps to easa compilation of 3rd party apps against our headers (mickeyl) | 16 | * Added the Qtopia 1.7 SDK macros for quick-apps to easa compilation of 3rd party apps against our headers (mickeyl) |
16 | 17 | ||
17 | 2004-11-26Opie 1.1.8 | 18 | 2004-11-26Opie 1.1.8 |
18 | 19 | ||
19 | New Features | 20 | New Features |
20 | ------------ | 21 | ------------ |
21 | * PackageManager supports installation of local ipkg files (drw) | 22 | * PackageManager supports installation of local ipkg files (drw) |
22 | * PackageManager supports linking of applications to root (drw) | 23 | * PackageManager supports linking of applications to root (drw) |
23 | * PackageManager supports src/gz feeds (drw,wimpie) | 24 | * PackageManager supports src/gz feeds (drw,wimpie) |
24 | * Added a syslog information tab to sysinfo (mickeyl) | 25 | * Added a syslog information tab to sysinfo (mickeyl) |
25 | * Added new, more consistent, PIM icons + a GIMP teplate (ar) | 26 | * Added new, more consistent, PIM icons + a GIMP teplate (ar) |
26 | 27 | ||
27 | Fixed Bugs | 28 | Fixed Bugs |
28 | ---------- | 29 | ---------- |
29 | * #1017 - Tetrix doesn't display correctly for high resolution screens (drw) | 30 | * #1017 - Tetrix doesn't display correctly for high resolution screens (drw) |
30 | * #1269 - VCards were imported into personal area if it was activated (eilers) | 31 | * #1269 - VCards were imported into personal area if it was activated (eilers) |
31 | * #1464 - Packagemanager dont set active filter after install a package (drw) | 32 | * #1464 - Packagemanager dont set active filter after install a package (drw) |
32 | * #1479 - Improved VCard-Parser to import VCards created by Evolution 2 and Apple Addressbook (eilers) | 33 | * #1479 - Improved VCard-Parser to import VCards created by Evolution 2 and Apple Addressbook (eilers) |
33 | * #1493 - Fixed one column layout bug of the launcher (hrw) | 34 | * #1493 - Fixed one column layout bug of the launcher (hrw) |
34 | * n.a. - PackageManager - (Minor UI tweak) in filter dialog, when option is enabled, set focus to widget that corresponds to that option (drw) | 35 | * n.a. - PackageManager - (Minor UI tweak) in filter dialog, when option is enabled, set focus to widget that corresponds to that option (drw) |
35 | * n.a. - PackageManager - (Minor UI tweak) fix double entry in source feed configuration when adding a new feed (drw) | 36 | * n.a. - PackageManager - (Minor UI tweak) fix double entry in source feed configuration when adding a new feed (drw) |
36 | * n.a. - Battery Applet - fix sizing of battery info popup (drw,mickeyl) | 37 | * n.a. - Battery Applet - fix sizing of battery info popup (drw,mickeyl) |
37 | 38 | ||
38 | Internal | 39 | Internal |
39 | -------- | 40 | -------- |
40 | * Moved libopie1 to unsupported (mickeyl) | 41 | * Moved libopie1 to unsupported (mickeyl) |
41 | * Implemented generic queryByExample() with incremental searching. A lot of internal changes of the Pim2-library (eilers) | 42 | * Implemented generic queryByExample() with incremental searching. A lot of internal changes of the Pim2-library (eilers) |
42 | * Added fast and full featured and incremental sorted() for SQL addressbook backend (eilers) | 43 | * Added fast and full featured and incremental sorted() for SQL addressbook backend (eilers) |
43 | 44 | ||
44 | 2004-11-14Opie 1.1.7 | 45 | 2004-11-14Opie 1.1.7 |
45 | 46 | ||
46 | New Features | 47 | New Features |
47 | ------------ | 48 | ------------ |
48 | * libOpieDB now uses SQLite V3 instead V2. Remember to upgrade your database files! (eilers) | 49 | * libOpieDB now uses SQLite V3 instead V2. Remember to upgrade your database files! (eilers) |
49 | * Backup now uses the busy indicator when backing up and restore (ar) | 50 | * Backup now uses the busy indicator when backing up and restore (ar) |
50 | * OpiePlayer2 gained adding of Directories to the playlist (zecke) | 51 | * OpiePlayer2 gained adding of Directories to the playlist (zecke) |
51 | * OpiePlayer2 better error handling (zecke) | 52 | * OpiePlayer2 better error handling (zecke) |
52 | * OpiePlayer2 progress indication while streaming (zecke) | 53 | * OpiePlayer2 progress indication while streaming (zecke) |
53 | * OpiePlayer2 ported to use libxine 1.0.0-rc6a (brad,zecke) | 54 | * OpiePlayer2 ported to use libxine 1.0.0-rc6a (brad,zecke) |
54 | * Ported brightnessapplet from Qtopia 1.7 (mickeyl) | 55 | * Ported brightnessapplet from Qtopia 1.7 (mickeyl) |
55 | * Opie-Eye got a Digital Camera File Backend (alwin,zecke) | 56 | * Opie-Eye got a Digital Camera File Backend (alwin,zecke) |
56 | * Support for Tuxpad1 of Tradesquare.NL (mickeyl,zecke) | 57 | * Support for Tuxpad1 of Tradesquare.NL (mickeyl,zecke) |
57 | * Opie-Console use Custom Font and Size in a Profile (harlekin) | 58 | * Opie-Console use Custom Font and Size in a Profile (harlekin) |
58 | * Opie-Console transparently log the Output and Input to a file (harlekin) | 59 | * Opie-Console transparently log the Output and Input to a file (harlekin) |
59 | * Added new O-menu icon to lock the PDA immediately: opie-lockapplet (clem) | 60 | * Added new O-menu icon to lock the PDA immediately: opie-lockapplet (clem) |
60 | * Opie-Security now hides the plugin-based authentication tabs if no auth. plugin package is installed (clem) | 61 | * Opie-Security now hides the plugin-based authentication tabs if no auth. plugin package is installed (clem) |
61 | * Opie-Security gained a 'test authentication' button (clem) | 62 | * Opie-Security gained a 'test authentication' button (clem) |
62 | * Opie-Eye got a more unique layout (menubar), a slideshow, user can setup some defaults | 63 | * Opie-Eye got a more unique layout (menubar), a slideshow, user can setup some defaults |
63 | * Opie-Mail improve the handling of POP mail boxes (alwin) | 64 | * Opie-Mail improve the handling of POP mail boxes (alwin) |
64 | * Both Opie-Eye and Opie-Mail were greatly improved due the hard work of Rajko Albrecht(alwin) | 65 | * Both Opie-Eye and Opie-Mail were greatly improved due the hard work of Rajko Albrecht(alwin) |
65 | * Opie IRC - backports of the 'NeIRC fork' (zecke) | 66 | * Opie IRC - backports of the 'NeIRC fork' (zecke) |
66 | 67 | ||
67 | Fixed Bugs | 68 | Fixed Bugs |
68 | ---------- | 69 | ---------- |
69 | * #501 - Pickboard is able to show 'Umlaute' (TT,zecke) | 70 | * #501 - Pickboard is able to show 'Umlaute' (TT,zecke) |
70 | * #608 - Make Opie usable for left handed users (zecke) | 71 | * #608 - Make Opie usable for left handed users (zecke) |
71 | * #957 - Import of VCards/VTodos/VEvents with BASE64 encoding (ljp,zecke) | 72 | * #957 - Import of VCards/VTodos/VEvents with BASE64 encoding (ljp,zecke) |
72 | * #1245 - Opie-Go 'paused' (zecke) | 73 | * #1245 - Opie-Go 'paused' (zecke) |
73 | * #1358 - DocTab didn't show any MimeTypes (was fixed earlier) (zecke) | 74 | * #1358 - DocTab didn't show any MimeTypes (was fixed earlier) (zecke) |
74 | * #1380 - QDateBookAccess::remove() doesn't remove entries (eilers, zecke) | 75 | * #1380 - QDateBookAccess::remove() doesn't remove entries (eilers, zecke) |
75 | * #1395 - Build VNC Backend with gcc3.4 | 76 | * #1395 - Build VNC Backend with gcc3.4 |
76 | * #1440 - The icon of opie-mobilemsg is missing (CoreDump) | 77 | * #1440 - The icon of opie-mobilemsg is missing (CoreDump) |
77 | * #1426 - Add missing opie-bartender Icon (CoreDump) | 78 | * #1426 - Add missing opie-bartender Icon (CoreDump) |
78 | * #1445 - Opie-Sheet Has No Icon (CoreDump) | 79 | * #1445 - Opie-Sheet Has No Icon (CoreDump) |
79 | * #1448 - Brightness Applet added (mickeyl) | 80 | * #1448 - Brightness Applet added (mickeyl) |
80 | * #1450 - ZSame didn't clear the bonus item after winning a game (zecke) | 81 | * #1450 - ZSame didn't clear the bonus item after winning a game (zecke) |
81 | * #1482 - Fix OFileSelector to be able to sort by size (zecke) | 82 | * #1482 - Fix OFileSelector to be able to sort by size (zecke) |
82 | * n.a. - Opie-mail: fixed some crasher, some layout-problems | 83 | * n.a. - Opie-mail: fixed some crasher, some layout-problems |
83 | * n.a. - Converted applications to not hardcode /opt/QtPalmtop but to use QPEApplication::qpeDir (zecke) | 84 | * n.a. - Converted applications to not hardcode /opt/QtPalmtop but to use QPEApplication::qpeDir (zecke) |
84 | * n.a. - Converted usage of qpeDir() not to include a '/' as first charachter of the string (zecke) | 85 | * n.a. - Converted usage of qpeDir() not to include a '/' as first charachter of the string (zecke) |
85 | * n.a. - Build system: Enable distcc and ccache when crosscompiling too, and use them everywhere we can (clem) | 86 | * n.a. - Build system: Enable distcc and ccache when crosscompiling too, and use them everywhere we can (clem) |
86 | * n.a. - Build system: Fix deps in several config.in (and fix scripts/deps.pl too) to stop breaking builds, especially with make -j highNumber (clem) | 87 | * n.a. - Build system: Fix deps in several config.in (and fix scripts/deps.pl too) to stop breaking builds, especially with make -j highNumber (clem) |
87 | * n.a. - Removed hardcoded icon size in a couple of applets (mickeyl) | 88 | * n.a. - Removed hardcoded icon size in a couple of applets (mickeyl) |
88 | 89 | ||
89 | Internal | 90 | Internal |
90 | -------- | 91 | -------- |
91 | * Opie-Qashmoney has been moved to unsupported (mickeyl) | 92 | * Opie-Qashmoney has been moved to unsupported (mickeyl) |
92 | * Opie-Ubrowser has been moved to unsupported (mickeyl) | 93 | * Opie-Ubrowser has been moved to unsupported (mickeyl) |
93 | 94 | ||
94 | 2004-09-17Opie 1.1.6 | 95 | 2004-09-17Opie 1.1.6 |
95 | 96 | ||
96 | New Features | 97 | New Features |
97 | ------------ | 98 | ------------ |
98 | * Fifteen gained configurable number of items (zecke) | 99 | * Fifteen gained configurable number of items (zecke) |
99 | * Fifteen can have custom background images (zecke) | 100 | * Fifteen can have custom background images (zecke) |
100 | * Added daemonizing capabilities to QWS Server [via Qt/Embedded] (mickeyl) | 101 | * Added daemonizing capabilities to QWS Server [via Qt/Embedded] (mickeyl) |
101 | * Integrated the new security framework into libopie2 (zecke,clem) | 102 | * Integrated the new security framework into libopie2 (zecke,clem) |
102 | * Converted the launcher to use the new security framework (zecke) | 103 | * Converted the launcher to use the new security framework (zecke) |
103 | * Backup can now handle custom locations for backup and restore (ar) | 104 | * Backup can now handle custom locations for backup and restore (ar) |
104 | * Implemented right-on-hold feedback (wimpie,zecke) | 105 | * Implemented right-on-hold feedback (wimpie,zecke) |
105 | * Lots of new features in opie-reader (tim,pohly) | 106 | * Lots of new features in opie-reader (tim,pohly) |
106 | * Build system cleanups (schurig) | 107 | * Build system cleanups (schurig) |
107 | 108 | ||
diff --git a/core/launcher/documentlist.cpp b/core/launcher/documentlist.cpp index 9781a32..d2b9afa 100644 --- a/core/launcher/documentlist.cpp +++ b/core/launcher/documentlist.cpp | |||
@@ -453,195 +453,197 @@ void DocumentList::sendAllDocLinks() | |||
453 | QString contents; | 453 | QString contents; |
454 | Categories cats; | 454 | Categories cats; |
455 | for ( QListIterator<DocLnk> it( d->dls.children() ); it.current(); ++it ) { | 455 | for ( QListIterator<DocLnk> it( d->dls.children() ); it.current(); ++it ) { |
456 | DocLnk *doc = it.current(); | 456 | DocLnk *doc = it.current(); |
457 | QFileInfo fi( doc->file() ); | 457 | QFileInfo fi( doc->file() ); |
458 | if ( !fi.exists() ) | 458 | if ( !fi.exists() ) |
459 | continue; | 459 | continue; |
460 | 460 | ||
461 | bool fake = !doc->linkFileKnown(); | 461 | bool fake = !doc->linkFileKnown(); |
462 | if ( !fake ) { | 462 | if ( !fake ) { |
463 | QFile f( doc->linkFile() ); | 463 | QFile f( doc->linkFile() ); |
464 | if ( f.open( IO_ReadOnly ) ) { | 464 | if ( f.open( IO_ReadOnly ) ) { |
465 | QTextStream ts( &f ); | 465 | QTextStream ts( &f ); |
466 | ts.setEncoding( QTextStream::UnicodeUTF8 ); | 466 | ts.setEncoding( QTextStream::UnicodeUTF8 ); |
467 | QString docLnk = ts.read(); | 467 | QString docLnk = ts.read(); |
468 | // Strip out the (stale) LinkFile entry | 468 | // Strip out the (stale) LinkFile entry |
469 | int start = docLnk.find( "\nLinkFile = " ) + 1; | 469 | int start = docLnk.find( "\nLinkFile = " ) + 1; |
470 | if ( start > 0 ) { | 470 | if ( start > 0 ) { |
471 | int end = docLnk.find( "\n", start + 1 ) + 1; | 471 | int end = docLnk.find( "\n", start + 1 ) + 1; |
472 | contents += docLnk.left(start); | 472 | contents += docLnk.left(start); |
473 | contents += docLnk.mid(end); | 473 | contents += docLnk.mid(end); |
474 | } else { | 474 | } else { |
475 | contents += docLnk; | 475 | contents += docLnk; |
476 | } | 476 | } |
477 | contents += "LinkFile = " + doc->linkFile() + "\n"; | 477 | contents += "LinkFile = " + doc->linkFile() + "\n"; |
478 | 478 | ||
479 | f.close(); | 479 | f.close(); |
480 | } else | 480 | } else |
481 | fake = TRUE; | 481 | fake = TRUE; |
482 | } | 482 | } |
483 | if (fake) { | 483 | if (fake) { |
484 | contents += "[Desktop Entry]\n"; // No tr | 484 | contents += "[Desktop Entry]\n"; // No tr |
485 | contents += "Categories = " + // No tr | 485 | contents += "Categories = " + // No tr |
486 | cats.labels("Document View",doc->categories()).join(";") + "\n"; // No tr | 486 | cats.labels("Document View",doc->categories()).join(";") + "\n"; // No tr |
487 | contents += "Name = "+doc->name()+"\n"; // No tr | 487 | contents += "Name = "+doc->name()+"\n"; // No tr |
488 | contents += "Type = "+doc->type()+"\n"; // No tr | 488 | contents += "Type = "+doc->type()+"\n"; // No tr |
489 | } | 489 | } |
490 | contents += "File = "+doc->file()+"\n"; // No tr // (resolves path) | 490 | contents += "File = "+doc->file()+"\n"; // No tr // (resolves path) |
491 | contents += QString("Size = %1\n").arg( fi.size() ); // No tr | 491 | contents += QString("Size = %1\n").arg( fi.size() ); // No tr |
492 | } | 492 | } |
493 | 493 | ||
494 | //odebug << "sending length " << contents.length() << "" << oendl; | 494 | //odebug << "sending length " << contents.length() << "" << oendl; |
495 | #ifndef QT_NO_COP | 495 | #ifndef QT_NO_COP |
496 | QCopEnvelope e( "QPE/Desktop", "docLinks(QString)" ); | 496 | QCopEnvelope e( "QPE/Desktop", "docLinks(QString)" ); |
497 | e << contents; | 497 | e << contents; |
498 | #endif | 498 | #endif |
499 | //odebug << "================ \n\n" << contents << "\n\n===============" << oendl; | 499 | //odebug << "================ \n\n" << contents << "\n\n===============" << oendl; |
500 | 500 | ||
501 | d->needToSendAllDocLinks = false; | 501 | d->needToSendAllDocLinks = false; |
502 | } | 502 | } |
503 | 503 | ||
504 | 504 | ||
505 | 505 | ||
506 | 506 | ||
507 | 507 | ||
508 | 508 | ||
509 | 509 | ||
510 | 510 | ||
511 | 511 | ||
512 | 512 | ||
513 | 513 | ||
514 | 514 | ||
515 | 515 | ||
516 | 516 | ||
517 | 517 | ||
518 | 518 | ||
519 | 519 | ||
520 | 520 | ||
521 | 521 | ||
522 | 522 | ||
523 | 523 | ||
524 | 524 | ||
525 | 525 | ||
526 | 526 | ||
527 | DocumentListPrivate::DocumentListPrivate( ServerInterface *gui ) | 527 | DocumentListPrivate::DocumentListPrivate( ServerInterface *gui ) |
528 | { | 528 | { |
529 | storage = new StorageInfo( this ); | 529 | storage = new StorageInfo( this ); |
530 | serverGui = gui; | 530 | serverGui = gui; |
531 | if ( serverGui ) { | 531 | if ( serverGui ) { |
532 | sendAppLnks = serverGui->requiresApplications(); | 532 | sendAppLnks = serverGui->requiresApplications(); |
533 | sendDocLnks = serverGui->requiresDocuments(); | 533 | sendDocLnks = serverGui->requiresDocuments(); |
534 | } else { | 534 | } else { |
535 | sendAppLnks = false; | 535 | sendAppLnks = false; |
536 | sendDocLnks = false; | 536 | sendDocLnks = false; |
537 | } | 537 | } |
538 | for ( int i = 0; i < MAX_SEARCH_DEPTH; i++ ) { | 538 | for ( int i = 0; i < MAX_SEARCH_DEPTH; i++ ) { |
539 | listDirs[i] = 0; | 539 | listDirs[i] = 0; |
540 | lists[i] = 0; | 540 | lists[i] = 0; |
541 | listPositions[i] = 0; | 541 | listPositions[i] = 0; |
542 | } | 542 | } |
543 | initialize(); | 543 | initialize(); |
544 | tid = 0; | 544 | tid = 0; |
545 | } | 545 | } |
546 | 546 | ||
547 | void DocumentListPrivate::appendDocpath(FileSystem*fs) | 547 | void DocumentListPrivate::appendDocpath(FileSystem*fs) |
548 | { | 548 | { |
549 | Config c( "qpe" ); | ||
550 | c.setGroup( "Startup" ); | ||
549 | QDir defPath(fs->path()+"/Documents"); | 551 | QDir defPath(fs->path()+"/Documents"); |
550 | QFileInfo f(fs->path()+"/.opiestorage.cf"); | 552 | QFileInfo f(fs->path()+"/.opiestorage.cf"); |
551 | if (!f.exists()) { | 553 | if ( c.readNumEntry( "FirstUse", 42 ) == 0 && !f.exists()) { |
552 | Mediadlg dlg(fs); | 554 | Mediadlg dlg(fs); |
553 | if (QDialog::Accepted != QPEApplication::execDialog( &dlg )) { | 555 | if (QDialog::Accepted != QPEApplication::execDialog( &dlg )) { |
554 | return; | 556 | return; |
555 | } | 557 | } |
556 | } | 558 | } |
557 | Config conf(f.filePath(), Config::File ); | 559 | Config conf(f.filePath(), Config::File ); |
558 | conf.setGroup("main"); | 560 | conf.setGroup("main"); |
559 | if (!conf.readBoolEntry("check",false)) { | 561 | if (!conf.readBoolEntry("check",false)) { |
560 | return; | 562 | return; |
561 | } | 563 | } |
562 | conf.setGroup("subdirs"); | 564 | conf.setGroup("subdirs"); |
563 | bool read_all = conf.readBoolEntry("wholemedia",true); | 565 | bool read_all = conf.readBoolEntry("wholemedia",true); |
564 | if (read_all) { | 566 | if (read_all) { |
565 | docPaths+=fs->path(); | 567 | docPaths+=fs->path(); |
566 | return; | 568 | return; |
567 | } | 569 | } |
568 | QStringList subDirs = conf.readListEntry("subdirs",':'); | 570 | QStringList subDirs = conf.readListEntry("subdirs",':'); |
569 | if (subDirs.isEmpty()) { | 571 | if (subDirs.isEmpty()) { |
570 | if (defPath.exists()) { | 572 | if (defPath.exists()) { |
571 | docPaths+=defPath.path(); | 573 | docPaths+=defPath.path(); |
572 | } | 574 | } |
573 | return; | 575 | return; |
574 | } | 576 | } |
575 | for (unsigned c = 0; c < subDirs.count();++c) { | 577 | for (unsigned c = 0; c < subDirs.count();++c) { |
576 | QDir docDir(QString(fs->path()+"/"+subDirs[c])); | 578 | QDir docDir(QString(fs->path()+"/"+subDirs[c])); |
577 | if (docDir.exists()) { | 579 | if (docDir.exists()) { |
578 | docPaths+=docDir.path(); | 580 | docPaths+=docDir.path(); |
579 | } | 581 | } |
580 | } | 582 | } |
581 | } | 583 | } |
582 | 584 | ||
583 | void DocumentListPrivate::initialize() | 585 | void DocumentListPrivate::initialize() |
584 | { | 586 | { |
585 | // Reset | 587 | // Reset |
586 | dls.clear(); | 588 | dls.clear(); |
587 | docPaths.clear(); | 589 | docPaths.clear(); |
588 | reference.clear(); | 590 | reference.clear(); |
589 | 591 | ||
590 | QDir docDir( QPEApplication::documentDir() ); | 592 | QDir docDir( QPEApplication::documentDir() ); |
591 | if ( docDir.exists() ) | 593 | if ( docDir.exists() ) |
592 | docPaths += QPEApplication::documentDir(); | 594 | docPaths += QPEApplication::documentDir(); |
593 | int i = 1; | 595 | int i = 1; |
594 | const QList<FileSystem> &fs = storage->fileSystems(); | 596 | const QList<FileSystem> &fs = storage->fileSystems(); |
595 | QListIterator<FileSystem> it( fs ); | 597 | QListIterator<FileSystem> it( fs ); |
596 | for ( ; it.current(); ++it ) { | 598 | for ( ; it.current(); ++it ) { |
597 | if ( (*it)->isRemovable() ) { | 599 | if ( (*it)->isRemovable() ) { |
598 | appendDocpath((*it)); | 600 | appendDocpath((*it)); |
599 | ++i; | 601 | ++i; |
600 | } | 602 | } |
601 | } | 603 | } |
602 | 604 | ||
603 | for ( int i = 0; i < MAX_SEARCH_DEPTH; ++i ) { | 605 | for ( int i = 0; i < MAX_SEARCH_DEPTH; ++i ) { |
604 | if ( listDirs[i] ) { | 606 | if ( listDirs[i] ) { |
605 | delete listDirs[i]; | 607 | delete listDirs[i]; |
606 | listDirs[i] = 0; | 608 | listDirs[i] = 0; |
607 | } | 609 | } |
608 | lists[i] = 0; | 610 | lists[i] = 0; |
609 | listPositions[i] = 0; | 611 | listPositions[i] = 0; |
610 | } | 612 | } |
611 | 613 | ||
612 | docPathsSearched = 0; | 614 | docPathsSearched = 0; |
613 | searchDepth = -1; | 615 | searchDepth = -1; |
614 | state = Find; | 616 | state = Find; |
615 | dit = 0; | 617 | dit = 0; |
616 | } | 618 | } |
617 | 619 | ||
618 | 620 | ||
619 | DocumentListPrivate::~DocumentListPrivate() | 621 | DocumentListPrivate::~DocumentListPrivate() |
620 | { | 622 | { |
621 | for ( int i = 0; i < MAX_SEARCH_DEPTH; i++ ) | 623 | for ( int i = 0; i < MAX_SEARCH_DEPTH; i++ ) |
622 | if ( listDirs[i] ) | 624 | if ( listDirs[i] ) |
623 | delete listDirs[i]; | 625 | delete listDirs[i]; |
624 | delete dit; | 626 | delete dit; |
625 | } | 627 | } |
626 | 628 | ||
627 | 629 | ||
628 | void DocumentListPrivate::estimatedPercentScanned() | 630 | void DocumentListPrivate::estimatedPercentScanned() |
629 | { | 631 | { |
630 | double overallProgress = 0.0; | 632 | double overallProgress = 0.0; |
631 | double levelWeight = 75.0; | 633 | double levelWeight = 75.0; |
632 | 634 | ||
633 | int topCount = docPaths.count(); | 635 | int topCount = docPaths.count(); |
634 | if ( topCount > 1 ) { | 636 | if ( topCount > 1 ) { |
635 | levelWeight = levelWeight / topCount; | 637 | levelWeight = levelWeight / topCount; |
636 | overallProgress += (docPathsSearched - 1) * levelWeight; | 638 | overallProgress += (docPathsSearched - 1) * levelWeight; |
637 | } | 639 | } |
638 | 640 | ||
639 | for ( int d = 0; d <= searchDepth; d++ ) { | 641 | for ( int d = 0; d <= searchDepth; d++ ) { |
640 | if ( listDirs[d] ) { | 642 | if ( listDirs[d] ) { |
641 | int items = lists[d]->count(); | 643 | int items = lists[d]->count(); |
642 | if ( items > 1 ) { | 644 | if ( items > 1 ) { |
643 | levelWeight = levelWeight / items; | 645 | levelWeight = levelWeight / items; |
644 | // Take in to account "." and ".." | 646 | // Take in to account "." and ".." |
645 | overallProgress += (listPositions[d] - 3) * levelWeight; | 647 | overallProgress += (listPositions[d] - 3) * levelWeight; |
646 | } | 648 | } |
647 | } else { | 649 | } else { |