Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove crash test function from global scope #11350

Merged
merged 2 commits into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions src/gui/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,22 +193,6 @@ void Application::slotCleanup()
AccountManager::instance()->shutdown();
}

void Application::slotCrash()
{
Utility::crash();
}

void Application::slotCrashEnforce()
{
OC_ENFORCE(1 == 0);
}


void Application::slotCrashFatal()
{
qFatal("la Qt fatale");
}

AccountStatePtr Application::addNewAccount(AccountPtr newAccount)
{
auto *accountMan = AccountManager::instance();
Expand Down Expand Up @@ -268,13 +252,6 @@ void Application::openVirtualFile(const QString &filename)
});
}

void Application::tryTrayAgain()
{
qCInfo(lcApplication) << "Trying tray icon, tray available:" << QSystemTrayIcon::isSystemTrayAvailable();
if (!_gui->contextMenuVisible())
_gui->hideAndShowTray();
}

bool Application::eventFilter(QObject *obj, QEvent *event)
{
#ifdef Q_OS_MAC
Expand Down
6 changes: 0 additions & 6 deletions src/gui/application.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,12 @@ class Application : public QObject
AccountStatePtr addNewAccount(AccountPtr newAccount);

public slots:
void slotCrash();
void slotCrashEnforce();
void slotCrashFatal();
/**
* Will download a virtual file, and open the result.
* The argument is the filename of the virtual file (including the extension)
*/
void openVirtualFile(const QString &filename);

/// Attempt to show() the tray icon again. Used if no systray was available initially.
void tryTrayAgain();

protected:
bool eventFilter(QObject *obj, QEvent *event) override;

Expand Down
6 changes: 3 additions & 3 deletions src/gui/owncloudgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -640,9 +640,9 @@ void ownCloudGui::updateContextMenu()

if (_app->debugMode()) {
auto *crashMenu = _contextMenu->addMenu(QStringLiteral("Debug actions"));
crashMenu->addAction(QStringLiteral("Crash now - Div by zero"), _app, &Application::slotCrash);
crashMenu->addAction(QStringLiteral("Crash now - ENFORCE()"), _app, &Application::slotCrashEnforce);
crashMenu->addAction(QStringLiteral("Crash now - qFatal"), _app, &Application::slotCrashFatal);
crashMenu->addAction(QStringLiteral("Crash now - Div by zero"), _app, [] { Utility::crash(); });
crashMenu->addAction(QStringLiteral("Crash now - ENFORCE()"), _app, [] { OC_ENFORCE(1 == 0); });
fmoc marked this conversation as resolved.
Show resolved Hide resolved
crashMenu->addAction(QStringLiteral("Crash now - qFatal"), _app, [] { qFatal("la Qt fatale"); });
}

_contextMenu->addSeparator();
Expand Down
Loading