Skip to content

Commit

Permalink
removing unnecessary changes
Browse files Browse the repository at this point in the history
  • Loading branch information
octaeder committed Jan 11, 2025
1 parent 043ec94 commit 1a65c06
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 20 deletions.
28 changes: 12 additions & 16 deletions src/pdfviewer/PDFDocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1589,15 +1589,13 @@ void PDFWidget::contextMenuEvent(QContextMenuEvent *event)
usingTool = kNone;
}

if (pdfDoc) {
if (pdfDoc->menuGrid || pdfDoc->menuShow) {
menu.addSeparator();
if (pdfDoc->menuGrid) {
menu.addMenu(pdfDoc->menuGrid);
}
if (pdfDoc->menuShow) {
menu.addMenu(pdfDoc->menuShow);
}
if (pdfDoc && pdfDoc->menuShow) {
menu.addSeparator();
if (pdfDoc->menuGrid) {
menu.addMenu(pdfDoc->menuGrid);
}
if (pdfDoc->menuShow) {
menu.addMenu(pdfDoc->menuShow);
}
}

Expand Down Expand Up @@ -2959,7 +2957,7 @@ PDFDocument::~PDFDocument()
/*!
* \brief setup ToolBar
*/
void PDFDocument::setupToolBar(bool embedded){
void PDFDocument::setupToolBar(){
toolBar = new QToolBar(this);
toolBar->setWindowTitle(tr("Toolbar"));
toolBar->setObjectName(QString("toolBar"));
Expand Down Expand Up @@ -3110,12 +3108,10 @@ void PDFDocument::setupMenus(bool embedded)
actionCustom->setProperty("grid","xx");
actionCustom->setCheckable(true);
actionGroupGrid->addAction(actionCustom);
menuGrid->addSeparator();
menuGrid->addSeparator();
actionSinglePageStep=configManager->newManagedAction(menuroot,menuGrid, "singlePageStep", tr("Single Page Step"), pdfWidget, SLOT(setSinglePageStep(bool)), QList<QKeySequence>());
// if (embedded) {
menuGrid->addAction(actionContinuous);
// }
menuWindow->addAction(menuShow->menuAction());
menuGrid->addAction(actionContinuous);
menuWindow->addAction(menuShow->menuAction());
#if (QT_VERSION > 0x050a00) && (defined(Q_OS_MAC))
actionCloseElement=configManager->newManagedAction(menuroot,menuWindow, "closeElement", tr("&Close something"), this, SLOT(closeElement()), QList<QKeySequence>()); // osx work around
#else
Expand Down Expand Up @@ -3189,7 +3185,7 @@ void PDFDocument::init(bool embedded)

setupMenus(embedded);

setupToolBar(embedded);
setupToolBar();


setAttribute(Qt::WA_DeleteOnClose, true);
Expand Down
7 changes: 3 additions & 4 deletions src/pdfviewer/PDFDocument.h
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ private slots:
private:
void init(bool embedded = false);
void setupMenus(bool embedded);
void setupToolBar(bool embedded);
void setupToolBar();
void setCurrentFile(const QString &fileName);
void loadSyncData();

Expand Down Expand Up @@ -682,11 +682,10 @@ private slots:

QStatusBar *statusbar;
QToolBar *toolBar;
QToolBar *tbPdfView;
QTimer *toolBarTimer;
public:
QMenu *menuGrid;
QMenu *menuShow;
QMenu *menuGrid = nullptr;
QMenu *menuShow = nullptr;
private:
QMenu *menuEdit_2;

Expand Down

0 comments on commit 1a65c06

Please sign in to comment.