Skip to content

Commit

Permalink
added: default constructor for CFileOperationJob to allow setting up …
Browse files Browse the repository at this point in the history
…of the job after construction
  • Loading branch information
Jonathan Marshall committed Jan 25, 2011
1 parent a704015 commit 035b794
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
10 changes: 10 additions & 0 deletions xbmc/utils/FileOperationJob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,21 @@
using namespace std;
using namespace XFILE;

CFileOperationJob::CFileOperationJob()
{
}

CFileOperationJob::CFileOperationJob(FileAction action, CFileItemList & items, const CStdString& strDestFile)
{
SetFileOperation(action, items, strDestFile);
}

void CFileOperationJob::SetFileOperation(FileAction action, CFileItemList &items, const CStdString &strDestFile)
{
m_action = action;
m_strDestFile = strDestFile;

m_items.Clear();
for (int i = 0; i < items.Size(); i++)
m_items.Add(CFileItemPtr(new CFileItem(*items[i])));
}
Expand Down
3 changes: 3 additions & 0 deletions xbmc/utils/FileOperationJob.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ class CFileOperationJob : public CJob
ActionDeleteFolder,
};

CFileOperationJob();
CFileOperationJob(FileAction action, CFileItemList & items, const CStdString& strDestFile);

void SetFileOperation(FileAction action, CFileItemList &items, const CStdString &strDestFile);

virtual bool DoWork();
const CStdString &GetAverageSpeed() { return m_avgSpeed; }
const CStdString &GetCurrentOperation() { return m_currentOperation; }
Expand Down

0 comments on commit 035b794

Please sign in to comment.