From 125217074e61ff25b901a05004208ccb21f121ce Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Sun, 8 Nov 2015 21:50:12 -0200 Subject: Remove lambdas: they don't work on OSX 10.7 Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- desktop-widgets/mainwindow.cpp | 21 +++++++++++++++++++-- desktop-widgets/mainwindow.h | 2 ++ 2 files changed, 21 insertions(+), 2 deletions(-) (limited to 'desktop-widgets') diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index 14ba96772..32f0d8d07 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(sender()); + ISocialNetworkIntegration *plugin = action->data().value(); + if (plugin->isConnected()) + plugin->requestLogoff(); + else + plugin->requestLogin(); +} + +void MainWindow::socialNetworkRequestUpload() +{ + QAction *action = qobject_cast(sender()); + ISocialNetworkIntegration *plugin = action->data().value(); + 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 0d431b8b5..fc63c5740 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; -- cgit v1.2.3-70-g09d2