Skip to content

Commit

Permalink
MainWindow: Make templates menu local variable
Browse files Browse the repository at this point in the history
m_templatesMenu doesn't need to be a member because it's only used once
in finalize().
  • Loading branch information
lukas-w committed Aug 23, 2019
1 parent 77089e3 commit ebf6b92
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 0 additions & 2 deletions include/MainWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@

#include "ConfigManager.h"
#include "SubWindow.h"
#include "TemplatesMenu.h"

class QAction;
class QDomElement;
Expand Down Expand Up @@ -204,7 +203,6 @@ private slots:
QWidget * m_toolBar;
QGridLayout * m_toolBarLayout;

TemplatesMenu * m_templatesMenu;
QMenu * m_recentlyOpenedProjectsMenu;

struct keyModifiers
Expand Down
8 changes: 4 additions & 4 deletions src/gui/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
#include "SetupDialog.h"
#include "SideBar.h"
#include "SongEditor.h"
#include "TemplatesMenu.h"
#include "TextFloat.h"
#include "TimeLineWidget.h"
#include "ToolButton.h"
Expand Down Expand Up @@ -88,7 +89,6 @@ void disableAutoKeyAccelerators(QWidget* mainWindow)

MainWindow::MainWindow() :
m_workspace( NULL ),
m_templatesMenu( NULL ),
m_recentlyOpenedProjectsMenu( NULL ),
m_toolsMenu( NULL ),
m_autoSaveTimer( this ),
Expand Down Expand Up @@ -277,8 +277,8 @@ void MainWindow::finalize()
this, SLOT( createNewProject() ),
QKeySequence::New );

m_templatesMenu = new TemplatesMenu( this );
project_menu->addMenu(m_templatesMenu);
auto templates_menu = new TemplatesMenu( this );
project_menu->addMenu(templates_menu);

project_menu->addAction( embed::getIconPixmap( "project_open" ),
tr( "&Open..." ),
Expand Down Expand Up @@ -425,7 +425,7 @@ void MainWindow::finalize()
tr( "Create new project from template" ),
this, SLOT( emptySlot() ),
m_toolBar );
project_new_from_template->setMenu( m_templatesMenu );
project_new_from_template->setMenu( templates_menu );
project_new_from_template->setPopupMode( ToolButton::InstantPopup );

ToolButton * project_open = new ToolButton(
Expand Down

0 comments on commit ebf6b92

Please sign in to comment.