Fix compile on macOS

Amends 44acfc0702.

Change-Id: I1abfb757c88f60ed22a2c94f55dd0e418d2fb6a0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Christian Stenger
2019-07-24 13:17:01 +02:00
parent 39aa325245
commit b0bee4b947

View File

@@ -54,9 +54,8 @@ public:
void toFront(); void toFront();
bool hasNext() const; bool hasNext() const;
QString next(); Utils::FilePath next() override;
QString filePath() const; Utils::FilePath filePath() const override;
QString fileName() const;
private: private:
void ensureNext(); void ensureNext();
@@ -132,24 +131,18 @@ bool SpotlightIterator::hasNext() const
return (m_index + 1 < m_filePaths.size()); return (m_index + 1 < m_filePaths.size());
} }
QString SpotlightIterator::next() Utils::FilePath SpotlightIterator::next()
{ {
ensureNext(); ensureNext();
++m_index; ++m_index;
QTC_ASSERT(m_index < m_filePaths.size(), return QString()); QTC_ASSERT(m_index < m_filePaths.size(), return Utils::FilePath());
return m_filePaths.at(m_index); return Utils::FilePath::fromString(m_filePaths.at(m_index));
} }
QString SpotlightIterator::filePath() const Utils::FilePath SpotlightIterator::filePath() const
{ {
QTC_ASSERT(m_index < m_filePaths.size(), return QString()); QTC_ASSERT(m_index < m_filePaths.size(), return Utils::FilePath());
return m_filePaths.at(m_index); return Utils::FilePath::fromString(m_filePaths.at(m_index));
}
QString SpotlightIterator::fileName() const
{
QTC_ASSERT(m_index < m_fileNames.size(), return QString());
return m_fileNames.at(m_index);
} }
void SpotlightIterator::ensureNext() void SpotlightIterator::ensureNext()
@@ -183,7 +176,7 @@ void SpotlightLocatorFilter::prepareSearch(const QString &entry)
{ {
const EditorManager::FilePathInfo fp = EditorManager::splitLineAndColumnNumber(entry); const EditorManager::FilePathInfo fp = EditorManager::splitLineAndColumnNumber(entry);
if (fp.filePath.isEmpty()) { if (fp.filePath.isEmpty()) {
setFileIterator(new BaseFileFilter::ListIterator(QStringList())); setFileIterator(new BaseFileFilter::ListIterator(Utils::FilePathList()));
} else { } else {
// only pass the file name part to spotlight to allow searches like "somepath/*foo" // only pass the file name part to spotlight to allow searches like "somepath/*foo"
int lastSlash = fp.filePath.lastIndexOf(QLatin1Char('/')); int lastSlash = fp.filePath.lastIndexOf(QLatin1Char('/'));