From 0f0c3b746116beec834e28045b4336085c2a2dbf Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 8 Apr 2019 16:22:07 +0400 Subject: [PATCH] Remove FlatLabel::_contextExpandLinksMode. --- Telegram/SourceFiles/ui/widgets/labels.cpp | 12 ++++-------- Telegram/SourceFiles/ui/widgets/labels.h | 2 -- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/Telegram/SourceFiles/ui/widgets/labels.cpp b/Telegram/SourceFiles/ui/widgets/labels.cpp index a76a9dea5..25c9d6e9a 100644 --- a/Telegram/SourceFiles/ui/widgets/labels.cpp +++ b/Telegram/SourceFiles/ui/widgets/labels.cpp @@ -226,10 +226,6 @@ void FlatLabel::setContextCopyText(const QString ©Text) { _contextCopyText = copyText; } -void FlatLabel::setExpandLinksMode(ExpandLinksMode mode) { - _contextExpandLinksMode = mode; -} - void FlatLabel::setBreakEverywhere(bool breakEverywhere) { _breakEverywhere = breakEverywhere; } @@ -366,7 +362,7 @@ Text::StateResult FlatLabel::dragActionFinish(const QPoint &p, Qt::MouseButton b #if defined Q_OS_LINUX32 || defined Q_OS_LINUX64 if (!_selection.empty()) { - QApplication::clipboard()->setText(_text.originalText(_selection, _contextExpandLinksMode), QClipboard::Selection); + QApplication::clipboard()->setText(_text.originalText(_selection, ExpandLinksAll), QClipboard::Selection); } #endif // Q_OS_LINUX32 || Q_OS_LINUX64 @@ -437,7 +433,7 @@ void FlatLabel::keyPressEvent(QKeyEvent *e) { } else if (e->key() == Qt::Key_E && e->modifiers().testFlag(Qt::ControlModifier)) { auto selection = _selection.empty() ? (_contextMenu ? _savedSelection : _selection) : _selection; if (!selection.empty()) { - QApplication::clipboard()->setText(_text.originalText(selection, _contextExpandLinksMode), QClipboard::FindBuffer); + QApplication::clipboard()->setText(_text.originalText(selection, ExpandLinksAll), QClipboard::FindBuffer); } #endif // Q_OS_MAC } @@ -573,12 +569,12 @@ void FlatLabel::showContextMenu(QContextMenuEvent *e, ContextMenuReason reason) void FlatLabel::onCopySelectedText() { const auto selection = _selection.empty() ? (_contextMenu ? _savedSelection : _selection) : _selection; if (!selection.empty()) { - QApplication::clipboard()->setText(_text.toString(selection, _contextExpandLinksMode)); + QApplication::clipboard()->setText(_text.toString(selection, ExpandLinksAll)); } } void FlatLabel::onCopyContextText() { - QApplication::clipboard()->setText(_text.toString(AllTextSelection, _contextExpandLinksMode)); + QApplication::clipboard()->setText(_text.toString(AllTextSelection, ExpandLinksAll)); } void FlatLabel::onTouchSelect() { diff --git a/Telegram/SourceFiles/ui/widgets/labels.h b/Telegram/SourceFiles/ui/widgets/labels.h index 0a70c7693..b24a2ef7e 100644 --- a/Telegram/SourceFiles/ui/widgets/labels.h +++ b/Telegram/SourceFiles/ui/widgets/labels.h @@ -105,7 +105,6 @@ public: void setSelectable(bool selectable); void setDoubleClickSelectsParagraph(bool doubleClickSelectsParagraph); void setContextCopyText(const QString ©Text); - void setExpandLinksMode(ExpandLinksMode mode); void setBreakEverywhere(bool breakEverywhere); int naturalWidth() const override; @@ -207,7 +206,6 @@ private: Ui::PopupMenu *_contextMenu = nullptr; QString _contextCopyText; - ExpandLinksMode _contextExpandLinksMode = ExpandLinksAll; ClickHandlerFilter _clickHandlerFilter;