From 22b61e23e6f672911f86996eeaacb35702f68bc6 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Tue, 11 Jan 2022 17:25:34 +0100 Subject: [PATCH] REmoved more unused stuff and fixes Signed-off-by: Claudio Cambra --- src/gui/internallinkwidget.cpp | 22 +++++----------------- src/gui/internallinkwidget.h | 12 +----------- src/gui/sharedialog.cpp | 2 +- 3 files changed, 7 insertions(+), 29 deletions(-) diff --git a/src/gui/internallinkwidget.cpp b/src/gui/internallinkwidget.cpp index e7ceddd3e20a9..a8e58295c6b49 100644 --- a/src/gui/internallinkwidget.cpp +++ b/src/gui/internallinkwidget.cpp @@ -24,31 +24,24 @@ namespace OCC { -Q_LOGGING_CATEGORY(lcInternalLink, "nextcloud.gui.internaklink", QtInfoMsg) +Q_LOGGING_CATEGORY(lcInternalLink, "nextcloud.gui.internalink", QtInfoMsg) -InternalLinkWidget::InternalLinkWidget(AccountPtr account, - const QString &localPath, +InternalLinkWidget::InternalLinkWidget(const QString &localPath, QWidget *parent) : QWidget(parent) , _ui(new Ui::InternalLinkWidget) - , _account(account) , _localPath(localPath) { _ui->setupUi(this); - //Is this a file or folder? - QFileInfo fi(localPath); - _isFile = fi.isFile(); - - const auto folder = FolderMan::instance()->folderForPath(localPath); - const auto folderRelativePath = localPath.mid(folder->cleanPath().length() + 1); + const auto folder = FolderMan::instance()->folderForPath(_localPath); + const auto folderRelativePath = _localPath.mid(folder->cleanPath().length() + 1); const auto serverRelativePath = QDir(folder->remotePath()).filePath(folderRelativePath); SyncJournalFileRecord record; - if (folder) - folder->journalDb()->getFileRecord(folderRelativePath, &record); const auto bindLinkSlot = std::bind(&InternalLinkWidget::slotLinkFetched, this, std::placeholders::_1); + fetchPrivateLinkUrl( folder->accountState()->account(), serverRelativePath, @@ -88,11 +81,6 @@ void InternalLinkWidget::slotCopyInternalLink(const bool clicked) const QApplication::clipboard()->setText(_internalUrl); } -void InternalLinkWidget::slotStyleChanged() -{ - customizeStyle(); -} - void InternalLinkWidget::customizeStyle() { _ui->copyInternalLinkButton->setIcon(Theme::createColorAwareIcon(":/client/theme/copy.svg")); diff --git a/src/gui/internallinkwidget.h b/src/gui/internallinkwidget.h index 7980771f42be9..e08aa93c78e59 100644 --- a/src/gui/internallinkwidget.h +++ b/src/gui/internallinkwidget.h @@ -15,8 +15,6 @@ #ifndef INTERNALLINKWIDGET_H #define INTERNALLINKWIDGET_H -#include "accountfwd.h" - #include "QProgressIndicator.h" #include #include @@ -36,17 +34,12 @@ class InternalLinkWidget : public QWidget Q_OBJECT public: - explicit InternalLinkWidget(AccountPtr account, - const QString &localPath, + explicit InternalLinkWidget(const QString &localPath, QWidget *parent = nullptr); ~InternalLinkWidget() override; - void toggleButton(bool show); void setupUiOptions(); -public slots: - void slotStyleChanged(); - private slots: void slotLinkFetched(const QString &url); void slotCopyInternalLink(const bool clicked) const; @@ -55,12 +48,9 @@ private slots: void customizeStyle(); Ui::InternalLinkWidget *_ui; - AccountPtr _account; QString _localPath; QString _internalUrl; - bool _isFile; - QPushButton *_copyInternalLinkButton{}; }; } diff --git a/src/gui/sharedialog.cpp b/src/gui/sharedialog.cpp index 7e6d4085614c4..c15c77647b88a 100644 --- a/src/gui/sharedialog.cpp +++ b/src/gui/sharedialog.cpp @@ -152,7 +152,7 @@ ShareDialog::ShareDialog(QPointer accountState, connect(_manager, &ShareManager::linkShareRequiresPassword, this, &ShareDialog::slotLinkShareRequiresPassword); } - _internalLinkWidget = new InternalLinkWidget(_accountState->account(), _localPath, this); + _internalLinkWidget = new InternalLinkWidget(localPath, this); _ui->verticalLayout->insertWidget(_linkWidgetList.size()+1, _internalLinkWidget); }