Don't copy empty selected text.
This commit is contained in:
parent
b46659eb22
commit
fda2f56fd8
|
@ -2341,7 +2341,8 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) {
|
||||||
const auto item = _dragStateItem;
|
const auto item = _dragStateItem;
|
||||||
const auto itemId = item ? item->fullId() : FullMsgId();
|
const auto itemId = item ? item->fullId() : FullMsgId();
|
||||||
if (isUponSelected > 0) {
|
if (isUponSelected > 0) {
|
||||||
if (!hasCopyRestrictionForSelected()) {
|
if (!hasCopyRestrictionForSelected()
|
||||||
|
&& !getSelectedText().empty()) {
|
||||||
_menu->addAction(
|
_menu->addAction(
|
||||||
(isUponSelected > 1
|
(isUponSelected > 1
|
||||||
? tr::lng_context_copy_selected_items(tr::now)
|
? tr::lng_context_copy_selected_items(tr::now)
|
||||||
|
@ -2442,7 +2443,8 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) {
|
||||||
: QString();
|
: QString();
|
||||||
|
|
||||||
if (isUponSelected > 0) {
|
if (isUponSelected > 0) {
|
||||||
if (!hasCopyRestrictionForSelected()) {
|
if (!hasCopyRestrictionForSelected()
|
||||||
|
&& !getSelectedText().empty()) {
|
||||||
_menu->addAction(
|
_menu->addAction(
|
||||||
((isUponSelected > 1)
|
((isUponSelected > 1)
|
||||||
? tr::lng_context_copy_selected_items(tr::now)
|
? tr::lng_context_copy_selected_items(tr::now)
|
||||||
|
|
|
@ -995,7 +995,9 @@ base::unique_qptr<Ui::PopupMenu> FillContextMenu(
|
||||||
list,
|
list,
|
||||||
st::popupMenuWithIcons);
|
st::popupMenuWithIcons);
|
||||||
|
|
||||||
if (request.overSelection && !list->hasCopyRestrictionForSelected()) {
|
if (request.overSelection
|
||||||
|
&& !list->hasCopyRestrictionForSelected()
|
||||||
|
&& !list->getSelectedText().empty()) {
|
||||||
const auto text = request.selectedItems.empty()
|
const auto text = request.selectedItems.empty()
|
||||||
? tr::lng_context_copy_selected(tr::now)
|
? tr::lng_context_copy_selected(tr::now)
|
||||||
: tr::lng_context_copy_selected_items(tr::now);
|
: tr::lng_context_copy_selected_items(tr::now);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user