@@ -33,14 +33,12 @@
3333#include <QQmlEngine>
3434
3535#include <UnityCore/Variant.h>
36−#include <UnityCore/GLibWrapper.h>
3736
3837#include <libintl.h>
3938#include <glib.h>
4039
4140Scope::Scope(QObject *parent) : QObject(parent)
4241 , m_formFactor("phone")
43− , m_searchInProgress(false)
4442{
4543 m_categories.reset(new Categories(this));
4644}
@@ -70,11 +68,6 @@ QString Scope::searchHint() const
7068 return QString::fromStdString(m_unityScope->search_hint());
7169}
7270
73−bool Scope::searchInProgress() const
74−{
75− return m_searchInProgress;
76−}
77−
7871bool Scope::visible() const
7972{
8073 return m_unityScope->visible();
@@ -122,15 +115,10 @@ void Scope::setSearchQuery(const QString& search_query)
122115 string ("") and m_searchQuery is the null string,
123116 search_query != m_searchQuery is still true.
124117 */
125− using namespace std::placeholders;
126−
127118 if (m_searchQuery.isNull() || search_query != m_searchQuery) {
128119 m_searchQuery = search_query;
129− m_cancellable.Renew();
130− m_searchInProgress = true;
131− m_unityScope->Search(search_query.toStdString(), std::bind(&Scope::onSearchFinished, this, _1, _2, _3), m_cancellable);
120+ m_unityScope->Search(search_query.toStdString(), sigc::mem_fun(this, &Scope::searchFinished));
132121 Q_EMIT searchQueryChanged();
133− Q_EMIT searchInProgressChanged();
134122 }
135123}
136124
@@ -306,6 +294,8 @@ void Scope::setUnityScope(const unity::dash::Scope::Ptr& scope)
306294 m_unityScope->visible.changed.connect(sigc::mem_fun(this, &Scope::visibleChanged));
307295 m_unityScope->shortcut.changed.connect(sigc::mem_fun(this, &Scope::shortcutChanged));
308296 m_unityScope->connected.changed.connect(sigc::mem_fun(this, &Scope::connectedChanged));
297+ /* Signals forwarding */
298+ connect(this, SIGNAL(searchFinished(const std::string &, unity::glib::HintsMap const &, unity::glib::Error const &)), SLOT(onSearchFinished(const std::string &, unity::glib::HintsMap const &)));
309299
310300 /* FIXME: signal should be forwarded instead of calling the handler directly */
311301 m_unityScope->activated.connect(sigc::mem_fun(this, &Scope::onActivated));
@@ -326,33 +316,18 @@ unity::dash::Scope::Ptr Scope::unityScope() const
326316
327317void Scope::synchronizeStates()
328318{
329− using namespace std::placeholders;
330−
331319 if (connected()) {
332320 /* Forward local states to m_unityScope */
333321 if (!m_searchQuery.isNull()) {
334− m_cancellable.Renew();
335− m_searchInProgress = true;
336− m_unityScope->Search(m_searchQuery.toStdString(), std::bind(&Scope::onSearchFinished, this, _1, _2, _3), m_cancellable);
337− Q_EMIT searchInProgressChanged();
322+ m_unityScope->Search(m_searchQuery.toStdString());
338323 }
339324 }
340325}
341326
342−void Scope::onSearchFinished(std::string const& /* query */, unity::glib::HintsMap const& hints, unity::glib::Error const& err)
327+void Scope::onSearchFinished(const std::string& /* query */, unity::glib::HintsMap const &hints)
343328{
344329 QString hint;
345330
346− GError* error = const_cast<unity::glib::Error&>(err);
347−
348− if (!err || !g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
349− m_searchInProgress = false;
350− Q_EMIT searchInProgressChanged();
351− } else {
352− // no need to check the results hint, we're still searching
353− return;
354− }
355−
356331 if (!m_unityScope->results()->count()) {
357332 unity::glib::HintsMap::const_iterator it = hints.find("no-results-hint");
358333 if (it != hints.end()) {