Remove unused variables

Change-Id: I653f6fa71bb04e049d4e1848a7e38a606692e678
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2022-12-07 19:48:18 +01:00
parent 4ff34cf47f
commit 834f89acf2
12 changed files with 5 additions and 19 deletions

View File

@@ -1751,8 +1751,6 @@ QStringList FileFilter::asFindArguments(const QString &path) const
if (!(filters & QDir::Hidden)) if (!(filters & QDir::Hidden))
filterOptions << "!" << "-name" << ".*"; filterOptions << "!" << "-name" << ".*";
QStringList typesToList;
QStringList filterFilesAndDirs; QStringList filterFilesAndDirs;
if (filters.testFlag(QDir::Dirs)) if (filters.testFlag(QDir::Dirs))
filterFilesAndDirs << "-type" << "d"; filterFilesAndDirs << "-type" << "d";

View File

@@ -862,7 +862,7 @@ bool FileSystemModel::remove(const QModelIndex &aindex)
if (useFileSystemWatcher() && HostOsInfo::isWindowsHost()) { if (useFileSystemWatcher() && HostOsInfo::isWindowsHost()) {
// QTBUG-65683: Remove file system watchers prior to deletion to prevent // QTBUG-65683: Remove file system watchers prior to deletion to prevent
// failure due to locked files on Windows. // failure due to locked files on Windows.
const QStringList watchedPaths = d->unwatchPathsAt(aindex); d->unwatchPathsAt(aindex);
} }
const bool success = (fileInfo.isFile() || fileInfo.isSymLink()) const bool success = (fileInfo.isFile() || fileInfo.isSymLink())
? QFile::remove(path) : QDir(path).removeRecursively(); ? QFile::remove(path) : QDir(path).removeRecursively();
@@ -2192,6 +2192,7 @@ void FileSystemModel::setNameFilters(const QStringList &filters)
// update the bypass filter to only bypass the stuff that must be kept around // update the bypass filter to only bypass the stuff that must be kept around
d->bypassFilters.clear(); d->bypassFilters.clear();
// We guarantee that rootPath will stick around // We guarantee that rootPath will stick around
// TODO: root looks unused - does it really guarantee anything?
QPersistentModelIndex root(index(rootPath())); QPersistentModelIndex root(index(rootPath()));
const QModelIndexList persistentList = persistentIndexList(); const QModelIndexList persistentList = persistentIndexList();
for (const auto &persistentIndex : persistentList) { for (const auto &persistentIndex : persistentList) {

View File

@@ -162,7 +162,8 @@ void AndroidRunner::launchAVD()
if (!m_target || !m_target->project()) if (!m_target || !m_target->project())
return; return;
QStringList androidAbis = AndroidManager::applicationAbis(m_target); // TODO: is this still needed?
AndroidManager::applicationAbis(m_target);
// Get AVD info // Get AVD info
const IDevice::ConstPtr device = DeviceKitAspect::device(m_target->kit()); const IDevice::ConstPtr device = DeviceKitAspect::device(m_target->kit());

View File

@@ -199,10 +199,8 @@ void ActionsFilter::collectEntriesForAction(QAction *action,
const QStringList &path, const QStringList &path,
QList<const QMenu *> &processedMenus) QList<const QMenu *> &processedMenus)
{ {
QList<LocatorFilterEntry> entries;
if (!m_enabledActions.contains(action)) if (!m_enabledActions.contains(action))
return; return;
const QString whatsThis = action->whatsThis();
const QString text = actionText(action); const QString text = actionText(action);
if (QMenu *menu = action->menu()) { if (QMenu *menu = action->menu()) {
if (processedMenus.contains(menu)) if (processedMenus.contains(menu))

View File

@@ -8966,7 +8966,6 @@ private:
if (constructorLocation == CppQuickFixSettings::FunctionLocation::CppFile) { if (constructorLocation == CppQuickFixSettings::FunctionLocation::CppFile) {
implLoc = sourceLocationFor(m_class, &insertedNamespaces); implLoc = sourceLocationFor(m_class, &insertedNamespaces);
implFile = m_sourceFile; implFile = m_sourceFile;
QString clazz = overview.prettyName(m_class->name());
if (m_settings->rewriteTypesinCppFile()) if (m_settings->rewriteTypesinCppFile())
implCode = symbolAt(m_class, m_sourceFile, implLoc); implCode = symbolAt(m_class, m_sourceFile, implLoc);
else else
@@ -8997,7 +8996,6 @@ private:
if (!member->defaultValue.isEmpty()) if (!member->defaultValue.isEmpty())
inClassDeclaration += " = " + member->defaultValue; inClassDeclaration += " = " + member->defaultValue;
inClassDeclaration += ", "; inClassDeclaration += ", ";
QString param = member->parameterName;
if (implFile) { if (implFile) {
FullySpecifiedType type = typeAt(member->type, FullySpecifiedType type = typeAt(member->type,
m_class, m_class,

View File

@@ -145,7 +145,6 @@ QVariantMap JsonWizardFactory::loadDefaultValues(const QString &fileName)
return {}; return {};
} }
QList <Core::IWizardFactory *> result;
const Utils::FilePaths paths = searchPaths(); const Utils::FilePaths paths = searchPaths();
for (const Utils::FilePath &path : paths) { for (const Utils::FilePath &path : paths) {
if (path.isEmpty()) if (path.isEmpty())
@@ -378,7 +377,6 @@ JsonWizardFactory::Page JsonWizardFactory::parsePage(const QVariant &value, QStr
//loadDefaultValues() and loadDefaultValues() //loadDefaultValues() and loadDefaultValues()
void JsonWizardFactory::createWizardFactories() void JsonWizardFactory::createWizardFactories()
{ {
QString errorMessage;
QString verboseLog; QString verboseLog;
const QString wizardFileName = QLatin1String("wizard.json"); const QString wizardFileName = QLatin1String("wizard.json");

View File

@@ -3321,7 +3321,6 @@ void ProjectExplorerPluginPrivate::updateDeployActions()
enableDeployActionsContextMenu = false; enableDeployActionsContextMenu = false;
} }
const QString projectName = project ? project->displayName() : QString();
bool hasProjects = SessionManager::hasProjects(); bool hasProjects = SessionManager::hasProjects();
m_deployAction->setEnabled(enableDeployActions); m_deployAction->setEnabled(enableDeployActions);

View File

@@ -260,7 +260,6 @@ void PyLSClient::updateExtraCompilers(ProjectExplorer::Project *project,
void PyLSClient::updateExtraCompilerContents(ExtraCompiler *compiler, const FilePath &file) void PyLSClient::updateExtraCompilerContents(ExtraCompiler *compiler, const FilePath &file)
{ {
const QString text = QString::fromUtf8(compiler->content(file));
const FilePath target = m_extraCompilerOutputDir.pathAppended(file.fileName()); const FilePath target = m_extraCompilerOutputDir.pathAppended(file.fileName());
target.writeFileContents(compiler->content(file)); target.writeFileContents(compiler->content(file));

View File

@@ -296,7 +296,6 @@ bool QbsBuildSystem::renameFile(Node *context,
QVariant QbsBuildSystem::additionalData(Id id) const QVariant QbsBuildSystem::additionalData(Id id) const
{ {
if (id == "QmlDesignerImportPath") { if (id == "QmlDesignerImportPath") {
QStringList designerImportPaths;
const QJsonObject project = session()->projectData(); const QJsonObject project = session()->projectData();
QStringList paths; QStringList paths;
forAllProducts(project, [&paths](const QJsonObject &product) { forAllProducts(project, [&paths](const QJsonObject &product) {

View File

@@ -91,7 +91,6 @@ public:
template<typename... TypeName> template<typename... TypeName>
bool hasDynamicTypeName(const std::tuple<TypeName...> &typeNames) const bool hasDynamicTypeName(const std::tuple<TypeName...> &typeNames) const
{ {
auto dynamicTypeName_ = dynamicTypeName();
return std::apply([&](auto... typeName) { return hasDynamicTypeName(typeName...); }, return std::apply([&](auto... typeName) { return hasDynamicTypeName(typeName...); },
typeNames); typeNames);
} }

View File

@@ -397,7 +397,6 @@ void QdsNewDialog::accept()
.execute(); .execute();
std::shared_ptr<PresetItem> item = m_wizard.preset(); std::shared_ptr<PresetItem> item = m_wizard.preset();
QString customSizeName = m_qmlCustomWidth + " x " + m_qmlCustomHeight;
UserPresetData preset = currentUserPresetData(m_currentPreset->displayName()); UserPresetData preset = currentUserPresetData(m_currentPreset->displayName());
m_recentsStore.save(preset); m_recentsStore.save(preset);

View File

@@ -201,12 +201,9 @@ void ICodeStylePreferences::fromSettings(const QString &category, QSettings *s)
QVariantMap ICodeStylePreferences::toMap() const QVariantMap ICodeStylePreferences::toMap() const
{ {
QVariantMap map;
if (!currentDelegate()) if (!currentDelegate())
return d->m_tabSettings.toMap(); return d->m_tabSettings.toMap();
return { return {{currentPreferencesKey, currentDelegateId()}};
{currentPreferencesKey, currentDelegateId()}
};
} }
void ICodeStylePreferences::fromMap(const QVariantMap &map) void ICodeStylePreferences::fromMap(const QVariantMap &map)