Axivion: Use Core namespace in axivionplugin.cpp

Change-Id: I4f4fb678f03b486aa2c3d50c42625510e3a8c783
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Jarek Kobus
2024-01-30 14:01:58 +01:00
parent 76dcc5463a
commit 4cc80b6cd0

View File

@@ -48,6 +48,7 @@
constexpr char AxivionTextMarkId[] = "AxivionTextMark"; constexpr char AxivionTextMarkId[] = "AxivionTextMark";
using namespace Core;
using namespace Tasking; using namespace Tasking;
using namespace Utils; using namespace Utils;
@@ -95,8 +96,8 @@ public:
void onStartupProjectChanged(); void onStartupProjectChanged();
void fetchProjectInfo(const QString &projectName); void fetchProjectInfo(const QString &projectName);
void handleOpenedDocs(ProjectExplorer::Project *project); void handleOpenedDocs(ProjectExplorer::Project *project);
void onDocumentOpened(Core::IDocument *doc); void onDocumentOpened(IDocument *doc);
void onDocumentClosed(Core::IDocument * doc); void onDocumentClosed(IDocument * doc);
void clearAllMarks(); void clearAllMarks();
void handleIssuesForFile(const IssuesList &issues); void handleIssuesForFile(const IssuesList &issues);
void fetchRuleInfo(const QString &id); void fetchRuleInfo(const QString &id);
@@ -158,7 +159,7 @@ bool handleCertificateIssue()
{ {
QTC_ASSERT(dd, return false); QTC_ASSERT(dd, return false);
const QString serverHost = QUrl(settings().server.dashboard).host(); const QString serverHost = QUrl(settings().server.dashboard).host();
if (QMessageBox::question(Core::ICore::dialogParent(), Tr::tr("Certificate Error"), if (QMessageBox::question(ICore::dialogParent(), Tr::tr("Certificate Error"),
Tr::tr("Server certificate for %1 cannot be authenticated.\n" Tr::tr("Server certificate for %1 cannot be authenticated.\n"
"Do you want to disable SSL verification for this server?\n" "Do you want to disable SSL verification for this server?\n"
"Note: This can expose you to man-in-the-middle attack.") "Note: This can expose you to man-in-the-middle attack.")
@@ -290,7 +291,7 @@ static Group fetchDataRecipe(const QUrl &url,
return NetworkError(reply->url(), error, reply->errorString()); return NetworkError(reply->url(), error, reply->errorString());
}; };
Core::MessageManager::writeFlashing( MessageManager::writeFlashing(
QStringLiteral("Axivion: %1").arg(getError().message())); QStringLiteral("Axivion: %1").arg(getError().message()));
return DoneResult::Error; return DoneResult::Error;
}; };
@@ -459,8 +460,8 @@ void AxivionPluginPrivate::handleOpenedDocs(ProjectExplorer::Project *project)
{ {
if (project && ProjectExplorer::ProjectManager::startupProject() != project) if (project && ProjectExplorer::ProjectManager::startupProject() != project)
return; return;
const QList<Core::IDocument *> openDocuments = Core::DocumentModel::openedDocuments(); const QList<IDocument *> openDocuments = DocumentModel::openedDocuments();
for (Core::IDocument *doc : openDocuments) for (IDocument *doc : openDocuments)
onDocumentOpened(doc); onDocumentOpened(doc);
if (project) if (project)
disconnect(ProjectExplorer::ProjectManager::instance(), disconnect(ProjectExplorer::ProjectManager::instance(),
@@ -470,12 +471,12 @@ void AxivionPluginPrivate::handleOpenedDocs(ProjectExplorer::Project *project)
void AxivionPluginPrivate::clearAllMarks() void AxivionPluginPrivate::clearAllMarks()
{ {
const QList<Core::IDocument *> openDocuments = Core::DocumentModel::openedDocuments(); const QList<IDocument *> openDocuments = DocumentModel::openedDocuments();
for (Core::IDocument *doc : openDocuments) for (IDocument *doc : openDocuments)
onDocumentClosed(doc); onDocumentClosed(doc);
} }
void AxivionPluginPrivate::onDocumentOpened(Core::IDocument *doc) void AxivionPluginPrivate::onDocumentOpened(IDocument *doc)
{ {
if (!m_currentProjectInfo) // we do not have a project info (yet) if (!m_currentProjectInfo) // we do not have a project info (yet)
return; return;
@@ -498,7 +499,7 @@ void AxivionPluginPrivate::onDocumentOpened(Core::IDocument *doc)
runner->start(); runner->start();
} }
void AxivionPluginPrivate::onDocumentClosed(Core::IDocument *doc) void AxivionPluginPrivate::onDocumentClosed(IDocument *doc)
{ {
const auto document = qobject_cast<TextEditor::TextDocument *>(doc); const auto document = qobject_cast<TextEditor::TextDocument *>(doc);
if (!document) if (!document)
@@ -553,9 +554,9 @@ class AxivionPlugin final : public ExtensionSystem::IPlugin
connect(ProjectExplorer::ProjectManager::instance(), connect(ProjectExplorer::ProjectManager::instance(),
&ProjectExplorer::ProjectManager::startupProjectChanged, &ProjectExplorer::ProjectManager::startupProjectChanged,
dd, &AxivionPluginPrivate::onStartupProjectChanged); dd, &AxivionPluginPrivate::onStartupProjectChanged);
connect(Core::EditorManager::instance(), &Core::EditorManager::documentOpened, connect(EditorManager::instance(), &EditorManager::documentOpened,
dd, &AxivionPluginPrivate::onDocumentOpened); dd, &AxivionPluginPrivate::onDocumentOpened);
connect(Core::EditorManager::instance(), &Core::EditorManager::documentClosed, connect(EditorManager::instance(), &EditorManager::documentClosed,
dd, &AxivionPluginPrivate::onDocumentClosed); dd, &AxivionPluginPrivate::onDocumentClosed);
} }
}; };