mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-24 21:35:47 +03:00
Merge pull request #781 from ivaradi/qt5.5-compat
Qt 5.5 compatibility patch for Xenial
This commit is contained in:
commit
2b760cd63b
1 changed files with 40 additions and 0 deletions
|
@ -0,0 +1,40 @@
|
|||
--- nextcloud-client-2.4.0.orig/src/gui/wizard/owncloudoauthcredspage.cpp
|
||||
+++ nextcloud-client-2.4.0/src/gui/wizard/owncloudoauthcredspage.cpp
|
||||
@@ -53,10 +53,8 @@ OwncloudOAuthCredsPage::OwncloudOAuthCredsPage()
|
||||
_ui.openLinkButton->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
QObject::connect(_ui.openLinkButton, &QWidget::customContextMenuRequested, [this](const QPoint &pos) {
|
||||
auto menu = new QMenu(_ui.openLinkButton);
|
||||
- menu->addAction(tr("Copy link to clipboard"), this, [this] {
|
||||
- if (_asyncAuth)
|
||||
- QApplication::clipboard()->setText(_asyncAuth->authorisationLink().toString(QUrl::FullyEncoded));
|
||||
- });
|
||||
+ auto action = menu->addAction(tr("Copy link to clipboard"));
|
||||
+ connect(action, &QAction::triggered, this, &OwncloudOAuthCredsPage::copyLinkToClipboard);
|
||||
menu->setAttribute(Qt::WA_DeleteOnClose);
|
||||
menu->popup(_ui.openLinkButton->mapToGlobal(pos));
|
||||
});
|
||||
@@ -131,4 +129,11 @@ bool OwncloudOAuthCredsPage::isComplete() const
|
||||
return false; /* We can never go forward manually */
|
||||
}
|
||||
|
||||
+void OwncloudOAuthCredsPage::copyLinkToClipboard()
|
||||
+{
|
||||
+ if (_asyncAuth)
|
||||
+ QApplication::clipboard()->setText(_asyncAuth->authorisationLink().toString(QUrl::FullyEncoded));
|
||||
+}
|
||||
+
|
||||
+
|
||||
} // namespace OCC
|
||||
--- nextcloud-client-2.4.0.orig/src/gui/wizard/owncloudoauthcredspage.h
|
||||
+++ nextcloud-client-2.4.0/src/gui/wizard/owncloudoauthcredspage.h
|
||||
@@ -57,6 +57,10 @@ public:
|
||||
QString _refreshToken;
|
||||
QScopedPointer<OAuth> _asyncAuth;
|
||||
Ui_OwncloudOAuthCredsPage _ui;
|
||||
+
|
||||
+protected slots:
|
||||
+ void copyLinkToClipboard();
|
||||
+
|
||||
};
|
||||
|
||||
} // namespace OCC
|
Loading…
Reference in a new issue