forked from qt-creator/qt-creator
Use isEmpty() instead of count() or size()
Change-Id: I0a89d2808c6d041da0dc41ea5aea58e6e8759bb4 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -1100,7 +1100,7 @@ ClassOrNamespace *ClassOrNamespace::nestedType(const Name *name,
|
||||
// for "using" we should use the real one ClassOrNamespace(it should be the first
|
||||
// one item from usings list)
|
||||
// we indicate that it is a 'using' by checking number of symbols(it should be 0)
|
||||
if (reference->symbols().count() == 0 && reference->usings().count() != 0)
|
||||
if (reference->symbols().isEmpty() && !reference->usings().isEmpty())
|
||||
reference = reference->_usings[0];
|
||||
|
||||
// if it is a TemplateNameId it could be a specialization(full or partial) or
|
||||
|
||||
@@ -335,7 +335,7 @@ void TypePrettyPrinter::prependSpaceAfterIndirection(bool hasName)
|
||||
const bool case2 = ! hasCvSpecifier && spaceBeforeNameNeeded;
|
||||
// case 3: In "char *argv[]", put a space between '*' and "argv" when requested
|
||||
const bool case3 = ! hasCvSpecifier && ! shouldBindToIdentifier
|
||||
&& ! _isIndirectionToArrayOrFunction && _text.size() && _text.at(0).isLetter();
|
||||
&& ! _isIndirectionToArrayOrFunction && !_text.isEmpty() && _text.at(0).isLetter();
|
||||
if (case1 || case2 || case3)
|
||||
_text.prepend(QLatin1Char(' '));
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ qint64 QCompressedDevice::writeData(const char *data, qint64 len)
|
||||
|
||||
qint64 QCompressedDevice::flush()
|
||||
{
|
||||
if (openMode() == QIODevice::WriteOnly && m_buffer.size() > 0) {
|
||||
if (openMode() == QIODevice::WriteOnly && !m_buffer.isEmpty()) {
|
||||
QMT_ASSERT(m_targetDevice->isOpen(), return 0);
|
||||
QMT_ASSERT(m_targetDevice->openMode() == QIODevice::WriteOnly, return 0);
|
||||
QByteArray compressedBuffer = qCompress(m_buffer);
|
||||
|
||||
@@ -76,7 +76,7 @@ public:
|
||||
PathShape *IconShape::IconShapePrivate::activePath()
|
||||
{
|
||||
PathShape *pathShape = nullptr;
|
||||
if (m_shapes.count() > 0)
|
||||
if (!m_shapes.isEmpty())
|
||||
pathShape = dynamic_cast<PathShape *>(m_shapes.last());
|
||||
if (!pathShape) {
|
||||
pathShape = new PathShape();
|
||||
|
||||
@@ -254,7 +254,7 @@ qint64 QPacketProtocol::packetsAvailable() const
|
||||
*/
|
||||
QByteArray QPacketProtocol::read()
|
||||
{
|
||||
if (0 == d->packets.count())
|
||||
if (d->packets.isEmpty())
|
||||
return QByteArray();
|
||||
|
||||
return d->packets.takeFirst();
|
||||
|
||||
@@ -141,7 +141,7 @@ TimelineRenderPass::State *TimelineNotesRenderPass::update(const TimelineAbstrac
|
||||
|
||||
QSGGeometryNode *collapsedNode = static_cast<QSGGeometryNode *>(state->collapsedOverlay());
|
||||
|
||||
if (collapsed.count() > 0) {
|
||||
if (!collapsed.isEmpty()) {
|
||||
collapsedNode->setGeometry(NotesGeometry::createGeometry(collapsed, model, parentState,
|
||||
true));
|
||||
collapsedNode->setFlag(QSGGeometryNode::OwnsGeometry, true);
|
||||
|
||||
@@ -271,7 +271,7 @@ static QString quoteWinCommand(const QString &program)
|
||||
|
||||
static QString quoteWinArgument(const QString &arg)
|
||||
{
|
||||
if (!arg.length())
|
||||
if (arg.isEmpty())
|
||||
return QString::fromLatin1("\"\"");
|
||||
|
||||
QString ret(arg);
|
||||
|
||||
@@ -206,7 +206,7 @@ static int cleanupSemanticsScore(const QString &text1, const QString &text2)
|
||||
const QRegularExpression blankLineStart("^\\r?\\n\\r?\\n");
|
||||
const QRegularExpression sentenceEnd("\\. $");
|
||||
|
||||
if (!text1.count() || !text2.count()) // Edges
|
||||
if (text1.isEmpty() || text2.isEmpty()) // Edges
|
||||
return 6;
|
||||
|
||||
const QChar char1 = text1[text1.count() - 1];
|
||||
@@ -551,13 +551,12 @@ static QString encodeExpandedWhitespace(const QString &leftEquality,
|
||||
return QString(); // equalities broken
|
||||
}
|
||||
|
||||
if ((leftWhitespaces.count() && !rightWhitespaces.count())
|
||||
|| (!leftWhitespaces.count() && rightWhitespaces.count())) {
|
||||
if (leftWhitespaces.isEmpty() ^ rightWhitespaces.isEmpty()) {
|
||||
// there must be at least 1 corresponding whitespace, equalities broken
|
||||
return QString();
|
||||
}
|
||||
|
||||
if (leftWhitespaces.count() && rightWhitespaces.count()) {
|
||||
if (!leftWhitespaces.isEmpty() && !rightWhitespaces.isEmpty()) {
|
||||
const int replacementPosition = output.count();
|
||||
const int replacementSize = qMax(leftWhitespaces.count(), rightWhitespaces.count());
|
||||
const QString replacement(replacementSize, ' ');
|
||||
@@ -723,10 +722,10 @@ static void appendWithEqualitiesSquashed(const QList<Diff> &leftInput,
|
||||
QList<Diff> *leftOutput,
|
||||
QList<Diff> *rightOutput)
|
||||
{
|
||||
if (leftInput.count()
|
||||
&& rightInput.count()
|
||||
&& leftOutput->count()
|
||||
&& rightOutput->count()
|
||||
if (!leftInput.isEmpty()
|
||||
&& !rightInput.isEmpty()
|
||||
&& !leftOutput->isEmpty()
|
||||
&& !rightOutput->isEmpty()
|
||||
&& leftInput.first().command == Diff::Equal
|
||||
&& rightInput.first().command == Diff::Equal
|
||||
&& leftOutput->last().command == Diff::Equal
|
||||
@@ -1245,7 +1244,7 @@ QList<Diff> Differ::diffNonCharMode(const QString &text1, const QString &text2)
|
||||
} else if (diffItem.command == Diff::Insert) {
|
||||
lastInsert += diffItem.text;
|
||||
} else { // Diff::Equal
|
||||
if (lastDelete.count() || lastInsert.count()) {
|
||||
if (!(lastDelete.isEmpty() && lastInsert.isEmpty())) {
|
||||
// Rediff here on char basis
|
||||
newDiffList += preprocess1AndDiff(lastDelete, lastInsert);
|
||||
|
||||
@@ -1334,7 +1333,7 @@ QList<Diff> Differ::merge(const QList<Diff> &diffList)
|
||||
} else if (diff.command == Diff::Insert) {
|
||||
lastInsert += diff.text;
|
||||
} else { // Diff::Equal
|
||||
if (lastDelete.count() || lastInsert.count()) {
|
||||
if (!(lastDelete.isEmpty() && lastInsert.isEmpty())) {
|
||||
|
||||
// common prefix
|
||||
const int prefixCount = commonPrefix(lastDelete, lastInsert);
|
||||
@@ -1343,7 +1342,7 @@ QList<Diff> Differ::merge(const QList<Diff> &diffList)
|
||||
lastDelete = lastDelete.mid(prefixCount);
|
||||
lastInsert = lastInsert.mid(prefixCount);
|
||||
|
||||
if (newDiffList.count()
|
||||
if (!newDiffList.isEmpty()
|
||||
&& newDiffList.last().command == Diff::Equal) {
|
||||
newDiffList.last().text += prefix;
|
||||
} else {
|
||||
@@ -1362,20 +1361,20 @@ QList<Diff> Differ::merge(const QList<Diff> &diffList)
|
||||
}
|
||||
|
||||
// append delete / insert / equal
|
||||
if (lastDelete.count())
|
||||
if (!lastDelete.isEmpty())
|
||||
newDiffList.append(Diff(Diff::Delete, lastDelete));
|
||||
if (lastInsert.count())
|
||||
if (!lastInsert.isEmpty())
|
||||
newDiffList.append(Diff(Diff::Insert, lastInsert));
|
||||
if (diff.text.count())
|
||||
if (!diff.text.isEmpty())
|
||||
newDiffList.append(diff);
|
||||
lastDelete.clear();
|
||||
lastInsert.clear();
|
||||
} else { // join with last equal diff
|
||||
if (newDiffList.count()
|
||||
if (!newDiffList.isEmpty()
|
||||
&& newDiffList.last().command == Diff::Equal) {
|
||||
newDiffList.last().text += diff.text;
|
||||
} else {
|
||||
if (diff.text.count())
|
||||
if (!diff.text.isEmpty())
|
||||
newDiffList.append(diff);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -538,7 +538,7 @@ QStringList QtcProcess::splitArgs(const QString &args, OsType osType,
|
||||
|
||||
QString QtcProcess::quoteArgUnix(const QString &arg)
|
||||
{
|
||||
if (!arg.length())
|
||||
if (arg.isEmpty())
|
||||
return QString::fromLatin1("''");
|
||||
|
||||
QString ret(arg);
|
||||
@@ -574,7 +574,7 @@ static bool hasSpecialCharsWin(const QString &arg)
|
||||
|
||||
static QString quoteArgWin(const QString &arg)
|
||||
{
|
||||
if (!arg.length())
|
||||
if (arg.isEmpty())
|
||||
return QString::fromLatin1("\"\"");
|
||||
|
||||
QString ret(arg);
|
||||
|
||||
@@ -191,7 +191,7 @@ QWidget *AndroidBuildApkWidget::createSignPackageGroup()
|
||||
|
||||
auto updateAlias = [this](int idx) {
|
||||
QString alias = m_certificatesAliasComboBox->itemText(idx);
|
||||
if (alias.length())
|
||||
if (!alias.isEmpty())
|
||||
m_step->setCertificateAlias(alias);
|
||||
};
|
||||
|
||||
|
||||
@@ -165,10 +165,10 @@ void AndroidCreateKeystoreCertificate::on_buttonBox_accepted()
|
||||
.arg(ui->localityNameLineEdit->text().replace(QLatin1Char(','), QLatin1String("\\,")))
|
||||
.arg(ui->countryLineEdit->text().replace(QLatin1Char(','), QLatin1String("\\,"))));
|
||||
|
||||
if (ui->organizationUnitLineEdit->text().length())
|
||||
if (!ui->organizationUnitLineEdit->text().isEmpty())
|
||||
distinguishedNames += QLatin1String(", OU=") + ui->organizationUnitLineEdit->text().replace(QLatin1Char(','), QLatin1String("\\,"));
|
||||
|
||||
if (ui->stateNameLineEdit->text().length())
|
||||
if (!ui->stateNameLineEdit->text().isEmpty())
|
||||
distinguishedNames += QLatin1String(", S=") + ui->stateNameLineEdit->text().replace(QLatin1Char(','), QLatin1String("\\,"));
|
||||
|
||||
const CommandLine command(AndroidConfigurations::currentConfig().keytoolPath(),
|
||||
|
||||
@@ -427,7 +427,7 @@ QString AndroidManager::apkDevicePreferredAbi(Target *target)
|
||||
auto libsPath = dirPath(target).pathAppended("libs");
|
||||
QStringList apkAbis;
|
||||
for (const auto &abi : QDir{libsPath.toString()}.entryList(QDir::Dirs | QDir::NoDotAndDotDot))
|
||||
if (QDir{libsPath.pathAppended(abi).toString()}.entryList(QStringList("*.so"), QDir::Files | QDir::NoDotAndDotDot).length())
|
||||
if (!QDir{libsPath.pathAppended(abi).toString()}.entryList(QStringList("*.so"), QDir::Files | QDir::NoDotAndDotDot).isEmpty())
|
||||
apkAbis << abi;
|
||||
return preferredAbi(apkAbis, target);
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ static bool handleBoostTest(QFutureInterface<TestParseResultPtr> futureInterface
|
||||
firstSuite);
|
||||
BoostTestParseResult *currentSuite = topLevelSuite;
|
||||
suitesStates.removeFirst();
|
||||
while (suitesStates.size()) {
|
||||
while (!suitesStates.isEmpty()) {
|
||||
firstSuite = suitesStates.first();
|
||||
suites = firstSuite.fullName.split('/');
|
||||
BoostTestParseResult *suiteResult = createParseResult(suites.last(), filePath,
|
||||
|
||||
@@ -83,7 +83,7 @@ QStringList GTestConfiguration::argumentsForTestRunner(QStringList *omitted) con
|
||||
}
|
||||
|
||||
const QStringList &testSets = testCases();
|
||||
if (testSets.size())
|
||||
if (!testSets.isEmpty())
|
||||
arguments << "--gtest_filter=" + testSets.join(':');
|
||||
|
||||
TestFrameworkManager *manager = TestFrameworkManager::instance();
|
||||
|
||||
@@ -103,7 +103,7 @@ static bool handleGTest(QFutureInterface<TestParseResultPtr> futureInterface,
|
||||
QMap<GTestCaseSpec, GTestCodeLocationList> result = visitor.gtestFunctions();
|
||||
QString proFile;
|
||||
const QList<CppTools::ProjectPart::Ptr> &ppList = modelManager->projectPart(filePath);
|
||||
if (ppList.size())
|
||||
if (!ppList.isEmpty())
|
||||
proFile = ppList.first()->projectFile;
|
||||
else
|
||||
return false; // happens if shutting down while parsing
|
||||
|
||||
@@ -51,7 +51,7 @@ bool CppParser::selectedForBuilding(const QString &fileName)
|
||||
QList<CppTools::ProjectPart::Ptr> projParts =
|
||||
CppTools::CppModelManager::instance()->projectPart(fileName);
|
||||
|
||||
return projParts.size() && projParts.at(0)->selectedForBuilding;
|
||||
return !projParts.isEmpty() && projParts.at(0)->selectedForBuilding;
|
||||
}
|
||||
|
||||
QByteArray CppParser::getFileContent(const QString &filePath)
|
||||
|
||||
@@ -65,7 +65,7 @@ QStringList QtTestConfiguration::argumentsForTestRunner(QStringList *omitted) co
|
||||
return arguments;
|
||||
if (qtSettings->useXMLOutput)
|
||||
arguments << "-xml";
|
||||
if (testCases().count())
|
||||
if (!testCases().isEmpty())
|
||||
arguments << testCases();
|
||||
|
||||
const QString &metricsOption = QtTestSettings::metricsTypeToOption(qtSettings->metrics);
|
||||
|
||||
@@ -128,7 +128,7 @@ bool TestAstVisitor::visit(CallAST *ast)
|
||||
QList<LookupItem> toeItems
|
||||
= toe(argumentExpressionAST, m_currentDoc, m_currentScope);
|
||||
|
||||
if (toeItems.size()) {
|
||||
if (!toeItems.isEmpty()) {
|
||||
if (const auto pointerType = toeItems.first().type()->asPointerType())
|
||||
m_className = o.prettyType(pointerType->elementType());
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ QStringList QuickTestConfiguration::argumentsForTestRunner(QStringList *omitted)
|
||||
return arguments;
|
||||
if (qtSettings->useXMLOutput)
|
||||
arguments << "-xml";
|
||||
if (testCases().count())
|
||||
if (!testCases().isEmpty())
|
||||
arguments << testCases();
|
||||
|
||||
const QString &metricsOption = QtTestSettings::metricsTypeToOption(qtSettings->metrics);
|
||||
|
||||
@@ -1556,7 +1556,7 @@ void BinEditorWidget::undo()
|
||||
setCursorPosition(cmd.position);
|
||||
if (emitModificationChanged)
|
||||
emit modificationChanged(m_undoStack.size() != m_unmodifiedState);
|
||||
if (!m_undoStack.size())
|
||||
if (m_undoStack.isEmpty())
|
||||
emit undoAvailable(false);
|
||||
if (m_redoStack.size() == 1)
|
||||
emit redoAvailable(true);
|
||||
@@ -1577,7 +1577,7 @@ void BinEditorWidget::redo()
|
||||
emit modificationChanged(m_undoStack.size() != m_unmodifiedState);
|
||||
if (m_undoStack.size() == 1)
|
||||
emit undoAvailable(true);
|
||||
if (!m_redoStack.size())
|
||||
if (m_redoStack.isEmpty())
|
||||
emit redoAvailable(false);
|
||||
}
|
||||
|
||||
|
||||
@@ -113,8 +113,8 @@ public:
|
||||
|
||||
bool event(QEvent*) override;
|
||||
|
||||
bool isUndoAvailable() const { return m_undoStack.size(); }
|
||||
bool isRedoAvailable() const { return m_redoStack.size(); }
|
||||
bool isUndoAvailable() const { return !m_undoStack.isEmpty(); }
|
||||
bool isRedoAvailable() const { return !m_redoStack.isEmpty(); }
|
||||
|
||||
QString addressString(quint64 address);
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ static int translateModifiers(Qt::KeyboardModifiers state,
|
||||
int result = 0;
|
||||
// The shift modifier only counts when it is not used to type a symbol
|
||||
// that is only reachable using the shift key anyway
|
||||
if ((state & Qt::ShiftModifier) && (text.size() == 0
|
||||
if ((state & Qt::ShiftModifier) && (text.isEmpty()
|
||||
|| !text.at(0).isPrint()
|
||||
|| text.at(0).isLetterOrNumber()
|
||||
|| text.at(0).isSpace()))
|
||||
|
||||
@@ -348,12 +348,12 @@ void EditorView::removeEditor(IEditor *editor)
|
||||
m_toolBar->removeToolbarForEditor(editor);
|
||||
|
||||
if (wasCurrent)
|
||||
setCurrentEditor(m_editors.count() ? m_editors.last() : nullptr);
|
||||
setCurrentEditor(!m_editors.isEmpty() ? m_editors.last() : nullptr);
|
||||
}
|
||||
|
||||
IEditor *EditorView::currentEditor() const
|
||||
{
|
||||
if (m_editors.count() > 0)
|
||||
if (!m_editors.isEmpty())
|
||||
return m_widgetEditorMap.value(m_container->currentWidget());
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -207,7 +207,7 @@ void DirectoryFilter::handleRemoveDirectory()
|
||||
|
||||
void DirectoryFilter::updateOptionButtons()
|
||||
{
|
||||
bool haveSelectedItem = (m_ui->directoryList->selectedItems().count() > 0);
|
||||
bool haveSelectedItem = !m_ui->directoryList->selectedItems().isEmpty();
|
||||
m_ui->editButton->setEnabled(haveSelectedItem);
|
||||
m_ui->removeButton->setEnabled(haveSelectedItem);
|
||||
}
|
||||
@@ -222,7 +222,7 @@ void DirectoryFilter::refresh(QFutureInterface<void> &future)
|
||||
QStringList directories;
|
||||
{
|
||||
QMutexLocker locker(&m_lock);
|
||||
if (m_directories.count() < 1) {
|
||||
if (m_directories.isEmpty()) {
|
||||
m_files.clear();
|
||||
QTimer::singleShot(0, this, &DirectoryFilter::updateFileIterator);
|
||||
future.setProgressRange(0, 1);
|
||||
|
||||
@@ -289,7 +289,7 @@ void SideBar::readSettings(QSettings *settings, const QString &name)
|
||||
const QString viewsKey = prefix + QLatin1String("Views");
|
||||
if (settings->contains(viewsKey)) {
|
||||
QStringList views = settings->value(viewsKey).toStringList();
|
||||
if (views.count()) {
|
||||
if (!views.isEmpty()) {
|
||||
foreach (const QString &id, views)
|
||||
if (availableItemIds().contains(id))
|
||||
insertSideBarWidget(d->m_widgets.count(), id);
|
||||
|
||||
@@ -89,7 +89,7 @@ SideBarWidget::SideBarWidget(SideBar *sideBar, const QString &id)
|
||||
QStringList titleList = m_sideBar->availableItemTitles();
|
||||
Utils::sort(titleList);
|
||||
QString t = id;
|
||||
if (titleList.count()) {
|
||||
if (!titleList.isEmpty()) {
|
||||
foreach (const QString &itemTitle, titleList)
|
||||
m_comboBox->addItem(itemTitle, m_sideBar->idForTitle(itemTitle));
|
||||
|
||||
|
||||
@@ -413,7 +413,7 @@ static void addSearchResults(CppTools::Usages usages, SearchResult &search, cons
|
||||
|
||||
const QString lineContent = getDocumentLine(document, usage.line);
|
||||
|
||||
if (lineContent.size()) {
|
||||
if (!lineContent.isEmpty()) {
|
||||
Search::TextRange range{Search::TextPosition(usage.line, usage.column - 1),
|
||||
Search::TextPosition(usage.line, usage.column + text.length() - 1)};
|
||||
search.addResult(usage.path, lineContent, range);
|
||||
|
||||
@@ -74,7 +74,7 @@ void CppHighlighter::highlightBlock(const QString &text)
|
||||
if (tokens.isEmpty()) {
|
||||
setCurrentBlockState((braceDepth << 8) | lexerState);
|
||||
TextDocumentLayout::clearParentheses(currentBlock());
|
||||
if (text.length()) {// the empty line can still contain whitespace
|
||||
if (!text.isEmpty()) {// the empty line can still contain whitespace
|
||||
if (initialLexerState == T_COMMENT)
|
||||
setFormatWithSpaces(text, 0, text.length(), formatForCategory(C_COMMENT));
|
||||
else if (initialLexerState == T_DOXY_COMMENT)
|
||||
|
||||
@@ -131,7 +131,7 @@ CppTools::CheckSymbols *createHighlighter(const CPlusPlus::Document::Ptr &doc,
|
||||
|
||||
// Filter out C++ keywords
|
||||
const Tokens tokens = tokenize(name);
|
||||
if (tokens.length() && (tokens.at(0).isKeyword() || tokens.at(0).isObjCAtKeyword()))
|
||||
if (!tokens.isEmpty() && (tokens.at(0).isKeyword() || tokens.at(0).isObjCAtKeyword()))
|
||||
continue;
|
||||
|
||||
int line, column;
|
||||
|
||||
@@ -165,7 +165,7 @@ void HeaderPathFilter::tweakHeaderPaths()
|
||||
|
||||
void HeaderPathFilter::addPreIncludesPath()
|
||||
{
|
||||
if (projectDirectory.size()) {
|
||||
if (!projectDirectory.isEmpty()) {
|
||||
const Utils::FilePath rootProjectDirectory = Utils::FilePath::fromString(projectDirectory)
|
||||
.pathAppended(".pre_includes");
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@ bool BreakpointParameters::conditionsMatch(const QString &other) const
|
||||
|
||||
void BreakpointParameters::updateLocation(const QString &location)
|
||||
{
|
||||
if (location.size()) {
|
||||
if (!location.isEmpty()) {
|
||||
int pos = location.indexOf(':');
|
||||
lineNumber = location.midRef(pos + 1).toInt();
|
||||
QString file = location.left(pos);
|
||||
|
||||
@@ -376,7 +376,7 @@ void LldbEngine::handleResponse(const QString &response)
|
||||
const QString name = item.name();
|
||||
if (name == "result") {
|
||||
QString msg = item["status"].data();
|
||||
if (msg.size())
|
||||
if (!msg.isEmpty())
|
||||
msg[0] = msg.at(0).toUpper();
|
||||
showStatusMessage(msg);
|
||||
|
||||
|
||||
@@ -1364,7 +1364,7 @@ void QmlEnginePrivate::scripts(int types, const QList<int> ids, bool includeSour
|
||||
DebuggerCommand cmd(SCRIPTS);
|
||||
cmd.arg(TYPES, types);
|
||||
|
||||
if (ids.count())
|
||||
if (!ids.isEmpty())
|
||||
cmd.arg(IDS, ids);
|
||||
|
||||
if (includeSource)
|
||||
@@ -1727,7 +1727,7 @@ void QmlEnginePrivate::messageReceived(const QByteArray &data)
|
||||
const QVariantList actualLocations =
|
||||
breakpointData.value("actual_locations").toList();
|
||||
const int line = breakpointData.value("line").toInt() + 1;
|
||||
if (actualLocations.count()) {
|
||||
if (!actualLocations.isEmpty()) {
|
||||
//The breakpoint requested line should be same as
|
||||
//actual line
|
||||
if (bp && bp->state() != BreakpointInserted) {
|
||||
|
||||
@@ -254,7 +254,7 @@ void QmlInspectorAgent::onResult(quint32 queryId, const QVariant &value,
|
||||
} else if (queryId == m_engineQueryId) {
|
||||
m_engineQueryId = 0;
|
||||
QList<EngineReference> engines = qvariant_cast<QList<EngineReference> >(value);
|
||||
QTC_ASSERT(engines.count(), return);
|
||||
QTC_ASSERT(!engines.isEmpty(), return);
|
||||
m_engines = engines;
|
||||
queryEngineContext();
|
||||
} else {
|
||||
@@ -637,7 +637,7 @@ void QmlInspectorAgent::addWatchData(const ObjectReference &obj,
|
||||
}
|
||||
|
||||
// properties
|
||||
if (append && obj.properties().count()) {
|
||||
if (append && !obj.properties().isEmpty()) {
|
||||
QString iname = objIname + ".[properties]";
|
||||
auto propertiesWatch = new WatchItem;
|
||||
propertiesWatch->iname = iname;
|
||||
|
||||
@@ -61,10 +61,10 @@ static QList<TextLineData> assemblyRows(const QList<TextLineData> &lines,
|
||||
static bool lastLinesEqual(const QList<TextLineData> &leftLines,
|
||||
const QList<TextLineData> &rightLines)
|
||||
{
|
||||
const bool leftLineEqual = leftLines.count()
|
||||
const bool leftLineEqual = !leftLines.isEmpty()
|
||||
? leftLines.last().text.isEmpty()
|
||||
: true;
|
||||
const bool rightLineEqual = rightLines.count()
|
||||
const bool rightLineEqual = !rightLines.isEmpty()
|
||||
? rightLines.last().text.isEmpty()
|
||||
: true;
|
||||
return leftLineEqual && rightLineEqual;
|
||||
@@ -166,7 +166,7 @@ ChunkData DiffUtils::calculateOriginalData(const QList<Diff> &leftDiffList,
|
||||
|
||||
int line = 0;
|
||||
|
||||
if (i < leftDiffList.count() || j < rightDiffList.count() || (leftLines.count() && rightLines.count())) {
|
||||
if (i < leftDiffList.count() || j < rightDiffList.count() || (!leftLines.isEmpty() && !rightLines.isEmpty())) {
|
||||
while (line < qMax(newLeftLines.count(), newRightLines.count())) {
|
||||
handleLine(newLeftLines, line, &leftLines, &leftLineNumber);
|
||||
handleLine(newRightLines, line, &rightLines, &rightLineNumber);
|
||||
@@ -409,7 +409,7 @@ QString DiffUtils::makePatch(const ChunkData &chunkData,
|
||||
// ensure we process buffers to the end.
|
||||
// rowData will be equal
|
||||
if (rowData.equal && i != rowToBeSplit) {
|
||||
if (leftBuffer.count()) {
|
||||
if (!leftBuffer.isEmpty()) {
|
||||
for (int j = 0; j < leftBuffer.count(); j++) {
|
||||
const QString line = makePatchLine('-',
|
||||
leftBuffer.at(j).text,
|
||||
@@ -424,7 +424,7 @@ QString DiffUtils::makePatch(const ChunkData &chunkData,
|
||||
}
|
||||
leftBuffer.clear();
|
||||
}
|
||||
if (rightBuffer.count()) {
|
||||
if (!rightBuffer.isEmpty()) {
|
||||
for (int j = 0; j < rightBuffer.count(); j++) {
|
||||
const QString line = makePatchLine('+',
|
||||
rightBuffer.at(j).text,
|
||||
|
||||
@@ -373,7 +373,7 @@ QString UnifiedDiffEditorWidget::showChunk(const ChunkData &chunkData,
|
||||
// ensure we process buffers to the end.
|
||||
// rowData will be equal
|
||||
if (rowData.equal && i != lastEqualRow) {
|
||||
if (leftBuffer.count()) {
|
||||
if (!leftBuffer.isEmpty()) {
|
||||
for (int j = 0; j < leftBuffer.count(); j++) {
|
||||
const TextLineData &lineData = leftBuffer.at(j);
|
||||
const QString line = DiffUtils::makePatchLine(
|
||||
@@ -414,7 +414,7 @@ QString UnifiedDiffEditorWidget::showChunk(const ChunkData &chunkData,
|
||||
leftBuffer.clear();
|
||||
leftRowsBuffer.clear();
|
||||
}
|
||||
if (rightBuffer.count()) {
|
||||
if (!rightBuffer.isEmpty()) {
|
||||
for (int j = 0; j < rightBuffer.count(); j++) {
|
||||
const TextLineData &lineData = rightBuffer.at(j);
|
||||
const QString line = DiffUtils::makePatchLine(
|
||||
|
||||
@@ -6666,7 +6666,7 @@ static int someInt(const QString &str)
|
||||
{
|
||||
if (str.toInt())
|
||||
return str.toInt();
|
||||
if (str.size())
|
||||
if (!str.isEmpty())
|
||||
return str.at(0).unicode();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ public:
|
||||
|
||||
QStringList childrenNames() const
|
||||
{
|
||||
if (children.count() > 0) {
|
||||
if (!children.isEmpty()) {
|
||||
QStringList names;
|
||||
for (BranchNode *n : children) {
|
||||
names.append(n->childrenNames());
|
||||
|
||||
@@ -223,7 +223,7 @@ void RemoteDialog::updateButtonState()
|
||||
{
|
||||
const QModelIndexList indexList = m_ui->remoteView->selectionModel()->selectedIndexes();
|
||||
|
||||
const bool haveSelection = (indexList.count() > 0);
|
||||
const bool haveSelection = !indexList.isEmpty();
|
||||
m_ui->addButton->setEnabled(true);
|
||||
m_ui->fetchButton->setEnabled(haveSelection);
|
||||
m_ui->pushButton->setEnabled(haveSelection);
|
||||
|
||||
@@ -86,7 +86,7 @@ void GlslHighlighter::highlightBlock(const QString &text)
|
||||
if (tokens.isEmpty()) {
|
||||
setCurrentBlockState(previousState);
|
||||
TextDocumentLayout::clearParentheses(currentBlock());
|
||||
if (text.length()) // the empty line can still contain whitespace
|
||||
if (!text.isEmpty()) // the empty line can still contain whitespace
|
||||
setFormat(0, text.length(), formatForCategory(C_VISUAL_WHITESPACE));
|
||||
TextDocumentLayout::setFoldingIndent(currentBlock(), foldingIndent);
|
||||
return;
|
||||
|
||||
@@ -274,7 +274,7 @@ void IosBuildSettingsWidget::populateProvisioningProfiles()
|
||||
QSignalBlocker blocker(m_signEntityCombo);
|
||||
m_signEntityCombo->clear();
|
||||
const ProvisioningProfiles profiles = IosConfigurations::provisioningProfiles();
|
||||
if (profiles.count() > 0) {
|
||||
if (!profiles.isEmpty()) {
|
||||
for (auto profile : profiles) {
|
||||
m_signEntityCombo->addItem(profile->displayName());
|
||||
const int index = m_signEntityCombo->count() - 1;
|
||||
|
||||
@@ -98,7 +98,7 @@ Macro& Macro::operator=(const Macro &other)
|
||||
|
||||
bool Macro::load(QString fileName)
|
||||
{
|
||||
if (d->events.count())
|
||||
if (!d->events.isEmpty())
|
||||
return true; // the macro is not empty
|
||||
|
||||
// Take the current filename if the parameter is null
|
||||
|
||||
@@ -381,7 +381,7 @@ void MacroManager::changeMacro(const QString &name, const QString &description)
|
||||
|
||||
void MacroManager::saveLastMacro()
|
||||
{
|
||||
if (d->currentMacro->events().count())
|
||||
if (!d->currentMacro->events().isEmpty())
|
||||
d->showSaveDialog();
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ UiController::~UiController()
|
||||
|
||||
bool UiController::hasRightSplitterState() const
|
||||
{
|
||||
return d->rightSplitterState.size() > 0;
|
||||
return !d->rightSplitterState.isEmpty();
|
||||
}
|
||||
|
||||
QByteArray UiController::rightSplitterState() const
|
||||
@@ -62,7 +62,7 @@ QByteArray UiController::rightSplitterState() const
|
||||
|
||||
bool UiController::hasRightHorizSplitterState() const
|
||||
{
|
||||
return d->rightHorizSplitterState.size() > 0;
|
||||
return !d->rightHorizSplitterState.isEmpty();
|
||||
}
|
||||
|
||||
QByteArray UiController::rightHorizSplitterState() const
|
||||
|
||||
@@ -790,7 +790,7 @@ Abi Abi::fromString(const QString &abiString)
|
||||
{
|
||||
Abi::Architecture architecture = UnknownArchitecture;
|
||||
const QVector<QStringRef> abiParts = abiString.splitRef('-');
|
||||
if (abiParts.count() >= 1) {
|
||||
if (!abiParts.isEmpty()) {
|
||||
architecture = architectureFromString(abiParts.at(0));
|
||||
if (abiParts.at(0) != toString(architecture))
|
||||
return Abi();
|
||||
|
||||
@@ -80,7 +80,7 @@ static FolderNode *recursiveFindOrCreateFolderNode(FolderNode *folder,
|
||||
}
|
||||
}
|
||||
QStringList parts = directoryWithoutPrefix.toString().split('/', QString::SkipEmptyParts);
|
||||
if (!Utils::HostOsInfo::isWindowsHost() && !isRelative && parts.count() > 0)
|
||||
if (!Utils::HostOsInfo::isWindowsHost() && !isRelative && !parts.isEmpty())
|
||||
parts[0].prepend('/');
|
||||
|
||||
ProjectExplorer::FolderNode *parent = folder;
|
||||
|
||||
@@ -364,7 +364,7 @@ void ProjectTree::showContextMenu(ProjectTreeWidget *focus, const QPoint &global
|
||||
contextMenu = Core::ActionManager::actionContainer(Constants::M_FILECONTEXT)->menu();
|
||||
}
|
||||
|
||||
if (contextMenu && contextMenu->actions().count() > 0) {
|
||||
if (contextMenu && !contextMenu->actions().isEmpty()) {
|
||||
s_instance->m_focusForContextMenu = focus;
|
||||
contextMenu->popup(globalPos);
|
||||
connect(contextMenu, &QMenu::aboutToHide,
|
||||
|
||||
@@ -85,7 +85,7 @@ QString toJSLiteral(const QVariant &val)
|
||||
QString res;
|
||||
const auto list = val.toList();
|
||||
for (const QVariant &child : list) {
|
||||
if (res.length()) res.append(", ");
|
||||
if (!res.isEmpty() ) res.append(", ");
|
||||
res.append(toJSLiteral(child));
|
||||
}
|
||||
res.prepend('[');
|
||||
|
||||
@@ -652,7 +652,7 @@ void addSignalHandlerOrGotoImplementation(const SelectionContext &selectionState
|
||||
|
||||
Core::ModeManager::activateMode(Core::Constants::MODE_EDIT);
|
||||
|
||||
if (usages.count() > 0 && (addAlwaysNewSlot || usages.count() < 2) && (!isModelNodeRoot || addAlwaysNewSlot)) {
|
||||
if (!usages.isEmpty() && (addAlwaysNewSlot || usages.count() < 2) && (!isModelNodeRoot || addAlwaysNewSlot)) {
|
||||
Core::EditorManager::openEditorAt(usages.constFirst().path, usages.constFirst().line, usages.constFirst().col);
|
||||
|
||||
if (!signalNames.isEmpty()) {
|
||||
|
||||
@@ -466,7 +466,7 @@ QString FunctionHintProposalModel::text(int index) const
|
||||
prettyMethod += arg;
|
||||
}
|
||||
if (m_isVariadic) {
|
||||
if (m_namedArguments.size())
|
||||
if (!m_namedArguments.isEmpty())
|
||||
prettyMethod += QLatin1String(", ");
|
||||
prettyMethod += QLatin1String("...");
|
||||
}
|
||||
|
||||
@@ -332,7 +332,7 @@ QStringList QmlOutlineModel::mimeTypes() const
|
||||
|
||||
QMimeData *QmlOutlineModel::mimeData(const QModelIndexList &indexes) const
|
||||
{
|
||||
if (indexes.count() <= 0)
|
||||
if (indexes.isEmpty())
|
||||
return nullptr;
|
||||
auto data = new Utils::DropMimeData;
|
||||
data->setOverrideFileDropAction(Qt::CopyAction);
|
||||
|
||||
@@ -535,7 +535,7 @@ void MainWidget::addStateView(BaseItem *item)
|
||||
m_actionHandler->action(ActionPaste)->setEnabled(currentView && para);
|
||||
});
|
||||
|
||||
if (m_views.count() > 0)
|
||||
if (!m_views.isEmpty())
|
||||
m_views.last()->scene()->unselectAll();
|
||||
|
||||
if (item) {
|
||||
@@ -582,7 +582,7 @@ void MainWidget::newDocument()
|
||||
void MainWidget::clear()
|
||||
{
|
||||
// Clear and delete all stateviews
|
||||
while (m_views.count() > 0) {
|
||||
while (!m_views.isEmpty()) {
|
||||
m_views.last()->clear();
|
||||
delete m_views.takeLast();
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ void ShapesToolbox::setUIFactory(ScxmlEditor::PluginInterface::ScxmlUiFactory *f
|
||||
void ShapesToolbox::initView()
|
||||
{
|
||||
// Delete old widgets
|
||||
while (m_widgets.count() > 0)
|
||||
while (!m_widgets.isEmpty())
|
||||
delete m_widgets.takeLast();
|
||||
|
||||
// Create new widgets
|
||||
|
||||
@@ -740,7 +740,7 @@ void ConnectableItem::addOverlappingItem(ConnectableItem *item)
|
||||
if (!m_overlappedItems.contains(item))
|
||||
m_overlappedItems.append(item);
|
||||
|
||||
setOverlapping(m_overlappedItems.count() > 0);
|
||||
setOverlapping(!m_overlappedItems.isEmpty());
|
||||
}
|
||||
|
||||
void ConnectableItem::removeOverlappingItem(ConnectableItem *item)
|
||||
@@ -748,7 +748,7 @@ void ConnectableItem::removeOverlappingItem(ConnectableItem *item)
|
||||
if (m_overlappedItems.contains(item))
|
||||
m_overlappedItems.removeAll(item);
|
||||
|
||||
setOverlapping(m_overlappedItems.count() > 0);
|
||||
setOverlapping(!m_overlappedItems.isEmpty());
|
||||
}
|
||||
|
||||
void ConnectableItem::checkOverlapping()
|
||||
@@ -776,7 +776,7 @@ void ConnectableItem::checkOverlapping()
|
||||
}
|
||||
}
|
||||
|
||||
setOverlapping(m_overlappedItems.count() > 0);
|
||||
setOverlapping(!m_overlappedItems.isEmpty());
|
||||
}
|
||||
|
||||
bool ConnectableItem::canStartTransition(ItemType type) const
|
||||
|
||||
@@ -201,7 +201,7 @@ void GraphicsScene::cut()
|
||||
void GraphicsScene::removeSelectedItems()
|
||||
{
|
||||
QVector<ScxmlTag*> tags = SceneUtils::findRemovedTags(m_baseItems);
|
||||
if (tags.count() > 0) {
|
||||
if (!tags.isEmpty()) {
|
||||
m_document->undoStack()->beginMacro(tr("Remove items"));
|
||||
|
||||
// Then remove found tags
|
||||
@@ -235,7 +235,7 @@ void GraphicsScene::copy()
|
||||
if (tags.isEmpty() && m_document->currentTag())
|
||||
tags << m_document->currentTag();
|
||||
|
||||
if (tags.count() > 0) {
|
||||
if (!tags.isEmpty()) {
|
||||
auto mime = new QMimeData;
|
||||
QByteArray result = m_document->content(tags);
|
||||
mime->setText(QLatin1String(result));
|
||||
|
||||
@@ -92,7 +92,7 @@ void ParallelItem::doLayout(int d)
|
||||
// 3. Relocate children-states
|
||||
// a) sort list
|
||||
QVector<StateItem*> sortedList;
|
||||
while (children.count() > 0) {
|
||||
while (!children.isEmpty()) {
|
||||
qreal minTop = children.first()->boundingRect().top();
|
||||
int minTopIndex = 0;
|
||||
for (int i = 1; i < children.count(); ++i) {
|
||||
|
||||
@@ -238,7 +238,7 @@ void layout(const QList<QGraphicsItem*> &items)
|
||||
|
||||
int startAngle = qrand() % 2 == 0 ? 180 : 90;
|
||||
int startDistance = 40 + childItems.count() * 10;
|
||||
if (childItems.count() > 0) {
|
||||
if (!childItems.isEmpty()) {
|
||||
// Init position of the items
|
||||
int angleDiff = 360 / (childItems.count() + 1);
|
||||
for (int i = 0; i < childItems.count(); ++i) {
|
||||
|
||||
@@ -400,7 +400,7 @@ void ScxmlDocument::printSCXML()
|
||||
QByteArray ScxmlDocument::content(const QVector<ScxmlTag*> &tags) const
|
||||
{
|
||||
QByteArray result;
|
||||
if (tags.count() > 0) {
|
||||
if (!tags.isEmpty()) {
|
||||
QBuffer buffer(&result);
|
||||
buffer.open(QIODevice::WriteOnly);
|
||||
|
||||
@@ -666,7 +666,7 @@ ScxmlTag *ScxmlDocument::popRootTag()
|
||||
|
||||
void ScxmlDocument::deleteRootTags()
|
||||
{
|
||||
while (m_rootTags.count() > 0)
|
||||
while (!m_rootTags.isEmpty())
|
||||
delete m_rootTags.takeLast();
|
||||
}
|
||||
|
||||
|
||||
@@ -269,7 +269,7 @@ void ScxmlTag::setContent(const QString &content)
|
||||
|
||||
bool ScxmlTag::hasData() const
|
||||
{
|
||||
if (m_attributeNames.count() > 0 || !m_content.isEmpty())
|
||||
if (!m_attributeNames.isEmpty() || !m_content.isEmpty())
|
||||
return true;
|
||||
|
||||
foreach (ScxmlTag *tag, m_childTags) {
|
||||
|
||||
@@ -264,7 +264,7 @@ void initChildMenu(TagType tagType, QMenu *menu)
|
||||
|
||||
QVector<TagType> childTags = childTypes(tagType);
|
||||
|
||||
if (childTags.count() > 0) {
|
||||
if (!childTags.isEmpty()) {
|
||||
for (int i = 0; i < childTags.count(); ++i) {
|
||||
if (childTags[i] == OnEntry || childTags[i] == OnExit)
|
||||
initChildMenu(childTags[i], menu->addMenu(QLatin1String(scxml_tags[childTags[i]].name)));
|
||||
|
||||
@@ -120,7 +120,7 @@ void StateItem::updateAttributes()
|
||||
QString strNewId = tagValue("id", true);
|
||||
if (!m_parallelState) {
|
||||
QStringList NSIDs = strNewId.split(tag()->document()->nameSpaceDelimiter(), QString::SkipEmptyParts);
|
||||
if (NSIDs.count() > 0) {
|
||||
if (!NSIDs.isEmpty()) {
|
||||
NSIDs[NSIDs.count() - 1] = m_stateNameItem->toPlainText();
|
||||
QString strOldId = NSIDs.join(tag()->document()->nameSpaceDelimiter());
|
||||
ScxmlTag *parentTag = tag()->parentTag();
|
||||
@@ -388,7 +388,7 @@ void StateItem::checkInitial(bool parent)
|
||||
tag = this->tag();
|
||||
}
|
||||
|
||||
if (items.count() > 0 && tag && uiFactory()) {
|
||||
if (!items.isEmpty() && tag && uiFactory()) {
|
||||
auto utilsProvider = static_cast<UtilsProvider*>(uiFactory()->object("utilsProvider"));
|
||||
if (utilsProvider)
|
||||
utilsProvider->checkInitialState(items, tag);
|
||||
|
||||
@@ -133,7 +133,7 @@ void TransitionItem::createGrabbers()
|
||||
if (m_cornerGrabbers.count() != m_cornerPoints.count()) {
|
||||
int selectedGrabberIndex = m_cornerGrabbers.indexOf(m_selectedCornerGrabber);
|
||||
|
||||
if (m_cornerGrabbers.count() > 0) {
|
||||
if (!m_cornerGrabbers.isEmpty()) {
|
||||
qDeleteAll(m_cornerGrabbers);
|
||||
m_cornerGrabbers.clear();
|
||||
}
|
||||
@@ -158,7 +158,7 @@ void TransitionItem::createGrabbers()
|
||||
|
||||
void TransitionItem::removeGrabbers()
|
||||
{
|
||||
if (m_cornerGrabbers.count() > 0) {
|
||||
if (!m_cornerGrabbers.isEmpty()) {
|
||||
qDeleteAll(m_cornerGrabbers);
|
||||
m_cornerGrabbers.clear();
|
||||
}
|
||||
@@ -267,7 +267,7 @@ void TransitionItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
||||
m_cornerPoints.append(p);
|
||||
snapToAnyPoint(m_cornerPoints.count() - 1, p);
|
||||
|
||||
if (m_cornerGrabbers.count() > 0) {
|
||||
if (!m_cornerGrabbers.isEmpty()) {
|
||||
auto corner = new CornerGrabberItem(this);
|
||||
corner->setGrabberType(CornerGrabberItem::Circle);
|
||||
corner->setPos(p);
|
||||
@@ -615,7 +615,7 @@ void TransitionItem::connectToTopItem(const QPointF &pos, TransitionPoint tp, It
|
||||
|
||||
// First try to find parentItem
|
||||
QList<QGraphicsItem*> items = scene()->items(p);
|
||||
if (items.count() > 0) {
|
||||
if (!items.isEmpty()) {
|
||||
for (int i = 0; i < items.count(); ++i) {
|
||||
ItemType type = ItemType(items[i]->type());
|
||||
if ((targetType == UnknownType && type >= FinalStateType) || type >= StateType) {
|
||||
@@ -797,7 +797,7 @@ QPointF TransitionItem::findIntersectionPoint(ConnectableItem *item, const QLine
|
||||
|
||||
// Find intersection point between line and target item
|
||||
QPolygonF itemPolygon = item->polygonShape();
|
||||
if (itemPolygon.count() > 0) {
|
||||
if (!itemPolygon.isEmpty()) {
|
||||
QPointF intersectPoint;
|
||||
QPointF p1 = itemPolygon.at(0) + item->scenePos();
|
||||
QPointF p2;
|
||||
|
||||
@@ -4603,7 +4603,7 @@ void TextEditorWidgetPrivate::paintCursor(const PaintEventData &data, QPainter &
|
||||
|
||||
void TextEditorWidgetPrivate::clearSelectionBackground(PaintEventData &data) const
|
||||
{
|
||||
if (m_inBlockSelectionMode && data.context.selections.count()
|
||||
if (m_inBlockSelectionMode && !data.context.selections.isEmpty()
|
||||
&& data.context.selections.last().cursor == data.textCursor) {
|
||||
data.blockSelectionIndex = data.context.selections.size() - 1;
|
||||
data.context.selections[data.blockSelectionIndex].format.clearBackground();
|
||||
|
||||
@@ -144,7 +144,7 @@ void OptionsDialog::resetKeywordsButtonClicked()
|
||||
|
||||
void OptionsDialog::setKeywordsButtonsEnabled()
|
||||
{
|
||||
bool isSomethingSelected = ui->keywordsList->selectedItems().count() != 0;
|
||||
const bool isSomethingSelected = !ui->keywordsList->selectedItems().isEmpty();
|
||||
ui->removeKeywordButton->setEnabled(isSomethingSelected);
|
||||
ui->editKeywordButton->setEnabled(isSomethingSelected);
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ void TodoProjectSettingsWidget::prepareItem(QListWidgetItem *item) const
|
||||
|
||||
void TodoProjectSettingsWidget::addExcludedPatternButtonClicked()
|
||||
{
|
||||
if (ui->excludedPatternsList->findItems(excludePlaceholder(), Qt::MatchFixedString).count())
|
||||
if (!ui->excludedPatternsList->findItems(excludePlaceholder(), Qt::MatchFixedString).isEmpty())
|
||||
return;
|
||||
ui->excludedPatternsList->editItem(addToExcludedPatternsList(excludePlaceholder()));
|
||||
}
|
||||
@@ -116,7 +116,7 @@ void TodoProjectSettingsWidget::removeExcludedPatternButtonClicked()
|
||||
|
||||
void TodoProjectSettingsWidget::setExcludedPatternsButtonsEnabled()
|
||||
{
|
||||
bool isSomethingSelected = ui->excludedPatternsList->selectedItems().count() != 0;
|
||||
const bool isSomethingSelected = !ui->excludedPatternsList->selectedItems().isEmpty();
|
||||
ui->removeExcludedPatternButton->setEnabled(isSomethingSelected);
|
||||
}
|
||||
|
||||
|
||||
@@ -702,7 +702,7 @@ void BookmarkManager::itemChanged(QStandardItem *item)
|
||||
if (item->text() != oldText) {
|
||||
if (item->data(Qt::UserRole + 10).toString() != QLatin1String("Folder")) {
|
||||
QList<QStandardItem*>itemList = listModel->findItems(oldText);
|
||||
if (itemList.count() > 0)
|
||||
if (!itemList.isEmpty())
|
||||
itemList.at(0)->setText(item->text());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ QString IoUtils::shellQuoteUnix(const QString &arg)
|
||||
0x00, 0x00, 0x00, 0x38, 0x01, 0x00, 0x00, 0x78
|
||||
}; // 0-32 \'"$`<>|;&(){}*?#!~[]
|
||||
|
||||
if (!arg.length())
|
||||
if (arg.isEmpty())
|
||||
return QString::fromLatin1("''");
|
||||
|
||||
QString ret(arg);
|
||||
@@ -167,7 +167,7 @@ QString IoUtils::shellQuoteWin(const QString &arg)
|
||||
0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x10
|
||||
}; // &()<>^|
|
||||
|
||||
if (!arg.length())
|
||||
if (arg.isEmpty())
|
||||
return QString::fromLatin1("\"\"");
|
||||
|
||||
QString ret(arg);
|
||||
|
||||
@@ -885,7 +885,7 @@ void QMakeParser::read(ProFile *pro, const QStringRef &in, int line, SubGrammar
|
||||
flushScopes(tokPtr);
|
||||
if (m_blockstack.size() > 1 || m_blockstack.top().braceLevel)
|
||||
parseError(fL1S("Missing closing brace(s)."));
|
||||
while (m_blockstack.size())
|
||||
while (!m_blockstack.isEmpty())
|
||||
leaveScope(tokPtr);
|
||||
tokBuff.resize(tokPtr - (ushort *)tokBuff.constData()); // Reserved capacity stays
|
||||
*pro->itemsRef() = tokBuff;
|
||||
|
||||
@@ -250,7 +250,7 @@ QVariantMap AddKeysOperation::addKeys(const QVariantMap &map, const KeyValuePair
|
||||
foldBack = current;
|
||||
}
|
||||
|
||||
Q_ASSERT(stack.count() == 0);
|
||||
Q_ASSERT(stack.isEmpty());
|
||||
Q_ASSERT(foldBack != map);
|
||||
|
||||
result = foldBack;
|
||||
|
||||
@@ -203,7 +203,7 @@ QVariantMap RmKeysOperation::rmKeys(const QVariantMap &map, const QStringList &r
|
||||
foldBack = current;
|
||||
}
|
||||
|
||||
Q_ASSERT(stack.count() == 0);
|
||||
Q_ASSERT(stack.isEmpty());
|
||||
Q_ASSERT(foldBack != map);
|
||||
|
||||
result = foldBack;
|
||||
|
||||
Reference in New Issue
Block a user