summaryrefslogtreecommitdiff
path: root/src/clipboard.c
AgeCommit message (Collapse)Author
2026-07-20clipboard: offer text/uri-list (CRLF) + text/plain via union provider (iu0)Paul Buetow
clipboard_copy_uris wrapped its URI text as a generic G_TYPE_STRING provider, so targets could not request text/uri-list and file-manager paste failed. Extracted clipboard_build_uri_provider builds a union of two byte providers: text/uri-list (RFC 2483 CRLF-terminated URI lines, trailing CRLF) and text/plain (newline-joined local paths, URI fallback for non-local files). clipboard_copy_uris sets the union on the GdkClipboard with correct refcounting (new_union steals the sub-provider refs; clipboard takes its own ref). Empty list returns NULL and leaves the clipboard untouched. New integration test tests/test_clipboard.c: serializes the provider's content per MIME type via gdk_content_provider_write_mime_type_async into a GMemoryOutputStream and memcmps the bytes. Covers formats (both MIME advertised, bogus type absent), single + multiple files (exact CRLF/newline-joined bytes), empty list (no crash), and a negative (unknown MIME rejected with GError).
2026-07-14operate: mover, opener, runner, clipboard modules + tests (ut0)Paul Buetow
M8 (partial): plain-C operate modules + unit tests. - src/mover.{c,h}: move files to configured dests (g_file_move + stem collision suffix -1/-2), one-level undo (move back), acts on marks-or-current. - src/opener.{c,h}: %f expand + detached GSubprocess launch (non-blocking). - src/runner.{c,h}: /bin/sh -c with single-quoted %f/%d (injection guard), async wait_check, rescan on completion. - src/clipboard.{c,h}: image/png via GdkContentProvider + uri-list. - meson: new sources added to libggae. - tests: unit test_mover (move/undo/collision), test_opener (true/false/weird filenames), test_runner (true/false/injection guard). 19/19 green, ASan clean. - Fixed: g_str_replace (not in GLib 2.88) → manual _str_replace; GdkContentProvider API (new_typed/new_for_value); mover collision stem-suffix; runner /bin/sh -c argv (single arg, not shell-parsed); test GFile leaks.