forked from qt-creator/qt-creator
ProjectExplorer: Simplify return statements
Change-Id: Ifef006cd2dcc567097ce16376eab9ccedb092f04 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -196,7 +196,7 @@ static Abi macAbiForCpu(quint32 type) {
|
||||
case 0x01000000 + 12: // CPU_TYPE_ARM64
|
||||
return Abi(Abi::ArmArchitecture, Abi::DarwinOS, Abi::GenericFlavor, Abi::MachOFormat, 64);
|
||||
default:
|
||||
return Abi();
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -451,7 +451,7 @@ Abi Abi::abiFromTargetTriplet(const QString &triple)
|
||||
{
|
||||
const QString machine = triple.toLower();
|
||||
if (machine.isEmpty())
|
||||
return Abi();
|
||||
return {};
|
||||
|
||||
const QStringList parts = machine.split(QRegularExpression("[ /-]"));
|
||||
|
||||
@@ -873,7 +873,7 @@ Abi Abi::fromString(const QString &abiString)
|
||||
if (!abiParts.isEmpty()) {
|
||||
architecture = architectureFromString(abiParts.at(0));
|
||||
if (abiParts.at(0) != toString(architecture))
|
||||
return Abi();
|
||||
return {};
|
||||
}
|
||||
|
||||
Abi::OS os = UnknownOS;
|
||||
|
||||
@@ -52,7 +52,7 @@ private:
|
||||
}
|
||||
return displayPath.isEmpty() ? Tr::tr("[none]") : displayPath.toUserOutput();
|
||||
}
|
||||
return QVariant();
|
||||
return {};
|
||||
}
|
||||
|
||||
const RunConfigurationCreationInfo m_creationInfo;
|
||||
|
||||
@@ -546,9 +546,8 @@ bool BuildConfiguration::isEnabled() const
|
||||
|
||||
QString BuildConfiguration::disabledReason() const
|
||||
{
|
||||
if (!buildSystem()->hasParsingData())
|
||||
return (Tr::tr("The project was not parsed successfully."));
|
||||
return QString();
|
||||
return buildSystem()->hasParsingData() ? QString()
|
||||
: Tr::tr("The project was not parsed successfully.");
|
||||
}
|
||||
|
||||
bool BuildConfiguration::regenerateBuildFiles(Node *node)
|
||||
|
||||
@@ -199,13 +199,13 @@ static inline QIcon wizardIcon(const QString &configFileFullPath,
|
||||
if (fi.isFile() && fi.isAbsolute())
|
||||
return QIcon(fi.absoluteFilePath());
|
||||
if (!fi.isRelative())
|
||||
return QIcon();
|
||||
return {};
|
||||
// Expand by config path
|
||||
const QFileInfo absFi(QFileInfo(configFileFullPath).absolutePath() +
|
||||
QLatin1Char('/') + xmlIconFileName);
|
||||
if (absFi.isFile())
|
||||
return QIcon(absFi.absoluteFilePath());
|
||||
return QIcon();
|
||||
return {};
|
||||
}
|
||||
|
||||
// Forward a reader over element text
|
||||
@@ -929,13 +929,13 @@ QString CustomWizardContext::processFile(const FieldReplacementMap &fm, QString
|
||||
if (!errorMessage.isEmpty()) {
|
||||
qWarning("Error processing custom widget file: %s\nFile:\n%s",
|
||||
qPrintable(errorMessage), qPrintable(in));
|
||||
return QString();
|
||||
return {};
|
||||
}
|
||||
|
||||
if (!Utils::TemplateEngine::preprocessText(in, &out, &errorMessage)) {
|
||||
qWarning("Error preprocessing custom widget file: %s\nFile:\n%s",
|
||||
qPrintable(errorMessage), qPrintable(in));
|
||||
return QString();
|
||||
return {};
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Internal {
|
||||
QStringList fixGeneratorScript(const QString &configFile, QString binary)
|
||||
{
|
||||
if (binary.isEmpty())
|
||||
return QStringList();
|
||||
return {};
|
||||
// Expand to full path if it is relative and in the wizard
|
||||
// directory, else assume it can be found in path.
|
||||
QFileInfo binaryInfo(binary);
|
||||
|
||||
@@ -81,7 +81,7 @@ QVariant DependenciesModel::data(const QModelIndex &index, int role) const
|
||||
case Qt::DecorationRole:
|
||||
return Utils::FileIconProvider::icon(p->projectFilePath());
|
||||
default:
|
||||
return QVariant();
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
{
|
||||
if (role == Qt::DisplayRole || role == Qt::EditRole)
|
||||
return column == 0 ? file.localFilePath().toUserOutput() : file.remoteDirectory();
|
||||
return QVariant();
|
||||
return {};
|
||||
}
|
||||
|
||||
bool setData(int column, const QVariant &data, int role) override
|
||||
|
||||
@@ -73,7 +73,7 @@ DesktopDevice::~DesktopDevice() = default;
|
||||
|
||||
IDevice::DeviceInfo DesktopDevice::deviceInformation() const
|
||||
{
|
||||
return DeviceInfo();
|
||||
return {};
|
||||
}
|
||||
|
||||
IDeviceWidget *DesktopDevice::createWidget()
|
||||
|
||||
@@ -141,9 +141,9 @@ int DeviceManagerModel::rowCount(const QModelIndex &parent) const
|
||||
QVariant DeviceManagerModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
if (!index.isValid() || index.row() >= rowCount())
|
||||
return QVariant();
|
||||
return {};
|
||||
if (role != Qt::DisplayRole && role != Qt::UserRole)
|
||||
return QVariant();
|
||||
return {};
|
||||
const IDevice::ConstPtr dev = device(index.row());
|
||||
if (role == Qt::UserRole)
|
||||
return dev->id().toSetting();
|
||||
|
||||
@@ -259,7 +259,7 @@ ProcessInfo DeviceProcessesDialogPrivate::selectedProcess() const
|
||||
{
|
||||
const QModelIndexList indexes = procView->selectionModel()->selectedIndexes();
|
||||
if (indexes.empty() || !processList)
|
||||
return ProcessInfo();
|
||||
return {};
|
||||
return processList->at(proxyModel.mapToSource(indexes.first()).row());
|
||||
}
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ QVariant DeviceProcessTreeItem::data(int column, int role) const
|
||||
else
|
||||
return process.commandLine;
|
||||
}
|
||||
return QVariant();
|
||||
return {};
|
||||
}
|
||||
|
||||
void ProcessList::setFinished()
|
||||
|
||||
@@ -114,7 +114,7 @@ static FilePath filePathValue(const FilePath &value, const QStringList &candidat
|
||||
if (!filePath.isEmpty())
|
||||
return filePath;
|
||||
}
|
||||
return FilePath();
|
||||
return {};
|
||||
}
|
||||
|
||||
// Keep read locker locked while calling this method
|
||||
|
||||
@@ -350,12 +350,12 @@ GroupItem ProcessExtraCompiler::taskItemImpl(const ContentProvider &provider)
|
||||
|
||||
FilePath ProcessExtraCompiler::workingDirectory() const
|
||||
{
|
||||
return FilePath();
|
||||
return {};
|
||||
}
|
||||
|
||||
QStringList ProcessExtraCompiler::arguments() const
|
||||
{
|
||||
return QStringList();
|
||||
return {};
|
||||
}
|
||||
|
||||
bool ProcessExtraCompiler::prepareToRun(const QByteArray &sourceContents)
|
||||
|
||||
@@ -48,7 +48,7 @@ private:
|
||||
return displayName();
|
||||
if (column == 1 && role == Qt::CheckStateRole)
|
||||
return m_enabled ? Qt::Checked : Qt::Unchecked;
|
||||
return QVariant();
|
||||
return {};
|
||||
}
|
||||
|
||||
bool setData(int column, const QVariant &data, int role) override
|
||||
|
||||
@@ -1670,7 +1670,7 @@ QString ClangToolChain::sysRoot() const
|
||||
{
|
||||
const MingwToolChain *parentTC = mingwToolChainFromId(m_parentToolChainId);
|
||||
if (!parentTC)
|
||||
return QString();
|
||||
return {};
|
||||
|
||||
const FilePath mingwCompiler = parentTC->compilerCommand();
|
||||
return mingwCompiler.parentDir().parentDir().toString();
|
||||
|
||||
@@ -59,7 +59,7 @@ private:
|
||||
QVariant data(int column, int role) const override
|
||||
{
|
||||
if (column != 0 || role != Qt::DisplayRole)
|
||||
return QVariant();
|
||||
return {};
|
||||
return m_candidate->file.filePath().toUserOutput();
|
||||
}
|
||||
|
||||
@@ -192,7 +192,7 @@ JsonWizard::GeneratorFiles JsonWizard::generateFileList()
|
||||
Tr::tr("The wizard failed to generate files.<br>"
|
||||
"The error message was: \"%1\".").arg(errorMessage));
|
||||
reject();
|
||||
return GeneratorFiles();
|
||||
return {};
|
||||
}
|
||||
|
||||
QList<GeneratorFile *> projectFiles;
|
||||
@@ -216,7 +216,7 @@ QString JsonWizard::stringValue(const QString &n) const
|
||||
{
|
||||
QVariant v = value(n);
|
||||
if (!v.isValid())
|
||||
return QString();
|
||||
return {};
|
||||
|
||||
if (v.typeId() == QVariant::String) {
|
||||
QString tmp = m_expander.expand(v.toString());
|
||||
@@ -271,7 +271,7 @@ QVariant JsonWizard::value(const QString &n) const
|
||||
return v;
|
||||
if (hasField(n))
|
||||
return field(n); // Cannot contain macros!
|
||||
return QVariant();
|
||||
return {};
|
||||
}
|
||||
|
||||
bool JsonWizard::boolFromVariant(const QVariant &v, MacroExpander *expander)
|
||||
@@ -287,7 +287,7 @@ QString JsonWizard::stringListToArrayString(const QStringList &list, const Macro
|
||||
{
|
||||
// Todo: Handle ' embedded in the strings better.
|
||||
if (list.isEmpty())
|
||||
return QString();
|
||||
return {};
|
||||
|
||||
QStringList tmp = Utils::transform(list, [expander](const QString &i) {
|
||||
return expander->expand(i).replace(QLatin1Char('\''), QLatin1String("\\'"));
|
||||
|
||||
@@ -660,7 +660,7 @@ QList<QVariant> JsonWizardFactory::objectOrList(const QVariant &data, QString *e
|
||||
QString JsonWizardFactory::localizedString(const QVariant &value)
|
||||
{
|
||||
if (value.isNull())
|
||||
return QString();
|
||||
return {};
|
||||
if (value.typeId() == QVariant::Map) {
|
||||
QVariantMap tmp = value.toMap();
|
||||
const QString locale = languageSetting().toLower();
|
||||
@@ -671,7 +671,7 @@ QString JsonWizardFactory::localizedString(const QVariant &value)
|
||||
if (!result.isEmpty())
|
||||
return result;
|
||||
}
|
||||
return QString();
|
||||
return {};
|
||||
}
|
||||
return Tr::tr(value.toByteArray());
|
||||
}
|
||||
@@ -871,7 +871,7 @@ QVariant JsonWizardFactoryJsExtension::value(const QString &name) const
|
||||
return Id::toStringList(m_availableFeatures);
|
||||
if (name == "Plugins")
|
||||
return Id::toStringList(m_pluginFeatures);
|
||||
return QVariant();
|
||||
return {};
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -149,7 +149,7 @@ Utils::Id SysRootKitAspect::id()
|
||||
FilePath SysRootKitAspect::sysRoot(const Kit *k)
|
||||
{
|
||||
if (!k)
|
||||
return FilePath();
|
||||
return {};
|
||||
|
||||
if (!k->value(SysRootKitAspect::id()).toString().isEmpty())
|
||||
return FilePath::fromString(k->value(SysRootKitAspect::id()).toString());
|
||||
@@ -158,8 +158,7 @@ FilePath SysRootKitAspect::sysRoot(const Kit *k)
|
||||
if (!tc->sysRoot().isEmpty())
|
||||
return FilePath::fromString(tc->sysRoot());
|
||||
}
|
||||
|
||||
return FilePath();
|
||||
return {};
|
||||
}
|
||||
|
||||
void SysRootKitAspect::setSysRoot(Kit *k, const FilePath &v)
|
||||
@@ -584,7 +583,7 @@ QByteArray ToolChainKitAspect::toolChainId(const Kit *k, Id language)
|
||||
{
|
||||
QTC_ASSERT(ToolChainManager::isLoaded(), return nullptr);
|
||||
if (!k)
|
||||
return QByteArray();
|
||||
return {};
|
||||
QVariantMap value = k->value(ToolChainKitAspect::id()).toMap();
|
||||
return value.value(language.toString(), QByteArray()).toByteArray();
|
||||
}
|
||||
@@ -977,7 +976,7 @@ QVariant DeviceKitAspect::defaultValue(const Kit *k) const
|
||||
return dev->id().toString();
|
||||
}
|
||||
// Fail: No device set up.
|
||||
return QString();
|
||||
return {};
|
||||
}
|
||||
|
||||
Tasks DeviceKitAspect::validate(const Kit *k) const
|
||||
@@ -1544,7 +1543,7 @@ EnvironmentItems EnvironmentKitAspect::environmentChanges(const Kit *k)
|
||||
{
|
||||
if (k)
|
||||
return EnvironmentItem::fromStringList(k->value(EnvironmentKitAspect::id()).toStringList());
|
||||
return EnvironmentItems();
|
||||
return {};
|
||||
}
|
||||
|
||||
void EnvironmentKitAspect::setEnvironmentChanges(Kit *k, const EnvironmentItems &changes)
|
||||
|
||||
@@ -702,19 +702,19 @@ QList<OutputLineParser *> KitAspect::createOutputParsers(const Kit *k) const
|
||||
QString KitAspect::displayNamePostfix(const Kit *k) const
|
||||
{
|
||||
Q_UNUSED(k)
|
||||
return QString();
|
||||
return {};
|
||||
}
|
||||
|
||||
QSet<Id> KitAspect::supportedPlatforms(const Kit *k) const
|
||||
{
|
||||
Q_UNUSED(k)
|
||||
return QSet<Id>();
|
||||
return {};
|
||||
}
|
||||
|
||||
QSet<Id> KitAspect::availableFeatures(const Kit *k) const
|
||||
{
|
||||
Q_UNUSED(k)
|
||||
return QSet<Id>();
|
||||
return {};
|
||||
}
|
||||
|
||||
void KitAspect::addToMacroExpander(Kit *k, MacroExpander *expander) const
|
||||
@@ -816,7 +816,7 @@ QString KitFeatureProvider::displayNameForPlatform(Id id) const
|
||||
QTC_CHECK(!dn.isEmpty());
|
||||
return dn;
|
||||
}
|
||||
return QString();
|
||||
return {};
|
||||
}
|
||||
|
||||
} // namespace ProjectExplorer
|
||||
|
||||
@@ -230,11 +230,11 @@ void KitOptionsPageWidget::updateState()
|
||||
QModelIndex KitOptionsPageWidget::currentIndex() const
|
||||
{
|
||||
if (!m_selectionModel)
|
||||
return QModelIndex();
|
||||
return {};
|
||||
|
||||
QModelIndexList idxs = m_selectionModel->selectedRows();
|
||||
if (idxs.count() != 1)
|
||||
return QModelIndex();
|
||||
return {};
|
||||
return idxs.at(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ static QString platformName(MsvcToolChain::Platform t)
|
||||
{
|
||||
if (const MsvcPlatform *p = platformEntry(t))
|
||||
return QLatin1String(p->name);
|
||||
return QString();
|
||||
return {};
|
||||
}
|
||||
|
||||
static bool hostPrefersPlatform(MsvcToolChain::Platform platform)
|
||||
@@ -2120,7 +2120,7 @@ std::optional<QString> MsvcToolChain::generateEnvironmentSettings(const Utils::E
|
||||
saver.write("@echo " + marker.toLocal8Bit() + "\r\n");
|
||||
if (!saver.finalize()) {
|
||||
qWarning("%s: %s", Q_FUNC_INFO, qPrintable(saver.errorString()));
|
||||
return QString();
|
||||
return {};
|
||||
}
|
||||
|
||||
Utils::Process run;
|
||||
@@ -2161,13 +2161,13 @@ std::optional<QString> MsvcToolChain::generateEnvironmentSettings(const Utils::E
|
||||
const int start = stdOut.indexOf(marker);
|
||||
if (start == -1) {
|
||||
qWarning("Could not find start marker in stdout output.");
|
||||
return QString();
|
||||
return {};
|
||||
}
|
||||
|
||||
const int end = stdOut.indexOf(marker, start + 1);
|
||||
if (end == -1) {
|
||||
qWarning("Could not find end marker in stdout output.");
|
||||
return QString();
|
||||
return {};
|
||||
}
|
||||
|
||||
const QString output = stdOut.mid(start, end - start);
|
||||
|
||||
@@ -725,7 +725,7 @@ FilePath Project::projectDirectory() const
|
||||
FilePath Project::projectDirectory(const FilePath &top)
|
||||
{
|
||||
if (top.isEmpty())
|
||||
return FilePath();
|
||||
return {};
|
||||
return top.absolutePath();
|
||||
}
|
||||
|
||||
@@ -1232,10 +1232,10 @@ void Project::addVariablesToMacroExpander(const QByteArray &prefix,
|
||||
//: %1 is something like "Active project"
|
||||
::PE::Tr::tr("%1: Variables in the active build environment.")
|
||||
.arg(descriptor),
|
||||
[bcGetter](const QString &var) {
|
||||
[bcGetter](const QString &var) -> QString {
|
||||
if (BuildConfiguration *const bc = bcGetter())
|
||||
return bc->environment().expandedValueForKey(var);
|
||||
return QString();
|
||||
return {};
|
||||
});
|
||||
|
||||
expander->registerVariable(fullPrefix + "RunConfig:Name",
|
||||
@@ -1245,7 +1245,7 @@ void Project::addVariablesToMacroExpander(const QByteArray &prefix,
|
||||
[rcGetter]() -> QString {
|
||||
if (const RunConfiguration *const rc = rcGetter())
|
||||
return rc->displayName();
|
||||
return QString();
|
||||
return {};
|
||||
});
|
||||
expander->registerFileVariables(fullPrefix + "RunConfig:Executable",
|
||||
//: %1 is something like "Active project"
|
||||
@@ -1262,25 +1262,25 @@ void Project::addVariablesToMacroExpander(const QByteArray &prefix,
|
||||
::PE::Tr::tr(
|
||||
"%1: Variables in the environment of the active run configuration.")
|
||||
.arg(descriptor),
|
||||
[rcGetter](const QString &var) {
|
||||
[rcGetter](const QString &var) -> QString {
|
||||
if (const RunConfiguration *const rc = rcGetter()) {
|
||||
if (const auto envAspect = rc->aspect<EnvironmentAspect>())
|
||||
return envAspect->environment().expandedValueForKey(var);
|
||||
}
|
||||
return QString();
|
||||
return {};
|
||||
});
|
||||
expander->registerVariable(fullPrefix + "RunConfig:WorkingDir",
|
||||
//: %1 is something like "Active project"
|
||||
::PE::Tr::tr(
|
||||
"%1: Working directory of the active run configuration.")
|
||||
.arg(descriptor),
|
||||
[rcGetter] {
|
||||
[rcGetter]() -> QString {
|
||||
if (const RunConfiguration *const rc = rcGetter()) {
|
||||
if (const auto wdAspect
|
||||
= rc->aspect<WorkingDirectoryAspect>())
|
||||
return wdAspect->workingDirectory().toString();
|
||||
}
|
||||
return QString();
|
||||
return {};
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -24,8 +24,7 @@ QByteArray Macro::toByteArray() const
|
||||
case MacroType::Undefine: return QByteArray("#undef ") + key;
|
||||
case MacroType::Invalid: break;
|
||||
}
|
||||
|
||||
return QByteArray();
|
||||
return {};
|
||||
}
|
||||
|
||||
QByteArray Macro::toByteArray(const Macros ¯os)
|
||||
|
||||
@@ -406,14 +406,14 @@ QString ProjectManagerPrivate::sessionTitle(const FilePath &filePath)
|
||||
} else {
|
||||
return sessionName.isEmpty() ? Tr::tr("Untitled") : sessionName;
|
||||
}
|
||||
return QString();
|
||||
return {};
|
||||
}
|
||||
|
||||
QString ProjectManagerPrivate::locationInProject(const FilePath &filePath)
|
||||
{
|
||||
const Project *project = ProjectManager::projectForFile(filePath);
|
||||
if (!project)
|
||||
return QString();
|
||||
return {};
|
||||
|
||||
const FilePath parentDir = filePath.parentDir();
|
||||
if (parentDir == project->projectDirectory())
|
||||
|
||||
@@ -190,7 +190,7 @@ QVariant FlatModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
const Node * const node = nodeForIndex(index);
|
||||
if (!node)
|
||||
return QVariant();
|
||||
return {};
|
||||
|
||||
const FolderNode * const folderNode = node->asFolderNode();
|
||||
const ContainerNode * const containerNode = node->asContainerNode();
|
||||
@@ -247,8 +247,7 @@ QVariant FlatModel::data(const QModelIndex &index, int role) const
|
||||
case Project::isParsingRole:
|
||||
return project && bs ? bs->isParsing() && !project->needsConfiguration() : false;
|
||||
}
|
||||
|
||||
return QVariant();
|
||||
return {};
|
||||
}
|
||||
|
||||
Qt::ItemFlags FlatModel::flags(const QModelIndex &index) const
|
||||
|
||||
@@ -911,7 +911,7 @@ bool ProjectNode::addSubProject(const FilePath &proFilePath)
|
||||
|
||||
QStringList ProjectNode::subProjectFileNamePatterns() const
|
||||
{
|
||||
return QStringList();
|
||||
return {};
|
||||
}
|
||||
|
||||
bool ProjectNode::removeSubProject(const FilePath &proFilePath)
|
||||
|
||||
@@ -142,7 +142,7 @@ public:
|
||||
virtual ContainerNode *asContainerNode() { return nullptr; }
|
||||
virtual const ContainerNode *asContainerNode() const { return nullptr; }
|
||||
|
||||
virtual QString buildKey() const { return QString(); }
|
||||
virtual QString buildKey() const { return {}; }
|
||||
|
||||
static bool sortByPath(const Node *a, const Node *b);
|
||||
void setParentFolderNode(FolderNode *parentFolder);
|
||||
|
||||
@@ -81,10 +81,10 @@ QVariant ProjectModel::data(const QModelIndex &index, int role) const
|
||||
const Id projectBase = PROJECT_BASE_ID;
|
||||
if (Command *cmd = ActionManager::command(projectBase.withSuffix(index.row() + 1)))
|
||||
return cmd->keySequence().toString(QKeySequence::NativeText);
|
||||
return QVariant();
|
||||
return {};
|
||||
}
|
||||
default:
|
||||
return QVariant();
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -246,8 +246,7 @@ QVariant MiscSettingsPanelItem::data(int column, int role) const
|
||||
|
||||
if (role == ActiveItemRole) // We are the active one.
|
||||
return QVariant::fromValue<TreeItem *>(const_cast<MiscSettingsPanelItem *>(this));
|
||||
|
||||
return QVariant();
|
||||
return {};
|
||||
}
|
||||
|
||||
Qt::ItemFlags MiscSettingsPanelItem::flags(int column) const
|
||||
@@ -300,7 +299,7 @@ public:
|
||||
if (0 <= m_currentPanelIndex && m_currentPanelIndex < childCount())
|
||||
return childAt(m_currentPanelIndex)->data(column, role);
|
||||
}
|
||||
return QVariant();
|
||||
return {};
|
||||
}
|
||||
|
||||
bool setData(int column, const QVariant &data, int role) override
|
||||
@@ -363,7 +362,7 @@ public:
|
||||
if (m_currentChildIndex == 1)
|
||||
return m_miscItem->data(column, role);
|
||||
}
|
||||
return QVariant();
|
||||
return {};
|
||||
}
|
||||
|
||||
bool setData(int column, const QVariant &dat, int role) override
|
||||
|
||||
@@ -108,7 +108,7 @@ QVariant AddNewTree::data(int, int role) const
|
||||
case Qt::UserRole:
|
||||
return QVariant::fromValue(static_cast<void*>(node()));
|
||||
default:
|
||||
return QVariant();
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ QString BestNodeSelector::deployingProjects() const
|
||||
{
|
||||
if (m_deploys)
|
||||
return m_deployText;
|
||||
return QString();
|
||||
return {};
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -1771,7 +1771,7 @@ QString RunWorker::userMessageForProcessError(QProcess::ProcessError error, cons
|
||||
// "The last waitFor...() function timed out. "
|
||||
// "The state of QProcess is unchanged, and you can try calling "
|
||||
// "waitFor...() again."
|
||||
return QString(); // sic!
|
||||
return {}; // sic!
|
||||
case QProcess::WriteError:
|
||||
msg = Tr::tr("An error occurred when attempting to write "
|
||||
"to the process. For example, the process may not be running, "
|
||||
|
||||
@@ -184,12 +184,12 @@ QModelIndex SelectableFilesModel::index(int row, int column, const QModelIndex &
|
||||
QModelIndex SelectableFilesModel::parent(const QModelIndex &child) const
|
||||
{
|
||||
if (!child.isValid())
|
||||
return QModelIndex();
|
||||
return {};
|
||||
if (!child.internalPointer())
|
||||
return QModelIndex();
|
||||
return {};
|
||||
auto parent = static_cast<Tree *>(child.internalPointer())->parent;
|
||||
if (!parent)
|
||||
return QModelIndex();
|
||||
return {};
|
||||
if (!parent->parent) //then the parent is the root
|
||||
return createIndex(0, 0, parent);
|
||||
// figure out where the parent is
|
||||
@@ -202,7 +202,7 @@ QModelIndex SelectableFilesModel::parent(const QModelIndex &child) const
|
||||
QVariant SelectableFilesModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
if (!index.isValid())
|
||||
return QVariant();
|
||||
return {};
|
||||
auto t = static_cast<Tree *>(index.internalPointer());
|
||||
if (role == Qt::DisplayRole)
|
||||
return t->name;
|
||||
@@ -213,7 +213,7 @@ QVariant SelectableFilesModel::data(const QModelIndex &index, int role) const
|
||||
t->icon = Utils::FileIconProvider::icon(t->fullPath);
|
||||
return t->icon;
|
||||
}
|
||||
return QVariant();
|
||||
return {};
|
||||
}
|
||||
|
||||
bool SelectableFilesModel::setData(const QModelIndex &index, const QVariant &value, int role)
|
||||
|
||||
@@ -584,7 +584,7 @@ QString Target::overlayIconToolTip()
|
||||
QVariantMap Target::toMap() const
|
||||
{
|
||||
if (!d->m_kit) // Kit was deleted, target is only around to be copied.
|
||||
return QVariantMap();
|
||||
return {};
|
||||
|
||||
QVariantMap map;
|
||||
map.insert(displayNameKey(), displayName());
|
||||
|
||||
@@ -309,8 +309,7 @@ public:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return QVariant();
|
||||
return {};
|
||||
}
|
||||
|
||||
bool setData(int column, const QVariant &data, int role) override
|
||||
@@ -554,8 +553,7 @@ public:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return QVariant();
|
||||
return {};
|
||||
}
|
||||
|
||||
Qt::ItemFlags flags(int column) const override
|
||||
@@ -611,8 +609,7 @@ public:
|
||||
font.setItalic(true);
|
||||
return font;
|
||||
}
|
||||
|
||||
return QVariant();
|
||||
return {};
|
||||
}
|
||||
|
||||
bool setData(int column, const QVariant &data, int role) override
|
||||
@@ -700,8 +697,7 @@ QVariant TargetGroupItem::data(int column, int role) const
|
||||
d->ensureWidget();
|
||||
return QVariant::fromValue<QWidget *>(d->m_configurePage.data());
|
||||
}
|
||||
|
||||
return QVariant();
|
||||
return {};
|
||||
}
|
||||
|
||||
bool TargetGroupItem::setData(int column, const QVariant &data, int role)
|
||||
|
||||
@@ -283,7 +283,7 @@ Task TaskModel::task(const QModelIndex &index) const
|
||||
int row = index.row();
|
||||
if (!index.isValid() || row < 0 || row >= m_tasks.count() || index.internalId()
|
||||
|| index.column() > 0) {
|
||||
return Task();
|
||||
return {};
|
||||
}
|
||||
return m_tasks.at(row);
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ Id fromLanguageV1(int language)
|
||||
return Id(Constants::CXX_LANGUAGE_ID);
|
||||
case Deprecated::Toolchain::None:
|
||||
default:
|
||||
return Id();
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ QString languageId(Language l)
|
||||
case Language::Cxx:
|
||||
return QStringLiteral("Cxx");
|
||||
};
|
||||
return QString();
|
||||
return {};
|
||||
}
|
||||
|
||||
} // namespace Deprecated::ToolChain
|
||||
@@ -517,7 +517,7 @@ Tasks ToolChain::validateKit(const Kit *) const
|
||||
|
||||
QString ToolChain::sysRoot() const
|
||||
{
|
||||
return QString();
|
||||
return {};
|
||||
}
|
||||
|
||||
QString ToolChain::explicitCodeModelTargetTriple() const
|
||||
|
||||
@@ -94,9 +94,9 @@ public:
|
||||
void setTargetAbi(const Abi &abi);
|
||||
|
||||
virtual ProjectExplorer::Abis supportedAbis() const;
|
||||
virtual QString originalTargetTriple() const { return QString(); }
|
||||
virtual QStringList extraCodeModelFlags() const { return QStringList(); }
|
||||
virtual Utils::FilePath installDir() const { return Utils::FilePath(); }
|
||||
virtual QString originalTargetTriple() const { return {}; }
|
||||
virtual QStringList extraCodeModelFlags() const { return {}; }
|
||||
virtual Utils::FilePath installDir() const { return {}; }
|
||||
virtual bool hostPrefersToolchain() const { return true; }
|
||||
|
||||
virtual bool isValid() const;
|
||||
|
||||
@@ -78,7 +78,7 @@ public:
|
||||
return column == 0 && !toolChain->isValid()
|
||||
? Utils::Icons::CRITICAL.icon() : QVariant();
|
||||
}
|
||||
return QVariant();
|
||||
return {};
|
||||
}
|
||||
|
||||
ToolChainConfigWidget *widget()
|
||||
|
||||
@@ -306,10 +306,10 @@ public:
|
||||
static bool hasToolChains() { return !m_toolChains.isEmpty(); }
|
||||
|
||||
bool isValid() const override { return m_valid; }
|
||||
MacroInspectionRunner createMacroInspectionRunner() const override { return MacroInspectionRunner(); }
|
||||
MacroInspectionRunner createMacroInspectionRunner() const override { return {}; }
|
||||
LanguageExtensions languageExtensions(const QStringList &cxxflags) const override { Q_UNUSED(cxxflags) return LanguageExtension::None; }
|
||||
WarningFlags warningFlags(const QStringList &cflags) const override { Q_UNUSED(cflags) return WarningFlags::NoWarnings; }
|
||||
BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner(const Utils::Environment &) const override { return BuiltInHeaderPathsRunner(); }
|
||||
BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner(const Utils::Environment &) const override { return {}; }
|
||||
void addToEnvironment(Environment &env) const override { Q_UNUSED(env) }
|
||||
FilePath makeCommand(const Environment &) const override { return "make"; }
|
||||
QList<OutputLineParser *> createOutputParsers() const override { return {}; }
|
||||
|
||||
@@ -77,7 +77,7 @@ TreeScanner::Result TreeScanner::result() const
|
||||
{
|
||||
if (isFinished())
|
||||
return m_scanFuture.result();
|
||||
return Result();
|
||||
return {};
|
||||
}
|
||||
|
||||
TreeScanner::Result TreeScanner::release()
|
||||
@@ -88,7 +88,7 @@ TreeScanner::Result TreeScanner::release()
|
||||
return result;
|
||||
}
|
||||
m_scanFuture = Future();
|
||||
return Result();
|
||||
return {};
|
||||
}
|
||||
|
||||
void TreeScanner::reset()
|
||||
|
||||
Reference in New Issue
Block a user