-
Notifications
You must be signed in to change notification settings - Fork 131
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
support paste image #593
Conversation
There was a problem hiding this 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
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.
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)) { |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
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); |
Codecov ReportAttention: Patch coverage is
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. |
No description provided.