on xenial help sign in
Clean up unnecessary methods
aa2134aMichal Hruby
plugins/Unity/scope.cpp−9
@@ -31,7 +31,6 @@
31Scope::Scope(QObject *parent) :
31Scope::Scope(QObject *parent) :
32 QObject(parent)
32 QObject(parent)
33{
33{
34− m_results.reset(new DeeListModel(this));
35 m_categories.reset(new Categories(this));
34 m_categories.reset(new Categories(this));
36}
35}
37
36
@@ -179,8 +178,6 @@ void Scope::setUnityScope(const unity::dash::Scope::Ptr& scope)
179{
178{
180 m_unityScope = scope;
179 m_unityScope = scope;
181
180
182− // TODO: do we even need this?
183− m_results->setModel(m_unityScope->results()->model());
184 m_categories->setUnityScope(m_unityScope);
181 m_categories->setUnityScope(m_unityScope);
185
182
186 m_unityScope->form_factor = m_formFactor.toStdString();
183 m_unityScope->form_factor = m_formFactor.toStdString();
@@ -193,7 +190,6 @@ void Scope::setUnityScope(const unity::dash::Scope::Ptr& scope)
193 m_unityScope->visible.changed.connect(sigc::mem_fun(this, &Scope::visibleChanged));
190 m_unityScope->visible.changed.connect(sigc::mem_fun(this, &Scope::visibleChanged));
194 m_unityScope->shortcut.changed.connect(sigc::mem_fun(this, &Scope::shortcutChanged));
191 m_unityScope->shortcut.changed.connect(sigc::mem_fun(this, &Scope::shortcutChanged));
195 m_unityScope->connected.changed.connect(sigc::mem_fun(this, &Scope::connectedChanged));
192 m_unityScope->connected.changed.connect(sigc::mem_fun(this, &Scope::connectedChanged));
196− m_unityScope->results()->model.changed.connect(sigc::mem_fun(this, &Scope::onResultsModelChanged));
197 /* Signals forwarding */
193 /* Signals forwarding */
198 connect(this, SIGNAL(searchFinished(const std::string &, unity::glib::HintsMap const &, unity::glib::Error const &)), SLOT(onSearchFinished(const std::string &, unity::glib::HintsMap const &)));
194 connect(this, SIGNAL(searchFinished(const std::string &, unity::glib::HintsMap const &, unity::glib::Error const &)), SLOT(onSearchFinished(const std::string &, unity::glib::HintsMap const &)));
199
195
@@ -222,11 +218,6 @@ void Scope::synchronizeStates()
222 }
218 }
223}
219}
224
220
225−void Scope::onResultsModelChanged(unity::glib::Object<DeeModel> /* model */)
226−{
227− m_results->setModel(m_unityScope->results()->model());
228−}
229−
230void Scope::onSearchFinished(const std::string& /* query */, unity::glib::HintsMap const &hints)
221void Scope::onSearchFinished(const std::string& /* query */, unity::glib::HintsMap const &hints)
231{
222{
232 QString hint;
223 QString hint;
plugins/Unity/scope.h−4
@@ -100,14 +100,10 @@ private Q_SLOTS:
100 void onSearchFinished(const std::string &, unity::glib::HintsMap const &);
100 void onSearchFinished(const std::string &, unity::glib::HintsMap const &);
101
101
102private:
102private:
103− void onResultsModelChanged(unity::glib::Object<DeeModel>);
104− void onCategoriesModelChanged(unity::glib::Object<DeeModel>);
105−
106 void onActivated(unity::dash::LocalResult const& result, unity::dash::ScopeHandledType type, unity::glib::HintsMap const&);
103 void onActivated(unity::dash::LocalResult const& result, unity::dash::ScopeHandledType type, unity::glib::HintsMap const&);
107 void fallbackActivate(const QString& uri);
104 void fallbackActivate(const QString& uri);
108
105
109 unity::dash::Scope::Ptr m_unityScope;
106 unity::dash::Scope::Ptr m_unityScope;
110− std::unique_ptr<DeeListModel> m_results;
111 std::unique_ptr<Categories> m_categories;
107 std::unique_ptr<Categories> m_categories;
112 QString m_searchQuery;
108 QString m_searchQuery;
113 QString m_noResultsHint;
109 QString m_noResultsHint;