chatgui: clear clipboard before setText for reliable copy on Linux
This commit is contained in:
1 parent
e71cae16c1
commit
ef27633a88
2 files changed
+6
-1
No files matched your search
@@ -133,6 +133,7 @@ void ChatView::copySelection() {
|
||||
QString text = idx.data(MsgTextRole).toString();
|
||||
if (m_textSel.startChar >= 0 && m_textSel.endChar > m_textSel.startChar)
|
||||
text = text.mid(m_textSel.startChar, m_textSel.endChar - m_textSel.startChar);
|
||||
QApplication::clipboard()->clear(QClipboard::Clipboard);
|
||||
QApplication::clipboard()->setText(text);
|
||||
} else {
|
||||
QString r;
|
||||
@@ -145,6 +146,7 @@ void ChatView::copySelection() {
|
||||
r += idx.data(MsgAuthorRole).toString() + ": ";
|
||||
r += idx.data(MsgTextRole).toString();
|
||||
}
|
||||
QApplication::clipboard()->clear(QClipboard::Clipboard);
|
||||
QApplication::clipboard()->setText(r);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user