Fix compiler warnings

Change-Id: I9b0b4a60d1152142f62bf3f76885cf8019714623
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Sivert Krøvel <sivert.krovel@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Eike Ziller
2023-04-28 11:29:08 +02:00
parent 3e953f4896
commit 66c0c36bc1
15 changed files with 29 additions and 26 deletions

View File

@@ -179,7 +179,7 @@ void SyntaxHighlighter::applyFolding(int offset, int length, FoldingRegion regio
{
Q_UNUSED(offset);
Q_UNUSED(length);
Q_D(SyntaxHighlighter);
[[maybe_unused]] Q_D(SyntaxHighlighter);
if (region.type() == FoldingRegion::Begin) {
d->foldingRegions.push_back(region);

View File

@@ -764,7 +764,7 @@ void CMakeBuildStep::updateDeploymentData()
const auto appFileNames = transform<QSet<QString>>(buildSystem()->applicationTargets(),
[](const BuildTargetInfo &appTarget) { return appTarget.targetFilePath.fileName(); });
auto handleFile = [this, &appFileNames, startPos, &deploymentData](const FilePath &filePath) {
auto handleFile = [&appFileNames, startPos, &deploymentData](const FilePath &filePath) {
const DeployableFile::Type type = appFileNames.contains(filePath.fileName())
? DeployableFile::TypeExecutable
: DeployableFile::TypeNormal;

View File

@@ -38,7 +38,6 @@ private:
QNetworkReply *m_listReply = nullptr;
QString m_fetchId;
int m_postId = -1;
bool m_hostChecked = false;
};

View File

@@ -60,7 +60,7 @@
const char GIT_DIRECTORY[] = ".git";
const char HEAD[] = "HEAD";
const char CHERRY_PICK_HEAD[] = "CHERRY_PICK_HEAD";
const char BRANCHES_PREFIX[] = "Branches: ";
[[maybe_unused]] const char BRANCHES_PREFIX[] = "Branches: ";
const char stashNamePrefix[] = "stash@{";
const char noColorOption[] = "--no-color";
const char colorOption[] = "--color=always";
@@ -92,7 +92,7 @@ static QString branchesDisplay(const QString &prefix, QStringList *branches, boo
if (*first)
*first = false;
else
output += QString(sizeof(BRANCHES_PREFIX) - 1, ' '); // Align
output += QString(sizeof(BRANCHES_PREFIX) - 1 /* the \0 */, ' '); // Align
output += prefix + ": ";
// If there are more than 'limit' branches, list limit/2 (first limit/4 and last limit/4)
if (count > limit) {

View File

@@ -152,11 +152,7 @@ const QString renesasProgrammerEnvVar{"RenesasFlashProgrammer_PATH"};
const char renesasProgrammerLabel[]{"Renesas Flash Programmer"};
const QString renesasProgrammerDetectionPath{HostOsInfo::withExecutableSuffix("rfp-cli")};
const char renesasE2StudioCmakeVar[]{"EK_RA6M3G_E2_PROJECT_PATH"};
const char renesasE2StudioDefaultPath[]{"%{Env:HOME}/e2_studio/workspace"};
const QString renesasE2StudioPath{(FileUtils::homePath() / "/e2_studio/workspace").toUserOutput()};
const char renesasE2StudioLabel[]{"Path to project for Renesas e2 Studio"};
const char renesasE2StudioSetting[]{"RenesasE2StudioPath"};
const char cypressProgrammerSetting[]{"CypressAutoFlashUtil"};
const char cypressProgrammerCmakeVar[]{"INFINEON_AUTO_FLASH_UTILITY_DIR"};
@@ -1760,9 +1756,9 @@ void McuSupportTest::test_nonemptyVersionDetector()
// pkgDesc.versionDetection.xmlAttribute left empty
pkgDesc.shouldAddToSystemPath = false;
const auto package = targetFactory.createPackage(pkgDesc);
QVERIFY(package->getVersionDetector() != nullptr);
QCOMPARE(typeid(*package->getVersionDetector()).name(),
typeid(McuPackageExecutableVersionDetector).name());
const McuPackageVersionDetector *detector = package->getVersionDetector();
QVERIFY(detector != nullptr);
QCOMPARE(typeid(*detector).name(), typeid(McuPackageExecutableVersionDetector).name());
}
void McuSupportTest::test_emptyVersionDetector()

View File

@@ -29,6 +29,7 @@ public:
QmlObjectNode(const ModelNode &modelNode)
: QmlModelNodeFacade(modelNode)
{}
virtual ~QmlObjectNode() = default;
static bool isValidQmlObjectNode(const ModelNode &modelNode);
bool isValid() const override;

View File

@@ -42,7 +42,7 @@ public:
private:
// m_pathCache and m_storage are only used when compiled for QDS
#ifdef QDS_HAS_QMLDOM
PathCache &m_pathCache;
[[maybe_unused]] PathCache &m_pathCache;
ProjectStorage &m_storage;
#endif
};

View File

@@ -41,6 +41,11 @@ void MultiFileDownloader::setDownloader(FileDownloader *downloader)
});
}
FileDownloader *MultiFileDownloader::downloader()
{
return m_downloader;
}
void MultiFileDownloader::start()
{
emit downloadStarting();

View File

@@ -13,7 +13,7 @@ class MultiFileDownloader : public QObject
{
Q_OBJECT
Q_PROPERTY(FileDownloader *downloader WRITE setDownloader)
Q_PROPERTY(FileDownloader *downloader READ downloader WRITE setDownloader)
Q_PROPERTY(bool finished READ finished NOTIFY finishedChanged)
Q_PROPERTY(int progress READ progress NOTIFY progressChanged)
Q_PROPERTY(QUrl baseUrl READ baseUrl WRITE setBaseUrl NOTIFY baseUrlChanged)
@@ -34,6 +34,7 @@ public:
void setTargetDirPath(const QString &path);
QString targetDirPath() const;
void setDownloader(FileDownloader *downloader);
FileDownloader *downloader();
bool finished() const;
int progress() const;

View File

@@ -88,11 +88,14 @@ QmlPreviewRunner::QmlPreviewRunner(RunControl *runControl, const QmlPreviewRunne
if (!runControl->isRunning())
return;
this->connect(runControl, &RunControl::stopped, [this, runControl] {
auto rc = new RunControl(ProjectExplorer::Constants::QML_PREVIEW_RUN_MODE);
rc->copyDataFromRunControl(runControl);
ProjectExplorerPlugin::startRunControl(rc);
});
this->connect(runControl,
&RunControl::stopped,
ProjectExplorerPlugin::instance(),
[runControl] {
auto rc = new RunControl(ProjectExplorer::Constants::QML_PREVIEW_RUN_MODE);
rc->copyDataFromRunControl(runControl);
ProjectExplorerPlugin::startRunControl(rc);
});
runControl->initiateStop();
});
@@ -124,7 +127,7 @@ QUrl QmlPreviewRunner::serverUrl() const
QmlPreviewRunWorkerFactory::QmlPreviewRunWorkerFactory(QmlPreviewPlugin *plugin,
const QmlPreviewRunnerSetting *runnerSettings)
{
setProducer([this, plugin, runnerSettings](RunControl *runControl) {
setProducer([plugin, runnerSettings](RunControl *runControl) {
auto runner = new QmlPreviewRunner(runControl, *runnerSettings);
QObject::connect(plugin, &QmlPreviewPlugin::updatePreviews,
runner, &QmlPreviewRunner::loadFile);

View File

@@ -40,7 +40,7 @@ public:
connect(target, &Target::kitChanged, [aspect] { aspect->setRemoteEnvironment({}); });
connect(fetchButton, &QPushButton::clicked, this, [this, aspect, target] {
connect(fetchButton, &QPushButton::clicked, this, [aspect, target] {
if (IDevice::ConstPtr device = DeviceKitAspect::device(target->kit())) {
DeviceFileAccess *access = device->fileAccess();
QTC_ASSERT(access, return);

View File

@@ -185,7 +185,7 @@ void SquishNavigationWidget::contextMenuEvent(QContextMenuEvent *event)
QAction *closeAllSuites = new QAction(Tr::tr("Close All Test Suites"), &menu);
menu.addAction(closeAllSuites);
connect(closeAllSuites, &QAction::triggered, this, [this] {
connect(closeAllSuites, &QAction::triggered, this, [] {
if (SquishMessages::simpleQuestion(Tr::tr("Close All Test Suites"),
Tr::tr("Close all test suites?"
/*"\nThis will close all related files as well."*/))

View File

@@ -44,8 +44,6 @@ void PrintTo(const std::vector<UserPresetData> &presets, std::ostream *os)
using namespace StudioWelcome;
constexpr char ARRAY_NAME[] = "UserPresets";
class FakeStoreIo : public StoreIo
{
public:

View File

@@ -28,7 +28,7 @@ public:
MOCK_METHOD(void, prepare, (Utils::SmallStringView sqlStatement), ());
MOCK_METHOD(void, execute, (Utils::SmallStringView sqlStatement), ());
MOCK_METHOD(void, execute, (Utils::SmallStringView sqlStatement), (override));
MOCK_METHOD(int64_t, lastInsertedRowId, (), (const));

View File

@@ -43,7 +43,7 @@ public:
());
template<typename ResultType, typename... QueryTypes>
auto optionalValue(const QueryTypes &...queryValues)
auto optionalValue([[maybe_unused]] const QueryTypes &...queryValues)
{
static_assert(!std::is_same_v<ResultType, ResultType>,
"SqliteReadStatementMock::value does not handle result type!");