-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix CoreServices initalisation order #4058
Merged
Merged
Changes from 6 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
e8541a5
Fix uninitialized variable
daschuer ef2bcd1
Add function preInitialize() to CoreServices
daschuer 4ffe39c
Move Stats and translation init to peInitialize().
daschuer 2684e24
Merge remote-tracking branch 'upstream/main' into lp1934655
daschuer 8a38e81
Move initalizer to the header
daschuer 419a3df
Fix unused warning
daschuer 14a61dc
Merge remote-tracking branch 'upstream/main' into lp1934655
daschuer 434f6cf
move pCoreServices->preInitialize() to runMixxx
daschuer b1f0434
move preInitalize to the constructor and make init functions private
daschuer 6780078
Merge remote-tracking branch 'upstream/main' into lp1934655
daschuer acda4cc
Remove initalizing of m_pLV2Backend
daschuer 9c9e00f
inline CoreService::preInitalize()
daschuer d0eb104
over runtime measurement to CoreServices c-tor
daschuer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,8 +37,12 @@ class CoreServices : public QObject { | |
~CoreServices() = default; | ||
|
||
void initializeSettings(); | ||
// FIXME: should be private, but WMainMenuBar needs it initialized early | ||
void initializeKeyboard(); | ||
void initializeLogging(); | ||
|
||
// The short first run that is done without start up screen | ||
void preInitialize(QApplication* pApp); | ||
// The secondary long run which should be called after displaying the start up screen | ||
void initialize(QApplication* pApp); | ||
Holzhaus marked this conversation as resolved.
Show resolved
Hide resolved
|
||
void shutdown(); | ||
|
||
|
@@ -112,7 +116,7 @@ class CoreServices : public QObject { | |
std::shared_ptr<SettingsManager> m_pSettingsManager; | ||
std::shared_ptr<EffectsManager> m_pEffectsManager; | ||
// owned by EffectsManager | ||
LV2Backend* m_pLV2Backend; | ||
LV2Backend* m_pLV2Backend{}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. unrelated change, please remove from this PR |
||
std::shared_ptr<EngineMaster> m_pEngine; | ||
std::shared_ptr<SoundManager> m_pSoundManager; | ||
std::shared_ptr<PlayerManager> m_pPlayerManager; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this method really necessary? Couldn't we just make it part of the CoreServices constructor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any need to create the
CoreServices
object before creating aQApplication
? If not, we should move this into the constructor. Less possibilities to use this class wrong or miss an initialization step.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ping
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There does not seem to be a purpose for this method. Move the code directly into the constructor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is just documentation support.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this makes the code more readable; it makes me wonder why the function exists. I think it would be better to move the code into the constructor and add a comment: "These need to be initialized before the GUI. They are fast to initialize. Everything else is deferred to the
initialize
method so the GUI can show the progress."There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the current state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't to bike-shed, but
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function is private.