Commit 191346f0 authored by Sergey Chupligin's avatar Sergey Chupligin Committed by akozhevnikov

[ssu] Provide list repos over dbus

parent 64028867
...@@ -93,6 +93,11 @@ ...@@ -93,6 +93,11 @@
<arg direction="in" type="s" name="repo" /> <arg direction="in" type="s" name="repo" />
<arg direction="in" type="s" name="url" /> <arg direction="in" type="s" name="url" />
</method> </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 name="updateRepos">
</method> </method>
......
...@@ -231,3 +231,16 @@ void Ssud::updateRepos() ...@@ -231,3 +231,16 @@ void Ssud::updateRepos()
repoManager.update(); repoManager.update();
autoclose.start(); 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;
}
...@@ -45,6 +45,7 @@ public slots: ...@@ -45,6 +45,7 @@ public slots:
void modifyRepo(int action, const QString &repo); void modifyRepo(int action, const QString &repo);
void addRepo(const QString &repo, const QString &url); void addRepo(const QString &repo, const QString &url);
void updateRepos(); void updateRepos();
QVariantList listRepos(bool rnd);
bool error(); bool error();
QString lastError(); QString lastError();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment