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.
38 lines
706 B
C++
38 lines
706 B
C++
#ifndef PROJECTIMPORTMANAGER_H
|
|
#define PROJECTIMPORTMANAGER_H
|
|
|
|
#include <QFileInfoList>
|
|
#include <QUndoCommand>
|
|
|
|
#include "projectviewmodel.h"
|
|
#include "task/task.h"
|
|
|
|
class ProjectImportManager : public Task
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
ProjectImportManager(ProjectViewModel* model, Folder* folder, const QStringList& filenames);
|
|
|
|
const int& GetFileCount();
|
|
|
|
protected:
|
|
virtual void Action() override;
|
|
|
|
signals:
|
|
void ImportComplete(QUndoCommand* command);
|
|
|
|
private:
|
|
void Import(Folder* folder, const QFileInfoList &import, int& counter, QUndoCommand *parent_command);
|
|
|
|
ProjectViewModel* model_;
|
|
|
|
Folder* folder_;
|
|
|
|
QFileInfoList filenames_;
|
|
|
|
int file_count_;
|
|
|
|
};
|
|
|
|
#endif // PROJECTIMPORTMANAGER_H
|