summaryrefslogtreecommitdiff
path: root/src/libs/utils/filesearch.h
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@theqtcompany.com>2015-12-16 14:58:04 +0100
committerEike Ziller <eike.ziller@theqtcompany.com>2016-01-13 13:00:52 +0000
commit0e012a835b4d7e086eb954a210a10871dc28726e (patch)
tree8c5acea09c118e9a01cceaa844befcb660b501d3 /src/libs/utils/filesearch.h
parent54779131c5b208756eafca2f9515e17f7a20eb48 (diff)
downloadqt-creator-0e012a835b4d7e086eb954a210a10871dc28726e.tar.gz
File search: Avoid use of QtConcurrent
QtConcurrent limits resource usage to a global number of simultaneous threads. That means that if some QtConcurrent based algorithm currently grabs all threads, any other use of QtConcurrent blocks, which is not what we want. Use the new threading methods of C++11 instead, but still use QFuture(Interface) manually for the progress, result and status reporting. Task-number: QTCREATORBUG-14640 Change-Id: I6379d2f2a01b6d200811ef4be0bbfcd4493dd154 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/libs/utils/filesearch.h')
-rw-r--r--src/libs/utils/filesearch.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/libs/utils/filesearch.h b/src/libs/utils/filesearch.h
index bf827d0c27..3c3195fea9 100644
--- a/src/libs/utils/filesearch.h
+++ b/src/libs/utils/filesearch.h
@@ -56,6 +56,8 @@ public:
QTextCodec *encoding;
};
+ typedef Item value_type;
+
class const_iterator
{
public:
@@ -65,27 +67,27 @@ public:
typedef const value_type *pointer;
typedef const value_type &reference;
- const_iterator(FileIterator *parent, Item item, int id)
+ const_iterator(const FileIterator *parent, Item item, int id)
: m_parent(parent), m_item(item), m_index(id)
{}
const Item operator*() const { return m_item; }
const Item *operator->() const { return &m_item; }
- void operator++() { m_parent->next(this); }
+ void operator++() { m_parent->advance(this); }
bool operator==(const const_iterator &other) const
{
return m_parent == other.m_parent && m_index == other.m_index;
}
bool operator!=(const const_iterator &other) const { return !operator==(other); }
- FileIterator *m_parent;
+ const FileIterator *m_parent;
Item m_item;
int m_index; // -1 == end
};
virtual ~FileIterator() {}
- void next(const_iterator *it);
- const_iterator begin();
- const_iterator end();
+ void advance(const_iterator *it) const;
+ const_iterator begin() const;
+ const_iterator end() const;
virtual int maxProgress() const = 0;
virtual int currentProgress() const = 0;