Skip to content

Commit d767c9f

Browse files
committed
Refactoring: Remove legacy class
1 parent a12020d commit d767c9f

25 files changed

+505
-749
lines changed

src/gui/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ target_sources(OpenCloudGui PRIVATE
4444
networksettings.cpp
4545
notifications.cpp
4646
openfilemanager.cpp
47-
owncloudgui.cpp
4847
protocolwidget.cpp
4948
protocolitem.cpp
5049
issueswidget.cpp

src/gui/accountsettings.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ void AccountSettings::slotRemoveCurrentFolder(Folder *folder)
187187
tr("<p>Do you really want to stop syncing the folder <i>%1</i>?</p>"
188188
"<p><b>Note:</b> This will <b>not</b> delete any files.</p>")
189189
.arg(shortGuiLocalPath),
190-
QMessageBox::NoButton, ocApp()->gui()->settingsDialog());
190+
QMessageBox::NoButton, ocApp()->settingsDialog());
191191
messageBox->setAttribute(Qt::WA_DeleteOnClose);
192192
QPushButton *yesButton = messageBox->addButton(tr("Remove Folder Sync Connection"), QMessageBox::YesRole);
193193
messageBox->addButton(tr("Cancel"), QMessageBox::NoRole);
@@ -304,14 +304,14 @@ void AccountSettings::slotForceSyncCurrentFolder(Folder *folder)
304304
auto messageBox = new QMessageBox(QMessageBox::Question, tr("Internet connection is metered"),
305305
tr("Synchronization is paused because the Internet connection is a metered connection"
306306
"<p>Do you really want to force a Synchronization now?"),
307-
QMessageBox::Yes | QMessageBox::No, ocApp()->gui()->settingsDialog());
307+
QMessageBox::Yes | QMessageBox::No, ocApp()->settingsDialog());
308308
messageBox->setAttribute(Qt::WA_DeleteOnClose);
309309
connect(messageBox, &QMessageBox::accepted, this, [folder = QPointer<Folder>(folder), this] {
310310
if (folder) {
311311
doForceSyncCurrentFolder(folder);
312312
}
313313
});
314-
ownCloudGui::raise();
314+
ocApp()->showSettings();
315315
messageBox->open();
316316
} else {
317317
doForceSyncCurrentFolder(folder);
@@ -477,11 +477,11 @@ void AccountSettings::addModalLegacyDialog(QWidget *widget, ModalWidgetSizePolic
477477
connect(widget, &QWidget::destroyed, this, [this, outerWidget] {
478478
outerWidget->deleteLater();
479479
if (!_goingDown) {
480-
ocApp()->gui()->settingsDialog()->ceaseModality(_accountState->account().get());
480+
ocApp()->settingsDialog()->ceaseModality(_accountState->account().get());
481481
}
482482
});
483483
widget->setVisible(true);
484-
ocApp()->gui()->settingsDialog()->requestModality(_accountState->account().get());
484+
ocApp()->settingsDialog()->requestModality(_accountState->account().get());
485485
}
486486

487487
void AccountSettings::addModalWidget(AccountModalWidget *widget)
@@ -491,9 +491,9 @@ void AccountSettings::addModalWidget(AccountModalWidget *widget)
491491

492492
connect(widget, &AccountModalWidget::finished, this, [widget, this] {
493493
widget->deleteLater();
494-
ocApp()->gui()->settingsDialog()->ceaseModality(_accountState->account().get());
494+
ocApp()->settingsDialog()->ceaseModality(_accountState->account().get());
495495
});
496-
ocApp()->gui()->settingsDialog()->requestModality(_accountState->account().get());
496+
ocApp()->settingsDialog()->requestModality(_accountState->account().get());
497497
}
498498

499499
uint AccountSettings::unsyncedSpaces() const

src/gui/accountsettings.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include "folder.h"
2020
#include "gui/notifications.h"
2121
#include "gui/qmlutils.h"
22-
#include "owncloudgui.h"
2322
#include "progressdispatcher.h"
2423

2524
#include <QSortFilterProxyModel>

src/gui/accountstate.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,15 @@ UpdateUrlDialog *AccountState::updateUrlDialog(const QUrl &newUrl)
6161
return nullptr;
6262
}
6363

64-
_updateUrlDialog = UpdateUrlDialog::fromAccount(_account, newUrl, ocApp()->gui()->settingsDialog());
64+
_updateUrlDialog = UpdateUrlDialog::fromAccount(_account, newUrl, ocApp()->settingsDialog());
6565

6666
connect(_updateUrlDialog, &UpdateUrlDialog::accepted, this, [=]() {
6767
_account->setUrl(newUrl);
6868
Q_EMIT _account->wantsAccountSaved(_account.data());
6969
Q_EMIT urlUpdated();
7070
});
7171

72-
ownCloudGui::raise();
72+
ocApp()->showSettings();
7373
_updateUrlDialog->open();
7474

7575
return _updateUrlDialog;
@@ -180,9 +180,9 @@ AccountState::AccountState(AccountPtr account)
180180
}
181181

182182
connect(account.data(), &Account::appProviderErrorOccured, this, [](const QString &error) {
183-
QMessageBox *msgBox = new QMessageBox(QMessageBox::Information, Theme::instance()->appNameGUI(), error, {}, ocApp()->gui()->settingsDialog());
183+
QMessageBox *msgBox = new QMessageBox(QMessageBox::Information, Theme::instance()->appNameGUI(), error, {}, ocApp()->settingsDialog());
184184
msgBox->setAttribute(Qt::WA_DeleteOnClose);
185-
ownCloudGui::raise();
185+
ocApp()->showSettings();
186186
msgBox->open();
187187
});
188188
}
@@ -390,7 +390,7 @@ void AccountState::checkConnectivity(bool blockJobs)
390390
// ignore errors for already accepted certificates
391391
auto filteredErrors = _account->accessManager()->filterSslErrors(errors);
392392
if (!filteredErrors.isEmpty()) {
393-
_tlsDialog = new TlsErrorDialog(filteredErrors, _account->url().host(), ocApp()->gui()->settingsDialog());
393+
_tlsDialog = new TlsErrorDialog(filteredErrors, _account->url().host(), ocApp()->settingsDialog());
394394
_tlsDialog->setAttribute(Qt::WA_DeleteOnClose);
395395
QSet<QSslCertificate> certs;
396396
certs.reserve(filteredErrors.size());
@@ -411,7 +411,7 @@ void AccountState::checkConnectivity(bool blockJobs)
411411
setState(SignedOut);
412412
});
413413

414-
ownCloudGui::raise();
414+
ocApp()->showSettings();
415415
_tlsDialog->open();
416416
}
417417
}

0 commit comments

Comments
 (0)