aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/gitlab/queryrunner.cpp
diff options
context:
space:
mode:
authorChristian Stenger <[email protected]>2022-05-12 13:54:00 +0200
committerChristian Stenger <[email protected]>2022-05-31 10:47:11 +0000
commitdd27901759e3f03edfb7926fbd63fc821d509760 (patch)
tree22bd4bb11e05997f4c75ec4cdc9fd30b7e249a53 /src/plugins/gitlab/queryrunner.cpp
parentcd1af2864bf79c4cc8c7b79c4dae0d1ca51402c0 (diff)
GitLab: Allow fetching events
Projects that are linked to a GitLab instance will now fetch notifications for this project and print them to the vcs output pane. Change-Id: Ifb960e64b30a260327efb28a3dfd26f6457503a0 Reviewed-by: <[email protected]> Reviewed-by: David Schulz <[email protected]>
Diffstat (limited to 'src/plugins/gitlab/queryrunner.cpp')
-rw-r--r--src/plugins/gitlab/queryrunner.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/plugins/gitlab/queryrunner.cpp b/src/plugins/gitlab/queryrunner.cpp
index e0369d78c52..86ad6b303ab 100644
--- a/src/plugins/gitlab/queryrunner.cpp
+++ b/src/plugins/gitlab/queryrunner.cpp
@@ -43,6 +43,7 @@ const char API_PREFIX[] = "/api/v4";
const char QUERY_PROJECT[] = "/projects/%1";
const char QUERY_PROJECTS[] = "/projects?simple=true";
const char QUERY_USER[] = "/user";
+const char QUERY_EVENTS[] = "/projects/%1/events";
Query::Query(Type type, const QStringList &parameter)
: m_type(type)
@@ -62,7 +63,7 @@ void Query::setAdditionalParameters(const QStringList &additional)
bool Query::hasPaginatedResults() const
{
- return m_type == Query::Projects;
+ return m_type == Query::Projects || m_type == Query::Events;
}
QString Query::toString() const
@@ -82,6 +83,11 @@ QString Query::toString() const
case Query::User:
query += QUERY_USER;
break;
+ case Query::Events:
+ QTC_ASSERT(!m_parameter.isEmpty(), return {});
+ query += QLatin1String(QUERY_EVENTS).arg(QLatin1String(
+ QUrl::toPercentEncoding(m_parameter.at(0))));
+ break;
}
if (m_pageParameter > 0) {
query.append(m_type == Query::Projects ? '&' : '?');