summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--compat/util.hpp8
-rw-r--r--gui/main-window.cpp8
-rw-r--r--gui/main-window.hpp18
3 files changed, 13 insertions, 21 deletions
diff --git a/compat/util.hpp b/compat/util.hpp
index cd0dbdef..c0d3e3fd 100644
--- a/compat/util.hpp
+++ b/compat/util.hpp
@@ -20,14 +20,6 @@
#define prog1(x, ...) (([&]() { auto _ret1324 = (x); do { __VA_ARGS__; } while (0); return _ret1324; })())
#define once_only(...) do { static bool once = false; if (!once) { once = true; __VA_ARGS__; } } while(false)
-#define load_time_value(x) \
- progn( \
- static const auto _value132((x)); \
- return static_cast<decltype(_value132)&>(value132); \
- )
-
-template<typename t> using mem = std::shared_ptr<t>;
-template<typename t> using ptr = std::unique_ptr<t>;
template<typename t>
inline int iround(const t& val)
diff --git a/gui/main-window.cpp b/gui/main-window.cpp
index 010fd1d0..51e22861 100644
--- a/gui/main-window.cpp
+++ b/gui/main-window.cpp
@@ -574,7 +574,7 @@ void MainWindow::show_pose()
}
template<typename t, typename F>
-bool MainWindow::mk_window_common(ptr<t>& d, F&& ctor)
+bool MainWindow::mk_window_common(std::unique_ptr<t>& d, F&& ctor)
{
if (d)
{
@@ -583,7 +583,7 @@ bool MainWindow::mk_window_common(ptr<t>& d, F&& ctor)
return false;
}
- else if ((d = ptr<t>(ctor())))
+ else if ((d = std::unique_ptr<t>(ctor())))
{
QWidget& w = *d;
@@ -602,13 +602,13 @@ bool MainWindow::mk_window_common(ptr<t>& d, F&& ctor)
}
template<typename t, typename... Args>
-inline bool MainWindow::mk_window(ptr<t>& place, Args&&... params)
+inline bool MainWindow::mk_window(std::unique_ptr<t>& place, Args&&... params)
{
return mk_window_common(place, [&]() { return new t(std::forward<Args>(params)...); });
}
template<typename t>
-bool MainWindow::mk_dialog(std::shared_ptr<dylib> lib, ptr<t>& d)
+bool MainWindow::mk_dialog(std::shared_ptr<dylib> lib, std::unique_ptr<t>& d)
{
const bool just_created = mk_window_common(d, [&]() -> t* {
if (lib && lib->Dialog)
diff --git a/gui/main-window.hpp b/gui/main-window.hpp
index 75f58db1..3fde4301 100644
--- a/gui/main-window.hpp
+++ b/gui/main-window.hpp
@@ -49,17 +49,17 @@ class MainWindow : public QMainWindow, private State
Shortcuts global_shortcuts;
module_settings m;
- ptr<QSystemTrayIcon> tray;
+ std::unique_ptr<QSystemTrayIcon> tray;
QMenu tray_menu;
QTimer pose_update_timer;
QTimer det_timer;
QTimer config_list_timer;
- ptr<OptionsDialog> options_widget;
- ptr<MapWidget> mapping_widget;
+ std::unique_ptr<OptionsDialog> options_widget;
+ std::unique_ptr<MapWidget> mapping_widget;
QShortcut kbd_quit;
- ptr<IFilterDialog> pFilterDialog;
- ptr<IProtocolDialog> pProtocolDialog;
- ptr<ITrackerDialog> pTrackerDialog;
+ std::unique_ptr<IFilterDialog> pFilterDialog;
+ std::unique_ptr<IProtocolDialog> pProtocolDialog;
+ std::unique_ptr<ITrackerDialog> pTrackerDialog;
process_detector_worker det;
QMenu profile_menu;
@@ -100,15 +100,15 @@ class MainWindow : public QMainWindow, private State
// only use in impl file since no definition in header!
template<typename t>
- bool mk_dialog(std::shared_ptr<dylib> lib, ptr<t>& d);
+ bool mk_dialog(std::shared_ptr<dylib> lib, std::unique_ptr<t>& d);
// idem
template<typename t, typename... Args>
- inline bool mk_window(ptr<t>& place, Args&&... params);
+ inline bool mk_window(std::unique_ptr<t>& place, Args&&... params);
// idem
template<typename t, typename F>
- bool mk_window_common(ptr<t>& d, F&& ctor);
+ bool mk_window_common(std::unique_ptr<t>& d, F&& ctor);
private slots:
void save_modules();