From 6b978a554c6e65c9ee602a50e34bc7548a22155b Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Fri, 17 Sep 2021 17:42:04 +0200 Subject: [PATCH] annotationtoolbartest: Remove unneded cast Also allows us not to compile a ./part/toggleactionmenu.cpp in the test, which seems to fix the crashes in freebsd, makes some sense since we end up with two ToggleActionMenu in the test, the one provided by the okularpart library and the other compiled in --- autotests/CMakeLists.txt | 2 +- autotests/annotationtoolbartest.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/autotests/CMakeLists.txt b/autotests/CMakeLists.txt index 69350e1df..6825ce6c0 100644 --- a/autotests/CMakeLists.txt +++ b/autotests/CMakeLists.txt @@ -108,7 +108,7 @@ if(KF5Activities_FOUND AND BUILD_DESKTOP) endif() if(BUILD_DESKTOP) - ecm_add_test(annotationtoolbartest.cpp ../shell/okular_main.cpp ../shell/shellutils.cpp ../shell/shell.cpp ../part/toggleactionmenu.cpp closedialoghelper.cpp + ecm_add_test(annotationtoolbartest.cpp ../shell/okular_main.cpp ../shell/shellutils.cpp ../shell/shell.cpp closedialoghelper.cpp TEST_NAME "annotationtoolbartest" LINK_LIBRARIES Qt5::Test okularpart ) diff --git a/autotests/annotationtoolbartest.cpp b/autotests/annotationtoolbartest.cpp index c3a6a1f15..ceaab201e 100644 --- a/autotests/annotationtoolbartest.cpp +++ b/autotests/annotationtoolbartest.cpp @@ -145,7 +145,7 @@ void AnnotationToolBarTest::testAnnotationToolBar() QVERIFY(annToolBar); // Check config action default enabled states - ToggleActionMenu *aQuickTools = dynamic_cast(part->actionCollection()->action(QStringLiteral("annotation_favorites"))); + QAction *aQuickTools = part->actionCollection()->action(QStringLiteral("annotation_favorites")); QAction *aAddToQuickTools = part->actionCollection()->action(QStringLiteral("annotation_bookmark")); QAction *aAdvancedSettings = part->actionCollection()->action(QStringLiteral("annotation_settings_advanced")); QAction *aContinuousMode = part->actionCollection()->action(QStringLiteral("annotation_settings_pin"));