~ubuntu-branches/debian/stretch/kservice/stretch

« back to all changes in this revision

Viewing changes to src/services/kservicegroup.cpp

  • Committer: Package Import Robot
  • Author(s): Scarlett Clark
  • Date: 2014-08-05 17:29:09 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20140805172909-i30obau6w3p8glfr
Tags: 5.1.0-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
127
127
                it != m_serviceList.end(); ++it) {
128
128
            KSycocaEntry::Ptr p = *it;
129
129
            if (p->isType(KST_KService)) {
130
 
                KService::Ptr service = KService::Ptr(p);
 
130
                KService::Ptr service(static_cast<KService*>(p.data()));
131
131
                if (!service->noDisplay()) {
132
132
                    m_childCount++;
133
133
                }
134
134
            } else if (p->isType(KST_KServiceGroup)) {
135
 
                KServiceGroup::Ptr serviceGroup = KServiceGroup::Ptr(p);
 
135
                KServiceGroup::Ptr serviceGroup(static_cast<KServiceGroup*>(p.data()));
136
136
                m_childCount += serviceGroup->childCount();
137
137
            }
138
138
        }
263
263
    QStringList groupList;
264
264
    Q_FOREACH (KSycocaEntry::Ptr p, m_serviceList) {
265
265
        if (p->isType(KST_KService)) {
266
 
            KService::Ptr service = KService::Ptr(p);
 
266
            KService::Ptr service(static_cast<KService*>(p.data()));
267
267
            groupList.append(service->entryPath());
268
268
        } else if (p->isType(KST_KServiceGroup)) {
269
 
            KServiceGroup::Ptr serviceGroup = KServiceGroup::Ptr(p);
 
269
            KServiceGroup::Ptr serviceGroup(static_cast<KServiceGroup*>(p.data()));
270
270
            groupList.append(serviceGroup->relPath());
271
271
        } else {
272
272
            //fprintf(stderr, "KServiceGroup: Unexpected object in list!\n");
294
294
    List tmp = d->entries(this, sort, options & ExcludeNoDisplay, options & AllowSeparators, options & SortByGenericName);
295
295
    foreach (const SPtr &ptr, tmp) {
296
296
        if (ptr->isType(KST_KServiceGroup)) {
297
 
            list.append(Ptr(ptr));
 
297
            KServiceGroup::Ptr serviceGroup(static_cast<KServiceGroup*>(ptr.data()));
 
298
            list.append(serviceGroup);
298
299
        } else if (ptr->isType(KST_KServiceSeparator)) {
299
300
            list.append(KServiceGroup::Ptr(static_cast<KServiceGroup *>(new KSycocaEntry())));
300
301
        } else if (sort && ptr->isType(KST_KService)) {
313
314
    bool foundService = false;
314
315
    foreach (const SPtr &ptr, tmp) {
315
316
        if (ptr->isType(KST_KService)) {
316
 
            list.append(KService::Ptr(ptr));
 
317
            list.append(KService::Ptr(static_cast<KService*>(ptr.data())));
317
318
            foundService = true;
318
319
        } else if (ptr->isType(KST_KServiceSeparator) && foundService) {
319
320
            list.append(KService::Ptr(static_cast<KService *>(new KSycocaEntry())));
444
445
            QString groupPath = rp + item.mid(1) + QLatin1Char('/');
445
446
            // Remove entry from sorted list of services.
446
447
            for (SortedContainer::iterator it2 = glist.begin(); it2 != glist.end(); ++it2) {
447
 
                const KServiceGroup::Ptr group = KServiceGroup::Ptr(it2.value());
 
448
                const KServiceGroup::Ptr group(static_cast<KServiceGroup*>(it2.value().data()));
448
449
                if (group->relPath() == groupPath) {
449
450
                    glist.erase(it2);
450
451
                    break;
455
456
            // TODO: Remove item from sortOrder-list if not found
456
457
            // TODO: This prevents duplicates
457
458
            for (SortedContainer::iterator it2 = slist.begin(); it2 != slist.end(); ++it2) {
458
 
                const KService::Ptr service = KService::Ptr(it2.value());
 
459
                const KService::Ptr service(static_cast<KService*>(it2.value().data()));
459
460
                if (service->menuId() == item) {
460
461
                    slist.erase(it2);
461
462
                    break;
498
499
                    parseAttribute(*it3,  showEmptyMenu, showInline, showInlineHeader, showInlineAlias, inlineValue);
499
500
                }
500
501
                for (SortedContainer::Iterator it2 = glist.begin(); it2 != glist.end(); ++it2) {
501
 
                    KServiceGroup::Ptr group = KServiceGroup::Ptr(it2.value());
 
502
                    KServiceGroup::Ptr group(static_cast<KServiceGroup*>(it2.value().data()));
502
503
                    group->setShowEmptyMenu(showEmptyMenu);
503
504
                    group->setAllowInline(showInline);
504
505
                    group->setShowInlineHeader(showInlineHeader);
553
554
                if (!(*it2)->isType(KST_KServiceGroup)) {
554
555
                    continue;
555
556
                }
556
 
                KServiceGroup::Ptr group = KServiceGroup::Ptr(*it2);
 
557
                KServiceGroup::Ptr group(static_cast<KServiceGroup*>((*it2).data()));
557
558
                if (group->relPath() == groupPath) {
558
559
                    if (!excludeNoDisplay || !group->noDisplay()) {
559
560
                        ++it;
595
596
                if (!(*it2)->isType(KST_KService)) {
596
597
                    continue;
597
598
                }
598
 
                const KService::Ptr service = KService::Ptr(*it2);
 
599
                const KService::Ptr service(static_cast<KService*>((*it2).data()));
599
600
                if (service->menuId() == item) {
600
601
                    if (!excludeNoDisplay || !service->noDisplay()) {
601
602
                        addItem(sorted, (*it2), needSeparator);