try to index media immediately on import
Since indexing is supplemental, it can be made a background task that can occur at more or less any time. So we run it as soon as possible.
This commit is contained in:
@@ -20,8 +20,6 @@ set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
project/project.h
|
||||
project/project.cpp
|
||||
project/projectfilemanagerbase.h
|
||||
project/projectfilemanagerbase.cpp
|
||||
project/projectimportmanager.h
|
||||
project/projectimportmanager.cpp
|
||||
project/projectloadmanager.h
|
||||
|
||||
@@ -134,11 +134,11 @@ void Footage::set_timestamp(const QDateTime &t)
|
||||
|
||||
void Footage::add_stream(StreamPtr s)
|
||||
{
|
||||
// Set its footage parent to this
|
||||
s->set_footage(this);
|
||||
|
||||
// Add a copy of this stream to the list
|
||||
streams_.append(s);
|
||||
|
||||
// Set its footage parent to this
|
||||
streams_.last()->set_footage(this);
|
||||
}
|
||||
|
||||
StreamPtr Footage::stream(int index) const
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
#include "projectfilemanagerbase.h"
|
||||
|
||||
ProjectFileManagerBase::ProjectFileManagerBase() :
|
||||
cancelled_(false)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void ProjectFileManagerBase::Start()
|
||||
{
|
||||
Action();
|
||||
|
||||
emit Finished();
|
||||
}
|
||||
|
||||
void ProjectFileManagerBase::Cancel()
|
||||
{
|
||||
cancelled_ = true;
|
||||
}
|
||||
|
||||
const QAtomicInt &ProjectFileManagerBase::IsCancelled() const
|
||||
{
|
||||
return cancelled_;
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
#ifndef PROJECTFILEMANAGERBASE_H
|
||||
#define PROJECTFILEMANAGERBASE_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include "project.h"
|
||||
|
||||
class ProjectFileManagerBase : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ProjectFileManagerBase();
|
||||
|
||||
public slots:
|
||||
/**
|
||||
* @brief Start the save process
|
||||
*
|
||||
* It's recommended to invoke this through Qt signals/slots/QueuedConnection after moving this object to a separate
|
||||
* thread.
|
||||
*/
|
||||
void Start();
|
||||
|
||||
/**
|
||||
* @brief Cancel the current save
|
||||
*
|
||||
* Always connect to this with a DirectConnection. Otherwise, it'll be queued AFTER the save function is already
|
||||
* complete.
|
||||
*/
|
||||
void Cancel();
|
||||
|
||||
protected:
|
||||
virtual void Action() = 0;
|
||||
|
||||
const QAtomicInt& IsCancelled() const;
|
||||
|
||||
signals:
|
||||
void ProgressChanged(int);
|
||||
|
||||
void Finished();
|
||||
|
||||
private:
|
||||
QAtomicInt cancelled_;
|
||||
|
||||
};
|
||||
|
||||
#endif // PROJECTFILEMANAGERBASE_H
|
||||
@@ -4,10 +4,10 @@
|
||||
#include <QFileInfoList>
|
||||
#include <QUndoCommand>
|
||||
|
||||
#include "projectfilemanagerbase.h"
|
||||
#include "projectviewmodel.h"
|
||||
#include "task/task.h"
|
||||
|
||||
class ProjectImportManager : public ProjectFileManagerBase
|
||||
class ProjectImportManager : public Task
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
@@ -46,5 +46,5 @@ void ProjectLoadManager::Action()
|
||||
project_file.close();
|
||||
}
|
||||
|
||||
emit Finished();
|
||||
emit Succeeeded();
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
#ifndef PROJECTLOADMANAGER_H
|
||||
#define PROJECTLOADMANAGER_H
|
||||
|
||||
#include "projectfilemanagerbase.h"
|
||||
#include "project/project.h"
|
||||
#include "task/task.h"
|
||||
|
||||
class ProjectLoadManager : public ProjectFileManagerBase
|
||||
class ProjectLoadManager : public Task
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
@@ -32,5 +32,5 @@ void ProjectSaveManager::Action()
|
||||
project_file.close();
|
||||
}
|
||||
|
||||
emit Finished();
|
||||
emit Succeeeded();
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
#ifndef PROJECTSAVEMANAGER_H
|
||||
#define PROJECTSAVEMANAGER_H
|
||||
|
||||
#include "projectfilemanagerbase.h"
|
||||
#include "project/project.h"
|
||||
#include "task/task.h"
|
||||
|
||||
class ProjectSaveManager : public ProjectFileManagerBase
|
||||
class ProjectSaveManager : public Task
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user