Skip to content

Commit 6e31576

Browse files
committed
refactor: remove unused DeclarativeUi class.
The declarative ui in fact will be returned in the response from file actions. Signed-off-by: Camila Ayres <[email protected]>
1 parent 57c1780 commit 6e31576

File tree

7 files changed

+1
-152
lines changed

7 files changed

+1
-152
lines changed

resources.qrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
<file>src/gui/macOS/ui/FileProviderEvictionDialog.qml</file>
6565
<file>src/gui/macOS/ui/FileProviderSyncStatus.qml</file>
6666
<file>src/gui/macOS/ui/FileProviderStorageInfo.qml</file>
67-
<file>src/gui/declarativeui/DeclarativeUiWindow.qml</file>
6867
<file>src/gui/declarativeui/FileActionsWindow.qml</file>
6968
</qresource>
7069
</RCC>

src/gui/application.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -428,9 +428,6 @@ Application::Application(int &argc, char **argv)
428428
connect(FolderMan::instance()->socketApi(), &SocketApi::fileActionsCommandReceived,
429429
_gui.data(), &ownCloudGui::slotShowFileActionsDialog);
430430

431-
connect(FolderMan::instance()->socketApi(), &SocketApi::declarativeUiCommandReceived,
432-
_gui.data(), &ownCloudGui::slotShowDeclarativeUiDialog);
433-
434431
// startup procedure.
435432
connect(&_checkConnectionTimer, &QTimer::timeout, this, &Application::slotCheckConnection);
436433
_checkConnectionTimer.setInterval(ConnectionValidator::DefaultCallingIntervalMsec); // check for connection every 32 seconds.

src/gui/declarativeui/DeclarativeUiWindow.qml

Lines changed: 0 additions & 90 deletions
This file was deleted.

src/gui/owncloudgui.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#include "tray/sortedactivitylistmodel.h"
3434
#include "tray/syncstatussummary.h"
3535
#include "tray/unifiedsearchresultslistmodel.h"
36-
#include "declarativeui/declarativeui.h"
36+
#include "declarativeui/fileactionsmodel.h"
3737
#include "filesystem.h"
3838

3939
#ifdef WITH_LIBCLOUDPROVIDERS
@@ -135,7 +135,6 @@ ownCloudGui::ownCloudGui(Application *parent)
135135
qmlRegisterType<ShareeModel>("com.nextcloud.desktopclient", 1, 0, "ShareeModel");
136136
qmlRegisterType<SortedShareModel>("com.nextcloud.desktopclient", 1, 0, "SortedShareModel");
137137
qmlRegisterType<SyncConflictsModel>("com.nextcloud.desktopclient", 1, 0, "SyncConflictsModel");
138-
qmlRegisterType<DeclarativeUi>("com.nextcloud.desktopclient", 1, 0, "DeclarativeUi");
139138
qmlRegisterType<FileActionsModel>("com.nextcloud.desktopclient", 1, 0, "FileActionsModel");
140139

141140
qmlRegisterUncreatableType<QAbstractItemModel>("com.nextcloud.desktopclient", 1, 0, "QAbstractItemModel", "QAbstractItemModel");
@@ -713,11 +712,6 @@ void ownCloudGui::slotShowFileActivityDialog(const QString &localPath) const
713712
_tray->createFileActivityDialog(localPath);
714713
}
715714

716-
void ownCloudGui::slotShowDeclarativeUiDialog(const QString &localPath) const
717-
{
718-
_tray->showDeclarativeUiDialog(localPath);
719-
}
720-
721715
void ownCloudGui::slotShowFileActionsDialog(const QString &localPath) const
722716
{
723717
_tray->showFileActionsDialog(localPath);

src/gui/owncloudgui.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ public slots:
9595
*/
9696
void slotShowShareDialog(const QString &localPath) const;
9797
void slotShowFileActivityDialog(const QString &localPath) const;
98-
void slotShowDeclarativeUiDialog(const QString &localPath) const;
9998
void slotShowFileActionsDialog(const QString &localPath) const;
10099
void slotNewAccountWizard();
101100

src/gui/systray.cpp

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -437,52 +437,11 @@ void Systray::createFileActivityDialog(const QString &localPath)
437437
Q_EMIT showFileDetailsPage(localPath, FileDetailsPage::Activity);
438438
}
439439

