summaryrefslogtreecommitdiff
path: root/plugins
diff options
authorMarco Trevisan (TreviƱo) <mail@3v1n0.net>2013-11-17 19:45:40 +0000
committerTarmac <>2013-11-17 19:45:40 +0000
commit65b6fa9c42e00368ef35416ecfa2d7108f0df619 (patch)
treec7464cb7b567e9860b47a3af3dc1499c505dc76d /plugins
parentbf55704a9f65933f81e86d8b87970791e98b3880 (diff)
parent8f0d58e21f67f4e5ed9a708e619b1cfef33eb2d6 (diff)
Unity: always prefer passing [this] to lambdas than [&].
Approved by PS Jenkins bot, Andrea Azzarone. (bzr r3596)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/unity-mt-grab-handles/src/unity-mt-grab-handles.cpp6
-rw-r--r--plugins/unityshell/src/WindowMinimizeSpeedController.cpp8
-rw-r--r--plugins/unityshell/src/unityshell.cpp6
3 files changed, 10 insertions, 10 deletions
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();