diff --git a/src/libs/utils/filesearch.cpp b/src/libs/utils/filesearch.cpp index 2676d06c6917fb4f963d734aadca2e24c162f6a5..109e4248f26615dbc5d1ee2a8f2f10da0f1c5754 100644 --- a/src/libs/utils/filesearch.cpp +++ b/src/libs/utils/filesearch.cpp @@ -31,7 +31,6 @@ #include <cctype> #include <QtCore/QFile> -#include <QtCore/QDir> #include <QtCore/QFutureInterface> #include <QtCore/QtConcurrentRun> #include <QtCore/QRegExp> @@ -158,7 +157,7 @@ void runFileSearch(QFutureInterface<FileSearchResult> &future, int n = 0; while (startOfLastLine[i] != '\n' && startOfLastLine[i] != '\r' && i < textLength && n++ < 256) res.append(startOfLastLine[i++]); - future.reportResult(FileSearchResult(QDir::toNativeSeparators(s), lineNr, QString(res), + future.reportResult(FileSearchResult(s, lineNr, QString(res), regionPtr - startOfLastLine, sa.length())); ++numMatches; } @@ -204,7 +203,7 @@ void runFileSearchRegExp(QFutureInterface<FileSearchResult> &future, line = stream.readLine(); int pos = 0; while ((pos = expression.indexIn(line, pos)) != -1) { - future.reportResult(FileSearchResult(QDir::toNativeSeparators(s), lineNr, line, + future.reportResult(FileSearchResult(s, lineNr, line, pos, expression.matchedLength())); pos += expression.matchedLength(); } diff --git a/src/plugins/find/searchresulttreemodel.cpp b/src/plugins/find/searchresulttreemodel.cpp index a53b8fe5951d0e3b80acf39b235ee92d284a1fb5..ddb934c1a1fbe0f0a6a0691543a8577f20006684 100644 --- a/src/plugins/find/searchresulttreemodel.cpp +++ b/src/plugins/find/searchresulttreemodel.cpp @@ -33,6 +33,7 @@ #include <QtGui/QFont> #include <QtGui/QColor> +#include <QtCore/QDir> using namespace Find::Internal; @@ -187,7 +188,7 @@ QVariant SearchResultTreeModel::data(const SearchResultFile *file, int role) con result = QColor(qRgb(245, 245, 245)); break; case Qt::DisplayRole: - result = QString(file->fileName() + result = QString(QDir::toNativeSeparators(file->fileName()) + " (" + QString::number(file->childrenCount()) + ")"); break; case ItemDataRoles::FileNameRole: diff --git a/src/plugins/find/searchresultwindow.cpp b/src/plugins/find/searchresultwindow.cpp index d4ae8d926d85e824a8db97a3867a4362d4c3c8df..7b160a367985fd51477c5f1d530bd069d6ecce2d 100644 --- a/src/plugins/find/searchresultwindow.cpp +++ b/src/plugins/find/searchresultwindow.cpp @@ -153,6 +153,7 @@ void SearchResultWindow::handleJumpToSearchResult(int index, const QString &file ResultWindowItem *SearchResultWindow::addResult(const QString &fileName, int lineNumber, const QString &rowText, int searchTermStart, int searchTermLength) { + qDebug()<<"###"<<fileName; m_widget->setCurrentWidget(m_searchResultTreeView); int index = m_items.size(); ResultWindowItem *item = new ResultWindowItem;