Skip to content
Open
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
15 changes: 10 additions & 5 deletions src/ui/Menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -692,11 +692,16 @@ void Menu::populateBookmarkSelectorMenu()
}

const BookmarksModel::Bookmark *folderBookmark(BookmarksManager::getModel()->getBookmark(m_menuOptions.value(QLatin1String("bookmark")).toULongLong()));
Action *addFolderAction(new Action(-1, {}, {{QLatin1String("icon"), QLatin1String("document-open-folder")}, {QLatin1String("text"), QT_TRANSLATE_NOOP("actions", "This Folder")}}, ActionExecutor::Object(), this));
addFolderAction->setData(folderBookmark->getIdentifier());

addAction(addFolderAction);
addSeparator();
const bool supportsFolderSelection = m_menuOptions.value(QLatin1String("supportsFolderSelection"), true).toBool();
if (supportsFolderSelection)
{
Action *addFolderAction(new Action(-1, {}, {{QLatin1String("icon"), QLatin1String("document-open-folder")}, {QLatin1String("text"), QT_TRANSLATE_NOOP("actions", "This Folder")}}, ActionExecutor::Object(), this));
addFolderAction->setData(folderBookmark->getIdentifier());

addAction(addFolderAction);
addSeparator();
}

for (int i = 0; i < folderBookmark->rowCount(); ++i)
{
Expand All @@ -718,7 +723,7 @@ void Menu::populateBookmarkSelectorMenu()
if (type != BookmarksModel::UrlBookmark)
{
Menu *menu(new Menu(BookmarkSelectorMenu, this));
menu->setMenuOptions({{QLatin1String("bookmark"), bookmark->getIdentifier()}});
menu->setMenuOptions({{QLatin1String("bookmark"), bookmark->getIdentifier()}, {QLatin1String("supportsFolderSelection"), supportsFolderSelection}});

action->setMenu(menu);
}
Expand Down
1 change: 1 addition & 0 deletions src/ui/preferences/PreferencesGeneralPageWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ PreferencesGeneralPageWidget::PreferencesGeneralPageWidget(QWidget *parent) : QW
m_ui->homePageLineEditWidget->setText(SettingsManager::getOption(SettingsManager::Browser_HomePageOption).toString());

Menu *bookmarksMenu(new Menu(Menu::BookmarkSelectorMenu, m_ui->useBookmarkAsHomePageButton));
bookmarksMenu->setMenuOptions({{QLatin1String("supportsFolderSelection"), false}});

m_ui->useBookmarkAsHomePageButton->setMenu(bookmarksMenu);
m_ui->useBookmarkAsHomePageButton->setEnabled(BookmarksManager::getModel()->getRootItem()->rowCount() > 0);
Expand Down