Class for handling RPC timers * (used for e.g. re-locking the wallet after a timeout) */
| 109 | * (used for e.g. re-locking the wallet after a timeout) |
| 110 | */ |
| 111 | class QtRPCTimerBase: public QObject, public RPCTimerBase |
| 112 | { |
| 113 | Q_OBJECT |
| 114 | public: |
| 115 | QtRPCTimerBase(std::function<void()>& _func, int64_t millis): |
| 116 | func(_func) |
| 117 | { |
| 118 | timer.setSingleShot(true); |
| 119 | connect(&timer, &QTimer::timeout, [this]{ func(); }); |
| 120 | timer.start(millis); |
| 121 | } |
| 122 | ~QtRPCTimerBase() {} |
| 123 | private: |
| 124 | QTimer timer; |
| 125 | std::function<void()> func; |
| 126 | }; |
| 127 | |
| 128 | class QtRPCTimerInterface: public RPCTimerInterface |
| 129 | { |