mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-02 11:59:58 +00:00
Move RenderTaskJob impl to render_task_job.cpp
This commit is contained in:
parent
5ef6aac925
commit
90132698a6
@ -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
|
||||
|
35
src/app/render_task_job.cpp
Normal file
35
src/app/render_task_job.cpp
Normal 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
|
@ -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;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user