MCPcopy Create free account
hub / github.com/KDE/kdevelop / retrieveRepos

Method retrieveRepos

plugins/ghprovider/ghresource.cpp:103–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103void Resource::retrieveRepos(const QByteArray &data)
104{
105 QJsonParseError error;
106 QJsonDocument doc = QJsonDocument::fromJson(data, &error);
107
108 if (error.error == 0) {
109 const QVariantList list = doc.toVariant().toList();
110 m_model->clear();
111 for (const QVariant& it : list) {
112 const QVariantMap &map = it.toMap();
113 Response res;
114 res.name = map.value(QStringLiteral("name")).toString();
115 res.url = map.value(QStringLiteral("clone_url")).toUrl();
116 if (map.value(QStringLiteral("fork")).toBool())
117 res.kind = Fork;
118 else if (map.value(QStringLiteral("private")).toBool())
119 res.kind = Private;
120 else
121 res.kind = Public;
122 auto *item = new ProviderItem(res);
123 m_model->appendRow(item);
124 }
125 }
126 emit reposUpdated();
127}
128
129void Resource::retrieveOrgs(const QByteArray &data)
130{

Callers

nothing calls this directly

Calls 7

appendRowMethod · 0.80
toListMethod · 0.45
toVariantMethod · 0.45
clearMethod · 0.45
toStringMethod · 0.45
valueMethod · 0.45
toUrlMethod · 0.45

Tested by

no test coverage detected