Repository navigation
Closed
Description
We used to inherit qApplication which allowed us to hack around some dependency issues.
client/src/libsync/platform_mac.mm
Lines 44 to 45 in 076efb2
| if (auto *app = QApplication::instance()) { | |
| QMetaObject::invokeMethod(app, "showSettingsWindow", Qt::QueuedConnection); |
We probably need an setCoreInstance(CoreInstance *) function in platform.h where CoreInstance is an interface define in libsync.
client/src/libsync/creds/oauth.cpp
Lines 569 to 575 in f4f59cc
| if (!isUrlValid(authorisationLink())) { | |
| qCWarning(lcOauth) << "URL validation failed"; | |
| QMetaObject::invokeMethod(qApp, "slotShowGuiMessage", Qt::QueuedConnection, | |
| Q_ARG(QString, tr("Oauth2 Error")), | |
| Q_ARG(QString, tr("Oauth2 authentication requires a secured connection."))); | |
| emit result(Error, QString()); | |
| return; |
client/src/libsync/appprovider.cpp
Lines 88 to 90 in 2c2a8d7
| QMetaObject::invokeMethod(qApp, "slotShowGuiMessage", Qt::QueuedConnection, | |
| Q_ARG(QString, QCoreApplication::translate("AppProvider", "Error")), | |
| Q_ARG(QString, QCoreApplication::translate("AppProvider", "Failed to open %1 in web. Error: %2.").arg(localPath, job->reply()->errorString()))); |
There are probably more.
We should also run clazy to port away from string based connects...
Metadata
Metadata
Assignees
Labels
p2-highEscalation, on top of current planning, release blocker
Activity
[-]Mac: Platform tries to invoke methode on qApp instead of our main instance[/-][+]Invokes on qApp[/+]erikjv commentedon May 12, 2023
Wouldn't it be better to have the
Platformclass emit a signal, which we then connect toApplication::showSettingsDialog?TheOneRing commentedon May 12, 2023
Thats what I've done
saw-jan commentedon Jun 8, 2023
Looks like only code refactoring. Nothing is to be tested manually. Moving to Done
CC @TheOneRing