mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2025-11-12 21:12:44 -05:00
feat: Add support QtCreator 18 (#246)
This commit is contained in:
21
.github/workflows/build_cmake.yml
vendored
21
.github/workflows/build_cmake.yml
vendored
@ -45,13 +45,17 @@ jobs:
|
|||||||
cc: "clang", cxx: "clang++"
|
cc: "clang", cxx: "clang++"
|
||||||
}
|
}
|
||||||
qt_config:
|
qt_config:
|
||||||
|
- {
|
||||||
|
qt_version: "6.8.3",
|
||||||
|
qt_creator_version: "16.0.2"
|
||||||
|
}
|
||||||
- {
|
- {
|
||||||
qt_version: "6.9.2",
|
qt_version: "6.9.2",
|
||||||
qt_creator_version: "17.0.2"
|
qt_creator_version: "17.0.2"
|
||||||
}
|
}
|
||||||
- {
|
- {
|
||||||
qt_version: "6.8.3",
|
qt_version: "6.10.0",
|
||||||
qt_creator_version: "16.0.2"
|
qt_creator_version: "18.0.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@ -105,13 +109,18 @@ jobs:
|
|||||||
shell: cmake -P {0}
|
shell: cmake -P {0}
|
||||||
run: |
|
run: |
|
||||||
set(qt_version "${{ matrix.qt_config.qt_version }}")
|
set(qt_version "${{ matrix.qt_config.qt_version }}")
|
||||||
|
set(qt_creator_version "${{ matrix.qt_config.qt_creator_version }}")
|
||||||
|
|
||||||
string(REPLACE "." "" qt_version_dotless "${qt_version}")
|
string(REPLACE "." "" qt_version_dotless "${qt_version}")
|
||||||
if ("${{ runner.os }}" STREQUAL "Windows")
|
if ("${{ runner.os }}" STREQUAL "Windows")
|
||||||
set(url_os "windows_x86")
|
set(url_os "windows_x86")
|
||||||
set(qt_package_arch_suffix "win64_msvc2022_64")
|
set(qt_package_arch_suffix "win64_msvc2022_64")
|
||||||
set(qt_dir_prefix "${qt_version}/msvc2022_64")
|
set(qt_dir_prefix "${qt_version}/msvc2022_64")
|
||||||
set(qt_package_suffix "-Windows-Windows_11_23H2-MSVC2022-Windows-Windows_11_23H2-X86_64")
|
if (qt_creator_version VERSION_GREATER_EQUAL "18.0.0")
|
||||||
|
set(qt_package_suffix "-Windows-Windows_11_24H2-MSVC2022-Windows-Windows_11_24H2-X86_64")
|
||||||
|
else()
|
||||||
|
set(qt_package_suffix "-Windows-Windows_11_23H2-MSVC2022-Windows-Windows_11_23H2-X86_64")
|
||||||
|
endif()
|
||||||
elseif ("${{ runner.os }}" STREQUAL "Linux")
|
elseif ("${{ runner.os }}" STREQUAL "Linux")
|
||||||
set(url_os "linux_x64")
|
set(url_os "linux_x64")
|
||||||
if (qt_version VERSION_LESS "6.7.0")
|
if (qt_version VERSION_LESS "6.7.0")
|
||||||
@ -120,7 +129,11 @@ jobs:
|
|||||||
set(qt_package_arch_suffix "linux_gcc_64")
|
set(qt_package_arch_suffix "linux_gcc_64")
|
||||||
endif()
|
endif()
|
||||||
set(qt_dir_prefix "${qt_version}/gcc_64")
|
set(qt_dir_prefix "${qt_version}/gcc_64")
|
||||||
set(qt_package_suffix "-Linux-RHEL_8_10-GCC-Linux-RHEL_8_10-X86_64")
|
if (qt_creator_version VERSION_GREATER_EQUAL "18.0.0")
|
||||||
|
set(qt_package_suffix "-Linux-RHEL_9_4-GCC-Linux-RHEL_9_4-X86_64")
|
||||||
|
else()
|
||||||
|
set(qt_package_suffix "-Linux-RHEL_8_10-GCC-Linux-RHEL_8_10-X86_64")
|
||||||
|
endif()
|
||||||
elseif ("${{ runner.os }}" STREQUAL "macOS")
|
elseif ("${{ runner.os }}" STREQUAL "macOS")
|
||||||
set(url_os "mac_x64")
|
set(url_os "mac_x64")
|
||||||
set(qt_package_arch_suffix "clang_64")
|
set(qt_package_arch_suffix "clang_64")
|
||||||
|
|||||||
@ -395,7 +395,12 @@ void GeneralSettings::showModelsNotSupportedDialog(Utils::StringAspect &aspect)
|
|||||||
.append(
|
.append(
|
||||||
(&aspect == &ccModel) ? Constants::CC_MODEL_HISTORY
|
(&aspect == &ccModel) ? Constants::CC_MODEL_HISTORY
|
||||||
: Constants::CA_MODEL_HISTORY);
|
: Constants::CA_MODEL_HISTORY);
|
||||||
|
#if QODEASSIST_QT_CREATOR_VERSION >= QT_VERSION_CHECK(18, 0, 0)
|
||||||
|
QStringList historyList
|
||||||
|
= Utils::QtcSettings().value(Utils::Key(key.toLocal8Bit())).toStringList();
|
||||||
|
#else
|
||||||
QStringList historyList = qtcSettings()->value(Utils::Key(key.toLocal8Bit())).toStringList();
|
QStringList historyList = qtcSettings()->value(Utils::Key(key.toLocal8Bit())).toStringList();
|
||||||
|
#endif
|
||||||
|
|
||||||
auto modelList = dialog.addComboBox(historyList, aspect.value());
|
auto modelList = dialog.addComboBox(historyList, aspect.value());
|
||||||
dialog.addSpacing();
|
dialog.addSpacing();
|
||||||
@ -432,7 +437,12 @@ void GeneralSettings::showUrlSelectionDialog(
|
|||||||
(&aspect == &ccUrl) ? Constants::CC_URL_HISTORY
|
(&aspect == &ccUrl) ? Constants::CC_URL_HISTORY
|
||||||
: (&aspect == &ccPreset1Url) ? Constants::CC_PRESET1_URL_HISTORY
|
: (&aspect == &ccPreset1Url) ? Constants::CC_PRESET1_URL_HISTORY
|
||||||
: Constants::CA_URL_HISTORY);
|
: Constants::CA_URL_HISTORY);
|
||||||
|
#if QODEASSIST_QT_CREATOR_VERSION >= QT_VERSION_CHECK(18, 0, 0)
|
||||||
|
QStringList historyList
|
||||||
|
= Utils::QtcSettings().value(Utils::Key(key.toLocal8Bit())).toStringList();
|
||||||
|
#else
|
||||||
QStringList historyList = qtcSettings()->value(Utils::Key(key.toLocal8Bit())).toStringList();
|
QStringList historyList = qtcSettings()->value(Utils::Key(key.toLocal8Bit())).toStringList();
|
||||||
|
#endif
|
||||||
allUrls.append(historyList);
|
allUrls.append(historyList);
|
||||||
allUrls.removeDuplicates();
|
allUrls.removeDuplicates();
|
||||||
|
|
||||||
|
|||||||
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include "GetIssuesListTool.hpp"
|
#include "GetIssuesListTool.hpp"
|
||||||
|
|
||||||
|
#include <Version.hpp>
|
||||||
#include <logger/Logger.hpp>
|
#include <logger/Logger.hpp>
|
||||||
#include <projectexplorer/taskhub.h>
|
#include <projectexplorer/taskhub.h>
|
||||||
#include <QJsonArray>
|
#include <QJsonArray>
|
||||||
@ -61,7 +62,16 @@ void IssuesTracker::onTaskAdded(const ProjectExplorer::Task &task)
|
|||||||
m_tasks.append(task);
|
m_tasks.append(task);
|
||||||
|
|
||||||
QString typeStr;
|
QString typeStr;
|
||||||
switch (task.type) {
|
#if QODEASSIST_QT_CREATOR_VERSION >= QT_VERSION_CHECK(18, 0, 0)
|
||||||
|
auto taskType = task.type();
|
||||||
|
auto taskFile = task.file();
|
||||||
|
auto taskLine = task.line();
|
||||||
|
#else
|
||||||
|
auto taskType = task.type;
|
||||||
|
auto taskFile = task.file;
|
||||||
|
auto taskLine = task.line;
|
||||||
|
#endif
|
||||||
|
switch (taskType) {
|
||||||
case ProjectExplorer::Task::Error:
|
case ProjectExplorer::Task::Error:
|
||||||
typeStr = "ERROR";
|
typeStr = "ERROR";
|
||||||
break;
|
break;
|
||||||
@ -76,8 +86,8 @@ void IssuesTracker::onTaskAdded(const ProjectExplorer::Task &task)
|
|||||||
LOG_MESSAGE(QString("IssuesTracker: Task added [%1] %2 at %3:%4 (total: %5)")
|
LOG_MESSAGE(QString("IssuesTracker: Task added [%1] %2 at %3:%4 (total: %5)")
|
||||||
.arg(typeStr)
|
.arg(typeStr)
|
||||||
.arg(task.description())
|
.arg(task.description())
|
||||||
.arg(task.file.toUrlishString())
|
.arg(taskFile.toUrlishString())
|
||||||
.arg(task.line)
|
.arg(taskLine)
|
||||||
.arg(m_tasks.size()));
|
.arg(m_tasks.size()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,7 +112,11 @@ void IssuesTracker::onTasksCleared(Utils::Id categoryId)
|
|||||||
m_tasks.begin(),
|
m_tasks.begin(),
|
||||||
m_tasks.end(),
|
m_tasks.end(),
|
||||||
[categoryId](const ProjectExplorer::Task &task) {
|
[categoryId](const ProjectExplorer::Task &task) {
|
||||||
|
#if QODEASSIST_QT_CREATOR_VERSION >= QT_VERSION_CHECK(18, 0, 0)
|
||||||
|
return task.category() == categoryId;
|
||||||
|
#else
|
||||||
return task.category == categoryId;
|
return task.category == categoryId;
|
||||||
|
#endif
|
||||||
}),
|
}),
|
||||||
m_tasks.end());
|
m_tasks.end());
|
||||||
int removedCount = beforeCount - m_tasks.size();
|
int removedCount = beforeCount - m_tasks.size();
|
||||||
@ -201,13 +215,27 @@ QFuture<QString> GetIssuesListTool::executeAsync(const QJsonObject &input)
|
|||||||
int processedCount = 0;
|
int processedCount = 0;
|
||||||
|
|
||||||
for (const ProjectExplorer::Task &task : tasks) {
|
for (const ProjectExplorer::Task &task : tasks) {
|
||||||
if (severityFilter == "error" && task.type != ProjectExplorer::Task::Error)
|
|
||||||
|
#if QODEASSIST_QT_CREATOR_VERSION >= QT_VERSION_CHECK(18, 0, 0)
|
||||||
|
auto taskType = task.type();
|
||||||
|
auto taskFile = task.file();
|
||||||
|
auto taskLine = task.line();
|
||||||
|
auto taskColumn = task.column();
|
||||||
|
auto taskCategory = task.category();
|
||||||
|
#else
|
||||||
|
auto taskType = task.type;
|
||||||
|
auto taskFile = task.file;
|
||||||
|
auto taskLine = task.line;
|
||||||
|
auto taskColumn = task.column;
|
||||||
|
auto taskCategory = task.category;
|
||||||
|
#endif
|
||||||
|
if (severityFilter == "error" && taskType != ProjectExplorer::Task::Error)
|
||||||
continue;
|
continue;
|
||||||
if (severityFilter == "warning" && task.type != ProjectExplorer::Task::Warning)
|
if (severityFilter == "warning" && taskType != ProjectExplorer::Task::Warning)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
QString typeStr;
|
QString typeStr;
|
||||||
switch (task.type) {
|
switch (taskType) {
|
||||||
case ProjectExplorer::Task::Error:
|
case ProjectExplorer::Task::Error:
|
||||||
typeStr = "ERROR";
|
typeStr = "ERROR";
|
||||||
errorCount++;
|
errorCount++;
|
||||||
@ -223,18 +251,18 @@ QFuture<QString> GetIssuesListTool::executeAsync(const QJsonObject &input)
|
|||||||
|
|
||||||
QString issueText = QString("[%1] %2").arg(typeStr, task.description());
|
QString issueText = QString("[%1] %2").arg(typeStr, task.description());
|
||||||
|
|
||||||
if (!task.file.isEmpty()) {
|
if (!taskFile.isEmpty()) {
|
||||||
issueText += QString("\n File: %1").arg(task.file.toUrlishString());
|
issueText += QString("\n File: %1").arg(taskFile.toUrlishString());
|
||||||
if (task.line > 0) {
|
if (taskLine > 0) {
|
||||||
issueText += QString(":%1").arg(task.line);
|
issueText += QString(":%1").arg(taskLine);
|
||||||
if (task.column > 0) {
|
if (taskColumn > 0) {
|
||||||
issueText += QString(":%1").arg(task.column);
|
issueText += QString(":%1").arg(taskColumn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!task.category.toString().isEmpty()) {
|
if (!taskCategory.toString().isEmpty()) {
|
||||||
issueText += QString("\n Category: %1").arg(task.category.toString());
|
issueText += QString("\n Category: %1").arg(taskCategory.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
results.append(issueText);
|
results.append(issueText);
|
||||||
|
|||||||
Reference in New Issue
Block a user