They don't like c++11
From b881e39ea03ab9a6e5d949d04f3fa690a5feeeb4 Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava <tomaz.canabr...@intel.com>
Date: Sun, 8 Nov 2015 21:50:12 -0200
Subject: [PATCH 7/7] Remove lambdas: they don't work on OSX 10.7

Signed-off-by: Tomaz Canabrava <tomaz.canabr...@intel.com>
---
 desktop-widgets/mainwindow.cpp | 21 +++++++++++++++++++--
 desktop-widgets/mainwindow.h   |  2 ++
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp
index 14ba967..32f0d8d 100644
--- a/desktop-widgets/mainwindow.cpp
+++ b/desktop-widgets/mainwindow.cpp
@@ -250,7 +250,7 @@ MainWindow::MainWindow() : QMainWindow(),
 			toggle_connection->setText(plugin->socialNetworkName());
 			toggle_connection->setIcon(QIcon(plugin->socialNetworkIcon()));
 			toggle_connection->setData(QVariant::fromValue(plugin));
-			connect(toggle_connection, &QAction::triggered, [plugin](bool triggered){ plugin->requestLogin(); });
+			connect(toggle_connection, SIGNAL(triggered()), this, SLOT(socialNetworkRequestConnect()));
 
 			QAction *share_on = new QAction(this);
 			share_on->setText(plugin->socialNetworkName());
@@ -258,7 +258,7 @@ MainWindow::MainWindow() : QMainWindow(),
 			share_on->setData(QVariant::fromValue(plugin));
 			ui.menuShare_on->addAction(share_on);
 			connections->addAction(toggle_connection);
-			connect(share_on, &QAction::triggered, [plugin](bool triggered) { plugin->requestUpload(); });
+			connect(share_on, SIGNAL(triggered()), this, SLOT(socialNetworkRequestUpload()));
 		}
 		ui.menuShare_on->addSeparator();
 		ui.menuShare_on->addMenu(connections);
@@ -276,6 +276,23 @@ MainWindow::~MainWindow()
 	m_Instance = NULL;
 }
 
+void MainWindow::socialNetworkRequestConnect()
+{
+	QAction *action = qobject_cast<QAction*>(sender());
+	ISocialNetworkIntegration *plugin = action->data().value<ISocialNetworkIntegration*>();
+	if (plugin->isConnected())
+		plugin->requestLogoff();
+	else
+		plugin->requestLogin();
+}
+
+void MainWindow::socialNetworkRequestUpload()
+{
+	QAction *action = qobject_cast<QAction*>(sender());
+	ISocialNetworkIntegration *plugin = action->data().value<ISocialNetworkIntegration*>();
+	plugin->requestUpload();
+}
+
 void MainWindow::setStateProperties(const QByteArray& state, const PropertyList& tl, const PropertyList& tr, const PropertyList& bl, const PropertyList& br)
 {
 	stateProperties[state] = PropertiesForQuadrant(tl, tr, bl, br);
diff --git a/desktop-widgets/mainwindow.h b/desktop-widgets/mainwindow.h
index 0d431b8..fc63c57 100644
--- a/desktop-widgets/mainwindow.h
+++ b/desktop-widgets/mainwindow.h
@@ -195,6 +195,8 @@ slots:
 	void disableShortcuts(bool disablePaste = true);
 	void enableShortcuts();
 
+	void socialNetworkRequestConnect();
+	void socialNetworkRequestUpload();
 private:
 	Ui::MainWindow ui;
 	QAction *actionNextDive;
-- 
2.6.2

_______________________________________________
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to