Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support paste image #593

Merged
merged 4 commits into from
May 23, 2024
Merged

support paste image #593

merged 4 commits into from
May 23, 2024

Conversation

lidaobing
Copy link
Member

No description provided.

@lidaobing lidaobing linked an issue May 23, 2024 that may be closed by this pull request
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @lidaobing - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 3 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

Comment on lines +798 to +807
void DialogBase::OnPasteClipboard(DialogBase* self, GtkTextView* textview) {
GtkClipboard* clipboard;
GtkTextBuffer* buffer;
GtkTextIter iter;

clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD);
buffer = gtk_text_view_get_buffer(textview);
gtk_text_buffer_get_iter_at_mark(buffer, &iter,
gtk_text_buffer_get_insert(buffer));
if (gtk_clipboard_wait_is_text_available(clipboard)) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Consider adding logging for clipboard operations

Adding logging statements within the OnPasteClipboard method can help in tracking clipboard operations and diagnosing issues if the clipboard content is not pasted correctly.

@@ -81,6 +81,7 @@ class DialogBase : public SessionAbstract, public sigc::trackable {
static gint EnclosureTreePopup(DialogBase* self, GdkEvent* event);
static gboolean UpdateFileSendUI(DialogBase* dlggrp);
static void RemoveSelectedEnclosure(DialogBase* self);
static void OnPasteClipboard(DialogBase* self, GtkTextView* textview);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Consider adding documentation for OnPasteClipboard

Adding a brief comment or documentation for the OnPasteClipboard method in the header file can help other developers understand its purpose and usage.

Suggested change
static void OnPasteClipboard(DialogBase* self, GtkTextView* textview);
/**
* Handles the paste action from the clipboard to the specified text view.
*
* @param self Pointer to the DialogBase instance.
* @param textview Pointer to the GtkTextView where the clipboard content will be pasted.
*/
static void OnPasteClipboard(DialogBase* self, GtkTextView* textview);

Copy link

codecov bot commented May 23, 2024

Codecov Report

Attention: Patch coverage is 84.61538% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 50.28%. Comparing base (c27a8d2) to head (48e28db).

Files Patch % Lines
src/iptux/DialogBase.cpp 84.21% 3 Missing ⚠️
src/iptux/DialogPeer.cpp 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #593      +/-   ##
==========================================
+ Coverage   50.06%   50.28%   +0.22%     
==========================================
  Files          64       64              
  Lines        8236     8257      +21     
==========================================
+ Hits         4123     4152      +29     
+ Misses       4113     4105       -8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@iptux-src iptux-src deleted a comment from sourcery-ai bot May 23, 2024
@lidaobing lidaobing merged commit d6ce292 into master May 23, 2024
15 checks passed
@lidaobing lidaobing deleted the 592-image-paste branch May 23, 2024 06:05
@lidaobing lidaobing added this to the 0.9.2 milestone Jun 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support use Ctrl+V to insert image from clipboard to chat input
1 participant