diff options
| author | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2013-07-01 23:19:33 +0200 |
|---|---|---|
| committer | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2013-07-01 23:19:33 +0200 |
| commit | 2dd1f3ffd0c8df2dcc1aecfd454ceb753fa4976d (patch) | |
| tree | 12e16e4fcb0721884915c37ffcc529e55bb47108 /dash | |
| parent | 524e7381ac73f66cf280e7bbf4222d89bf46400d (diff) | |
Dash: use connection::Wrapper
(bzr r3387.5.3)
Diffstat (limited to 'dash')
| -rw-r--r-- | dash/DashController.cpp | 3 | ||||
| -rw-r--r-- | dash/DashController.h | 3 | ||||
| -rw-r--r-- | dash/DashView.cpp | 4 | ||||
| -rw-r--r-- | dash/DashView.h | 5 | ||||
| -rw-r--r-- | dash/FilterAllButton.cpp | 8 | ||||
| -rw-r--r-- | dash/FilterAllButton.h | 4 | ||||
| -rw-r--r-- | dash/ResultView.cpp | 10 | ||||
| -rw-r--r-- | dash/ResultView.h | 4 |
8 files changed, 14 insertions, 27 deletions
diff --git a/dash/DashController.cpp b/dash/DashController.cpp index 7c0635114..dab7214e9 100644 --- a/dash/DashController.cpp +++ b/dash/DashController.cpp @@ -301,7 +301,6 @@ void Controller::ShowDash() // for the screen to be available again before honouring the request. if (wm.IsScreenGrabbed()) { - screen_ungrabbed_slot_.disconnect(); screen_ungrabbed_slot_ = wm.screen_ungrabbed.connect(sigc::mem_fun(this, &Controller::OnScreenUngrabbed)); need_show_ = true; return; @@ -353,7 +352,7 @@ void Controller::HideDash(bool restore) if (!visible_) return; - screen_ungrabbed_slot_.disconnect(); + screen_ungrabbed_slot_->disconnect(); EnsureDash(); diff --git a/dash/DashController.h b/dash/DashController.h index 4dd2a709e..da8d064d5 100644 --- a/dash/DashController.h +++ b/dash/DashController.h @@ -22,6 +22,7 @@ #include <memory> #include <gdk/gdk.h> +#include <UnityCore/ConnectionManager.h> #include <UnityCore/GLibDBusServer.h> #include <UnityCore/GLibSignal.h> @@ -104,7 +105,7 @@ private: bool need_show_; DashView* view_; - sigc::connection screen_ungrabbed_slot_; + connection::Wrapper screen_ungrabbed_slot_; glib::DBusServer dbus_server_; glib::TimeoutSeconds ensure_timeout_; nux::animation::AnimateValue<double> timeline_animator_; diff --git a/dash/DashView.cpp b/dash/DashView.cpp index d50f3daf0..de6e39e49 100644 --- a/dash/DashView.cpp +++ b/dash/DashView.cpp @@ -165,9 +165,6 @@ DashView::DashView(Scopes::Ptr const& scopes, ApplicationStarter::Ptr const& app DashView::~DashView() { - scope_can_refine_connection_.disconnect(); - key_nav_focus_change_connection_.disconnect(); - // Do this explicitely, otherwise dee will complain about invalid access // to the scope models RemoveLayout(); @@ -1270,7 +1267,6 @@ void DashView::OnScopeBarActivated(std::string const& id) if (active_scope_view_.IsValid()) active_scope_view_->SetVisible(false); - scope_can_refine_connection_.disconnect(); nux::ObjectPtr<ScopeView> view = active_scope_view_ = scope_views_[id]; diff --git a/dash/DashView.h b/dash/DashView.h index 8388eb8f8..6abf56b1a 100644 --- a/dash/DashView.h +++ b/dash/DashView.h @@ -24,6 +24,7 @@ #include <Nux/View.h> #include <Nux/VLayout.h> +#include <UnityCore/ConnectionManager.h> #include <UnityCore/Scopes.h> #include <UnityCore/GLibSource.h> @@ -152,8 +153,8 @@ private: nux::ObjectPtr<ScopeView> active_scope_view_; nux::ObjectPtr<ScopeView> preview_scope_view_; - sigc::connection scope_can_refine_connection_; - sigc::connection key_nav_focus_change_connection_; + connection::Wrapper scope_can_refine_connection_; + connection::Wrapper key_nav_focus_change_connection_; // Drawing related nux::Geometry content_geo_; diff --git a/dash/FilterAllButton.cpp b/dash/FilterAllButton.cpp index bef183d04..592356295 100644 --- a/dash/FilterAllButton.cpp +++ b/dash/FilterAllButton.cpp @@ -43,16 +43,8 @@ FilterAllButton::FilterAllButton(NUX_FILE_LINE_DECL) state_change.connect(sigc::mem_fun(this, &FilterAllButton::OnStateChanged)); } -FilterAllButton::~FilterAllButton() -{ - filtering_connection_.disconnect(); -} - void FilterAllButton::SetFilter(Filter::Ptr const& filter) { - if (filtering_connection_.connected()) - filtering_connection_.disconnect(); - filter_ = filter; OnFilteringChanged(filter_->filtering); // Evil hack ;) diff --git a/dash/FilterAllButton.h b/dash/FilterAllButton.h index a31c0213c..bef1ae0c2 100644 --- a/dash/FilterAllButton.h +++ b/dash/FilterAllButton.h @@ -24,6 +24,7 @@ #define UNITYSHELL_FILTERALLBUTTON_H #include <sigc++/connection.h> +#include <UnityCore/ConnectionManager.h> #include <UnityCore/Filter.h> #include "FilterBasicButton.h" @@ -38,7 +39,6 @@ class FilterAllButton : public FilterBasicButton NUX_DECLARE_OBJECT_TYPE(FilterAllButton, FilterBasicButton); public: FilterAllButton(NUX_FILE_LINE_PROTO); - ~FilterAllButton(); void SetFilter(Filter::Ptr const& filter); @@ -47,7 +47,7 @@ private: void OnStateChanged(nux::View* view); Filter::Ptr filter_; - sigc::connection filtering_connection_; + connection::Wrapper filtering_connection_; }; } // namespace dash diff --git a/dash/ResultView.cpp b/dash/ResultView.cpp index c56985e4a..9fdd2ad74 100644 --- a/dash/ResultView.cpp +++ b/dash/ResultView.cpp @@ -106,20 +106,18 @@ void ResultView::SetResultsModel(Results::Ptr const& result_model) // cleanup if (result_model_) { - result_added_connection_.disconnect(); - result_removed_connection_.disconnect(); + result_connections_.Clear(); + for (ResultIterator it(GetIteratorAtRow(0)); !it.IsLast(); ++it) - { RemoveResult(*it); - } } result_model_ = result_model; if (result_model_) { - result_added_connection_ = result_model_->result_added.connect(sigc::mem_fun(this, &ResultView::AddResult)); - result_removed_connection_ = result_model_->result_removed.connect(sigc::mem_fun(this, &ResultView::RemoveResult)); + result_connections_.Add(result_model_->result_added.connect(sigc::mem_fun(this, &ResultView::AddResult))); + result_connections_.Add(result_model_->result_removed.connect(sigc::mem_fun(this, &ResultView::RemoveResult))); } } diff --git a/dash/ResultView.h b/dash/ResultView.h index 2c2f559e9..91408d7f2 100644 --- a/dash/ResultView.h +++ b/dash/ResultView.h @@ -28,6 +28,7 @@ #include <dee.h> #include <UnityCore/GLibSignal.h> +#include <UnityCore/ConnectionManager.h> #include <UnityCore/Results.h> #include "unity-shared/Introspectable.h" @@ -124,8 +125,7 @@ private: void OnRowRemoved(DeeModel* model, DeeModelIter* iter); Result cached_result_; - sigc::connection result_added_connection_; - sigc::connection result_removed_connection_; + connection::Manager result_connections_; }; } |
