Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 246568
Collapse All | Expand All

(-)kdelibs-4.1.3.old/kio/kio/kdirlister.cpp (-6 / +8 lines)
Lines 1065-1071 Link Here
1065
  // the signals to make sure it exists in KDirListerCache in case someone
1065
  // the signals to make sure it exists in KDirListerCache in case someone
1066
  // calls listDir during the signal emission
1066
  // calls listDir during the signal emission
1067
  Q_ASSERT( dirData.listersCurrentlyHolding.isEmpty() );
1067
  Q_ASSERT( dirData.listersCurrentlyHolding.isEmpty() );
1068
  dirData.moveListersWithoutCachedItemsJob();
1068
  //dirData.moveListersWithoutCachedItemsJob();
1069
  moveListersWithoutCachedItemsJob(dirData);
1069
1070
1070
  if ( job->error() )
1071
  if ( job->error() )
1071
  {
1072
  {
Lines 1437-1443 Link Here
1437
    DirectoryData& dirData = directoryData[jobUrlStr];
1438
    DirectoryData& dirData = directoryData[jobUrlStr];
1438
    // Collect the dirlisters which were listing the URL using that ListJob
1439
    // Collect the dirlisters which were listing the URL using that ListJob
1439
    // plus those that were already holding that URL - they all get updated.
1440
    // plus those that were already holding that URL - they all get updated.
1440
    dirData.moveListersWithoutCachedItemsJob();
1441
    //dirData.moveListersWithoutCachedItemsJob();
1442
    moveListersWithoutCachedItemsJob(dirData);
1441
    QList<KDirLister *> listers = dirData.listersCurrentlyHolding;
1443
    QList<KDirLister *> listers = dirData.listersCurrentlyHolding;
1442
    listers += dirData.listersCurrentlyListing;
1444
    listers += dirData.listersCurrentlyListing;
1443
1445
Lines 2514-2533 Link Here
2514
    }
2516
    }
2515
}
2517
}
2516
2518
2517
void KDirListerCache::DirectoryData::moveListersWithoutCachedItemsJob()
2519
void KDirListerCache::moveListersWithoutCachedItemsJob(DirectoryData& dirData)
2518
{
2520
{
2519
    // Move dirlisters from listersCurrentlyListing to listersCurrentlyHolding,
2521
    // Move dirlisters from listersCurrentlyListing to listersCurrentlyHolding,
2520
    // but not those that are still waiting on a CachedItemsJob...
2522
    // but not those that are still waiting on a CachedItemsJob...
2521
    // Unit-testing note:
2523
    // Unit-testing note:
2522
    // Run kdirmodeltest in valgrind to hit the case where an update
2524
    // Run kdirmodeltest in valgrind to hit the case where an update
2523
    // is triggered while a lister has a CachedItemsJob (different timing...)
2525
    // is triggered while a lister has a CachedItemsJob (different timing...)
2524
    QMutableListIterator<KDirLister *> lister_it(listersCurrentlyListing);
2526
    QMutableListIterator<KDirLister *> lister_it(dirData.listersCurrentlyListing);
2525
    while (lister_it.hasNext()) {
2527
    while (lister_it.hasNext()) {
2526
        KDirLister* kdl = lister_it.next();
2528
        KDirLister* kdl = lister_it.next();
2527
        if (!kdl->d->m_cachedItemsJob) {
2529
        if (!kdl->d->m_cachedItemsJob) {
2528
            Q_ASSERT(!listersCurrentlyHolding.contains(kdl));
2530
            Q_ASSERT(!dirData.listersCurrentlyHolding.contains(kdl));
2529
            // OK, move this lister from "currently listing" to "currently holding".
2531
            // OK, move this lister from "currently listing" to "currently holding".
2530
            listersCurrentlyHolding.append(kdl);
2532
            dirData.listersCurrentlyHolding.append(kdl);
2531
            lister_it.remove();
2533
            lister_it.remove();
2532
        }
2534
        }
2533
    }
2535
    }
(-)kdelibs-4.1.3.old/kio/kio/kdirlister_p.h (-1 / +1 lines)
Lines 382-389 Link Here
382
        // Listers that are currently holding this url
382
        // Listers that are currently holding this url
383
        QList<KDirLister *> listersCurrentlyHolding;
383
        QList<KDirLister *> listersCurrentlyHolding;
384
384
385
        void moveListersWithoutCachedItemsJob();
386
    };
385
    };
386
    void moveListersWithoutCachedItemsJob(DirectoryData&);
387
387
388
    typedef QHash<QString /*url*/, DirectoryData> DirectoryDataHash;
388
    typedef QHash<QString /*url*/, DirectoryData> DirectoryDataHash;
389
    DirectoryDataHash directoryData;
389
    DirectoryDataHash directoryData;

Return to bug 246568