Skip to content

Commit

Permalink
Remove crash test function from global scope
Browse files Browse the repository at this point in the history
  • Loading branch information
TheOneRing committed Nov 10, 2023
1 parent f7f00c7 commit 3f7bdae
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 22 deletions.
16 changes: 0 additions & 16 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
3 changes: 0 additions & 3 deletions src/gui/application.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ 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)
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); });
crashMenu->addAction(QStringLiteral("Crash now - qFatal"), _app, [] { qFatal("la Qt fatale"); });
}

_contextMenu->addSeparator();
Expand Down

0 comments on commit 3f7bdae

Please sign in to comment.