Skip to content

Commit

Permalink
Remove unused stuff
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Cambra <[email protected]>
  • Loading branch information
claucambra committed Jan 10, 2022
1 parent e9a0e38 commit 15654ec
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 77 deletions.
19 changes: 1 addition & 18 deletions src/gui/internallinkwidget.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
* Copyright (C) by Roeland Jago Douma <[email protected]>
* Copyright (C) 2015 by Klaas Freitag <[email protected]>
* Copyright (C) 2022 by Claudio Cambra <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -37,13 +36,11 @@ namespace OCC {
Q_LOGGING_CATEGORY(lcInternalLink, "nextcloud.gui.internaklink", QtInfoMsg)

InternalLinkWidget::InternalLinkWidget(AccountPtr account,
const QString &sharePath,
const QString &localPath,
QWidget *parent)
: QWidget(parent)
, _ui(new Ui::InternalLinkWidget)
, _account(account)
, _sharePath(sharePath)
, _localPath(localPath)
{
_ui->setupUi(this);
Expand Down Expand Up @@ -73,14 +70,6 @@ InternalLinkWidget::InternalLinkWidget(AccountPtr account,
_ui->internalLinkProgressIndicator->startAnimation();

connect(_ui->copyInternalLinkButton, &QPushButton::clicked, this, &InternalLinkWidget::slotCopyInternalLink);

_ui->errorLabel->hide();

// check if the file is already inside of a synced folder
if (sharePath.isEmpty()) {
qCWarning(lcInternalLink) << "Unable to share files not in a sync folder.";
return;
}
}

InternalLinkWidget::~InternalLinkWidget()
Expand Down Expand Up @@ -108,12 +97,6 @@ void InternalLinkWidget::slotCopyInternalLink(const bool clicked) const
QApplication::clipboard()->setText(_internalUrl);
}

void InternalLinkWidget::displayError(const QString &errMsg)
{
_ui->errorLabel->setText(errMsg);
_ui->errorLabel->show();
}

void InternalLinkWidget::slotStyleChanged()
{
customizeStyle();
Expand Down
7 changes: 1 addition & 6 deletions src/gui/internallinkwidget.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
* Copyright (C) by Roeland Jago Douma <[email protected]>
* Copyright (C) 2015 by Klaas Freitag <[email protected]>
* Copyright (C) 2022 by Claudio Cambra <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -53,7 +52,6 @@ class InternalLinkWidget : public QWidget

public:
explicit InternalLinkWidget(AccountPtr account,
const QString &sharePath,
const QString &localPath,
QWidget *parent = nullptr);
~InternalLinkWidget() override;
Expand All @@ -69,13 +67,10 @@ private slots:
void slotCopyInternalLink(const bool clicked) const;

private:
void displayError(const QString &errMsg);

void customizeStyle();

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

Expand Down
66 changes: 14 additions & 52 deletions src/gui/internallinkwidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -101,58 +101,20 @@
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="errorLabel">
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>123</red>
<green>121</green>
<blue>134</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string notr="true">TextLabel</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
<widget class="QLabel" name="infoMessage">
<property name="enabled">
<bool>true</bool>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(118, 118, 118)</string>
</property>
<property name="text">
<string>Only works for users with access to this folder</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
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(), _sharePath, _localPath, this);
_internalLinkWidget = new InternalLinkWidget(_accountState->account(), _localPath, this);
_ui->verticalLayout->insertWidget(_linkWidgetList.size()+1, _internalLinkWidget);
}

Expand Down

0 comments on commit 15654ec

Please sign in to comment.