From bab7c80976f08ee6c809d65d866642ec9ce42be9 Mon Sep 17 00:00:00 2001 From: Nikita Baryshnikov Date: Thu, 16 Jul 2015 02:00:56 +0300 Subject: [PATCH] SearchResultWidget: unclutter namespaces replace Q_ASSERT with QTC_ASSERT and be more consistent with asserts Change-Id: I81161a1ee82218ef23f62cc90e52587c342e2e22 Reviewed-by: Orgad Shaneh Reviewed-by: Eike Ziller --- .../coreplugin/find/searchresultwidget.cpp | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/plugins/coreplugin/find/searchresultwidget.cpp b/src/plugins/coreplugin/find/searchresultwidget.cpp index 1df894f6717..91184dd73fd 100644 --- a/src/plugins/coreplugin/find/searchresultwidget.cpp +++ b/src/plugins/coreplugin/find/searchresultwidget.cpp @@ -39,6 +39,8 @@ #include #include + +#include #include #include @@ -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 SearchResultWidget::checkedItems() const { QList 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(fileIndex.internalPointer()); - Q_ASSERT(fileItem != 0); + QModelIndex fileIndex = model->index(i, 0); + SearchResultTreeItem *fileItem = static_cast(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(textIndex.internalPointer()); + SearchResultTreeItem *rowItem = static_cast(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"