Skip to content

Invokes on qApp #10835

Closed
Closed

Description

@TheOneRing

We used to inherit qApplication which allowed us to hack around some dependency issues.

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.

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;

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...

Activity

  1. added
    p2-high
    on May 11, 2023
  2. added this to the Desktop Client 5.0 milestone on May 11, 2023
  3. self-assigned this
    on May 11, 2023
  4. changed the title [-]Mac: Platform tries to invoke methode on qApp instead of our main instance[/-] [+]Invokes on qApp[/+] on May 11, 2023
  5. erikjv commented on May 12, 2023

    @erikjv
    Contributor

    Wouldn't it be better to have the Platform class emit a signal, which we then connect to Application::showSettingsDialog?

  6. TheOneRing commented on May 12, 2023

    @TheOneRing
    ContributorAuthor

    Wouldn't it be better to have the Platform class emit a signal, which we then connect to Application::showSettingsDialog?

    Thats what I've done

  7. linked a pull request that will close this issueFix for 10835 #10841on May 12, 2023
  8. saw-jan commented on Jun 8, 2023

    @saw-jan
    Member

    Looks like only code refactoring. Nothing is to be tested manually. Moving to Done
    CC @TheOneRing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

p2-high

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions