From 46b6e63f9a9d09111cccf1788815d7db18a7b35b Mon Sep 17 00:00:00 2001 From: Konrad Rosenbaum Date: Wed, 1 Feb 2012 19:13:51 +0100 Subject: [PATCH] remove useless cpp file for lambda --- src/misc/lambda.cpp | 24 ------------------------ src/misc/lambda.h | 8 ++++---- src/misc/misc.pri | 3 +-- 3 files changed, 5 insertions(+), 30 deletions(-) delete mode 100644 src/misc/lambda.cpp diff --git a/src/misc/lambda.cpp b/src/misc/lambda.cpp deleted file mode 100644 index eb29a60..0000000 --- a/src/misc/lambda.cpp +++ /dev/null @@ -1,24 +0,0 @@ -// -// C++ Implementation: lambda object -// -// Description: allows to use lambda expressions (C++ 11) with Qt4 -// -// -// Author: Konrad Rosenbaum , (C) 2012 -// -// Copyright: See README/COPYING.GPL files that come with this distribution -// -// - -#include "lambda.h" - -MLambda::MLambda(std::function< void() > l, QObject* parent): QObject(parent) -{ - m_ptr=l; -} - -void MLambda::call() -{ - if(m_ptr) - m_ptr(); -} diff --git a/src/misc/lambda.h b/src/misc/lambda.h index 912f1fa..5408647 100644 --- a/src/misc/lambda.h +++ b/src/misc/lambda.h @@ -21,6 +21,8 @@ class MLambda:public QObject { Q_OBJECT + private: + std::functionm_ptr; public: ///instantiates the lambda object, e.g. /// \code @@ -31,12 +33,10 @@ class MLambda:public QObject ///button.show(); /// \endcode ///the above code will show the value of the variable 'x' whenever the user clicks the button - MLambda(std::functionl,QObject* parent = 0); + MLambda(std::functionl,QObject* parent = 0):QObject(parent),m_ptr(l){} public slots: ///generic slot that transparently executes the lambda expression - void call(); - private: - std::functionm_ptr; + void call(){if(m_ptr)m_ptr();} }; #endif diff --git a/src/misc/misc.pri b/src/misc/misc.pri index e321059..35bca43 100644 --- a/src/misc/misc.pri +++ b/src/misc/misc.pri @@ -12,8 +12,7 @@ SOURCES += \ misc/misc.cpp \ misc/waitcursor.cpp \ misc/sclock.cpp \ - misc/formula.cpp \ - misc/lambda.cpp + misc/formula.cpp INCLUDEPATH += ./misc QMAKE_CXXFLAGS += -std=gnu++0x \ No newline at end of file -- 1.7.2.5