[vlmc-devel] [PATCH] Remove AutomaticBackup
Yikai Lu
luyikei.qmltu at gmail.com
Sun Mar 6 17:13:42 CET 2016
It is merged into Project. The follow-up patch is coming...
---
src/CMakeLists.txt | 5 +--
src/Project/AutomaticBackup.cpp | 84 -----------------------------------------
src/Project/AutomaticBackup.h | 52 -------------------------
3 files changed, 2 insertions(+), 139 deletions(-)
delete mode 100644 src/Project/AutomaticBackup.cpp
delete mode 100644 src/Project/AutomaticBackup.h
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 3ec6c87..ea4867e 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -32,11 +32,10 @@ SET(VLMC_SRCS
Media/Clip.cpp
Media/Media.cpp
Metadata/MetaDataManager.cpp
- Project/AutomaticBackup.cpp
- Project/Project.cpp
+ Project/Project.cpp
Project/Workspace.cpp
Project/WorkspaceWorker.cpp
- Project/RecentProjects.cpp
+ Project/RecentProjects.cpp
Renderer/ClipRenderer.cpp
Renderer/GenericRenderer.cpp
Renderer/WorkflowFileRenderer.cpp
diff --git a/src/Project/AutomaticBackup.cpp b/src/Project/AutomaticBackup.cpp
deleted file mode 100644
index 5018a91..0000000
--- a/src/Project/AutomaticBackup.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-/*****************************************************************************
- * AutomaticBackup.cpp: Handles the project automatic backup & associated settings
- *****************************************************************************
- * Copyright (C) 2008-2014 VideoLAN
- *
- * Authors: Hugo Beauzée-Luyssen <hugo at beauzee.fr>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#include <QTimer>
-
-#include "AutomaticBackup.h"
-#include "Project.h"
-#include "Settings/Settings.h"
-
-AutomaticBackup::AutomaticBackup( Settings* vlmcSettings, QObject *parent )
- : QObject(parent)
- , m_vlmcSettings( vlmcSettings )
-{
- m_timer = new QTimer( this );
- SettingValue* autoBackup = m_vlmcSettings->createVar( SettingValue::Bool, "vlmc/AutomaticBackup", false,
- QT_TRANSLATE_NOOP( "PreferenceWidget", "Automatic save" ),
- QT_TRANSLATE_NOOP( "PreferenceWidget", "When this option is activated,"
- "VLMC will automatically save your project "
- "at a specified interval" ), SettingValue::Nothing );
- SettingValue* interval = m_vlmcSettings->createVar( SettingValue::Int, "vlmc/AutomaticBackupInterval", 5,
- QT_TRANSLATE_NOOP( "PreferenceWidget", "Automatic save interval" ),
- QT_TRANSLATE_NOOP( "PreferenceWidget", "This is the interval that VLMC will wait "
- "between two automatic save" ), SettingValue::Nothing );
-
- connect( autoBackup, SIGNAL( changed( QVariant ) ), this, SLOT( automaticSaveEnabledChanged( QVariant ) ) );
- connect( interval, SIGNAL( changed( QVariant ) ), this, SLOT( automaticSaveIntervalChanged( QVariant ) ) );
-}
-
-AutomaticBackup::~AutomaticBackup()
-{
- delete m_timer;
-}
-
-void
-AutomaticBackup::setProject( Project* projectManager )
-{
- m_timer->disconnect();
- connect( m_timer, SIGNAL( timeout() ), projectManager, SLOT(autoSaveRequired() ) );
- connect( projectManager, SIGNAL( destroyed() ), m_timer, SLOT( stop() ) );
- m_timer->start();
-}
-
-void
-AutomaticBackup::automaticSaveEnabledChanged( const QVariant& val )
-{
- bool enabled = val.toBool();
-
- if ( enabled == true )
- {
- int interval = m_vlmcSettings->value( "vlmc/AutomaticBackupInterval" )->get().toInt();
- m_timer->start( interval * 1000 * 60 );
- }
- else
- m_timer->stop();
-}
-
-void
-AutomaticBackup::automaticSaveIntervalChanged( const QVariant& val )
-{
- bool enabled = m_vlmcSettings->value( "vlmc/AutomaticBackup" )->get().toBool();
-
- if ( enabled == false )
- return ;
- m_timer->start( val.toInt() * 1000 * 60 );
-}
diff --git a/src/Project/AutomaticBackup.h b/src/Project/AutomaticBackup.h
deleted file mode 100644
index bbfdc5b..0000000
--- a/src/Project/AutomaticBackup.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*****************************************************************************
- * AutomaticBackup.h: Handles the project automatic backup & associated settings
- *****************************************************************************
- * Copyright (C) 2008-2014 VideoLAN
- *
- * Authors: Hugo Beauzée-Luyssen <hugo at beauzee.fr>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifndef AUTOMATICBACKUP_H
-#define AUTOMATICBACKUP_H
-
-class QTimer;
-
-class Project;
-class Settings;
-
-#include <QObject>
-
-class AutomaticBackup : public QObject
-{
- Q_OBJECT
-
- public:
- explicit AutomaticBackup( Settings* vlmcSettings, QObject *parent = 0 );
- virtual ~AutomaticBackup();
- void setProject( Project* projectManager );
-
- private:
- Settings* m_vlmcSettings;
- QTimer* m_timer;
-
- private slots:
- void automaticSaveEnabledChanged( const QVariant& enabled );
- void automaticSaveIntervalChanged( const QVariant& interval );
-
-};
-
-#endif // AUTOMATICBACKUP_H
--
1.9.1
More information about the Vlmc-devel
mailing list