Fix some warnings

Unused functions & variables, initialization order, signedness, non-
virtual destructor.

Change-Id: I405d768fe0e02a36a16c2cead9e1bc2f6a23fb75
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Christian Kandeler
2021-09-01 17:04:16 +02:00
parent 391588d08e
commit 3be9f52980
9 changed files with 11 additions and 39 deletions

View File

@@ -355,6 +355,7 @@ QQuickItem *Qt5NodeInstanceServer::parentEffectItem(QQuickItem *item)
return nullptr;
}
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
static bool isEffectItem(QQuickItem *item, QQuickShaderEffectSource *sourceItem)
{
QQuickItemPrivate *pItem = QQuickItemPrivate::get(sourceItem);
@@ -375,6 +376,7 @@ static bool isLayerEnabled(QQuickItemPrivate *item)
{
return item && item->layer() && item->layer()->enabled();
}
#endif // QT_VERSION check
QImage Qt5NodeInstanceServer::grabItem(QQuickItem *item)
{

View File

@@ -102,7 +102,6 @@ private:
Internal::LauncherSocket *const m_socket;
Internal::LauncherProcess *m_process = nullptr;
QString m_pathToLauncher;
int m_startRequests = 0;
};
LauncherInterfacePrivate::LauncherInterfacePrivate()

View File

@@ -484,12 +484,6 @@ void CallerHandle::setUnixTerminalDisabled()
m_unixTerminalDisabled = true;
}
static void warnAboutWrongSignal(QProcess::ProcessState state, CallerHandle::SignalType newSignal)
{
qWarning() << "LauncherHandle::doWaitForSignal: Can't wait for" << newSignal <<
"while being in" << state << "state.";
}
bool CallerHandle::waitForSignal(int msecs, CallerHandle::SignalType newSignal)
{
QTC_ASSERT(isCalledFromCallersThread(), return false);

View File

@@ -193,7 +193,7 @@ class LauncherHandle : public QObject
Q_OBJECT
public:
// Called from caller's thread, moved to launcher's thread afterwards.
LauncherHandle(quintptr token, ProcessMode mode) : m_token(token) {}
LauncherHandle(quintptr token, ProcessMode) : m_token(token) {}
// Called from caller's thread exclusively.
bool waitForSignal(int msecs, CallerHandle::SignalType newSignal);
CallerHandle *callerHandle() const { return m_callerHandle; }

View File

@@ -160,8 +160,8 @@ private:
return int((nsesc + halfMillion) / million);
}
const char * const m_functionName;
const bool m_measureProcess;
const char *m_functionName;
std::atomic_int m_hitThisAll = 0;
std::atomic_int m_hitThisMain = 0;
std::atomic_int64_t m_totalThisAll = 0;

View File

@@ -118,6 +118,8 @@ CompilerOptionsBuilder::CompilerOptionsBuilder(const ProjectPart &projectPart,
{
}
CompilerOptionsBuilder::~CompilerOptionsBuilder() = default;
QStringList CompilerOptionsBuilder::build(ProjectFile::Kind fileKind,
UsePrecompiledHeaders usePrecompiledHeaders)
{

View File

@@ -52,6 +52,7 @@ public:
UseBuildSystemWarnings useBuildSystemWarnings = UseBuildSystemWarnings::No,
const QString &clangVersion = {},
const Utils::FilePath &clangIncludeDirectory = {});
virtual ~CompilerOptionsBuilder();
QStringList build(ProjectFile::Kind fileKind, UsePrecompiledHeaders usePrecompiledHeaders);
QStringList options() const { return m_options; }

View File

@@ -81,14 +81,14 @@ void AnnotationListModel::resetModel()
ModelNode AnnotationListModel::getModelNode(int id) const
{
if (id >= 0 && id < m_annoList.size())
if (id >= 0 && id < int(m_annoList.size()))
return m_annoList.at(id).node;
return {};
}
AnnotationListEntry AnnotationListModel::getStoredAnnotation(int id) const
{
if (id >= 0 && id < m_annoList.size())
if (id >= 0 && id < int(m_annoList.size()))
return m_annoList.at(id);
return {};
@@ -134,7 +134,7 @@ int AnnotationListModel::columnCount(const QModelIndex &parent) const
QVariant AnnotationListModel::data(const QModelIndex &index, int role) const
{
if (!index.isValid() || index.row() < 0 || index.row() >= m_annoList.size())
if (!index.isValid() || index.row() < 0 || index.row() >= int(m_annoList.size()))
return {};
const auto &item = m_annoList.at(index.row());
@@ -153,7 +153,7 @@ QVariant AnnotationListModel::data(const QModelIndex &index, int role) const
Qt::ItemFlags AnnotationListModel::flags(const QModelIndex &index) const
{
if (!index.isValid() || index.row() < 0 || index.row() >= m_annoList.size())
if (!index.isValid() || index.row() < 0 || index.row() >= int(m_annoList.size()))
return Qt::NoItemFlags;
return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
}

View File

@@ -434,32 +434,6 @@ void VcsOutputWindow::appendWarning(const QString &text)
append(text, Warning, false);
}
// Helper to format arguments for log windows hiding common password options.
static inline QString formatArguments(const QStringList &args)
{
const char passwordOptionC[] = "--password";
QString rc;
QTextStream str(&rc);
const int size = args.size();
// Skip authentication options
for (int i = 0; i < size; i++) {
const QString arg = filterPasswordFromUrls(args.at(i));
if (i)
str << ' ';
if (arg.startsWith(QString::fromLatin1(passwordOptionC) + '=')) {
str << ProcessArgs::quoteArg("--password=********");
continue;
}
str << ProcessArgs::quoteArg(arg);
if (arg == passwordOptionC) {
str << ' ' << ProcessArgs::quoteArg("********");
i++;
}
}
return rc;
}
QString VcsOutputWindow::msgExecutionLogEntry(const FilePath &workingDir, const CommandLine &command)
{
if (workingDir.isEmpty())