~ubuntu-branches/ubuntu/vivid/muon/vivid-proposed

« back to all changes in this revision

Viewing changes to libmuon/resources/ResourcesUpdatesModel.cpp

  • Committer: Package Import Robot
  • Author(s): Scarlett Clark
  • Date: 2015-03-24 07:36:31 UTC
  • mto: This revision was merged to the branch mainline in revision 86.
  • Revision ID: package-import@ubuntu.com-20150324073631-7nmay5episnfkdlt
Tags: upstream-5.2.2
ImportĀ upstreamĀ versionĀ 5.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
            connect(updater, SIGNAL(downloadSpeedChanged(quint64)), SIGNAL(downloadSpeedChanged()));
66
66
            connect(updater, SIGNAL(progressingChanged(bool)), SLOT(slotProgressingChanged(bool)));
67
67
            connect(updater, SIGNAL(cancelableChanged(bool)), SIGNAL(cancelableChanged()));
 
68
            connect(updater, SIGNAL(destroyed(QObject*)), SLOT(updaterDestroyed(QObject*)));
68
69
            m_updaters += updater;
69
70
        }
70
71
    }
71
72
}
72
73
 
 
74
void ResourcesUpdatesModel::updaterDestroyed(QObject* obj)
 
75
{
 
76
//     TODO: use removeAll when build.kde.org doesn't complain about Qt 5.4 API usage...
 
77
    int idx = m_updaters.indexOf(qobject_cast<AbstractBackendUpdater*>(obj));
 
78
    if (idx>=0)
 
79
        m_updaters.remove(idx);
 
80
}
 
81
 
73
82
void ResourcesUpdatesModel::slotProgressingChanged(bool progressing)
74
83
{
75
84
    if ((!progressing && !isProgressing()) || (isProgressing() && !m_isProgressing)) {
148
157
        return i18nc("@item:intext Remaining time", "%1 remaining", KFormat().formatDuration(maxEta));
149
158
}
150
159
 
151
 
QList<QAction*> ResourcesUpdatesModel::messageActions() const
152
 
{
153
 
    QList<QAction*> ret;
154
 
    foreach(AbstractBackendUpdater* upd, m_updaters) {
155
 
        ret += upd->messageActions();
156
 
    }
157
 
    return ret;
158
 
}
159
 
 
160
160
bool ResourcesUpdatesModel::hasUpdates() const
161
161
{
162
162
    bool ret = false;