Skip to content

Commit

Permalink
Modernise QString-related construction
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
  • Loading branch information
claucambra committed Oct 26, 2022
1 parent da933fc commit a9a06fa
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/gui/accountsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ void AccountSettings::slotEncryptFolderFinished(int status)

const auto folder = job->property(propertyFolder).value<Folder *>();
Q_ASSERT(folder);
const auto path = job->property(propertyPath).value<QString>();
const auto path = job->property(propertyPath).toString();
const auto index = _model->indexForPath(folder, path);
Q_ASSERT(index.isValid());
_model->resetAndFetch(index.parent());
Expand Down Expand Up @@ -438,7 +438,7 @@ void AccountSettings::openIgnoredFilesDialog(const QString & absFolderPath)
{
Q_ASSERT(QFileInfo(absFolderPath).isAbsolute());

const QString ignoreFile(absFolderPath + ".sync-exclude.lst");
const QString ignoreFile{absFolderPath + ".sync-exclude.lst"};
const auto layout = new QVBoxLayout();
const auto ignoreListWidget = new IgnoreListTableWidget(this);
ignoreListWidget->readIgnoreFile(ignoreFile);
Expand Down Expand Up @@ -607,7 +607,7 @@ void AccountSettings::slotCustomContextMenuRequested(const QPoint &pos)
if (Theme::instance()->showVirtualFilesOption() && !folder->virtualFilesEnabled() && Vfs::checkAvailability(folder->path())) {
const auto mode = bestAvailableVfsMode();
if (mode == Vfs::WindowsCfApi || ConfigFile().showExperimentalOptions()) {
ac = menu->addAction(tr("Enable virtual file support %1 …").arg(mode == Vfs::WindowsCfApi ? QString() : tr("(experimental)")));
ac = menu->addAction(tr("Enable virtual file support %1 …").arg(mode == Vfs::WindowsCfApi ? {} : tr("(experimental)")));
// TODO: remove when UX decision is made
ac->setEnabled(!Utility::isPathWindowsDrivePartitionRoot(folder->path()));
//
Expand Down Expand Up @@ -1086,7 +1086,7 @@ void AccountSettings::slotUpdateQuota(qint64 total, qint64 used)
_ui->quotaProgressBar->setToolTip(toolTip);
} else {
_ui->quotaProgressBar->setVisible(false);
_ui->quotaInfoLabel->setToolTip(QString());
_ui->quotaInfoLabel->setToolTip({});

/* -1 means not computed; -2 means unknown; -3 means unlimited (#owncloud/client/issues/3940)*/
if (total == 0 || total == -1) {
Expand All @@ -1105,7 +1105,7 @@ void AccountSettings::slotAccountStateChanged()
_ui->sslButton->updateAccountState(_accountState);
const auto account = _accountState->account();
auto safeUrl = account->url();
safeUrl.setPassword(QString()); // Remove the password from the URL to avoid showing it in the UI
safeUrl.setPassword({}); // Remove the password from the URL to avoid showing it in the UI
const auto folders = FolderMan::instance()->map().values();
for (const auto folder : folders) {
_model->slotUpdateFolderState(folder);
Expand Down

0 comments on commit a9a06fa

Please sign in to comment.