iptux-src / iptux

A software for sharing in LAN
GNU General Public License v2.0
445 stars 130 forks source link

#605: Ctrl-V should not paste text twice #606

Closed lidaobing closed 5 months ago

lidaobing commented 5 months ago

Summary by Sourcery

This pull request addresses a bug where using Ctrl-V to paste text would result in the text being pasted twice. The text pasting logic was refactored to use the 'paste-clipboard' signal, and a new test was added to ensure correct functionality.

sourcery-ai[bot] commented 5 months ago

Reviewer's Guide by Sourcery

This pull request addresses the issue where Ctrl-V would paste text twice. The main changes include the introduction of a new utility function igtk_text_buffer_get_text for retrieving text from a GtkTextBuffer, refactoring paste handling to use GTK's 'paste-clipboard' signal, and updating tests to verify the correct behavior.

File-Level Changes

Files Changes
src/iptux/UiHelper.cpp
src/iptux/UiHelper.h
Introduced a new utility function igtk_text_buffer_get_text to retrieve text from a GtkTextBuffer.
src/iptux/DialogBase.cpp
src/iptux/DialogPeer.cpp
Refactored paste handling to use GTK's 'paste-clipboard' signal and removed direct text paste handling from OnPasteClipboard.

Tips - Trigger a new Sourcery review by commenting `@sourcery-ai review` on the pull request. - You can change your review settings at any time by accessing your [dashboard](https://app.sourcery.ai): - Enable or disable the Sourcery-generated pull request summary or reviewer's guide; - Change the review language; - You can always [contact us](mailto:support@sourcery.ai) if you have any questions or feedback.
codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 51.37%. Comparing base (8653a31) to head (467944a).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #606 +/- ## ======================================= Coverage 51.36% 51.37% ======================================= Files 64 64 Lines 8344 8345 +1 ======================================= + Hits 4286 4287 +1 Misses 4058 4058 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.