forked from qt-creator/qt-creator
Don't initialize QFlags unnecessarily
And if needed, do it with {} instead of with nullptr or 0.
Change-Id: Iae80253cd334494cfe1d69ec1552d710f2a31ad2
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
namespace Utils {
|
namespace Utils {
|
||||||
|
|
||||||
static QFile::Permissions m_umask = {};
|
static QFile::Permissions m_umask;
|
||||||
|
|
||||||
SaveFile::SaveFile(const QString &filename) :
|
SaveFile::SaveFile(const QString &filename) :
|
||||||
m_finalFileName(filename)
|
m_finalFileName(filename)
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ void CppToolsPlugin::test_builtinsymbolsearcher_data()
|
|||||||
// Check All Symbol Types
|
// Check All Symbol Types
|
||||||
searchParameters = SymbolSearcher::Parameters();
|
searchParameters = SymbolSearcher::Parameters();
|
||||||
searchParameters.text = _("");
|
searchParameters.text = _("");
|
||||||
searchParameters.flags = nullptr;
|
searchParameters.flags = {};
|
||||||
searchParameters.types = SearchSymbols::AllTypes;
|
searchParameters.types = SearchSymbols::AllTypes;
|
||||||
searchParameters.scope = SymbolSearcher::SearchGlobal;
|
searchParameters.scope = SymbolSearcher::SearchGlobal;
|
||||||
QTest::newRow("BuiltinSymbolSearcher::AllTypes")
|
QTest::newRow("BuiltinSymbolSearcher::AllTypes")
|
||||||
@@ -218,7 +218,7 @@ void CppToolsPlugin::test_builtinsymbolsearcher_data()
|
|||||||
// Check Classes
|
// Check Classes
|
||||||
searchParameters = SymbolSearcher::Parameters();
|
searchParameters = SymbolSearcher::Parameters();
|
||||||
searchParameters.text = _("myclass");
|
searchParameters.text = _("myclass");
|
||||||
searchParameters.flags = nullptr;
|
searchParameters.flags = {};
|
||||||
searchParameters.types = SymbolSearcher::Classes;
|
searchParameters.types = SymbolSearcher::Classes;
|
||||||
searchParameters.scope = SymbolSearcher::SearchGlobal;
|
searchParameters.scope = SymbolSearcher::SearchGlobal;
|
||||||
QTest::newRow("BuiltinSymbolSearcher::Classes")
|
QTest::newRow("BuiltinSymbolSearcher::Classes")
|
||||||
@@ -233,7 +233,7 @@ void CppToolsPlugin::test_builtinsymbolsearcher_data()
|
|||||||
// Check Functions
|
// Check Functions
|
||||||
searchParameters = SymbolSearcher::Parameters();
|
searchParameters = SymbolSearcher::Parameters();
|
||||||
searchParameters.text = _("fun");
|
searchParameters.text = _("fun");
|
||||||
searchParameters.flags = nullptr;
|
searchParameters.flags = {};
|
||||||
searchParameters.types = SymbolSearcher::Functions;
|
searchParameters.types = SymbolSearcher::Functions;
|
||||||
searchParameters.scope = SymbolSearcher::SearchGlobal;
|
searchParameters.scope = SymbolSearcher::SearchGlobal;
|
||||||
QTest::newRow("BuiltinSymbolSearcher::Functions")
|
QTest::newRow("BuiltinSymbolSearcher::Functions")
|
||||||
|
|||||||
@@ -260,7 +260,7 @@ bool WebEngineHelpViewer::findText(const QString &text, Core::FindFlags flags, b
|
|||||||
Q_UNUSED(fromSearch)
|
Q_UNUSED(fromSearch)
|
||||||
if (wrapped)
|
if (wrapped)
|
||||||
*wrapped = false; // missing feature in QWebEngine
|
*wrapped = false; // missing feature in QWebEngine
|
||||||
QWebEnginePage::FindFlags webEngineFlags = 0;
|
QWebEnginePage::FindFlags webEngineFlags;
|
||||||
if (flags & Core::FindBackward)
|
if (flags & Core::FindBackward)
|
||||||
webEngineFlags |= QWebEnginePage::FindBackward;
|
webEngineFlags |= QWebEnginePage::FindBackward;
|
||||||
if (flags & Core::FindCaseSensitively)
|
if (flags & Core::FindCaseSensitively)
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ static inline bool createFile(CustomWizardFile cwFile,
|
|||||||
generatedFile.setContents(CustomWizardContext::processFile(fm, contentsIn));
|
generatedFile.setContents(CustomWizardContext::processFile(fm, contentsIn));
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::GeneratedFile::Attributes attributes = {};
|
Core::GeneratedFile::Attributes attributes;
|
||||||
if (cwFile.openEditor)
|
if (cwFile.openEditor)
|
||||||
attributes |= Core::GeneratedFile::OpenEditorAttribute;
|
attributes |= Core::GeneratedFile::OpenEditorAttribute;
|
||||||
if (cwFile.openProject)
|
if (cwFile.openProject)
|
||||||
|
|||||||
@@ -660,7 +660,7 @@ bool JsonWizardFactory::initialize(const QVariantMap &data, const QDir &baseDir,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
WizardFlags flags = {};
|
WizardFlags flags;
|
||||||
if (data.value(QLatin1String(PLATFORM_INDEPENDENT_KEY), false).toBool())
|
if (data.value(QLatin1String(PLATFORM_INDEPENDENT_KEY), false).toBool())
|
||||||
flags |= PlatformIndependent;
|
flags |= PlatformIndependent;
|
||||||
setFlags(flags);
|
setFlags(flags);
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ Core::GeneratedFile JsonWizardFileGenerator::generateFile(const File &file,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::GeneratedFile::Attributes attributes = {};
|
Core::GeneratedFile::Attributes attributes;
|
||||||
if (JsonWizard::boolFromVariant(file.openInEditor, expander))
|
if (JsonWizard::boolFromVariant(file.openInEditor, expander))
|
||||||
attributes |= Core::GeneratedFile::OpenEditorAttribute;
|
attributes |= Core::GeneratedFile::OpenEditorAttribute;
|
||||||
if (JsonWizard::boolFromVariant(file.openAsProject, expander))
|
if (JsonWizard::boolFromVariant(file.openAsProject, expander))
|
||||||
|
|||||||
@@ -1643,7 +1643,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
|
|||||||
return ReturnFalse;
|
return ReturnFalse;
|
||||||
}
|
}
|
||||||
QString parseInto;
|
QString parseInto;
|
||||||
LoadFlags flags = {};
|
LoadFlags flags;
|
||||||
if (m_cumulative)
|
if (m_cumulative)
|
||||||
flags = LoadSilent;
|
flags = LoadSilent;
|
||||||
if (args.count() >= 2) {
|
if (args.count() >= 2) {
|
||||||
|
|||||||
Reference in New Issue
Block a user