Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHannah von Reth <hannah.vonreth@owncloud.com>2020-07-03 15:08:23 +0300
committerHannah von Reth <vonreth@kde.org>2020-07-06 11:43:42 +0300
commit8adee753fe47ba0b3b6a344219fc88feaa2a0907 (patch)
treeafa363c32a30e7325685d4353e1446994b843f61 /src/gui/sharedialog.cpp
parent7d7d919a15f28c6764bc680e3c621a6d5108dba2 (diff)
Gui: Remove usage of grid layout from src/gui/sharedialog.*
Diffstat (limited to 'src/gui/sharedialog.cpp')
-rw-r--r--src/gui/sharedialog.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/gui/sharedialog.cpp b/src/gui/sharedialog.cpp
index 33ea26ad3..0d3dcfa2b 100644
--- a/src/gui/sharedialog.cpp
+++ b/src/gui/sharedialog.cpp
@@ -29,6 +29,7 @@
#include <QPointer>
#include <QPushButton>
#include <QFrame>
+#include <QRegularExpression>
namespace OCC {
@@ -91,19 +92,16 @@ ShareDialog::ShareDialog(QPointer<AccountState> accountState,
QString ocDir(_sharePath);
ocDir.truncate(ocDir.length() - fileName.length());
- ocDir.replace(QRegExp("^/*"), "");
- ocDir.replace(QRegExp("/*$"), "");
+ // remove leading and trailing spaces
+ ocDir.remove(QRegularExpression(QStringLiteral("^/*|/*$")));
- // Laying this out is complex because sharePath
- // may be in use or not.
- _ui->gridLayout->removeWidget(_ui->label_sharePath);
- _ui->gridLayout->removeWidget(_ui->label_name);
if (ocDir.isEmpty()) {
- _ui->gridLayout->addWidget(_ui->label_name, 0, 1, 2, 1);
+ _ui->label_name->setVisible(true);
+ _ui->label_sharePath->setVisible(false);
_ui->label_sharePath->setText(QString());
} else {
- _ui->gridLayout->addWidget(_ui->label_name, 0, 1, 1, 1);
- _ui->gridLayout->addWidget(_ui->label_sharePath, 1, 1, 1, 1);
+ _ui->label_name->setVisible(true);
+ _ui->label_sharePath->setVisible(true);
_ui->label_sharePath->setText(tr("Folder: %2").arg(ocDir));
}