118 lines
4.7 KiB
Diff
118 lines
4.7 KiB
Diff
commit bfa0b337ae0c3efb08c9075af671be4371d4627f
|
|
Author: Daniel Nicoletti <dantti12@gmail.com>
|
|
Date: Sun Apr 15 10:49:40 2012 -0300
|
|
|
|
Add Supported filter entry
|
|
Fix repos not showing when refreshing the cache
|
|
|
|
diff --git a/ApperKCM/ApperKCM.cpp b/ApperKCM/ApperKCM.cpp
|
|
index ecd9a4d..4262ce7 100644
|
|
--- a/ApperKCM/ApperKCM.cpp
|
|
+++ b/ApperKCM/ApperKCM.cpp
|
|
@@ -83,7 +83,7 @@ ApperKCM::ApperKCM(QWidget *parent, const QVariantList &args) :
|
|
ki18n("(C) 2008-2011 Daniel Nicoletti"));
|
|
setAboutData(aboutData);
|
|
setButtons(Apply);
|
|
- KGlobal::locale()->insertCatalog("apper");
|
|
+ KGlobal::insertCatalog(QLatin1String("apper"));
|
|
|
|
// store the actions supported by the backend
|
|
m_roles = Daemon::actions();
|
|
diff --git a/ApperKCM/FiltersMenu.cpp b/ApperKCM/FiltersMenu.cpp
|
|
index 3a88cdf..2890d89 100644
|
|
--- a/ApperKCM/FiltersMenu.cpp
|
|
+++ b/ApperKCM/FiltersMenu.cpp
|
|
@@ -176,6 +176,37 @@ FiltersMenu::FiltersMenu(Transaction::Filters filters, QWidget *parent)
|
|
m_actions << freeNone;
|
|
}
|
|
|
|
+ if (filters & Transaction::FilterSupported || filters & Transaction::FilterNotSupported) {
|
|
+ // Supported
|
|
+ QMenu *menuSupported = new QMenu(i18nc("Filter for supported packages", "Supported"), this);
|
|
+ connect(menuSupported, SIGNAL(triggered(QAction*)),
|
|
+ this, SIGNAL(filtersChanged()));
|
|
+ addMenu(menuSupported);
|
|
+ QActionGroup *supportedGroup = new QActionGroup(menuSupported);
|
|
+ supportedGroup->setExclusive(true);
|
|
+
|
|
+ QAction *supportedTrue = new QAction(i18n("Only supported software"), supportedGroup);
|
|
+ supportedTrue->setCheckable(true);
|
|
+ m_filtersAction[supportedTrue] = Transaction::FilterSupported;
|
|
+ supportedGroup->addAction(supportedTrue);
|
|
+ menuSupported->addAction(supportedTrue);
|
|
+ m_actions << supportedTrue;
|
|
+
|
|
+ QAction *supportedFalse = new QAction(i18n("Only non-supported software"), supportedGroup);
|
|
+ supportedFalse->setCheckable(true);
|
|
+ m_filtersAction[supportedFalse] = Transaction::FilterNotSupported;
|
|
+ supportedGroup->addAction(supportedFalse);
|
|
+ menuSupported->addAction(supportedFalse);
|
|
+ m_actions << supportedFalse;
|
|
+
|
|
+ QAction *supportedNone = new QAction(i18n("No filter"), supportedGroup);
|
|
+ supportedNone->setCheckable(true);
|
|
+ supportedNone->setChecked(true);
|
|
+ supportedGroup->addAction(supportedNone);
|
|
+ menuSupported->addAction(supportedNone);
|
|
+ m_actions << supportedNone;
|
|
+ }
|
|
+
|
|
if (filters & Transaction::FilterSource || filters & Transaction::FilterNotSource) {
|
|
// Source
|
|
QMenu *menuSource = new QMenu(i18nc("Filter for source packages", "Source"), this);
|
|
diff --git a/apperd/apperd.cpp b/apperd/apperd.cpp
|
|
index 561e3da..3a7e8fe 100644
|
|
--- a/apperd/apperd.cpp
|
|
+++ b/apperd/apperd.cpp
|
|
@@ -128,6 +128,9 @@ void ApperD::poll()
|
|
// If lastRefreshCache is null it means that the cache was never refreshed
|
|
if (m_lastRefreshCache.isNull() || m_lastRefreshCache.toTime_t() < maxTime) {
|
|
callApperSentinel(QLatin1String("RefreshAndUpdate"));
|
|
+
|
|
+ // Invalidate the last time the cache was refreshed
|
|
+ m_lastRefreshCache = QDateTime();
|
|
}
|
|
}
|
|
|
|
@@ -159,6 +162,12 @@ void ApperD::transactionListChanged(const QStringList &tids)
|
|
message << static_cast<uint>(0);
|
|
QDBusConnection::sessionBus().send(message);
|
|
}
|
|
+
|
|
+ if (tids.isEmpty()) {
|
|
+ // update the last time the cache was refreshed
|
|
+ // TODO PackageKit should emit a property change for this
|
|
+ m_lastRefreshCache = getTimeSinceRefreshCache();
|
|
+ }
|
|
}
|
|
|
|
void ApperD::updatesChanged()
|
|
diff --git a/libapper/ProgressView.cpp b/libapper/ProgressView.cpp
|
|
index 21fb48e..6d2a85e 100644
|
|
--- a/libapper/ProgressView.cpp
|
|
+++ b/libapper/ProgressView.cpp
|
|
@@ -100,9 +100,10 @@ void ProgressView::handleRepo(bool handle) {
|
|
}
|
|
}
|
|
|
|
-void ProgressView::currentRepo(const QString &repoId, const QString &description)
|
|
+void ProgressView::currentRepo(const QString &repoId, const QString &description, bool enabled)
|
|
{
|
|
Q_UNUSED(repoId)
|
|
+ Q_UNUSED(enabled)
|
|
QStandardItem *item = new QStandardItem(description);
|
|
m_model->appendRow(item);
|
|
}
|
|
diff --git a/libapper/ProgressView.h b/libapper/ProgressView.h
|
|
index 0492622..4ccebf9 100644
|
|
--- a/libapper/ProgressView.h
|
|
+++ b/libapper/ProgressView.h
|
|
@@ -51,7 +51,7 @@ public:
|
|
|
|
public slots:
|
|
void currentPackage(const PackageKit::Package &package);
|
|
- void currentRepo(const QString &repoId, const QString &description);
|
|
+ void currentRepo(const QString& repoId, const QString& description, bool enabled);
|
|
|
|
private slots:
|
|
void followBottom(int value);
|