remove useless cpp file for lambda
authorKonrad Rosenbaum <konrad@silmor.de>
Wed, 1 Feb 2012 18:13:51 +0000 (19:13 +0100)
committerKonrad Rosenbaum <konrad@silmor.de>
Wed, 1 Feb 2012 18:14:18 +0000 (19:14 +0100)
src/misc/lambda.cpp [deleted file]
src/misc/lambda.h
src/misc/misc.pri

diff --git a/src/misc/lambda.cpp b/src/misc/lambda.cpp
deleted file mode 100644 (file)
index eb29a60..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// C++ Implementation: lambda object
-//
-// Description: allows to use lambda expressions (C++ 11) with Qt4
-//
-//
-// Author: Konrad Rosenbaum <konrad@silmor.de>, (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();
-}
index 912f1fa..5408647 100644 (file)
@@ -21,6 +21,8 @@
 class MLambda:public QObject
 {
        Q_OBJECT
+       private:
+               std::function<void()>m_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::function<void ()>l,QObject* parent = 0);
+               MLambda(std::function<void ()>l,QObject* parent = 0):QObject(parent),m_ptr(l){}
        public slots:
                ///generic slot that transparently executes the lambda expression
-               void call();
-       private:
-               std::function<void()>m_ptr;
+               void call(){if(m_ptr)m_ptr();}
 };
 
 #endif
index e321059..35bca43 100644 (file)
@@ -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