[vlmc-devel] Core: Add a runtime method

Hugo Beauzée-Luyssen git at videolan.org
Sun Mar 27 17:03:48 CEST 2016


vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Sun Mar 27 12:19:15 2016 +0200| [6a04fb49a2530707a0c01de51ec04c375a07bc88] | committer: Hugo Beauzée-Luyssen

Core: Add a runtime method

> https://code.videolan.org/videolan/vlmc/commit/6a04fb49a2530707a0c01de51ec04c375a07bc88
---

 src/Main/Core.cpp | 8 ++++++++
 src/Main/Core.h   | 6 ++++++
 2 files changed, 14 insertions(+)

diff --git a/src/Main/Core.cpp b/src/Main/Core.cpp
index 7145478..820f299 100644
--- a/src/Main/Core.cpp
+++ b/src/Main/Core.cpp
@@ -60,6 +60,8 @@ Core::Core()
     connect( m_library, &Library::cleanStateChanged, m_currentProject, &Project::libraryCleanChanged );
     connect( m_currentProject, SIGNAL( projectLoaded( QString, QString ) ),
              m_recentProjects, SLOT( projectLoaded( QString, QString ) ) );
+
+    m_timer.start();
 }
 
 Core::~Core()
@@ -175,6 +177,12 @@ Core::library()
     return m_library;
 }
 
+qint64
+Core::runtime()
+{
+    return m_timer.elapsed();
+}
+
 Core*
 Core::getInstance()
 {
diff --git a/src/Main/Core.h b/src/Main/Core.h
index 52463a6..198cba6 100644
--- a/src/Main/Core.h
+++ b/src/Main/Core.h
@@ -43,6 +43,7 @@ namespace Backend
 }
 
 #include <QObject>
+#include <QElapsedTimer>
 
 class Core : public QObject
 {
@@ -60,6 +61,10 @@ class Core : public QObject
         MainWorkflow*           workflow();
         QUndoStack*             undoStack();
         Library*                library();
+        /**
+         * @brief runtime returns the application runtime
+         */
+        qint64                  runtime();
 
         bool                    loadProject( const QString& fileName );
         bool                    newProject( const QString& projectName, const QString& projectPath );
@@ -85,6 +90,7 @@ class Core : public QObject
         WorkflowRenderer*       m_workflowRenderer;
         QUndoStack*             m_undoStack;
         Library*                m_library;
+        QElapsedTimer           m_timer;
 };
 
 #endif // CORE_H



More information about the Vlmc-devel mailing list