aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/gitlab/gitlabplugin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/gitlab/gitlabplugin.cpp')
-rw-r--r--src/plugins/gitlab/gitlabplugin.cpp43
1 files changed, 24 insertions, 19 deletions
diff --git a/src/plugins/gitlab/gitlabplugin.cpp b/src/plugins/gitlab/gitlabplugin.cpp
index 2059ae4d84..5ae4df682b 100644
--- a/src/plugins/gitlab/gitlabplugin.cpp
+++ b/src/plugins/gitlab/gitlabplugin.cpp
@@ -14,11 +14,15 @@
#include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/icore.h>
+
#include <git/gitplugin.h>
+
#include <projectexplorer/project.h>
#include <projectexplorer/projectpanelfactory.h>
-#include <projectexplorer/session.h>
+#include <projectexplorer/projectmanager.h>
+
#include <utils/qtcassert.h>
+
#include <vcsbase/vcsoutputwindow.h>
#include <QAction>
@@ -34,6 +38,18 @@ const char GITLAB_OPEN_VIEW[] = "GitLab.OpenView";
class GitLabPluginPrivate : public QObject
{
public:
+ void setupNotificationTimer();
+ void fetchEvents();
+ void fetchUser();
+ void createAndSendEventsRequest(const QDateTime timeStamp, int page = -1);
+ void handleUser(const User &user);
+ void handleEvents(const Events &events, const QDateTime &timeStamp);
+
+ void onSettingsChanged() {
+ if (dialog)
+ dialog->updateRemotes();
+ }
+
GitLabParameters parameters;
GitLabOptionsPage optionsPage{&parameters};
QHash<ProjectExplorer::Project *, GitLabProjectSettings *> projectSettings;
@@ -43,13 +59,6 @@ public:
QString projectName;
Utils::Id serverId;
bool runningQuery = false;
-
- void setupNotificationTimer();
- void fetchEvents();
- void fetchUser();
- void createAndSendEventsRequest(const QDateTime timeStamp, int page = -1);
- void handleUser(const User &user);
- void handleEvents(const Events &events, const QDateTime &timeStamp);
};
static GitLabPluginPrivate *dd = nullptr;
@@ -85,12 +94,8 @@ void GitLabPlugin::initialize()
connect(openViewAction, &QAction::triggered, this, &GitLabPlugin::openView);
Core::ActionContainer *ac = Core::ActionManager::actionContainer(Core::Constants::M_TOOLS);
ac->addAction(gitlabCommand);
- connect(&dd->optionsPage, &GitLabOptionsPage::settingsChanged, this, [] {
- if (dd->dialog)
- dd->dialog->updateRemotes();
- });
- connect(ProjectExplorer::SessionManager::instance(),
- &ProjectExplorer::SessionManager::startupProjectChanged,
+ connect(ProjectExplorer::ProjectManager::instance(),
+ &ProjectExplorer::ProjectManager::startupProjectChanged,
this, &GitLabPlugin::onStartupProjectChanged);
}
@@ -121,7 +126,7 @@ void GitLabPlugin::onStartupProjectChanged()
{
QTC_ASSERT(dd, return);
disconnect(&dd->notificationTimer);
- ProjectExplorer::Project *project = ProjectExplorer::SessionManager::startupProject();
+ ProjectExplorer::Project *project = ProjectExplorer::ProjectManager::startupProject();
if (!project) {
dd->notificationTimer.stop();
return;
@@ -147,7 +152,7 @@ void GitLabPluginPrivate::setupNotificationTimer()
void GitLabPluginPrivate::fetchEvents()
{
- ProjectExplorer::Project *project = ProjectExplorer::SessionManager::startupProject();
+ ProjectExplorer::Project *project = ProjectExplorer::ProjectManager::startupProject();
QTC_ASSERT(project, return);
if (runningQuery)
@@ -218,7 +223,7 @@ void GitLabPluginPrivate::handleEvents(const Events &events, const QDateTime &ti
{
runningQuery = false;
- ProjectExplorer::Project *project = ProjectExplorer::SessionManager::startupProject();
+ ProjectExplorer::Project *project = ProjectExplorer::ProjectManager::startupProject();
QTC_ASSERT(project, return);
GitLabProjectSettings *projSettings = GitLabPlugin::projectSettings(project);
@@ -301,7 +306,7 @@ bool GitLabPlugin::handleCertificateIssue(const Utils::Id &serverId)
int index = dd->parameters.gitLabServers.indexOf(server);
server.validateCert = false;
dd->parameters.gitLabServers.replace(index, server);
- emit dd->optionsPage.settingsChanged();
+ dd->onSettingsChanged();
return true;
}
return false;
@@ -311,7 +316,7 @@ void GitLabPlugin::linkedStateChanged(bool enabled)
{
QTC_ASSERT(dd, return);
- ProjectExplorer::Project *project = ProjectExplorer::SessionManager::startupProject();
+ ProjectExplorer::Project *project = ProjectExplorer::ProjectManager::startupProject();
if (project) {
const GitLabProjectSettings *pSettings = projectSettings(project);
dd->serverId = pSettings->currentServer();