~ubuntu-branches/debian/stretch/apper/stretch

« back to all changes in this revision

Viewing changes to ApperKCM/FiltersMenu.cpp

  • Committer: Package Import Robot
  • Author(s): Matthias Klumpp
  • Date: 2013-06-24 14:32:36 UTC
  • mfrom: (8.1.1 experimental)
  • Revision ID: package-import@ubuntu.com-20130624143236-8259lpdjgnrjxiik
Tags: 0.8.0-2
* Upload to unstable (Closes: #696585, #697996, #708090)
* Add patch to compile against new QPK API

Show diffs side-by-side

added added

removed removed

Lines of Context:
278
278
        m_actions << native;
279
279
    }
280
280
 
281
 
#ifdef HAVE_APPINSTALL
 
281
#ifdef HAVE_APPSTREAM
282
282
    addSeparator();
283
283
    m_applications = new QAction(i18n("Only Show Applications"), this);
284
284
    m_applications->setCheckable(true);
286
286
    m_applications->setToolTip(i18n("Hide packages that are not applications"));
287
287
    addAction(m_applications);
288
288
    connect(m_applications, SIGNAL(triggered(bool)),
289
 
            this, SLOT(filterAppTriggered(bool)));
290
 
#endif //HAVE_APPINSTALL
 
289
            this, SIGNAL(filterApplications(bool)));
 
290
#endif // HAVE_APPSTREAM
291
291
}
292
292
 
293
293
FiltersMenu::~FiltersMenu()
308
308
    // This entry does not depend on the backend it's ok to call this pointer
309
309
    filterMenuGroup.writeEntry("FilterNative",
310
310
                               static_cast<bool>(filters() & Transaction::FilterArch));
311
 
#ifdef HAVE_APPINSTALL
 
311
#ifdef HAVE_APPSTREAM
312
312
    filterMenuGroup.writeEntry("HidePackages", m_applications->isChecked());
313
 
#endif //HAVE_APPINSTALL
 
313
#endif // HAVE_APPSTREAM
314
314
}
315
315
 
316
 
QString FiltersMenu::filterApplications() const
 
316
bool FiltersMenu::filterApplications() const
317
317
{
318
 
#ifdef HAVE_APPINSTALL
319
 
    return m_applications->isChecked() ? "a" : QString();
 
318
#ifdef HAVE_APPSTREAM
 
319
    return m_applications->isChecked();
320
320
#else
321
 
    return QString();
322
 
#endif //HAVE_APPINSTALL
323
 
}
324
 
 
325
 
void FiltersMenu::filterAppTriggered(bool checked)
326
 
{
327
 
    emit filterApplications(checked ? "a" : QString());
 
321
    return false;
 
322
#endif // HAVE_APPSTREAM
328
323
}
329
324
 
330
325
Transaction::Filters FiltersMenu::filters() const