Commit 2f7625ac authored by Eike Ziller's avatar Eike Ziller

Fix assert on "Current Project" search without project

Task-number: QTCREATORBUG-10370

Change-Id: If512ea8cbbd77a9c39696093153455ca9e2bb83f
Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
parent d6f21bf5
......@@ -45,7 +45,6 @@ namespace Utils {
class QTCREATOR_UTILS_EXPORT FileIterator
{
public:
FileIterator();
explicit FileIterator(const QStringList &fileList,
const QList<QTextCodec *> encodings);
virtual ~FileIterator();
......@@ -56,6 +55,9 @@ public:
virtual int maxProgress() const;
virtual int currentProgress() const;
protected:
FileIterator();
private:
QStringList m_list;
QStringListIterator *m_iterator;
......
......@@ -80,13 +80,14 @@ QVariant CurrentProjectFind::additionalParameters() const
Utils::FileIterator *CurrentProjectFind::files(const QStringList &nameFilters,
const QVariant &additionalParameters) const
{
QTC_ASSERT(additionalParameters.isValid(), return new Utils::FileIterator());
QTC_ASSERT(additionalParameters.isValid(),
return new Utils::FileIterator(QStringList(), QList<QTextCodec *>()));
QString projectFile = additionalParameters.toString();
foreach (Project *project, SessionManager::projects()) {
if (project->document() && projectFile == project->projectFilePath())
return filesForProjects(nameFilters, QList<Project *>() << project);
}
return new Utils::FileIterator();
return new Utils::FileIterator(QStringList(), QList<QTextCodec *>());
}
QString CurrentProjectFind::label() const
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment