Skip to content

Commit 4b4da93

Browse files
committed
Fix issue about pasting raw text
1 parent 3f0e3f0 commit 4b4da93

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pyqt_openai/chat_widget/center/textEditPromptGroup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ def handlePaste(self):
163163
clipboard = QApplication.clipboard()
164164
mime_data = clipboard.mimeData()
165165

166+
# Image file
166167
if mime_data.hasImage():
167168
image = clipboard.image()
168169

@@ -186,7 +187,8 @@ def handlePaste(self):
186187

187188
# Emit the image data
188189
self.onPasteFile.emit(image_data)
189-
elif mime_data.hasText():
190+
# TXT file
191+
elif mime_data.hasUrls() and mime_data.hasText():
190192
text = mime_data.text()
191193
self.onPasteText.emit(text)
192194
else:

0 commit comments

Comments
 (0)