diff options
68 files changed, 159 insertions, 159 deletions
diff --git a/UnityCore/GLibDBusProxy.cpp b/UnityCore/GLibDBusProxy.cpp index 80c86b3f6..c794ea95d 100644 --- a/UnityCore/GLibDBusProxy.cpp +++ b/UnityCore/GLibDBusProxy.cpp @@ -136,7 +136,7 @@ void DBusProxy::Impl::StartReconnectionTimeout(unsigned timeout) { LOG_DEBUG(logger) << "Starting reconnection timeout for " << name_; - auto callback = [&] + auto callback = [this] { if (!proxy_) Connect(); diff --git a/UnityCore/GSettingsScopes.cpp b/UnityCore/GSettingsScopes.cpp index 833040c4f..03b58590a 100644 --- a/UnityCore/GSettingsScopes.cpp +++ b/UnityCore/GSettingsScopes.cpp @@ -72,7 +72,7 @@ GSettingsScopesReader::Impl::Impl(GSettingsScopesReader* owner) , loaded_(false) , settings_(g_settings_new(SETTINGS_NAME.c_str())) { - auto change_func = [&] (GSettings*, gchar*) + auto change_func = [this] (GSettings*, gchar*) { if (loaded_) { diff --git a/UnityCore/Hud.cpp b/UnityCore/Hud.cpp index 8883119d1..e79750c0d 100644 --- a/UnityCore/Hud.cpp +++ b/UnityCore/Hud.cpp @@ -52,7 +52,7 @@ public: , parent_(parent) { LOG_DEBUG(logger) << "Hud init with name: " << dbus_name << "and path: " << dbus_path; - proxy_.connected.connect([&]() { + proxy_.connected.connect([this]() { LOG_DEBUG(logger) << "Hud Connected"; parent_->connected = true; }); diff --git a/dash/CoverflowResultView.cpp b/dash/CoverflowResultView.cpp index 3c9180ef5..370ba1314 100755 --- a/dash/CoverflowResultView.cpp +++ b/dash/CoverflowResultView.cpp @@ -161,7 +161,7 @@ CoverflowResultView::Impl::Impl(CoverflowResultView *parent) coverflow_->y_offset = 0.15f; coverflow_->reflection_size = .5f; - ubus_.RegisterInterest(UBUS_DASH_PREVIEW_NAVIGATION_REQUEST, [&] (GVariant* data) { + ubus_.RegisterInterest(UBUS_DASH_PREVIEW_NAVIGATION_REQUEST, [this] (GVariant* data) { int nav_mode = 0; GVariant* local_result_variant = nullptr; glib::String proposed_unique_id; diff --git a/dash/DashController.cpp b/dash/DashController.cpp index 59f4d3616..54e653891 100644 --- a/dash/DashController.cpp +++ b/dash/DashController.cpp @@ -73,13 +73,13 @@ Controller::Controller(Controller::WindowCreator const& create_window) { RegisterUBusInterests(); - ensure_timeout_.Run([&]() { EnsureDash(); return false; }); + ensure_timeout_.Run([this]() { EnsureDash(); return false; }); timeline_animator_.updated.connect(sigc::mem_fun(this, &Controller::OnViewShowHideFrame)); // As a default. the create_window_ function should just create a base window. if (create_window_ == nullptr) { - create_window_ = [&]() { + create_window_ = [this]() { return new ResizingBaseWindow(dash::window_title, [this](nux::Geometry const& geo) { if (view_) @@ -90,7 +90,7 @@ Controller::Controller(Controller::WindowCreator const& create_window) } SetupWindow(); - UScreen::GetDefault()->changed.connect([&] (int, std::vector<nux::Geometry>&) { Relayout(true); }); + UScreen::GetDefault()->changed.connect([this] (int, std::vector<nux::Geometry>&) { Relayout(true); }); Settings::Instance().form_factor.changed.connect([this](FormFactor) { @@ -160,8 +160,8 @@ void Controller::RegisterUBusInterests() ubus_manager_.RegisterInterest(UBUS_OVERLAY_CLOSE_REQUEST, sigc::mem_fun(this, &Controller::OnExternalHideDash)); ubus_manager_.RegisterInterest(UBUS_DASH_ABOUT_TO_SHOW, - [&] (GVariant*) { EnsureDash(); }); - ubus_manager_.RegisterInterest(UBUS_OVERLAY_SHOWN, [&] (GVariant *data) + [this] (GVariant*) { EnsureDash(); }); + ubus_manager_.RegisterInterest(UBUS_OVERLAY_SHOWN, [this] (GVariant *data) { unity::glib::String overlay_identity; gboolean can_maximise = FALSE; diff --git a/dash/DashView.cpp b/dash/DashView.cpp index 6c1416a17..c68d49d91 100644 --- a/dash/DashView.cpp +++ b/dash/DashView.cpp @@ -237,7 +237,7 @@ void DashView::BuildPreview(Preview::Ptr model) preview_displaying_ = true; // connect to nav left/right signals to request nav left/right movement. - preview_container_->navigate_left.connect([&] () { + preview_container_->navigate_left.connect([this] () { preview_navigation_mode_ = previews::Navigation::LEFT; // sends a message to all result views, sending the the uri of the current preview result @@ -245,7 +245,7 @@ void DashView::BuildPreview(Preview::Ptr model) ubus_manager_.SendMessage(UBUS_DASH_PREVIEW_NAVIGATION_REQUEST, g_variant_new("(ivs)", -1, g_variant_ref(last_activated_result_.Variant()), stored_activated_unique_id_.c_str())); }); - preview_container_->navigate_right.connect([&] () { + preview_container_->navigate_right.connect([this] () { preview_navigation_mode_ = previews::Navigation::RIGHT; // sends a message to all result views, sending the the uri of the current preview result @@ -253,7 +253,7 @@ void DashView::BuildPreview(Preview::Ptr model) ubus_manager_.SendMessage(UBUS_DASH_PREVIEW_NAVIGATION_REQUEST, g_variant_new("(ivs)", 1, g_variant_ref(last_activated_result_.Variant()), stored_activated_unique_id_.c_str())); }); - preview_container_->request_close.connect([&] () { ClosePreview(); }); + preview_container_->request_close.connect([this] () { ClosePreview(); }); } else { @@ -303,7 +303,7 @@ void DashView::StartPreviewAnimation() split_animation_->SetStartValue(animate_split_value_); split_animation_->SetFinishValue(1.0f); split_animation_->SetEasingCurve(na::EasingCurve(na::EasingCurve::Type::Linear)); - split_animation_->updated.connect([&](float const& linear_split_animate_value) + split_animation_->updated.connect([this](float const& linear_split_animate_value) { static na::EasingCurve split_animation_curve(na::EasingCurve::Type::InQuad); @@ -319,7 +319,7 @@ void DashView::StartPreviewAnimation() preview_container_animation_->SetStartValue(animate_preview_container_value_); preview_container_animation_->SetFinishValue(1.0f); preview_container_animation_->SetEasingCurve(na::EasingCurve(na::EasingCurve::Type::Linear)); - preview_container_animation_->updated.connect([&](float const& linear_preview_container_animate_value) + preview_container_animation_->updated.connect([this](float const& linear_preview_container_animate_value) { static na::EasingCurve preview_container_animation_curve(na::EasingCurve::Type::InQuad); @@ -335,7 +335,7 @@ void DashView::StartPreviewAnimation() preview_animation_->SetStartValue(animate_preview_value_); preview_animation_->SetFinishValue(1.0f); preview_animation_->SetEasingCurve(na::EasingCurve(na::EasingCurve::Type::Linear)); - preview_animation_->updated.connect([&](float const& linear_preview_animate_value) + preview_animation_->updated.connect([this](float const& linear_preview_animate_value) { animate_preview_value_ = linear_preview_animate_value; QueueDraw(); @@ -372,7 +372,7 @@ void DashView::EndPreviewAnimation() preview_animation_->SetStartValue(1.0f - animate_preview_value_); preview_animation_->SetFinishValue(1.0f); preview_animation_->SetEasingCurve(na::EasingCurve(na::EasingCurve::Type::Linear)); - preview_animation_->updated.connect([&](float const& preview_value) + preview_animation_->updated.connect([this](float const& preview_value) { animate_preview_value_ = 1.0f - preview_value; QueueDraw(); @@ -386,7 +386,7 @@ void DashView::EndPreviewAnimation() preview_container_animation_->SetStartValue(1.0f - animate_preview_container_value_); preview_container_animation_->SetFinishValue(1.0f); preview_container_animation_->SetEasingCurve(na::EasingCurve(na::EasingCurve::Type::Linear)); - preview_container_animation_->updated.connect([&](float const& linear_preview_container_animate_value) + preview_container_animation_->updated.connect([this](float const& linear_preview_container_animate_value) { static na::EasingCurve preview_container_animation_curve(na::EasingCurve::Type::InQuad); @@ -401,7 +401,7 @@ void DashView::EndPreviewAnimation() split_animation_->SetStartValue(1.0f - animate_split_value_); split_animation_->SetFinishValue(1.0f); split_animation_->SetEasingCurve(na::EasingCurve(na::EasingCurve::Type::Linear)); - split_animation_->updated.connect([&](float const& linear_split_animate_value) + split_animation_->updated.connect([this](float const& linear_split_animate_value) { static na::EasingCurve split_animation_curve(na::EasingCurve::Type::InQuad); @@ -537,7 +537,7 @@ void DashView::SetupViews() search_bar_->activated.connect(sigc::mem_fun(this, &DashView::OnEntryActivated)); search_bar_->search_changed.connect(sigc::mem_fun(this, &DashView::OnSearchChanged)); search_bar_->live_search_reached.connect(sigc::mem_fun(this, &DashView::OnLiveSearchReached)); - search_bar_->showing_filters.changed.connect([&] (bool showing) + search_bar_->showing_filters.changed.connect([this] (bool showing) { if (active_scope_view_) { @@ -1220,10 +1220,10 @@ void DashView::OnScopeAdded(Scope::Ptr const& scope, int position) // set form factor used for the searches scope->form_factor = "desktop"; scope->activated.connect(sigc::mem_fun(this, &DashView::OnResultActivatedReply)); - scope->connected.changed.connect([&] (bool value) { }); + scope->connected.changed.connect([this] (bool value) { }); // Hook up to the new preview infrastructure - scope->preview_ready.connect([&] (LocalResult const& result, Preview::Ptr model) + scope->preview_ready.connect([this] (LocalResult const& result, Preview::Ptr model) { // HACK: Atm we don't support well the fact that a preview can be sent from // an ActionResponse and therefore transition does not work, this hack allows diff --git a/dash/FilterBasicButton.cpp b/dash/FilterBasicButton.cpp index 700998bde..104931857 100644 --- a/dash/FilterBasicButton.cpp +++ b/dash/FilterBasicButton.cpp @@ -75,12 +75,12 @@ void FilterBasicButton::Init() clear_before_draw_ = true; - key_nav_focus_change.connect([&] (nux::Area*, bool, nux::KeyNavDirection) + key_nav_focus_change.connect([this] (nux::Area*, bool, nux::KeyNavDirection) { QueueDraw(); }); - key_nav_focus_activate.connect([&](nux::Area*) + key_nav_focus_activate.connect([this](nux::Area*) { if (GetInputEventSensitivity()) Active() ? Deactivate() : Activate(); diff --git a/dash/FilterExpanderLabel.cpp b/dash/FilterExpanderLabel.cpp index b2fda6b34..2b5c2e6bb 100644 --- a/dash/FilterExpanderLabel.cpp +++ b/dash/FilterExpanderLabel.cpp @@ -174,17 +174,17 @@ void FilterExpanderLabel::BuildLayout() SetLayout(layout_); // Lambda functions - auto mouse_expand = [&](int x, int y, unsigned long b, unsigned long k) + auto mouse_expand = [this](int x, int y, unsigned long b, unsigned long k) { expanded = !expanded; }; - auto key_redraw = [&](nux::Area*, bool, nux::KeyNavDirection) + auto key_redraw = [this](nux::Area*, bool, nux::KeyNavDirection) { QueueDraw(); }; - auto key_expand = [&](nux::Area*) + auto key_expand = [this](nux::Area*) { expanded = !expanded; }; diff --git a/dash/FilterGenreButton.cpp b/dash/FilterGenreButton.cpp index a0164d247..fce405702 100644 --- a/dash/FilterGenreButton.cpp +++ b/dash/FilterGenreButton.cpp @@ -33,7 +33,7 @@ FilterGenreButton::FilterGenreButton(std::string const& label, NUX_FILE_LINE_DEC { InitTheme(); - state_change.connect([&](nux::Button* button) + state_change.connect([this](nux::Button* button) { if (filter_) filter_->active = Active(); @@ -45,7 +45,7 @@ FilterGenreButton::FilterGenreButton(NUX_FILE_LINE_DECL) { InitTheme(); - state_change.connect([&](nux::Button* button) + state_change.connect([this](nux::Button* button) { if (filter_) filter_->active = Active(); @@ -59,7 +59,7 @@ void FilterGenreButton::SetFilter(FilterOption::Ptr const& filter) SetActive(filter_->active); - filter_->active.changed.connect([&](bool is_active) + filter_->active.changed.connect([this](bool is_active) { SetActive(is_active); }); diff --git a/dash/FilterMultiRangeButton.cpp b/dash/FilterMultiRangeButton.cpp index 7f2302775..ccd13ea85 100644 --- a/dash/FilterMultiRangeButton.cpp +++ b/dash/FilterMultiRangeButton.cpp @@ -62,8 +62,8 @@ void FilterMultiRangeButton::Init() SetAcceptKeyNavFocusOnMouseEnter(false); state_change.connect(sigc::mem_fun(this, &FilterMultiRangeButton::OnActivated)); - key_nav_focus_change.connect([&](nux::Area*, bool, nux::KeyNavDirection) { QueueDraw(); }); - key_nav_focus_activate.connect([&](nux::Area* area) { Active() ? Deactivate() : Activate(); }); + key_nav_focus_change.connect([this](nux::Area*, bool, nux::KeyNavDirection) { QueueDraw(); }); + key_nav_focus_activate.connect([this](nux::Area* area) { Active() ? Deactivate() : Activate(); }); } void FilterMultiRangeButton::OnActivated(nux::Area* area) diff --git a/dash/FilterRatingsButton.cpp b/dash/FilterRatingsButton.cpp index c73df3a11..33c2ac44e 100644 --- a/dash/FilterRatingsButton.cpp +++ b/dash/FilterRatingsButton.cpp @@ -52,7 +52,7 @@ FilterRatingsButton::FilterRatingsButton(NUX_FILE_LINE_DECL) mouse_move.connect(sigc::mem_fun(this, &FilterRatingsButton::RecvMouseMove)); mouse_drag.connect(sigc::mem_fun(this, &FilterRatingsButton::RecvMouseDrag)); - key_nav_focus_change.connect([&](nux::Area* area, bool has_focus, nux::KeyNavDirection direction) + key_nav_focus_change.connect([this](nux::Area* area, bool has_focus, nux::KeyNavDirection direction) { if (has_focus) focused_star_ = 0; @@ -62,7 +62,7 @@ FilterRatingsButton::FilterRatingsButton(NUX_FILE_LINE_DECL) QueueDraw(); }); - key_nav_focus_activate.connect([&](nux::Area*) { filter_->rating = static_cast<float>(focused_star_+1)/num_stars; }); + key_nav_focus_activate.connect([this](nux::Area*) { filter_->rating = static_cast<float>(focused_star_+1)/num_stars; }); key_down.connect(sigc::mem_fun(this, &FilterRatingsButton::OnKeyDown)); } diff --git a/dash/PlacesGroup.cpp b/dash/PlacesGroup.cpp index b67229a9c..8ca4ec53c 100755 --- a/dash/PlacesGroup.cpp +++ b/dash/PlacesGroup.cpp @@ -203,7 +203,7 @@ PlacesGroup::PlacesGroup(dash::StyleInterface& style) _expand_label->mouse_click.connect(sigc::mem_fun(this, &PlacesGroup::RecvMouseClick)); _expand_icon->mouse_click.connect(sigc::mem_fun(this, &PlacesGroup::RecvMouseClick)); - key_nav_focus_change.connect([&](nux::Area* area, bool has_focus, nux::KeyNavDirection direction) + key_nav_focus_change.connect([this](nux::Area* area, bool has_focus, nux::KeyNavDirection direction) { if (!has_focus) return; @@ -289,7 +289,7 @@ PlacesGroup::SetChildView(dash::ResultView* view) _child_layout->SetLeftAndRightPadding(_style.GetPlacesGroupResultLeftPadding(), 0); _group_layout->AddLayout(_child_layout, 1); - view->results_per_row.changed.connect([&] (int results_per_row) + view->results_per_row.changed.connect([this] (int results_per_row) { _n_visible_items_in_unexpand_mode = results_per_row; RefreshLabel(); diff --git a/dash/PreviewStateMachine.cpp b/dash/PreviewStateMachine.cpp index 3e0c65c0b..2b549efc6 100644 --- a/dash/PreviewStateMachine.cpp +++ b/dash/PreviewStateMachine.cpp @@ -37,8 +37,8 @@ PreviewStateMachine::PreviewStateMachine() split_positions_[pos] = -1; } - left_results.changed.connect([&] (int value) { CheckPreviewRequirementsFulfilled();}); - right_results.changed.connect([&] (int value) { CheckPreviewRequirementsFulfilled();}); + left_results.changed.connect([this] (int value) { CheckPreviewRequirementsFulfilled();}); + right_results.changed.connect([this] (int value) { CheckPreviewRequirementsFulfilled();}); } PreviewStateMachine::~PreviewStateMachine() diff --git a/dash/ResultView.cpp b/dash/ResultView.cpp index 9fdd2ad74..cf63fb861 100644 --- a/dash/ResultView.cpp +++ b/dash/ResultView.cpp @@ -44,13 +44,13 @@ ResultView::ResultView(NUX_FILE_LINE_DECL) , renderer_(NULL) , cached_result_(nullptr, nullptr, nullptr) { - expanded.changed.connect([&](bool value) + expanded.changed.connect([this](bool value) { QueueRelayout(); NeedRedraw(); }); - desaturation_progress.changed.connect([&](float value) + desaturation_progress.changed.connect([this](float value) { NeedRedraw(); }); @@ -80,7 +80,7 @@ void ResultView::SetModelRenderer(ResultRenderer* renderer) renderer_->UnReference(); renderer_ = renderer; - renderer->NeedsRedraw.connect([&]() + renderer->NeedsRedraw.connect([this]() { NeedRedraw(); }); diff --git a/dash/ResultViewGrid.cpp b/dash/ResultViewGrid.cpp index c1a218179..6850ffe66 100644 --- a/dash/ResultViewGrid.cpp +++ b/dash/ResultViewGrid.cpp @@ -81,16 +81,16 @@ ResultViewGrid::ResultViewGrid(NUX_FILE_LINE_DECL) EnableDoubleClick(true); SetAcceptKeyNavFocusOnMouseDown(false); - auto needredraw_lambda = [&](int value) { NeedRedraw(); }; + auto needredraw_lambda = [this](int value) { NeedRedraw(); }; horizontal_spacing.changed.connect(needredraw_lambda); vertical_spacing.changed.connect(needredraw_lambda); padding.changed.connect(needredraw_lambda); selected_index_.changed.connect(needredraw_lambda); - expanded.changed.connect([&](bool value) { if (value) all_results_preloaded_ = false; }); - results_per_row.changed.connect([&](int value) { if (value > 0) all_results_preloaded_ = false; }); + expanded.changed.connect([this](bool value) { if (value) all_results_preloaded_ = false; }); + results_per_row.changed.connect([this](int value) { if (value > 0) all_results_preloaded_ = false; }); key_nav_focus_change.connect(sigc::mem_fun(this, &ResultViewGrid::OnKeyNavFocusChange)); - key_nav_focus_activate.connect([&] (nux::Area *area) + key_nav_focus_activate.connect([this] (nux::Area *area) { Activate(focused_result_, selected_index_, ResultView::ActivateType::DIRECT); }); @@ -99,7 +99,7 @@ ResultViewGrid::ResultViewGrid(NUX_FILE_LINE_DECL) mouse_click.connect(sigc::mem_fun(this, &ResultViewGrid::MouseClick)); mouse_double_click.connect(sigc::mem_fun(this, &ResultViewGrid::MouseDoubleClick)); - mouse_down.connect([&](int x, int y, unsigned long mouse_state, unsigned long button_state) + mouse_down.connect([this](int x, int y, unsigned long mouse_state, unsigned long button_state) { last_mouse_down_x_ = x; last_mouse_down_y_ = y; @@ -107,7 +107,7 @@ ResultViewGrid::ResultViewGrid(NUX_FILE_LINE_DECL) mouse_over_index_ = index; }); - mouse_leave.connect([&](int x, int y, unsigned long mouse_state, unsigned long button_state) + mouse_leave.connect([this](int x, int y, unsigned long mouse_state, unsigned long button_state) { mouse_over_index_ = -1; mouse_last_x_ = -1; @@ -123,7 +123,7 @@ ResultViewGrid::ResultViewGrid(NUX_FILE_LINE_DECL) g_variant_get (data, "(ii)", &recorded_dash_width_, &recorded_dash_height_); }); - ubus_.RegisterInterest(UBUS_DASH_PREVIEW_NAVIGATION_REQUEST, [&] (GVariant* data) { + ubus_.RegisterInterest(UBUS_DASH_PREVIEW_NAVIGATION_REQUEST, [this] (GVariant* data) { int nav_mode = 0; GVariant* local_result_variant = NULL; glib::String proposed_unique_id; diff --git a/dash/ScopeBar.cpp b/dash/ScopeBar.cpp index d2677bb02..fb437a4e7 100644 --- a/dash/ScopeBar.cpp +++ b/dash/ScopeBar.cpp @@ -80,8 +80,8 @@ void ScopeBar::AddScope(Scope::Ptr const& scope) layout_->AddView(icon, 0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FIX); AddChild(icon); - icon->mouse_click.connect([&, icon] (int x, int y, unsigned long button, unsigned long keyboard) { SetActive(icon); }); - icon->key_nav_focus_activate.connect([&, icon](nux::Area*){ SetActive(icon); }); + icon->mouse_click.connect([this, icon] (int x, int y, unsigned long button, unsigned long keyboard) { SetActive(icon); }); + icon->key_nav_focus_activate.connect([this, icon](nux::Area*){ SetActive(icon); }); } void ScopeBar::Activate(std::string id) diff --git a/dash/ScopeBarIcon.cpp b/dash/ScopeBarIcon.cpp index ed8519cc8..e1a42e5dd 100644 --- a/dash/ScopeBarIcon.cpp +++ b/dash/ScopeBarIcon.cpp @@ -57,7 +57,7 @@ ScopeBarIcon::ScopeBarIcon(std::string id_, std::string icon_hint) SetAcceptKeyNavFocusOnMouseEnter(true); active.changed.connect(sigc::mem_fun(this, &ScopeBarIcon::OnActiveChanged)); - key_nav_focus_change.connect([&](nux::Area*, bool, nux::KeyNavDirection){ QueueDraw(); }); + key_nav_focus_change.connect([this](nux::Area*, bool, nux::KeyNavDirection){ QueueDraw(); }); } ScopeBarIcon::~ScopeBarIcon() diff --git a/dash/ScopeView.cpp b/dash/ScopeView.cpp index d087b1335..4ae96c115 100755 --- a/dash/ScopeView.cpp +++ b/dash/ScopeView.cpp @@ -59,7 +59,7 @@ public: { SetVScrollBar(scroll_bar); - OnVisibleChanged.connect([&] (nux::Area* /*area*/, bool visible) { + OnVisibleChanged.connect([this] (nux::Area* /*area*/, bool visible) { if (m_horizontal_scrollbar_enable) _hscrollbar->SetVisible(visible); if (m_vertical_scrollbar_enable) @@ -178,7 +178,7 @@ ScopeView::ScopeView(Scope::Ptr const& scope, nux::Area* show_filters) conn_manager_.Add(scope_->filters.changed.connect(sigc::mem_fun(this, &ScopeView::SetupFilters))); SetupFilters(scope->filters); - scope_->connected.changed.connect([&](bool is_connected) + scope_->connected.changed.connect([this](bool is_connected) { // We need to search again if we were reconnected after being connected before. if (scope_connected_ && !is_connected) @@ -193,7 +193,7 @@ ScopeView::ScopeView(Scope::Ptr const& scope, nux::Area* show_filters) }); } - ubus_manager_.RegisterInterest(UBUS_RESULT_VIEW_KEYNAV_CHANGED, [&] (GVariant* data) { + ubus_manager_.RegisterInterest(UBUS_RESULT_VIEW_KEYNAV_CHANGED, [this] (GVariant* data) { // we get this signal when a result view keynav changes, // its a bad way of doing this but nux ABI needs to be broken // to do it properly @@ -220,7 +220,7 @@ ScopeView::ScopeView(Scope::Ptr const& scope, nux::Area* show_filters) } }); - OnVisibleChanged.connect([&] (nux::Area* area, bool visible) { + OnVisibleChanged.connect([this] (nux::Area* area, bool visible) { scroll_view_->SetVisible(visible); if ((filters_expanded && visible) || !visible) @@ -757,7 +757,7 @@ void ScopeView::QueueCategoryCountsCheck() { if (!model_updated_timeout_) { - model_updated_timeout_.reset(new glib::Idle([&] () { + model_updated_timeout_.reset(new glib::Idle([this] () { // Check if all results so far are from one category // If so, then expand that category. CheckCategoryCounts(); @@ -830,7 +830,7 @@ bool ScopeView::PerformSearch(std::string const& search_query, SearchCallback co if (scope_) { // 150ms to hide the no reults message if its take a while to return results - hide_message_delay_.reset(new glib::Timeout(150, [&] () { + hide_message_delay_.reset(new glib::Timeout(150, [this] () { HideResultsMessage(); return false; })); diff --git a/dash/previews/ActionButton.cpp b/dash/previews/ActionButton.cpp index b76bab00b..ddd1f4f23 100644 --- a/dash/previews/ActionButton.cpp +++ b/dash/previews/ActionButton.cpp @@ -76,7 +76,7 @@ void ActionButton::Init() { InitTheme(); - key_nav_focus_activate.connect([&](nux::Area*) + key_nav_focus_activate.connect([this](nux::Area*) { if (GetInputEventSensitivity()) activate.emit(this, action_hint_); diff --git a/dash/previews/ActionLink.cpp b/dash/previews/ActionLink.cpp index 317800bde..c0cddeb17 100644 --- a/dash/previews/ActionLink.cpp +++ b/dash/previews/ActionLink.cpp @@ -81,12 +81,12 @@ void ActionLink::Init() font_hint.SetSetterFunction(sigc::mem_fun(this, &ActionLink::set_font_hint)); font_hint.SetGetterFunction(sigc::mem_fun(this, &ActionLink::get_font_hint)); - key_nav_focus_change.connect([&] (nux::Area*, bool, nux::KeyNavDirection) + key_nav_focus_change.connect([this] (nux::Area*, bool, nux::KeyNavDirection) { QueueDraw(); }); - key_nav_focus_activate.connect([&](nux::Area*) + key_nav_focus_activate.connect([this](nux::Area*) { if (GetInputEventSensitivity()) activate.emit(this, action_hint_); diff --git a/dash/previews/ApplicationPreview.cpp b/dash/previews/ApplicationPreview.cpp index 7ab91a2d2..49a18b93c 100644 --- a/dash/previews/ApplicationPreview.cpp +++ b/dash/previews/ApplicationPreview.cpp @@ -119,7 +119,7 @@ void ApplicationPreview::SetupViews() previews::Style& style = dash::previews::Style::Instance(); - auto on_mouse_down = [&](int x, int y, unsigned long button_flags, unsigned long key_flags) { this->preview_container_->OnMouseDown(x, y, button_flags, key_flags); }; + auto on_mouse_down = [this](int x, int y, unsigned long button_flags, unsigned long key_flags) { this->preview_container_->OnMouseDown(x, y, button_flags, key_flags); }; nux::HLayout* image_data_layout = new nux::HLayout(); image_data_layout->SetSpaceBetweenChildren(style.GetPanelSplitWidth()); diff --git a/dash/previews/GenericPreview.cpp b/dash/previews/GenericPreview.cpp index b912722dd..e34e6630e 100644 --- a/dash/previews/GenericPreview.cpp +++ b/dash/previews/GenericPreview.cpp @@ -111,7 +111,7 @@ void GenericPreview::SetupViews() } previews::Style& style = dash::previews::Style::Instance(); - auto on_mouse_down = [&](int x, int y, unsigned long button_flags, unsigned long key_flags) { this->preview_container_->OnMouseDown(x, y, button_flags, key_flags); }; + auto on_mouse_down = [this](int x, int y, unsigned long button_flags, unsigned long key_flags) { this->preview_container_->OnMouseDown(x, y, button_flags, key_flags); }; nux::HLayout* image_data_layout = new nux::HLayout(); image_data_layout->SetSpaceBetweenChildren(style.GetPanelSplitWidth()); diff --git a/dash/previews/MoviePreview.cpp b/dash/previews/MoviePreview.cpp index 5edcb5db3..ec2e96e3c 100644 --- a/dash/previews/MoviePreview.cpp +++ b/dash/previews/MoviePreview.cpp @@ -121,7 +121,7 @@ void MoviePreview::SetupViews() } previews::Style& style = dash::previews::Style::Instance(); - auto on_mouse_down = [&](int x, int y, unsigned long button_flags, unsigned long key_flags) { this->preview_container_->OnMouseDown(x, y, button_flags, key_flags); }; + auto on_mouse_down = [this](int x, int y, unsigned long button_flags, unsigned long key_flags) { this->preview_container_->OnMouseDown(x, y, button_flags, key_flags); }; nux::HLayout* image_data_layout = new nux::HLayout(); image_data_layout->SetSpaceBetweenChildren(style.GetPanelSplitWidth()); diff --git a/dash/previews/MusicPreview.cpp b/dash/previews/MusicPreview.cpp index d41a7767f..960655f0a 100644 --- a/dash/previews/MusicPreview.cpp +++ b/dash/previews/MusicPreview.cpp @@ -128,7 +128,7 @@ void MusicPreview::SetupViews() } previews::Style& style = dash::previews::Style::Instance(); - auto on_mouse_down = [&](int x, int y, unsigned long button_flags, unsigned long key_flags) { this->preview_container_->OnMouseDown(x, y, button_flags, key_flags); }; + auto on_mouse_down = [this](int x, int y, unsigned long button_flags, unsigned long key_flags) { this->preview_container_->OnMouseDown(x, y, button_flags, key_flags); }; nux::HLayout* image_data_layout = new nux::HLayout(); image_data_layout->SetSpaceBetweenChildren(style.GetPanelSplitWidth()); diff --git a/dash/previews/Preview.cpp b/dash/previews/Preview.cpp index c32038444..c57f76afa 100644 --- a/dash/previews/Preview.cpp +++ b/dash/previews/Preview.cpp @@ -200,7 +200,7 @@ void Preview::UpdateCoverArtImage(CoverArt* cover_art) previews::Style& style = dash::previews::Style::Instance(); - auto on_mouse_down = [&](int x, int y, unsigned long button_flags, unsigned long key_flags) { this->preview_container_->OnMouseDown(x, y, button_flags, key_flags); }; + auto on_mouse_down = [this](int x, int y, unsigned long button_flags, unsigned long key_flags) { this->preview_container_->OnMouseDown(x, y, button_flags, key_flags); }; std::string image_hint; if (preview_model_->image.Get()) diff --git a/dash/previews/PreviewContainer.cpp b/dash/previews/PreviewContainer.cpp index 644095669..93d6d95a1 100644 --- a/dash/previews/PreviewContainer.cpp +++ b/dash/previews/PreviewContainer.cpp @@ -68,7 +68,7 @@ public: , nav_complete_(0) , relative_nav_index_(0) { - geometry_changed.connect([&](nux::Area*, nux::Geometry& geo) + geometry_changed.connect([this](nux::Area*, nux::Geometry& geo) { // Need to update the preview geometries when updating the container geo. UpdateAnimationProgress(progress_, curve_progress_); @@ -229,7 +229,7 @@ public: void StartPreviewWait() { - preview_wait_timer_.reset(new glib::Timeout(PREVIEW_SPINNER_WAIT, [&] () { + preview_wait_timer_.reset(new glib::Timeout(PREVIEW_SPINNER_WAIT, [this] () { if (waiting_preview_) return false; @@ -469,7 +469,7 @@ void PreviewContainer::SetupViews() AddChild(nav_left_); nav_left_->SetMinimumWidth(style.GetNavigatorWidth()); nav_left_->SetMaximumWidth(style.GetNavigatorWidth()); - nav_left_->activated.connect([&]() { navigate_left.emit(); }); + nav_left_->activated.connect([this]() { navigate_left.emit(); }); layout_content_->AddView(nav_left_, 0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_MATCHCONTENT); preview_layout_ = new PreviewContent(this); @@ -481,13 +481,13 @@ void PreviewContainer::SetupViews() AddChild(nav_right_); nav_right_->SetMinimumWidth(style.GetNavigatorWidth()); nav_right_->SetMaximumWidth(style.GetNavigatorWidth()); - nav_right_->activated.connect([&]() { navigate_right.emit(); }); + nav_right_->activated.connect([this]() { navigate_right.emit(); }); layout_content_->AddView(nav_right_, 0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_MATCHCONTENT); layout_content_->AddSpace(0, 1); layout->AddSpace(0, 1); - preview_layout_->start_navigation.connect([&]() + preview_layout_->start_navigation.connect([this]() { // reset animation clock. if (navigation_count_ == 0) @@ -500,19 +500,19 @@ void PreviewContainer::SetupViews() QueueAnimation(); }); - preview_layout_->continue_navigation.connect([&]() + preview_layout_->continue_navigation.connect([this]() { QueueAnimation(); }); - preview_layout_->end_navigation.connect([&]() + preview_layout_->end_navigation.connect([this]() { navigation_count_ = 0; navigation_progress_speed_ = 0; }); - navigate_right.connect( [&]() { preview_layout_->StartPreviewWait(); } ); - navigate_left.connect( [&]() { preview_layout_->StartPreviewWait(); } ); + navigate_right.connect( [this]() { preview_layout_->StartPreviewWait(); } ); + navigate_left.connect( [this]() { preview_layout_->StartPreviewWait(); } ); } void PreviewContainer::Draw(nux::GraphicsEngine& gfx_engine, bool force_draw) diff --git a/dash/previews/PreviewInfoHintWidget.cpp b/dash/previews/PreviewInfoHintWidget.cpp index 46ebfb0e3..f30fbdeaa 100644 --- a/dash/previews/PreviewInfoHintWidget.cpp +++ b/dash/previews/PreviewInfoHintWidget.cpp @@ -148,7 +148,7 @@ void PreviewInfoHintWidget::SetupViews() previews::Style& style = previews::Style::Instance(); - auto on_mouse_down = [&](int x, int y, unsigned long button_flags, unsigned long key_flags) { this->preview_container_.OnMouseDown(x, y, button_flags, key_flags); }; + auto on_mouse_down = [this](int x, int y, unsigned long button_flags, unsigned long key_flags) { this->preview_container_.OnMouseDown(x, y, button_flags, key_flags); }; nux::VLayout* layout = new nux::VLayout(); layout->SetSpaceBetweenChildren(6); diff --git a/dash/previews/PreviewNavigator.cpp b/dash/previews/PreviewNavigator.cpp index d71c2217c..afe52252d 100644 --- a/dash/previews/PreviewNavigator.cpp +++ b/dash/previews/PreviewNavigator.cpp @@ -141,7 +141,7 @@ void PreviewNavigator::SetupViews() AddChild(texture_); layout_->AddView(texture_, 0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL); - texture_->mouse_click.connect([&](int, int, unsigned long, unsigned long) { activated.emit(); }); + texture_->mouse_click.connect([this](int, int, unsigned long, unsigned long) { activated.emit(); }); texture_->mouse_enter.connect(sigc::mem_fun(this, &PreviewNavigator::TexRecvMouseEnter)); texture_->mouse_leave.connect(sigc::mem_fun(this, &PreviewNavigator::TexRecvMouseLeave)); } diff --git a/dash/previews/PreviewRatingsWidget.cpp b/dash/previews/PreviewRatingsWidget.cpp index 1e4454bc6..3aa358915 100644 --- a/dash/previews/PreviewRatingsWidget.cpp +++ b/dash/previews/PreviewRatingsWidget.cpp @@ -49,7 +49,7 @@ PreviewRatingsWidget::PreviewRatingsWidget(NUX_FILE_LINE_DECL) previews::Style& style = previews::Style::Instance(); - auto on_mouse_down = [&](int x, int y, unsigned long button_flags, unsigned long key_flags) { this->preview_container_.OnMouseDown(x, y, button_flags, key_flags); }; + auto on_mouse_down = [this](int x, int y, unsigned long button_flags, unsigned long key_flags) { this->preview_container_.OnMouseDown(x, y, button_flags, key_flags); }; ratings_ = new RatingsButton(18,2); ratings_->SetEditable(false); diff --git a/dash/previews/SocialPreview.cpp b/dash/previews/SocialPreview.cpp index a1513c019..02869889b 100644 --- a/dash/previews/SocialPreview.cpp +++ b/dash/previews/SocialPreview.cpp @@ -120,7 +120,7 @@ void SocialPreview::SetupViews() previews::Style& style = dash::previews::Style::Instance(); - auto on_mouse_down = [&](int x, int y, unsigned long button_flags, unsigned long key_flags) { this->preview_container_->OnMouseDown(x, y, button_flags, key_flags); }; + auto on_mouse_down = [this](int x, int y, unsigned long button_flags, unsigned long key_flags) { this->preview_container_->OnMouseDown(x, y, button_flags, key_flags); }; nux::HLayout* image_data_layout = new nux::HLayout(); image_data_layout->SetSpaceBetweenChildren(style.GetPanelSplitWidth()); diff --git a/dash/previews/SocialPreviewComments.cpp b/dash/previews/SocialPreviewComments.cpp index 653854896..8893659be 100644 --- a/dash/previews/SocialPreviewComments.cpp +++ b/dash/previews/SocialPreviewComments.cpp @@ -128,7 +128,7 @@ void SocialPreviewComments::SetupViews() previews::Style& style = previews::Style::Instance(); - auto on_mouse_down = [&](int x, int y, unsigned long button_flags, unsigned long key_flags) { this->preview_container_.OnMouseDown(x, y, button_flags, key_flags); }; + auto on_mouse_down = [this](int x, int y, unsigned long button_flags, unsigned long key_flags) { this->preview_container_.OnMouseDown(x, y, button_flags, key_flags); }; nux::VLayout* layout = new nux::VLayout(); layout->SetSpaceBetweenChildren(6); diff --git a/dash/previews/SocialPreviewContent.cpp b/dash/previews/SocialPreviewContent.cpp index 7c4b287ce..6b5b66a3e 100644 --- a/dash/previews/SocialPreviewContent.cpp +++ b/dash/previews/SocialPreviewContent.cpp @@ -130,7 +130,7 @@ void SocialPreviewContent::SetupViews() { dash::previews::Style const& style = dash::previews::Style::Instance(); - auto on_mouse_down = [&](int x, int y, unsigned long button_flags, unsigned long key_flags) { this->preview_container_.OnMouseDown(x, y, button_flags, key_flags); }; + auto on_mouse_down = [this](int x, int y, unsigned long button_flags, unsigned long key_flags) { this->preview_container_.OnMouseDown(x, y, button_flags, key_flags); }; text_ = new StaticCairoText("", false, NUX_TRACKER_LOCATION); text_->SetLines(-8); diff --git a/dash/previews/StandaloneApplicationPreview.cpp b/dash/previews/StandaloneApplicationPreview.cpp index 409785ecf..c254544e2 100644 --- a/dash/previews/StandaloneApplicationPreview.cpp +++ b/dash/previews/StandaloneApplicationPreview.cpp @@ -144,7 +144,7 @@ void TestRunner::Init () container_ = new previews::PreviewContainer(NUX_TRACKER_LOCATION); container_->navigate_right.connect(sigc::mem_fun(this, &TestRunner::NavRight)); container_->navigate_left.connect(sigc::mem_fun(this, &TestRunner::NavLeft)); - container_->request_close.connect([&]() { exit(0); }); + container_->request_close.connect([this]() { exit(0); }); DummyView* dummyView = new DummyView(container_.GetPointer()); layout_ = new nux::VLayout(NUX_TRACKER_LOCATION); @@ -243,7 +243,7 @@ The service allows users to communicate with peers by voice, video, and instant void TestRunner::NavLeft() { - preview_wait_timer_.reset(new glib::Timeout(2000, [&] () { + preview_wait_timer_.reset(new glib::Timeout(2000, [this] () { std::stringstream app_name; diff --git a/dash/previews/StandaloneErrorPreview.cpp b/dash/previews/StandaloneErrorPreview.cpp index 5d778ab6e..b15529be6 100644 --- a/dash/previews/StandaloneErrorPreview.cpp +++ b/dash/previews/StandaloneErrorPreview.cpp @@ -147,7 +147,7 @@ TestRunner::~TestRunner () void TestRunner::Init () { container_ = new previews::PreviewContainer(NUX_TRACKER_LOCATION); - container_->request_close.connect([&]() { exit(0); }); + container_->request_close.connect([this]() { exit(0); }); container_->DisableNavButton(previews::Navigation::BOTH); DummyView* dummyView = new DummyView(container_.GetPointer()); diff --git a/dash/previews/StandaloneMoviePreview.cpp b/dash/previews/StandaloneMoviePreview.cpp index 6289b6607..bfd43e70a 100644 --- a/dash/previews/StandaloneMoviePreview.cpp +++ b/dash/previews/StandaloneMoviePreview.cpp @@ -143,7 +143,7 @@ void TestRunner::Init () container_ = new previews::PreviewContainer(NUX_TRACKER_LOCATION); container_->navigate_right.connect(sigc::mem_fun(this, &TestRunner::NavRight)); container_->navigate_left.connect(sigc::mem_fun(this, &TestRunner::NavLeft)); - container_->request_close.connect([&]() { exit(0); }); + container_->request_close.connect([this]() { exit(0); }); DummyView* dummyView = new DummyView(container_.GetPointer()); layout_ = new nux::VLayout(NUX_TRACKER_LOCATION); diff --git a/dash/previews/StandaloneMusicPaymentPreview.cpp b/dash/previews/StandaloneMusicPaymentPreview.cpp index 9ba2a7da9..b3324b779 100644 --- a/dash/previews/StandaloneMusicPaymentPreview.cpp +++ b/dash/previews/StandaloneMusicPaymentPreview.cpp @@ -146,7 +146,7 @@ TestRunner::~TestRunner () void TestRunner::Init () { container_ = new previews::PreviewContainer(NUX_TRACKER_LOCATION); - container_->request_close.connect([&]() { exit(0); }); + container_->request_close.connect([this]() { exit(0); }); container_->DisableNavButton(previews::Navigation::BOTH); DummyView* dummyView = new DummyView(container_.GetPointer()); diff --git a/dash/previews/StandaloneMusicPreview.cpp b/dash/previews/StandaloneMusicPreview.cpp index c4680e587..bc9296321 100644 --- a/dash/previews/StandaloneMusicPreview.cpp +++ b/dash/previews/StandaloneMusicPreview.cpp @@ -143,14 +143,14 @@ TestRunner::TestRunner (std::string const& search_string) nav_iter = 0; nav_direction_ = previews::Navigation::RIGHT; - connected.connect([&](bool connected) { + connected.connect([this](bool connected) { if (connected) { Search(search_string_); } }); - results_->result_added.connect([&](Result const& result) + results_->result_added.connect([this](Result const& result) { previews::Navigation navDisabled = previews::Navigation::BOTH; if (nav_iter < results_->count.Get() - 1) @@ -177,7 +177,7 @@ void TestRunner::Init () container_ = new previews::PreviewContainer(NUX_TRACKER_LOCATION); container_->navigate_right.connect(sigc::mem_fun(this, &TestRunner::NavRight)); container_->navigate_left.connect(sigc::mem_fun(this, &TestRunner::NavLeft)); - container_->request_close.connect([&]() { exit(0); }); + container_->request_close.connect([this]() { exit(0); }); DummyView* dummyView = new DummyView(container_.GetPointer()); layout_ = new nux::VLayout(NUX_TRACKER_LOCATION); @@ -186,7 +186,7 @@ void TestRunner::Init () container_->DisableNavButton(previews::Navigation::BOTH); - preview_ready.connect([&](std::string const& uri, dash::Preview::Ptr preview_model) + preview_ready.connect([this](std::string const& uri, dash::Preview::Ptr preview_model) { container_->Preview(preview_model, nav_direction_); }); diff --git a/dash/previews/StandaloneSocialPreview.cpp b/dash/previews/StandaloneSocialPreview.cpp index 9280305e9..2ab5a76e9 100644 --- a/dash/previews/StandaloneSocialPreview.cpp +++ b/dash/previews/StandaloneSocialPreview.cpp @@ -144,7 +144,7 @@ void TestRunner::Init () container_ = new previews::PreviewContainer(NUX_TRACKER_LOCATION); container_->navigate_right.connect(sigc::mem_fun(this, &TestRunner::NavRight)); container_->navigate_left.connect(sigc::mem_fun(this, &TestRunner::NavLeft)); - container_->request_close.connect([&]() { exit(0); }); + container_->request_close.connect([this]() { exit(0); }); DummyView* dummyView = new DummyView(container_.GetPointer()); layout_ = new nux::VLayout(NUX_TRACKER_LOCATION); diff --git a/dash/previews/Track.cpp b/dash/previews/Track.cpp index a9898d61f..2bdd906d7 100644 --- a/dash/previews/Track.cpp +++ b/dash/previews/Track.cpp @@ -270,7 +270,7 @@ void Track::SetupViews() mouse_enter.connect(sigc::mem_fun(this, &Track::OnTrackControlMouseEnter)); mouse_leave.connect(sigc::mem_fun(this, &Track::OnTrackControlMouseLeave)); - mouse_click.connect([&](int, int, unsigned long, unsigned long) + mouse_click.connect([this](int, int, unsigned long, unsigned long) { switch (play_state_) { diff --git a/hud/HudButton.cpp b/hud/HudButton.cpp index b963a6658..92d3db21c 100644 --- a/hud/HudButton.cpp +++ b/hud/HudButton.cpp @@ -65,28 +65,28 @@ HudButton::HudButton(NUX_FILE_LINE_DECL) InitTheme(); - key_nav_focus_change.connect([&](nux::Area*, bool, nux::KeyNavDirection) + key_nav_focus_change.connect([this](nux::Area*, bool, nux::KeyNavDirection) { QueueDraw(); }); - fake_focused.changed.connect([&](bool) + fake_focused.changed.connect([this](bool) { QueueDraw(); }); - mouse_move.connect([&](int x, int y, int dx, int dy, unsigned int button, unsigned int key) + mouse_move.connect([this](int x, int y, int dx, int dy, unsigned int button, unsigned int key) { if (!fake_focused) fake_focused = true; }); - mouse_enter.connect([&](int x, int y, unsigned int button, unsigned int key) + mouse_enter.connect([this](int x, int y, unsigned int button, unsigned int key) { fake_focused = true; }); - mouse_leave.connect([&](int x, int y, unsigned int button, unsigned int key) + mouse_leave.connect([this](int x, int y, unsigned int button, unsigned int key) { fake_focused = false; }); @@ -94,7 +94,7 @@ HudButton::HudButton(NUX_FILE_LINE_DECL) void HudButton::InitTheme() { - is_rounded.changed.connect([&](bool) + is_rounded.changed.connect([this](bool) { nux::Geometry const& geo = GetGeometry(); prelight_->Invalidate(geo); diff --git a/hud/HudView.cpp b/hud/HudView.cpp index 8b7f2d003..22d9cd7de 100644 --- a/hud/HudView.cpp +++ b/hud/HudView.cpp @@ -83,7 +83,7 @@ View::View() search_bar_->text_entry()->SetLoseKeyFocusOnKeyNavDirectionUp(false); search_bar_->text_entry()->SetLoseKeyFocusOnKeyNavDirectionDown(false); - search_bar_->text_entry()->key_nav_focus_change.connect([&](nux::Area *area, bool receiving, nux::KeyNavDirection direction) + search_bar_->text_entry()->key_nav_focus_change.connect([this](nux::Area *area, bool receiving, nux::KeyNavDirection direction) { // We get here when the Hud closes. // The TextEntry should always have the keyboard focus as long as the hud is open. @@ -239,7 +239,7 @@ void View::SetQueries(Hud::Queries queries) button_views_->AddView(button.GetPointer(), 0, nux::MINOR_POSITION_START); - button->click.connect([&](nux::View* view) { + button->click.connect([this](nux::View* view) { query_activated.emit(dynamic_cast<HudButton*>(view)->GetQuery()); }); @@ -390,7 +390,7 @@ void View::SetupViews() content_layout_->AddLayout(button_views_.GetPointer(), 1, nux::MINOR_POSITION_START); } - content_layout_->geometry_changed.connect([&](nux::Area*, nux::Geometry& geo) + content_layout_->geometry_changed.connect([this](nux::Area*, nux::Geometry& geo) { if (!timeline_animating_) { diff --git a/hud/StandaloneHud.cpp b/hud/StandaloneHud.cpp index 33fbe1063..1c4c24434 100644 --- a/hud/StandaloneHud.cpp +++ b/hud/StandaloneHud.cpp @@ -72,7 +72,7 @@ void TestRunner::Init () nux::GetWindowThread()->SetLayout (layout); // things the controller normally does - hud_service_.queries_updated.connect([&] (unity::hud::Hud::Queries queries) { + hud_service_.queries_updated.connect([this] (unity::hud::Hud::Queries queries) { hud_view_->SetQueries(queries); std::string icon_name = ""; for (auto query = queries.begin(); query != queries.end(); query++) @@ -89,19 +89,19 @@ void TestRunner::Init () }); - hud_view_->query_activated.connect([&] (unity::hud::Query::Ptr query) { + hud_view_->query_activated.connect([this] (unity::hud::Query::Ptr query) { hud_service_.ExecuteQuery(query, 0); }); - hud_view_->query_selected.connect([&] (unity::hud::Query::Ptr query) { + hud_view_->query_selected.connect([this] (unity::hud::Query::Ptr query) { hud_view_->SetIcon(query->icon_name, 42, 52, 0); }); - hud_view_->search_changed.connect([&] (std::string search_string) { + hud_view_->search_changed.connect([this] (std::string search_string) { hud_service_.RequestQuery(search_string); }); - hud_view_->search_activated.connect([&] (std::string search_string) { + hud_view_->search_activated.connect([this] (std::string search_string) { hud_service_.ExecuteQueryBySearch(search_string, 0); }); diff --git a/launcher/BFBLauncherIcon.cpp b/launcher/BFBLauncherIcon.cpp index 15fe55cd3..d73bcac5c 100644 --- a/launcher/BFBLauncherIcon.cpp +++ b/launcher/BFBLauncherIcon.cpp @@ -42,7 +42,7 @@ BFBLauncherIcon::BFBLauncherIcon(LauncherHideMode hide_mode) background_color_ = nux::color::White; - mouse_enter.connect([&](int m) { ubus_manager_.SendMessage(UBUS_DASH_ABOUT_TO_SHOW, NULL); }); + mouse_enter.connect([this](int m) { ubus_manager_.SendMessage(UBUS_DASH_ABOUT_TO_SHOW, NULL); }); ubus_manager_.RegisterInterest(UBUS_OVERLAY_SHOWN, sigc::bind(sigc::mem_fun(this, &BFBLauncherIcon::OnOverlayShown), true)); ubus_manager_.RegisterInterest(UBUS_OVERLAY_HIDDEN, sigc::bind(sigc::mem_fun(this, &BFBLauncherIcon::OnOverlayShown), false)); } diff --git a/launcher/EdgeBarrierController.cpp b/launcher/EdgeBarrierController.cpp index f310b24de..2c12e4610 100644 --- a/launcher/EdgeBarrierController.cpp +++ b/launcher/EdgeBarrierController.cpp @@ -87,7 +87,7 @@ EdgeBarrierController::Impl::Impl(EdgeBarrierController *parent) ResizeBarrierList(monitors); /* FIXME: Back to c++11 lambda once we get sigc::track_obj. - uscreen->changed.connect(sigc::track_obj(([&](int primary, std::vector<nux::Geometry>& layout) { + uscreen->changed.connect(sigc::track_obj(([this](int primary, std::vector<nux::Geometry>& layout) { ResizeBarrierList(layout); SetupBarriers(layout); }));*/ @@ -106,9 +106,9 @@ EdgeBarrierController::Impl::Impl(EdgeBarrierController *parent) return false; }); - parent_->options.changed.connect([&](launcher::Options::Ptr options) { + parent_->options.changed.connect([this](launcher::Options::Ptr options) { /* FIXME: Back to c++11 lambda once we get sigc::track_obj. - options->option_changed.connect([&]() { + options->option_changed.connect([this]() { SetupBarriers(UScreen::GetDefault()->GetMonitors()); });*/ options->option_changed.connect(sigc::mem_fun(this, &EdgeBarrierController::Impl::OnOptionsChanged)); diff --git a/launcher/FavoriteStoreGSettings.cpp b/launcher/FavoriteStoreGSettings.cpp index a9759917e..415a04bfe 100644 --- a/launcher/FavoriteStoreGSettings.cpp +++ b/launcher/FavoriteStoreGSettings.cpp @@ -49,7 +49,7 @@ FavoriteStoreGSettings::FavoriteStoreGSettings() : ignore_signals_(false) , settings_(g_settings_new(SETTINGS_NAME.c_str())) { - favorites_changed_.Connect(settings_, "changed::"+SETTINGS_KEY, [&] (GSettings*, gchar*) + favorites_changed_.Connect(settings_, "changed::"+SETTINGS_KEY, [this] (GSettings*, gchar*) { Changed(); }); diff --git a/launcher/LauncherHideMachine.cpp b/launcher/LauncherHideMachine.cpp index c057c2c05..f348778de 100644 --- a/launcher/LauncherHideMachine.cpp +++ b/launcher/LauncherHideMachine.cpp @@ -39,7 +39,7 @@ LauncherHideMachine::LauncherHideMachine() , _should_hide(false) , _latest_emit_should_hide(false) { - decaymulator_.value.changed.connect([&](int value) { reveal_progress = value / static_cast<float>(reveal_pressure); }); + decaymulator_.value.changed.connect([this](int value) { reveal_progress = value / static_cast<float>(reveal_pressure); }); edge_decay_rate.changed.connect(sigc::mem_fun (this, &LauncherHideMachine::OnDecayRateChanged)); } @@ -68,7 +68,7 @@ void LauncherHideMachine::SetShouldHide(bool value, bool skip_delay) if (value && !skip_delay) { _hide_delay_timeout.reset(new glib::Timeout(HIDE_DELAY_TIMEOUT_LENGTH)); - _hide_delay_timeout->Run([&] () { + _hide_delay_timeout->Run([this] () { EnsureHideState(true); return false; }); diff --git a/launcher/LauncherIcon.cpp b/launcher/LauncherIcon.cpp index 171b7b20a..4b52d89ce 100644 --- a/launcher/LauncherIcon.cpp +++ b/launcher/LauncherIcon.cpp @@ -124,7 +124,7 @@ void LauncherIcon::LoadQuicklist() _quicklist = new QuicklistView(); AddChild(_quicklist.GetPointer()); - _quicklist->mouse_down_outside_pointer_grab_area.connect([&] (int x, int y, unsigned long button_flags, unsigned long key_flags) + _quicklist->mouse_down_outside_pointer_grab_area.connect([this] (int x, int y, unsigned long button_flags, unsigned long key_flags) { _allow_quicklist_to_show = false; }); diff --git a/launcher/SwitcherController.cpp b/launcher/SwitcherController.cpp index 618c76a10..cb8157337 100644 --- a/launcher/SwitcherController.cpp +++ b/launcher/SwitcherController.cpp @@ -301,7 +301,7 @@ Controller::Impl::Impl(Controller* obj, }; // TODO We need to get actual timing data to suggest this is necessary. - //sources_.AddTimeoutSeconds(construct_timeout_, [&] { ConstructWindow(); return false; }, LAZY_TIMEOUT); + //sources_.AddTimeoutSeconds(construct_timeout_, [this] { ConstructWindow(); return false; }, LAZY_TIMEOUT); fade_animator_.updated.connect([this] (double opacity) { if (view_window_) @@ -345,8 +345,8 @@ void Controller::Impl::Show(ShowMode show, SortMode sort, std::vector<AbstractLa if (real_wait > 0) { - sources_.AddIdle([&] { ConstructView(); return false; }, VIEW_CONSTRUCT_IDLE); - sources_.AddTimeout(real_wait, [&] { ShowView(); return false; }, SHOW_TIMEOUT); + sources_.AddIdle([this] { ConstructView(); return false; }, VIEW_CONSTRUCT_IDLE); + sources_.AddTimeout(real_wait, [this] { ShowView(); return false; }, SHOW_TIMEOUT); } else { diff --git a/launcher/TooltipManager.cpp b/launcher/TooltipManager.cpp index 94044b0a4..3fab52457 100644 --- a/launcher/TooltipManager.cpp +++ b/launcher/TooltipManager.cpp @@ -86,7 +86,7 @@ void TooltipManager::Reset() void TooltipManager::ResetTimer(AbstractLauncherIcon::Ptr const& icon_under_mouse) { hover_timer_.reset(new glib::Timeout(TOOLTIPS_SHOW_TIMEOUT_LENGTH)); - hover_timer_->Run([&] () { + hover_timer_->Run([this, icon_under_mouse] () { skip_timeout_ = true; icon_under_mouse->ShowTooltip(); return false; diff --git a/panel/PanelController.cpp b/panel/PanelController.cpp index df3cac6b4..c97e574fa 100644 --- a/panel/PanelController.cpp +++ b/panel/PanelController.cpp @@ -288,7 +288,7 @@ Controller::Controller(ui::EdgeBarrierController::Ptr const& edge_barriers) screen->changed.connect(sigc::mem_fun(this, &Controller::OnScreenChanged)); OnScreenChanged(screen->GetPrimaryMonitor(), screen->GetMonitors()); - launcher_width.changed.connect([&] (int width) + launcher_width.changed.connect([this] (int width) { pimpl->SetLauncherWidth(width); }); diff --git a/panel/PanelMenuView.cpp b/panel/PanelMenuView.cpp index e02a312fa..7417b945d 100644 --- a/panel/PanelMenuView.cpp +++ b/panel/PanelMenuView.cpp @@ -90,7 +90,7 @@ PanelMenuView::PanelMenuView() SetupWindowManagerSignals(); SetupUBusManagerInterests(); - style_changed_connection_ = panel::Style::Instance().changed.connect([&] { + style_changed_connection_ = panel::Style::Instance().changed.connect([this] { window_buttons_->ComputeContentSize(); layout_->SetLeftAndRightPadding(window_buttons_->GetContentWidth(), 0); diff --git a/panel/PanelTitlebarGrabAreaView.cpp b/panel/PanelTitlebarGrabAreaView.cpp index b072d4b05..c537a97ee 100644 --- a/panel/PanelTitlebarGrabAreaView.cpp +++ b/panel/PanelTitlebarGrabAreaView.cpp @@ -49,7 +49,7 @@ PanelTitlebarGrabArea::PanelTitlebarGrabArea() mouse_up.connect(sigc::mem_fun(this, &PanelTitlebarGrabArea::OnMouseUp)); mouse_drag.connect(sigc::mem_fun(this, &PanelTitlebarGrabArea::OnGrabMove)); - mouse_double_click.connect([&] (int x, int y, unsigned long button_flags, unsigned long) + mouse_double_click.connect([this] (int x, int y, unsigned long button_flags, unsigned long) { if (nux::GetEventButton(button_flags) == 1) restore_request.emit(x, y); @@ -102,7 +102,7 @@ void PanelTitlebarGrabArea::OnMouseDown(int x, int y, unsigned long button_flags mouse_down_point_.y = y; mouse_down_timer_.reset(new glib::Timeout(MOUSE_DOWN_TIMEOUT)); - mouse_down_timer_->Run([&] () { + mouse_down_timer_->Run([this] () { if (!grab_started_) { nux::Point const& mouse = nux::GetGraphicsDisplay()->GetMouseScreenCoord(); diff --git a/panel/PanelView.cpp b/panel/PanelView.cpp index dd56bd346..9012c5e79 100644 --- a/panel/PanelView.cpp +++ b/panel/PanelView.cpp @@ -119,7 +119,7 @@ PanelView::PanelView(MockableBaseWindow* parent, indicator::DBusIndicators::Ptr ubus_manager_.RegisterInterest(UBUS_OVERLAY_HIDDEN, sigc::mem_fun(this, &PanelView::OnOverlayHidden)); ubus_manager_.RegisterInterest(UBUS_OVERLAY_SHOWN, sigc::mem_fun(this, &PanelView::OnOverlayShown)); - ubus_manager_.RegisterInterest(UBUS_DASH_SIZE_CHANGED, [&] (GVariant *data) { + ubus_manager_.RegisterInterest(UBUS_DASH_SIZE_CHANGED, [this] (GVariant *data) { int width, height; g_variant_get(data, "(ii)", &width, &height); stored_dash_width_ = width; @@ -708,7 +708,7 @@ void PanelView::SetOpacityMaximizedToggle(bool enabled) if (enabled) { WindowManager& win_manager = WindowManager::Default(); - auto update_bg_lambda = [&](guint32) { ForceUpdateBackground(); }; + auto update_bg_lambda = [this](guint32) { ForceUpdateBackground(); }; auto conn = &maximized_opacity_toggle_connections_; conn->Add(win_manager.window_minimized.connect(update_bg_lambda)); diff --git a/plugins/unity-mt-grab-handles/src/unity-mt-grab-handles.cpp b/plugins/unity-mt-grab-handles/src/unity-mt-grab-handles.cpp index c4ff2c333..08b811e02 100644 --- a/plugins/unity-mt-grab-handles/src/unity-mt-grab-handles.cpp +++ b/plugins/unity-mt-grab-handles/src/unity-mt-grab-handles.cpp @@ -373,7 +373,7 @@ UnityMTGrabHandlesScreen::donePaint() { if (handles->needsAnimate()) { - handles->forEachHandle ([&](const unity::MT::GrabHandle::Ptr &h) + handles->forEachHandle ([this](const unity::MT::GrabHandle::Ptr &h) { h->damage (nux::Geometry (h->x (), h->y (), @@ -422,7 +422,7 @@ UnityMTGrabHandlesWindow::allowHandles() void UnityMTGrabHandlesWindow::getOutputExtents(CompWindowExtents& output) { - auto f = [&] (const unity::MT::GrabHandle::Ptr &h) + auto f = [this, &output] (const unity::MT::GrabHandle::Ptr &h) { output.left = std::max (window->borderRect().left() + h->width () / 2, static_cast <unsigned int> (output.left)); output.right = std::max (window->borderRect().right() + h->width () / 2, static_cast <unsigned int> (output.right)); @@ -630,7 +630,7 @@ UnityMTGrabHandlesWindow::restackHandles() if (!mHandles) return; - mHandles->forEachHandle ([&](const unity::MT::GrabHandle::Ptr &h) + mHandles->forEachHandle ([this](const unity::MT::GrabHandle::Ptr &h) { h->reposition (0, 0, unity::MT::PositionLock); }); } diff --git a/plugins/unityshell/src/WindowMinimizeSpeedController.cpp b/plugins/unityshell/src/WindowMinimizeSpeedController.cpp index a605b93f2..29df106fa 100644 --- a/plugins/unityshell/src/WindowMinimizeSpeedController.cpp +++ b/plugins/unityshell/src/WindowMinimizeSpeedController.cpp @@ -42,22 +42,22 @@ WindowMinimizeSpeedController::WindowMinimizeSpeedController() , _duration(200) // going to be overridden anyway, but at least it is initialised { _minimize_count_changed.Connect(_settings, "changed::minimize-count", - [&] (GSettings*, gchar* name) { + [this] (GSettings*, gchar* name) { _minimize_count = g_settings_get_int(_settings, name); SetDuration(); }); _minimize_speed_threshold_changed.Connect(_settings, "changed::minimize-speed-threshold", - [&] (GSettings*, gchar* name) { + [this] (GSettings*, gchar* name) { _minimize_speed_threshold = g_settings_get_int(_settings, name); SetDuration(); }); _minimize_fast_duration_changed.Connect(_settings, "changed::minimize-fast-duration", - [&] (GSettings*, gchar* name) { + [this] (GSettings*, gchar* name) { _minimize_fast_duration = g_settings_get_int(_settings, name); SetDuration(); }); _minimize_slow_duration_changed.Connect(_settings, "changed::minimize-slow-duration", - [&] (GSettings*, gchar* name) { + [this] (GSettings*, gchar* name) { _minimize_slow_duration = g_settings_get_int(_settings, name); SetDuration(); }); diff --git a/plugins/unityshell/src/unityshell.cpp b/plugins/unityshell/src/unityshell.cpp index a0d754d12..c876201e9 100644 --- a/plugins/unityshell/src/unityshell.cpp +++ b/plugins/unityshell/src/unityshell.cpp @@ -397,7 +397,7 @@ UnityScreen::UnityScreen(CompScreen* screen) BackgroundEffectHelper::updates_enabled = true; - ubus_manager_.RegisterInterest(UBUS_OVERLAY_SHOWN, [&](GVariant * data) + ubus_manager_.RegisterInterest(UBUS_OVERLAY_SHOWN, [this](GVariant * data) { unity::glib::String overlay_identity; gboolean can_maximise = FALSE; @@ -2917,7 +2917,7 @@ void UnityWindow::windowNotify(CompWindowNotify n) if (window->type() == CompWindowTypeDesktopMask) { if (!focus_desktop_timeout_) { - focus_desktop_timeout_.reset(new glib::Timeout(1000, [&] { + focus_desktop_timeout_.reset(new glib::Timeout(1000, [this] { for (CompWindow *w : screen->clientList()) { if (!(w->type() & NO_FOCUS_MASK) && w->focus ()) @@ -3297,7 +3297,7 @@ void UnityScreen::ScheduleRelayout(guint timeout) { if (!sources_.GetSource(local::RELAYOUT_TIMEOUT)) { - sources_.AddTimeout(timeout, [&] { + sources_.AddTimeout(timeout, [this] { NeedsRelayout(); Relayout(); diff --git a/unity-shared/CoverArt.cpp b/unity-shared/CoverArt.cpp index 31fe52c5b..b793cec21 100644 --- a/unity-shared/CoverArt.cpp +++ b/unity-shared/CoverArt.cpp @@ -160,7 +160,7 @@ void CoverArt::StartWaiting() rotate_matrix_.Rotate_z(0.0f); rotation_ = 0.0f; - spinner_timeout_.reset(new glib::TimeoutSeconds(IMAGE_TIMEOUT, [&] + spinner_timeout_.reset(new glib::TimeoutSeconds(IMAGE_TIMEOUT, [this] { StopWaiting(); diff --git a/unity-shared/IconLoader.cpp b/unity-shared/IconLoader.cpp index ee7db98df..bfa03fae7 100644 --- a/unity-shared/IconLoader.cpp +++ b/unity-shared/IconLoader.cpp @@ -830,7 +830,7 @@ IconLoader::Impl::Impl() , theme_(::gtk_icon_theme_get_default()) , handle_counter_(0) { - theme_changed_signal_.Connect(theme_, "changed", [&] (GtkIconTheme*) { + theme_changed_signal_.Connect(theme_, "changed", [this] (GtkIconTheme*) { /* Since the theme has been changed we can clear the cache, however we * could include two improvements here: * 1) clear only the themed icons in cache diff --git a/unity-shared/OverlayWindowButtons.cpp b/unity-shared/OverlayWindowButtons.cpp index 5b89b781c..4ef24c608 100644 --- a/unity-shared/OverlayWindowButtons.cpp +++ b/unity-shared/OverlayWindowButtons.cpp @@ -36,7 +36,7 @@ OverlayWindowButtons::OverlayWindowButtons() : nux::BaseWindow("OverlayWindowButtons") , window_buttons_(new WindowButtons()) { - window_buttons_->queue_draw.connect([&] (nux::Layout* /*layout*/) { + window_buttons_->queue_draw.connect([this] (nux::Layout* /*layout*/) { QueueDraw(); }); diff --git a/unity-shared/PanelStyle.cpp b/unity-shared/PanelStyle.cpp index ba0768224..5ce50c1fa 100644 --- a/unity-shared/PanelStyle.cpp +++ b/unity-shared/PanelStyle.cpp @@ -96,22 +96,22 @@ Style::Style() GtkSettings* settings = gtk_settings_get_default(); _style_changed_signal.Connect(settings, "notify::gtk-theme-name", - [&] (GtkSettings*, GParamSpec*) { + [this] (GtkSettings*, GParamSpec*) { Refresh(); }); _font_changed_signal.Connect(settings, "notify::gtk-font-name", - [&] (GtkSettings*, GParamSpec*) { + [this] (GtkSettings*, GParamSpec*) { changed.emit(); }); _dpi_changed_signal.Connect(settings, "notify::gtk-xft-dpi", - [&] (GtkSettings*, GParamSpec*) { + [this] (GtkSettings*, GParamSpec*) { changed.emit(); }); _settings_changed_signal.Connect(_gsettings, "changed::" + PANEL_TITLE_FONT_KEY, - [&] (GSettings*, gchar*) { + [this] (GSettings*, gchar*) { changed.emit(); }); diff --git a/unity-shared/RatingsButton.cpp b/unity-shared/RatingsButton.cpp index 45782d7e6..1ab69cca8 100644 --- a/unity-shared/RatingsButton.cpp +++ b/unity-shared/RatingsButton.cpp @@ -50,7 +50,7 @@ RatingsButton::RatingsButton(int star_size, int star_gap, NUX_FILE_LINE_DECL) mouse_move.connect(sigc::mem_fun(this, &RatingsButton::RecvMouseMove)); mouse_drag.connect(sigc::mem_fun(this, &RatingsButton::RecvMouseDrag)); - key_nav_focus_change.connect([&](nux::Area* area, bool has_focus, nux::KeyNavDirection direction) + key_nav_focus_change.connect([this](nux::Area* area, bool has_focus, nux::KeyNavDirection direction) { if (has_focus && direction != nux::KEY_NAV_NONE) focused_star_ = 0; @@ -59,7 +59,7 @@ RatingsButton::RatingsButton(int star_size, int star_gap, NUX_FILE_LINE_DECL) QueueDraw(); }); - key_nav_focus_activate.connect([&](nux::Area*) { SetRating(static_cast<float>(focused_star_+1)/num_stars); }); + key_nav_focus_activate.connect([this](nux::Area*) { SetRating(static_cast<float>(focused_star_+1)/num_stars); }); key_down.connect(sigc::mem_fun(this, &RatingsButton::OnKeyDown)); } diff --git a/unity-shared/SearchBar.cpp b/unity-shared/SearchBar.cpp index 3f300e91c..4c0482f05 100644 --- a/unity-shared/SearchBar.cpp +++ b/unity-shared/SearchBar.cpp @@ -167,8 +167,8 @@ void SearchBar::Init() pango_entry_->SetFontFamily(PANGO_ENTRY_DEFAULT_FONT_FAMILY.c_str()); pango_entry_->SetFontSize(PANGO_ENTRY_FONT_SIZE); pango_entry_->text_changed.connect(sigc::mem_fun(this, &SearchBar::OnSearchChanged)); - pango_entry_->activated.connect([&]() { activated.emit(); }); - pango_entry_->cursor_moved.connect([&](int i) { QueueDraw(); }); + pango_entry_->activated.connect([this]() { activated.emit(); }); + pango_entry_->cursor_moved.connect([this](int i) { QueueDraw(); }); pango_entry_->mouse_down.connect(sigc::mem_fun(this, &SearchBar::OnMouseButtonDown)); pango_entry_->end_key_focus.connect(sigc::mem_fun(this, &SearchBar::OnEndKeyFocus)); pango_entry_->key_up.connect([this] (unsigned int, unsigned long, unsigned long) { @@ -234,17 +234,17 @@ void SearchBar::Init() show_filters_->SetMaximumWidth(style.GetFilterBarWidth() - arrow_layout_->GetBaseWidth() - 8); // Lambda functions - auto mouse_expand = [&](int, int, unsigned long, unsigned long) + auto mouse_expand = [this](int, int, unsigned long, unsigned long) { showing_filters = !showing_filters; }; - auto key_redraw = [&](nux::Area*, bool, nux::KeyNavDirection) + auto key_redraw = [this](nux::Area*, bool, nux::KeyNavDirection) { QueueDraw(); }; - auto key_expand = [&](nux::Area*) + auto key_expand = [this](nux::Area*) { showing_filters = !showing_filters; }; @@ -261,13 +261,13 @@ void SearchBar::Init() sigc::mem_fun(this, &SearchBar::OnFontChanged)); OnFontChanged(gtk_settings_get_default()); - search_hint.changed.connect([&](std::string const& s) { OnSearchHintChanged(); }); + search_hint.changed.connect([this](std::string const& s) { OnSearchHintChanged(); }); search_string.SetGetterFunction(sigc::mem_fun(this, &SearchBar::get_search_string)); search_string.SetSetterFunction(sigc::mem_fun(this, &SearchBar::set_search_string)); im_active.SetGetterFunction(sigc::mem_fun(this, &SearchBar::get_im_active)); im_preedit.SetGetterFunction(sigc::mem_fun(this, &SearchBar::get_im_preedit)); showing_filters.changed.connect(sigc::mem_fun(this, &SearchBar::OnShowingFiltersChanged)); - can_refine_search.changed.connect([&] (bool can_refine) + can_refine_search.changed.connect([this] (bool can_refine) { if (show_filter_hint_) { diff --git a/unity-shared/SearchBarSpinner.cpp b/unity-shared/SearchBarSpinner.cpp index 645e64a76..7dba5ef19 100644 --- a/unity-shared/SearchBarSpinner.cpp +++ b/unity-shared/SearchBarSpinner.cpp @@ -176,7 +176,7 @@ SearchBarSpinner::SetState(SpinnerState state) if (search_timeout_ > 0 && state_== STATE_SEARCHING) { - spinner_timeout_.reset(new glib::Timeout(search_timeout_, [&] { + spinner_timeout_.reset(new glib::Timeout(search_timeout_, [this] { state_ = STATE_READY; return false; })); diff --git a/unity-shared/TextInput.cpp b/unity-shared/TextInput.cpp index 8a1929449..9969323bd 100644 --- a/unity-shared/TextInput.cpp +++ b/unity-shared/TextInput.cpp @@ -74,7 +74,7 @@ void TextInput::Init() pango_entry_ = new IMTextEntry(); pango_entry_->SetFontFamily(PANGO_ENTRY_DEFAULT_FONT_FAMILY.c_str()); pango_entry_->SetFontSize(PANGO_ENTRY_FONT_SIZE); - pango_entry_->cursor_moved.connect([&](int i) { QueueDraw(); }); + pango_entry_->cursor_moved.connect([this](int i) { QueueDraw(); }); pango_entry_->mouse_down.connect(sigc::mem_fun(this, &TextInput::OnMouseButtonDown)); pango_entry_->end_key_focus.connect(sigc::mem_fun(this, &TextInput::OnEndKeyFocus)); @@ -93,7 +93,7 @@ void TextInput::Init() input_string.SetSetterFunction(sigc::mem_fun(this, &TextInput::set_input_string)); im_active.SetGetterFunction(sigc::mem_fun(this, &TextInput::get_im_active)); im_preedit.SetGetterFunction(sigc::mem_fun(this, &TextInput::get_im_preedit)); - input_hint.changed.connect([&](std::string const& s) { OnInputHintChanged(); }); + input_hint.changed.connect([this](std::string const& s) { OnInputHintChanged(); }); } diff --git a/unity-shared/ThumbnailGenerator.cpp b/unity-shared/ThumbnailGenerator.cpp index fae86ad91..9eef47bab 100644 --- a/unity-shared/ThumbnailGenerator.cpp +++ b/unity-shared/ThumbnailGenerator.cpp @@ -187,7 +187,7 @@ ThumbnailNotifier::Ptr ThumbnailGeneratorImpl::GetThumbnail(std::string const& u if (!thread_create_timer_ && thumbnail_thread_is_running_ == false) { - thread_create_timer_.reset(new glib::Timeout(0, [&]() + thread_create_timer_.reset(new glib::Timeout(0, [this]() { thumbnail_thread_is_running_ = true; pthread_create (&thumbnail_thread_, NULL, thumbnail_thread_start, this); @@ -214,7 +214,7 @@ ThumbnailNotifier::Ptr ThumbnailGeneratorImpl::GetThumbnail(std::string const& u void ThumbnailGeneratorImpl::StartCleanupTimer() { if (!cleanup_timer_) - cleanup_timer_.reset(new glib::Timeout(CLEANUP_DURATION, [&]() { DoCleanup(); return false; })); + cleanup_timer_.reset(new glib::Timeout(CLEANUP_DURATION, [this]() { DoCleanup(); return false; })); } diff --git a/unity-shared/UBusServer.cpp b/unity-shared/UBusServer.cpp index 7016548a7..105983bfc 100644 --- a/unity-shared/UBusServer.cpp +++ b/unity-shared/UBusServer.cpp @@ -44,7 +44,7 @@ unsigned UBusServer::RegisterInterest(std::string const& interest_name, void UBusServer::UnregisterInterest(unsigned connection_id) { auto it = std::find_if(interests_.begin(), interests_.end(), - [&] (std::pair<std::string, UBusConnection::Ptr> const& p) + [connection_id] (std::pair<std::string, UBusConnection::Ptr> const& p) { return p.second->id == connection_id; }); if (it != interests_.end()) interests_.erase(it); } diff --git a/unity-shared/UScreen.cpp b/unity-shared/UScreen.cpp index 6812a8325..869383824 100644 --- a/unity-shared/UScreen.cpp +++ b/unity-shared/UScreen.cpp @@ -35,7 +35,7 @@ UScreen::UScreen() { size_changed_signal_.Connect(screen_, "size-changed", sigc::mem_fun(this, &UScreen::Changed)); monitors_changed_signal_.Connect(screen_, "monitors-changed", sigc::mem_fun(this, &UScreen::Changed)); - proxy_.Connect("Resuming", [&] (GVariant* data) { resuming.emit(); }); + proxy_.Connect("Resuming", [this] (GVariant* data) { resuming.emit(); }); Refresh(); } @@ -101,7 +101,7 @@ void UScreen::Changed(GdkScreen* screen) if (refresh_idle_) return; - refresh_idle_.reset(new glib::Idle([&] () { + refresh_idle_.reset(new glib::Idle([this] () { Refresh(); refresh_idle_.reset(); diff --git a/unity-shared/WindowButtons.cpp b/unity-shared/WindowButtons.cpp index d771b4e20..84836cbf9 100644 --- a/unity-shared/WindowButtons.cpp +++ b/unity-shared/WindowButtons.cpp @@ -262,17 +262,17 @@ WindowButtons::WindowButtons() controlled_window.changed.connect(sigc::mem_fun(this, &WindowButtons::OnControlledWindowChanged)); focused.changed.connect(sigc::hide(sigc::mem_fun(this, &WindowButtons::QueueDraw))); - auto lambda_enter = [&](int x, int y, unsigned long button_flags, unsigned long key_flags) + auto lambda_enter = [this](int x, int y, unsigned long button_flags, unsigned long key_flags) { mouse_enter.emit(x, y, button_flags, key_flags); }; - auto lambda_leave = [&](int x, int y, unsigned long button_flags, unsigned long key_flags) + auto lambda_leave = [this](int x, int y, unsigned long button_flags, unsigned long key_flags) { mouse_leave.emit(x, y, button_flags, key_flags); }; - auto lambda_moved = [&](int x, int y, int dx, int dy, unsigned long button_flags, unsigned long key_flags) + auto lambda_moved = [this](int x, int y, int dx, int dy, unsigned long button_flags, unsigned long key_flags) { mouse_move.emit(x, y, dx, dy, button_flags, key_flags); }; |
