Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVojtech Kral <vojtech@kral.hk>2018-05-18 19:37:16 +0300
committerVojtech Kral <vojtech@kral.hk>2018-05-21 19:58:22 +0300
commitfd00ea0ca725eb4dd786769605b3c9792e1a52fe (patch)
tree09eaaa2e9c837979f16e40c3e8b80f36a0304493 /xs/src/avrdude/avrdude-slic3r.cpp
parent98ae20c3df7ea00c608fe4ab4c504ffa09a8a1aa (diff)
Firmware updater: Add cancelation
Diffstat (limited to 'xs/src/avrdude/avrdude-slic3r.cpp')
-rw-r--r--xs/src/avrdude/avrdude-slic3r.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/xs/src/avrdude/avrdude-slic3r.cpp b/xs/src/avrdude/avrdude-slic3r.cpp
index a581371ae..13c37e508 100644
--- a/xs/src/avrdude/avrdude-slic3r.cpp
+++ b/xs/src/avrdude/avrdude-slic3r.cpp
@@ -21,10 +21,10 @@ static void avrdude_message_handler_closure(const char *msg, unsigned size, void
}
// Used by our custom code in avrdude to report progress in the GUI
-static void avrdude_progress_handler_closure(const char *task, unsigned progress, void *user_p)
+static bool avrdude_progress_handler_closure(const char *task, unsigned progress, void *user_p)
{
auto *progress_fn = reinterpret_cast<AvrDude::ProgressFn*>(user_p);
- (*progress_fn)(task, progress);
+ return (*progress_fn)(task, progress);
}
@@ -73,6 +73,8 @@ int AvrDude::priv::run() {
AvrDude::AvrDude() : p(new priv()) {}
+AvrDude::AvrDude(AvrDude &&other) : p(std::move(other.p)) {}
+
AvrDude::~AvrDude()
{
if (p && p->avrdude_thread.joinable()) {
@@ -98,7 +100,7 @@ AvrDude& AvrDude::on_message(MessageFn fn)
return *this;
}
-AvrDude& AvrDude::on_progress(MessageFn fn)
+AvrDude& AvrDude::on_progress(ProgressFn fn)
{
if (p) { p->progress_fn = std::move(fn); }
return *this;