Skip to content

Commit

Permalink
REmoved more unused stuff and fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Cambra <[email protected]>
  • Loading branch information
claucambra committed Jan 11, 2022
1 parent 9e006d5 commit 22b61e2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 29 deletions.
22 changes: 5 additions & 17 deletions src/gui/internallinkwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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"));
Expand Down
12 changes: 1 addition & 11 deletions src/gui/internallinkwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
#ifndef INTERNALLINKWIDGET_H
#define INTERNALLINKWIDGET_H

#include "accountfwd.h"

#include "QProgressIndicator.h"
#include <QList>
#include <QToolButton>
Expand All @@ -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;
Expand All @@ -55,12 +48,9 @@ private slots:
void customizeStyle();

Ui::InternalLinkWidget *_ui;
AccountPtr _account;
QString _localPath;
QString _internalUrl;

bool _isFile;

QPushButton *_copyInternalLinkButton{};
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/gui/sharedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ ShareDialog::ShareDialog(QPointer<AccountState> 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);
}

Expand Down

0 comments on commit 22b61e2

Please sign in to comment.