Skip to content
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
18 changes: 14 additions & 4 deletions reader/browser/BrowserMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,14 @@ void BrowserMenu::initActions(DocSheet *sheet, int index, SheetMenuType_e type,
}
} else if (type == DOC_MENU_KEY) {
qCDebug(appLog) << "BrowserMenu::initActions() - Processing DOC_MENU_KEY";
createAction(tr("Search"), "Search");
this->addSeparator();
if (sheet->fileType() == Dr::FileType::PDF || sheet->fileType() == Dr::FileType::DOCX
#ifdef XPS_SUPPORT_ENABLED
|| sheet->fileType() == Dr::FileType::XPS
#endif
) {
createAction(tr("Search"), "Search");
this->addSeparator();
}

if (sheet->hasBookMark(index)) {
qCDebug(appLog) << "BrowserMenu::initActions() - Adding remove bookmark action";
Expand Down Expand Up @@ -138,8 +144,12 @@ void BrowserMenu::initActions(DocSheet *sheet, int index, SheetMenuType_e type,
createAction(tr("Document info"), "DocumentInfo");
} else {
qCDebug(appLog) << "BrowserMenu::initActions() - Processing default menu type";
if (sheet->fileType() == Dr::FileType::PDF || sheet->fileType() == Dr::FileType::DOCX) {
qCDebug(appLog) << "BrowserMenu::initActions() - Adding search action for PDF/DOCX";
if (sheet->fileType() == Dr::FileType::PDF || sheet->fileType() == Dr::FileType::DOCX
#ifdef XPS_SUPPORT_ENABLED
|| sheet->fileType() == Dr::FileType::XPS
#endif
) {
qCDebug(appLog) << "BrowserMenu::initActions() - Adding search action for PDF/DOCX/XPS";
createAction(tr("Search"), "Search");
this->addSeparator();
}
Expand Down
6 changes: 5 additions & 1 deletion reader/uiframe/TitleMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ void TitleMenu::onCurSheetChanged(DocSheet *sheet)

QAction *searchAction = this->findChild<QAction *>("Search");
if (searchAction) {
if (sheet->fileType() == Dr::PDF || sheet->fileType() == Dr::DOCX) {
if (sheet->fileType() == Dr::PDF || sheet->fileType() == Dr::DOCX
#ifdef XPS_SUPPORT_ENABLED
|| sheet->fileType() == Dr::XPS
#endif
) {
qCDebug(appLog) << "Enabling search for PDF/DOCX";
searchAction->setVisible(true);
} else {
Expand Down