summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-05-12 15:43:50 +0200
committerStanislaw Halik <sthalik@misaki.pl>2017-05-12 15:48:16 +0200
commit4c4c783d023cf1bb6a8d7d883bf8d3384f7b7da1 (patch)
treeeb81974538149ce053d923991eaeebe2a2da3d9e
parent8cb6d9d0a5aa617d0d9922ea26f0c98df27b5f1e (diff)
minor fixes only
-rw-r--r--dinput/keybinding-worker.cpp5
-rw-r--r--options/connector.cpp7
-rw-r--r--options/group.cpp4
-rw-r--r--options/scoped.cpp2
-rw-r--r--pose-widget/pose-widget.cpp4
-rw-r--r--pose-widget/pose-widget.hpp2
6 files changed, 14 insertions, 10 deletions
diff --git a/dinput/keybinding-worker.cpp b/dinput/keybinding-worker.cpp
index b94b762e..0e16ac71 100644
--- a/dinput/keybinding-worker.cpp
+++ b/dinput/keybinding-worker.cpp
@@ -9,6 +9,7 @@
#ifdef _WIN32
#include "keybinding-worker.hpp"
+#include "compat/util.hpp"
#include <functional>
#include <windows.h>
#include <QDebug>
@@ -18,8 +19,8 @@ bool Key::should_process()
{
if (!enabled || (keycode == 0 && guid == ""))
return false;
- bool ret = !held || timer.elapsed_ms() > 100;
- timer.start();
+ bool ret = prog1(!held || timer.elapsed_ms() > 100,
+ timer.start());
return ret;
}
diff --git a/options/connector.cpp b/options/connector.cpp
index 63d70ca7..075a57e1 100644
--- a/options/connector.cpp
+++ b/options/connector.cpp
@@ -83,11 +83,12 @@ void connector::on_value_created(const QString& name, value_type val)
QMutexLocker l(get_mtx());
- if (on_value_destructed_impl(name, val))
+ int i = 1;
+ while (on_value_destructed_impl(name, val))
{
qWarning() << "options/connector: value created twice;"
- << "bundle"
- << val->b->name()
+ << "cnt" << i++
+ << "bundle" << val->b->name()
<< "value-name" << name
<< "value-ptr" << quintptr(val);
}
diff --git a/options/group.cpp b/options/group.cpp
index 3f800ff0..60e8a7b4 100644
--- a/options/group.cpp
+++ b/options/group.cpp
@@ -30,7 +30,9 @@ group::group(const QString& name) : name(name)
{
auto tmp = k_.toUtf8();
QString k(tmp);
- kvs[k] = conf.value(k_);
+ QVariant val = conf.value(k_);
+ if (val.type() != QVariant::Invalid)
+ kvs[k] = std::move(val);
}
conf.endGroup();
});
diff --git a/options/scoped.cpp b/options/scoped.cpp
index 96f4a261..58a4ee02 100644
--- a/options/scoped.cpp
+++ b/options/scoped.cpp
@@ -2,8 +2,8 @@
#include <QApplication>
#include <QThread>
-// for std::abort()
#include <cstdlib>
+#include <atomic>
#include <QDebug>
diff --git a/pose-widget/pose-widget.cpp b/pose-widget/pose-widget.cpp
index 54278c34..8646df30 100644
--- a/pose-widget/pose-widget.cpp
+++ b/pose-widget/pose-widget.cpp
@@ -47,7 +47,7 @@ void pose_widget::paintEvent(QPaintEvent* event)
xform.with_image_lock([&](const QImage& image)
{
- p.drawImage(event->rect(), image, offset, offset);
+ p.drawImage(event->rect(), image, QRect(offset, offset, pose_transform::w, pose_transform::h));
});
}
@@ -71,7 +71,7 @@ void pose_transform::run()
project_quad_texture();
end:
- portable::sleep(9);
+ portable::sleep(23);
}
}
diff --git a/pose-widget/pose-widget.hpp b/pose-widget/pose-widget.hpp
index 1d34778a..a27bf4b9 100644
--- a/pose-widget/pose-widget.hpp
+++ b/pose-widget/pose-widget.hpp
@@ -37,7 +37,7 @@ using lock_guard = std::unique_lock<std::mutex>;
class pose_widget;
-class pose_transform final : private QThread
+struct pose_transform final : private QThread
{
pose_transform(QWidget* dst);
~pose_transform();