Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[ssu] Provide list repos over dbus
  • Loading branch information
neochapay authored and Andrey Kozhevnikov committed Jul 11, 2018
1 parent 6402886 commit 191346f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dbus/org.nemo.ssu.xml
Expand Up @@ -93,6 +93,11 @@
<arg direction="in" type="s" name="repo" />
<arg direction="in" type="s" name="url" />
</method>
<method name="listRepos">
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantList"/>
<arg direction="in" type="b" name="rnd" />
<arg direction="out" type="a(v)" name="repos"/>
</method>
<method name="updateRepos">
</method>

Expand Down
13 changes: 13 additions & 0 deletions ssud/ssud.cpp
Expand Up @@ -231,3 +231,16 @@ void Ssud::updateRepos()
repoManager.update();
autoclose.start();
}

QVariantList Ssud::listRepos(bool rnd)
{
QVariantList reposList;
SsuRepoManager repoManager;

for (const QString &repo : repoManager.repos(rnd)) {
const QString repoUrl = ssu.repoUrl(repo, rnd);
reposList << QVariantMap({{ "url", repoUrl }, { "name", repo }});
}
autoclose.start();
return reposList;
}
1 change: 1 addition & 0 deletions ssud/ssud.h
Expand Up @@ -45,6 +45,7 @@ public slots:
void modifyRepo(int action, const QString &repo);
void addRepo(const QString &repo, const QString &url);
void updateRepos();
QVariantList listRepos(bool rnd);

bool error();
QString lastError();
Expand Down

0 comments on commit 191346f

Please sign in to comment.