Mercurial > cgi-bin > hgweb.cgi > ClipMan
diff src/name/blackcap/clipman/PasteboardQueue.kt @ 67:d35b8478e089 default tip
Remove redundant event dispatch thread task submissions.
author | David Barts <n5jrn@me.com> |
---|---|
date | Sun, 12 Jan 2025 16:26:11 -0800 |
parents | 19d9da731c43 |
children |
line wrap: on
line diff
--- a/src/name/blackcap/clipman/PasteboardQueue.kt Sun Jan 12 12:13:20 2025 -0800 +++ b/src/name/blackcap/clipman/PasteboardQueue.kt Sun Jan 12 16:26:11 2025 -0800 @@ -55,10 +55,8 @@ * @param item QueueItem to add */ @Synchronized fun add(item: QueueItem) { - inSwingThread { - parent.add(item.view.contents) - validate() - } + parent.add(item.view.contents) + validate() queue.addLast(item) truncate() } @@ -149,18 +147,16 @@ var dirty = false while (size > _maxSize) { var extra = queue.removeFirst().view - inSwingThread { - if (extra.searchable.selected) { - Application.anyRequired.disable() - Application.styledRequired.disable() - } - parent.remove(extra.contents) + if (extra.searchable.selected) { + Application.anyRequired.disable() + Application.styledRequired.disable() } + parent.remove(extra.contents) dirty = true size -= 1 } if (dirty) { - inSwingThread { validate() } + validate() } } }