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 {
|
||||
|
||||
static QFile::Permissions m_umask = {};
|
||||
static QFile::Permissions m_umask;
|
||||
|
||||
SaveFile::SaveFile(const QString &filename) :
|
||||
m_finalFileName(filename)
|
||||
|
||||
@@ -164,7 +164,7 @@ void CppToolsPlugin::test_builtinsymbolsearcher_data()
|
||||
// Check All Symbol Types
|
||||
searchParameters = SymbolSearcher::Parameters();
|
||||
searchParameters.text = _("");
|
||||
searchParameters.flags = nullptr;
|
||||
searchParameters.flags = {};
|
||||
searchParameters.types = SearchSymbols::AllTypes;
|
||||
searchParameters.scope = SymbolSearcher::SearchGlobal;
|
||||
QTest::newRow("BuiltinSymbolSearcher::AllTypes")
|
||||
@@ -218,7 +218,7 @@ void CppToolsPlugin::test_builtinsymbolsearcher_data()
|
||||
// Check Classes
|
||||
searchParameters = SymbolSearcher::Parameters();
|
||||
searchParameters.text = _("myclass");
|
||||
searchParameters.flags = nullptr;
|
||||
searchParameters.flags = {};
|
||||
searchParameters.types = SymbolSearcher::Classes;
|
||||
searchParameters.scope = SymbolSearcher::SearchGlobal;
|
||||
QTest::newRow("BuiltinSymbolSearcher::Classes")
|
||||
@@ -233,7 +233,7 @@ void CppToolsPlugin::test_builtinsymbolsearcher_data()
|
||||
// Check Functions
|
||||
searchParameters = SymbolSearcher::Parameters();
|
||||
searchParameters.text = _("fun");
|
||||
searchParameters.flags = nullptr;
|
||||
searchParameters.flags = {};
|
||||
searchParameters.types = SymbolSearcher::Functions;
|
||||
searchParameters.scope = SymbolSearcher::SearchGlobal;
|
||||
QTest::newRow("BuiltinSymbolSearcher::Functions")
|
||||
|
||||
@@ -260,7 +260,7 @@ bool WebEngineHelpViewer::findText(const QString &text, Core::FindFlags flags, b
|
||||
Q_UNUSED(fromSearch)
|
||||
if (wrapped)
|
||||
*wrapped = false; // missing feature in QWebEngine
|
||||
QWebEnginePage::FindFlags webEngineFlags = 0;
|
||||
QWebEnginePage::FindFlags webEngineFlags;
|
||||
if (flags & Core::FindBackward)
|
||||
webEngineFlags |= QWebEnginePage::FindBackward;
|
||||
if (flags & Core::FindCaseSensitively)
|
||||
|
||||
@@ -213,7 +213,7 @@ static inline bool createFile(CustomWizardFile cwFile,
|
||||
generatedFile.setContents(CustomWizardContext::processFile(fm, contentsIn));
|
||||
}
|
||||
|
||||
Core::GeneratedFile::Attributes attributes = {};
|
||||
Core::GeneratedFile::Attributes attributes;
|
||||
if (cwFile.openEditor)
|
||||
attributes |= Core::GeneratedFile::OpenEditorAttribute;
|
||||
if (cwFile.openProject)
|
||||
|
||||
@@ -660,7 +660,7 @@ bool JsonWizardFactory::initialize(const QVariantMap &data, const QDir &baseDir,
|
||||
return false;
|
||||
}
|
||||
|
||||
WizardFlags flags = {};
|
||||
WizardFlags flags;
|
||||
if (data.value(QLatin1String(PLATFORM_INDEPENDENT_KEY), false).toBool())
|
||||
flags |= PlatformIndependent;
|
||||
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))
|
||||
attributes |= Core::GeneratedFile::OpenEditorAttribute;
|
||||
if (JsonWizard::boolFromVariant(file.openAsProject, expander))
|
||||
|
||||
@@ -1643,7 +1643,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
|
||||
return ReturnFalse;
|
||||
}
|
||||
QString parseInto;
|
||||
LoadFlags flags = {};
|
||||
LoadFlags flags;
|
||||
if (m_cumulative)
|
||||
flags = LoadSilent;
|
||||
if (args.count() >= 2) {
|
||||
|
||||
Reference in New Issue
Block a user