From 52c7c9c032d547b957808d07f53f58ed247f924c Mon Sep 17 00:00:00 2001 From: aqua Date: Thu, 22 Sep 2022 22:07:28 +0300 Subject: Add validate_xml script --- src/bookmarks/CMakeLists.txt | 5 +++++ src/bookmarks/bookmarkstreeitem.hpp | 4 +++- src/panels/bookmarkstoolbar.cpp | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/bookmarks/CMakeLists.txt b/src/bookmarks/CMakeLists.txt index 3f89c74f..0e9fef9e 100644 --- a/src/bookmarks/CMakeLists.txt +++ b/src/bookmarks/CMakeLists.txt @@ -16,4 +16,9 @@ if(${CMAKE_BUILD_TYPE} STREQUAL "Debug") add_executable(xbel test/xbel.cpp) target_link_libraries(xbel GTest::gtest GTest::gtest_main bookmarks) gtest_discover_tests(xbel WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test) + + add_test(NAME bookmarks.validate_xml + COMMAND ${PROJECT_SOURCE_DIR}/scripts/validate_xml.py --dtd=${CMAKE_CURRENT_SOURCE_DIR}/test/xbel-1.0.dtd + ${CMAKE_CURRENT_SOURCE_DIR}/test/bookmarks.xbel + ) endif() diff --git a/src/bookmarks/bookmarkstreeitem.hpp b/src/bookmarks/bookmarkstreeitem.hpp index caed1ecb..91d4ab2a 100644 --- a/src/bookmarks/bookmarkstreeitem.hpp +++ b/src/bookmarks/bookmarkstreeitem.hpp @@ -40,7 +40,9 @@ public: template [[nodiscard]] QAction *action(T *sender, rekonq::OpenType type) const { - auto *action = new QAction(m_data.title, sender); + auto *action = new QAction(m_icon, m_data.title, sender); + action->setIconVisibleInMenu(true); + action->setToolTip(m_data.description.isEmpty() ? m_data.title : m_data.description); QObject::connect(action, &QAction::triggered, sender, [this, sender, type]() { emit sender->loadUrl(m_data.href, type); }); return action; diff --git a/src/panels/bookmarkstoolbar.cpp b/src/panels/bookmarkstoolbar.cpp index 01a7db30..c616410e 100644 --- a/src/panels/bookmarkstoolbar.cpp +++ b/src/panels/bookmarkstoolbar.cpp @@ -16,6 +16,7 @@ constexpr int elide_width = 100; BookmarkToolBar::BookmarkToolBar(QWidget *parent) : QToolBar(parent) { + setToolButtonStyle(Qt::ToolButtonTextBesideIcon); /* setContextMenuPolicy(Qt::CustomContextMenu); -- cgit v1.2.1