summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Baryshnikov <nib952051@gmail.com>2015-07-16 02:00:56 +0300
committerOrgad Shaneh <orgads@gmail.com>2015-10-16 08:26:42 +0000
commitbab7c80976f08ee6c809d65d866642ec9ce42be9 (patch)
tree2fbf35d0873b7d1906f61dfe972cce5344f6be0c
parent9dd457a6787427a95bfd36aa3b9f14dce05f9cbf (diff)
downloadqt-creator-bab7c80976f08ee6c809d65d866642ec9ce42be9.tar.gz
SearchResultWidget: unclutter namespaces
replace Q_ASSERT with QTC_ASSERT and be more consistent with asserts Change-Id: I81161a1ee82218ef23f62cc90e52587c342e2e22 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
-rw-r--r--src/plugins/coreplugin/find/searchresultwidget.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/plugins/coreplugin/find/searchresultwidget.cpp b/src/plugins/coreplugin/find/searchresultwidget.cpp
index 1df894f671..91184dd73f 100644
--- a/src/plugins/coreplugin/find/searchresultwidget.cpp
+++ b/src/plugins/coreplugin/find/searchresultwidget.cpp
@@ -39,6 +39,8 @@
#include <aggregation/aggregate.h>
#include <coreplugin/coreplugin.h>
+
+#include <utils/qtcassert.h>
#include <utils/theme/theme.h>
#include <QDir>
@@ -76,12 +78,6 @@ public slots:
void updateGeometry() { QLineEdit::updateGeometry(); }
};
-} // namespace Internal
-} // namespace Core
-
-using namespace Core;
-using namespace Core::Internal;
-
SearchResultWidget::SearchResultWidget(QWidget *parent) :
QWidget(parent),
m_count(0),
@@ -140,7 +136,7 @@ SearchResultWidget::SearchResultWidget(QWidget *parent) :
layout->addWidget(m_messageWidget);
m_messageWidget->setVisible(false);
- m_searchResultTreeView = new Internal::SearchResultTreeView(this);
+ m_searchResultTreeView = new SearchResultTreeView(this);
m_searchResultTreeView->setFrameStyle(QFrame::NoFrame);
m_searchResultTreeView->setAttribute(Qt::WA_MacShowFocusRect, false);
Aggregation::Aggregate * agg = new Aggregation::Aggregate;
@@ -497,15 +493,16 @@ void SearchResultWidget::searchAgain()
QList<SearchResultItem> SearchResultWidget::checkedItems() const
{
QList<SearchResultItem> result;
- Internal::SearchResultTreeModel *model = m_searchResultTreeView->model();
- const int fileCount = model->rowCount(QModelIndex());
+ SearchResultTreeModel *model = m_searchResultTreeView->model();
+ const int fileCount = model->rowCount();
for (int i = 0; i < fileCount; ++i) {
- QModelIndex fileIndex = model->index(i, 0, QModelIndex());
- Internal::SearchResultTreeItem *fileItem = static_cast<Internal::SearchResultTreeItem *>(fileIndex.internalPointer());
- Q_ASSERT(fileItem != 0);
+ QModelIndex fileIndex = model->index(i, 0);
+ SearchResultTreeItem *fileItem = static_cast<SearchResultTreeItem *>(fileIndex.internalPointer());
+ QTC_ASSERT(fileItem != 0, continue);
for (int rowIndex = 0; rowIndex < fileItem->childrenCount(); ++rowIndex) {
QModelIndex textIndex = model->index(rowIndex, 0, fileIndex);
- Internal::SearchResultTreeItem *rowItem = static_cast<Internal::SearchResultTreeItem *>(textIndex.internalPointer());
+ SearchResultTreeItem *rowItem = static_cast<SearchResultTreeItem *>(textIndex.internalPointer());
+ QTC_ASSERT(rowItem != 0, continue);
if (rowItem->checkState())
result << rowItem->item;
}
@@ -521,4 +518,7 @@ void SearchResultWidget::updateMatchesFoundLabel()
m_matchesFoundLabel->setText(tr("%n matches found.", 0, m_count));
}
+} // namespace Internal
+} // namespace Core
+
#include "searchresultwidget.moc"