Move RenderTaskJob impl to render_task_job.cpp

This commit is contained in:
David Capello 2017-05-22 14:37:29 -03:00
parent 5ef6aac925
commit 90132698a6
3 changed files with 39 additions and 10 deletions

View File

@ -390,6 +390,7 @@ add_library(app-lib
pref/preferences.cpp
project.cpp
recent_files.cpp
render_task_job.cpp
res/http_loader.cpp
res/palettes_loader_delegate.cpp
res/resources_loader.cpp

View File

@ -0,0 +1,35 @@
// Aseprite
// Copyright (C) 2017 David Capello
//
// This program is distributed under the terms of
// the End-User License Agreement for Aseprite.
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "app/render_task_job.h"
namespace app {
void RenderTaskJob::onJob()
{
try {
m_func();
}
catch (std::exception& ex) {
// TODO show the exception
}
}
bool RenderTaskJob::continueTask()
{
return !isCanceled();
}
void RenderTaskJob::notifyTaskProgress(double progress)
{
jobProgress(progress);
}
} // namespace app

View File

@ -25,18 +25,11 @@ public:
}
private:
void onJob() override {
m_func();
}
void onJob() override;
// render::TaskDelegate impl
bool continueTask() override {
return !isCanceled();
}
void notifyTaskProgress(double progress) override {
jobProgress(progress);
}
bool continueTask() override;
void notifyTaskProgress(double progress) override;
std::function<void()> m_func;
};