440-
void Systray::showDeclarativeUiDialog(const QString &localPath)
441-
{
442-
createDeclarativeUiDialog(localPath);
443-
}
444-
445440
void Systray::showFileActionsDialog(const QString &localPath)
446441
{
447442
createFileActionsDialog(localPath);
448443
}
449444

450-
void Systray::createDeclarativeUiDialog(const QString &localPath)
451-
{
452-
if (!_trayEngine) {
453-
qCWarning(lcSystray) << "Could not open declarative UI dialog for" << localPath << "as no tray engine was available";
454-
return;
455-
}
456-
457-
const auto folder = FolderMan::instance()->folderForPath(localPath);
458-
if (!folder) {
459-
qCWarning(lcSystray) << "Could not open declarative UI dialog for" << localPath << "no responsible folder found";
460-
return;
461-
}
462-
463-
QQmlComponent declarativeUiQml(trayEngine(), QStringLiteral("qrc:/qml/src/gui/declarativeui/DeclarativeUiWindow.qml"));
464-
if (declarativeUiQml.isError()) {
465-
qCWarning(lcSystray) << declarativeUiQml.errorString();
466-
qCWarning(lcSystray) << declarativeUiQml.errors();
467-
return;
468-
}
469-
470-
const QVariantMap initialProperties{
471-
{"accountState", QVariant::fromValue(folder->accountState())},
472-
{"localPath", localPath},
473-
};
474-
const auto declarativeUiDialog = declarativeUiQml.createWithInitialProperties(initialProperties);
475-
const auto dialog = qobject_cast<QQuickWindow*>(declarativeUiDialog);
476-
if (!dialog) {
477-
qCWarning(lcSystray) << "Declarative UI dialog window resulted in creation of object that was not a window!";
478-
return;
479-
}
480-
481-
dialog->show();
482-
dialog->raise();
483-
dialog->requestActivate();
484-
}
485-
486445
void Systray::createFileActionsDialog(const QString &localPath)
487446
{
488447
if (!_trayEngine) {
@@ -535,12 +494,6 @@ void Systray::presentShareViewInTray(const QString &localPath)
535494
Q_EMIT showFileDetails(folder->accountState(), localPath, FileDetailsPage::Sharing);
536495
}
537496

538-
void Systray::presentDeclarativeUiViewInSystray(const QString &localPath)
539-
{
540-
qCDebug(lcSystray) << "Opening declarative ui view in tray for " << localPath;
541-
createDeclarativeUiDialog(localPath);
542-
}
543-
544497
void Systray::presentFileActionsViewInSystray(const QString &localPath)
545498
{
546499
qCDebug(lcSystray) << "Opening file actions view in tray for " << localPath;

src/gui/systray.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,9 @@ public slots:
146146

147147
void createShareDialog(const QString &localPath);
148148
void createFileActivityDialog(const QString &localPath);
149-
void showDeclarativeUiDialog(const QString &localPath);
150149
void showFileActionsDialog(const QString &localPath);
151150

152151
void presentShareViewInTray(const QString &localPath);
153-
void presentDeclarativeUiViewInSystray(const QString &localPath);
154152
void presentFileActionsViewInSystray(const QString &localPath);
155153

156154
private slots:
@@ -169,7 +167,6 @@ private slots:
169167

170168
void setupContextMenu();
171169
void createFileDetailsDialog(const QString &localPath);
172-
void createDeclarativeUiDialog(const QString &localPath);
173170
void createFileActionsDialog(const QString &localPath);
174171

175172
[[nodiscard]] QScreen *currentScreen() const;

0 commit comments

Comments
 (0)