Commit Graph

21 Commits

Author SHA1 Message Date
Martchus 72e918b154 Remove debugging leftover 2019-10-11 19:55:45 +02:00
Martchus 4531d10a81 Move QJSEngine into the thread which executes the JavaScript
This fixes https://github.com/Martchus/tageditor/issues/50.

When keeping the QJSEngine tied to the main thread the garbage
collector will run on the main thread's event loop. This leads to
crashes when trying to allocate memory within the engine from
another thread (`QV4::PersistentValueStorage::allocate()`).

The Qt documentation does not mention that the garbage collector
might run on the event loop of the thread tied to the JSEngine.
I expected it only to run after or before allocations/deletions
within the thread calling the engine's methods. There is already
an issue regarding the lack of documentation:
https://bugreports.qt.io/browse/QTBUG-57227

I found no way to obtain the QThread object for a thread started
with Qt Concurrent. The possibility I found was calling
`QThread::currentThread()` from the concurrent thread once it has
already been started. However, when the concurrent thread has
been started it might already be too late to move the engine.
Adding further synchronization to solve this is an overkill so
I resorted to using QThread directly.
2019-10-11 19:47:30 +02:00
Martchus e9ded173f1 renaming utility: Show better info for confliciting targets
Conflicts are handles well but so far the user just got "can not
be renamed". Now the conflicting item is returned.
2019-02-13 21:42:29 +01:00
Martchus 28860e1051 Improve renaming tool
* Allow to pass a note to the skip function
* Add useful properties to the file info object
* Extend example
2018-11-15 21:36:12 +01:00
Martchus 57f4307c16 Improve coding style 2018-11-15 21:33:01 +01:00
Martchus db2f178542 Refactor and improve coding style of renaming utility 2018-08-15 21:49:06 +02:00
Martchus 159d0a9739 Improve coding style in renaming utility
Those changings have been created when adding JavaScript
support to syncthingctl. Maybe implement this more like it
works now in syncthingctl?
2018-04-29 19:01:55 +02:00
Martchus 4b7d7a9499 Apply clang-format 2018-03-07 01:18:01 +01:00
Martchus 59ab7e6181 Use std::make_unique provided by C++14 2017-02-05 21:04:27 +01:00
Martchus 5472c560f3 renaming utility: Show note for all new dirs 2017-01-06 22:07:03 +01:00
Martchus 0531460df9 renaming utility: Get rid of useless mutex 2017-01-06 22:00:27 +01:00
Martchus 537d31289d Fix typo 2017-01-06 21:29:43 +01:00
Martchus 1add0e7612 renaming utility: allow absolute paths 2016-05-06 23:16:37 +02:00
Martchus ec43ad8499 make web view and JavaScript engine optional 2016-04-21 23:56:10 +02:00
Martchus eaea2e2cda use Qt Concurrent instead of pthread 2016-03-10 22:13:43 +01:00
Martchus 0adb77fd58 use C++11 foreach loop consistently (instead of Qt foreach macro) 2016-03-05 17:12:16 +01:00
Martchus 1c4d577264 updated renaming utility
- allow usage of QJSEngine instead of deprecated QScriptEngine
- moved variables and functions from global object to tageditor object
2016-01-09 02:56:56 +01:00
Martchus 29795cc016 added missing include 2015-10-16 22:07:04 +02:00
Martchus dfe17afcc6 use only one engine, small adjustments 2015-10-13 20:12:00 +02:00
Martchus 77a0bc28ee fixed includes 2015-09-06 20:20:00 +02:00
Martchus b2b8231a27 First commit 2015-04-22 19:33:53 +02:00