Skip to content

Commit

Permalink
CrateFeature: Defer initActions invocation until bindLibraryWidget is…
Browse files Browse the repository at this point in the history
… called
  • Loading branch information
cr7pt0gr4ph7 committed Apr 26, 2024
1 parent be201bd commit f957646
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions src/library/trackset/crate/cratefeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <vector>

#include "analyzer/analyzerscheduledtrack.h"
#include "controllers/keyboard/keyboardeventfilter.h"
#include "library/export/trackexportwizard.h"
#include "library/library.h"
#include "library/library_prefs.h"
Expand Down Expand Up @@ -60,15 +61,19 @@ CrateFeature::CrateFeature(Library* pLibrary,
connectTrackCollection();
}

void CrateFeature::initActions() {
void CrateFeature::initActions(KeyboardEventFilter* pKeyboard) {
m_pCreateCrateAction = make_parented<QAction>(tr("Create New Crate"), this);
connect(m_pCreateCrateAction.get(),
&QAction::triggered,
this,
&CrateFeature::slotCreateCrate);

m_pRenameCrateAction = make_parented<QAction>(tr("Rename"), this);
m_pRenameCrateAction->setShortcut(kRenameSidebarItemShortcutKey);
pKeyboard->registerActionForShortcut(
m_pRenameCrateAction,
ConfigKey("[Library]", "EditItem"),
QKeySequence(kRenameSidebarItemShortcutKey).toString(),
true);
connect(m_pRenameCrateAction.get(),
&QAction::triggered,
this,
Expand Down
2 changes: 1 addition & 1 deletion src/library/trackset/crate/cratefeature.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class CrateFeature : public BaseTrackSetFeature {
void slotUpdateCrateLabels(const QSet<CrateId>& updatedCrateIds);

private:
void initActions();
void initActions(KeyboardEventFilter* pKeyboard);
void connectLibrary(Library* pLibrary);
void connectTrackCollection();

Expand Down

0 comments on commit f957646

Please sign in to comment.