Skip to content
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

Remove some skin internals from DlgPrefInterface #3891

Merged
merged 13 commits into from
May 26, 2021

Conversation

Holzhaus
Copy link
Member

@Holzhaus Holzhaus commented May 22, 2021

First step to untangle our Skin system a bit, so that we can have both legacy XML skins and QML skins at the same time.

This adds a new Skin class that we can later make multiple subclasses from. For now, this class is only used to simplify DlgPrefInterface.

Prerequisite for my QML skin PRs.

@Holzhaus
Copy link
Member Author

Please ignore the code style issues, I used --no-verify to avoid mass reformattings when moving the legacy files.

@uklotzde
Copy link
Contributor

Is this the first PR that should be merged before introducing the QML skin components?

@Holzhaus
Copy link
Member Author

Should I open a separate PR for the first commit to make this easier to review?

@Holzhaus
Copy link
Member Author

Is this the first PR that should be merged before introducing the QML skin components?

Yes.

Copy link
Contributor

@uklotzde uklotzde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No objections.

@ronso0?

class LegacySkin : public mixxx::skin::Skin {
public:
LegacySkin() = default;
LegacySkin(const QFileInfo& path);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • ctor: explicit
  • dtor: Add an override = default destructor

@uklotzde
Copy link
Contributor

We should keep the skin related changes in 2.3.x to a minimum or shortly release 2.4.0 afterwards to avoid merge conflicts.

Preventing merge conflicts is a valid reason for releasing a new version. Even if those features are not yet visible for users.

@uklotzde uklotzde requested a review from ronso0 May 25, 2021 17:07
@Holzhaus
Copy link
Member Author

We should keep the skin related changes in 2.3.x to a minimum or shortly release 2.4.0 afterwards to avoid merge conflicts.

Preventing merge conflicts is a valid reason for releasing a new version. Even if those features are not yet visible for users.

I mean I could even rebase the renaming commit on 2.3 and open a separate PR for that. That also makes this PR easier to review.

@uklotzde
Copy link
Contributor

Should I open a separate PR for the first commit to make this easier to review?

No, this is mainly reorganization. If it works everything is fine.

@Holzhaus
Copy link
Member Author

Should I open a separate PR for the first commit to make this easier to review?

No, this is mainly reorganization. If it works everything is fine.

Oops, I didn't see that comment and opend #3912. Should I close it or do we want to merge the mass renaming into 2.3 to avoid conflicts?

@daschuer
Copy link
Member

daschuer commented May 25, 2021

Should I close it or do we want to merge the mass renaming into 2.3 to avoid conflicts?

Merging to 2.3 sounds reasonable.

@Holzhaus Holzhaus force-pushed the skin-refactor-pt1 branch from a1f378d to b94d0ee Compare May 25, 2021 22:57
@Holzhaus
Copy link
Member Author

Holzhaus commented May 25, 2021

I rebased on latest main. Ready to review/merge. I'll rebase the follow-up PRs tomorrow.

@Holzhaus
Copy link
Member Author

By the way, this also fixes the situation when you configured a custom skin which is broken. Now it automatically falls back to the default skin. Before, it only used the fallback if the configured skin is missing, not when it's broken.

@Holzhaus
Copy link
Member Author

This has already been approved. Merge?

@uklotzde
Copy link
Contributor

LGTM

@daschuer
Copy link
Member

Unfortunately it segfaults when the skin folder is missing, after the error dialog:

[New Thread 0x7fff3f2fd700 (LWP 11181)]
[New Thread 0x7fff3e24d700 (LWP 11182)]
[New Thread 0x7fff3d6bb700 (LWP 11183)]
critical [Main] "Skin directory does not exist: /home/daniel/workspace/mixxx/res/skins"
critical [Main] "Skin directory does not exist: /home/daniel/workspace/mixxx/res/skins"
warning [Main] Configured skin "LateNight" not found, falling back to default skin "LateNight"
critical [Main] "Skin directory does not exist: /home/daniel/workspace/mixxx/res/skins"
--Type for more, q to quit, c to continue without paging--

Thread 1 "mixxx" received signal SIGSEGV, Segmentation fault.
0x0000555555783eb1 in DlgPrefInterface::slotUpdateSchemes (this=0x55555a83fba0)
at /usr/include/c++/9/bits/shared_ptr_base.h:1020
1020 _M_get() const noexcept
(gdb) bt
#0 0x0000555555783eb1 in DlgPrefInterface::slotUpdateSchemes()
(this=0x55555a83fba0) at /usr/include/c++/9/bits/shared_ptr_base.h:1020
#1 0x0000555555785df0 in DlgPrefInterface::DlgPrefInterface(QWidget*, MixxxMainWindow*, std::shared_ptrmixxx::skin::SkinLoader, QSharedPointer<ConfigObject >) (this=0x55555a83fba0, parent=, mixxx=
0x7fffffffdea0, pSkinLoader=..., pConfig=...)
at /home/daniel/workspace/mixxx/src/preferences/dialog/dlgprefinterface.cpp:123
#2 0x000055555577f0cd in DlgPreferences::DlgPreferences(MixxxMainWindow*, std::shared_ptrmixxx::skin::SkinLoader, std::shared_ptr, std::shared_ptr, std::shared_ptr, std::shared_ptr, LV2Backend*, std::shared_ptr, std::shared_ptr, std::shared_ptr)
(this=0x555558e8d5e0, mixxx=0x7fffffffdea0, pSkinLoader=std::shared_ptrmixxx::skin::SkinLoader (use count 4, weak count 0) = {...}, pSoundManager=..., pPlayerManager=..., pControllerManager=..., pVCManager=
std::shared_ptr (use count 3, weak count 0) = {...}, pLV2Backend=0x555556ad31d0, pEffectsManager=std::shared_ptr (use count 2, weak count 0) = {...}, pSettingsManager=std::shared_ptr (use count 2, weak count 0) = {...}, pLibrary=std::shared_ptr (use count 3, weak count 0) = {...}) at /usr/include/c++/9/bits/atomic_base.h:318
#3 0x000055555575be4d in MixxxMainWindow::MixxxMainWindow(QApplication*, std::shared_ptrmixxx::CoreServices)
--Type for more, q to quit, c to continue without paging--
(this=0x7fffffffdea0, pApp=0x7fffffffde60, pCoreServices=...)
at /usr/include/c++/9/ext/atomicity.h:96
#4 0x000055555571f93a in (anonymous namespace)::runMixxx
(args=..., app=0x7fffffffde60) at /usr/include/c++/9/ext/atomicity.h:96
#5 main(int, char**) (argc=, argv=)
at /home/daniel/workspace/mixxx/src/main.cpp:112

@daschuer
Copy link
Member

It segfaults at the same place when the configured skin is missing:

warning [Main] Configured skin "LateNight" not found, falling back to default skin "LateNight"
--Type <RET> for more, q to quit, c to continue without paging--

Thread 1 "mixxx" received signal SIGSEGV, Segmentation fault.
0x0000555555783eb1 in DlgPrefInterface::slotUpdateSchemes (this=0x55555a8289d0)
    at /usr/include/c++/9/bits/shared_ptr_base.h:1020
1020	      _M_get() const noexcept
(gdb) bt -a
Argument to negate operation not a number.
(gdb) bt 
#0  0x0000555555783eb1 in DlgPrefInterface::slotUpdateSchemes()

@daschuer
Copy link
Member

During shutdown I get this warning:

warning [LibraryScanner 1] QSqlDatabasePrivate::removeDatabase: connection 'MIXXX-2' is still in use, all queries will cease to work.

@daschuer
Copy link
Member

daschuer commented May 26, 2021

During start of LateNight I see various debug assertions:

warning [Main] ControlDoublePrivate::getControl returning NULL for ( "[Channel3]" , "end_of_track" )
critical [Main] DEBUG ASSERT: "flags.testFlag(ControlFlag::NoAssertIfMissing)" in function static QSharedPointer<ControlDoublePrivate> ControlDoublePrivate::getControl(const ConfigKey&, ControlFlags, ControlObject*, bool, bool, bool, double) at /home/daniel/workspace/mixxx/src/control/control.cpp:152
critical [Main] DEBUG ASSERT: "m_pControl || flags.testFlag(ControlFlag::NoAssertIfMissing)" in function void ControlProxy::initialize(ControlFlags) at /home/daniel/workspace/mixxx/src/control/controlproxy.cpp:37
critical [Main] DEBUG ASSERT: "valid() || flags.testFlag(ControlFlag::NoAssertIfMissing)" in function void ControlProxy::initialize(ControlFlags) at /home/daniel/workspace/mixxx/src/control/controlproxy.cpp:38
warning [Main] ControlDoublePrivate::getControl returning NULL for ( "[Channel3]" , "time_remaining" )
critical [Main] DEBUG ASSERT: "flags.testFlag(ControlFlag::NoAssertIfMissing)" in function static QSharedPointer<ControlDoublePrivate> ControlDoublePrivate::getControl(const ConfigKey&, ControlFlags, ControlObject*, bool, bool, bool, double) at /home/daniel/workspace/mixxx/src/control/control.cpp:152
critical [Main] DEBUG ASSERT: "m_pControl || flags.testFlag(ControlFlag::NoAssertIfMissing)" in function void ControlProxy::initialize(ControlFlags) at /home/daniel/workspace/mixxx/src/control/controlproxy.cpp:37
critical [Main] DEBUG ASSERT: "valid() || flags.testFlag(ControlFlag::NoAssertIfMissing)" in function void ControlProxy::initialize(ControlFlags) at /home/daniel/workspace/mixxx/src/control/controlproxy.cpp:38
debug [Main] Created QGLWidget. Context Valid: true Sharing: true
debug [Main] Created QGLWidget. Context Valid: true Sharing: true
debug [Main] Created QGLWidget. Context Valid: true Sharing: true
warning [Main] ControlDoublePrivate::getControl returning NULL for ( "[Channel4]" , "end_of_track" )
critical [Main] DEBUG ASSERT: "flags.testFlag(ControlFlag::NoAssertIfMissing)" in function static QSharedPointer<ControlDoublePrivate> ControlDoublePrivate::getControl(const ConfigKey&, ControlFlags, ControlObject*, bool, bool, bool, double) at /home/daniel/workspace/mixxx/src/control/control.cpp:152
critical [Main] DEBUG ASSERT: "m_pControl || flags.testFlag(ControlFlag::NoAssertIfMissing)" in function void ControlProxy::initialize(ControlFlags) at /home/daniel/workspace/mixxx/src/control/controlproxy.cpp:37
critical [Main] DEBUG ASSERT: "valid() || flags.testFlag(ControlFlag::NoAssertIfMissing)" in function void ControlProxy::initialize(ControlFlags) at /home/daniel/workspace/mixxx/src/control/controlproxy.cpp:38
warning [Main] ControlDoublePrivate::getControl returning NULL for ( "[Channel4]" , "time_remaining" )
critical [Main] DEBUG ASSERT: "flags.testFlag(ControlFlag::NoAssertIfMissing)" in function static QSharedPointer<ControlDoublePrivate> ControlDoublePrivate::getControl(const ConfigKey&, ControlFlags, ControlObject*, bool, bool, bool, double) at /home/daniel/workspace/mixxx/src/control/control.cpp:152
critical [Main] DEBUG ASSERT: "m_pControl || flags.testFlag(ControlFlag::NoAssertIfMissing)" in function void ControlProxy::initialize(ControlFlags) at /home/daniel/workspace/mixxx/src/control/controlproxy.cpp:37
critical [Main] DEBUG ASSERT: "valid() || flags.testFlag(ControlFlag::NoAssertIfMissing)" in function void ControlProxy::initialize(ControlFlags) at /home/daniel/workspace/mixxx/src/control/controlproxy.cpp:38

@daschuer
Copy link
Member

The fall back to the default skin works.

@Holzhaus
Copy link
Member Author

It segfaults at the same place when the configured skin is missing:

warning [Main] Configured skin "LateNight" not found, falling back to default skin "LateNight"
--Type <RET> for more, q to quit, c to continue without paging--

Thread 1 "mixxx" received signal SIGSEGV, Segmentation fault.
0x0000555555783eb1 in DlgPrefInterface::slotUpdateSchemes (this=0x55555a8289d0)
    at /usr/include/c++/9/bits/shared_ptr_base.h:1020
1020	      _M_get() const noexcept
(gdb) bt -a
Argument to negate operation not a number.
(gdb) bt 
#0  0x0000555555783eb1 in DlgPrefInterface::slotUpdateSchemes()

I'll have a look tomorrow. In this case the configured skin is the default skin, so there is no way that Mixxx is able to start anyway.

@Holzhaus
Copy link
Member Author

During shutdown I get this warning:

warning [LibraryScanner 1] QSqlDatabasePrivate::removeDatabase: connection 'MIXXX-2' is still in use, all queries will cease to work.

I see this all the time, even in 2.3 beta. It's always been like that IIRC.

@uklotzde
Copy link
Contributor

During start of LateNight I see various debug assertions:

warning [Main] ControlDoublePrivate::getControl returning NULL for ( "[Channel3]" , "end_of_track" )
critical [Main] DEBUG ASSERT: "flags.testFlag(ControlFlag::NoAssertIfMissing)" in function static QSharedPointer<ControlDoublePrivate> ControlDoublePrivate::getControl(const ConfigKey&, ControlFlags, ControlObject*, bool, bool, bool, double) at /home/daniel/workspace/mixxx/src/control/control.cpp:152
critical [Main] DEBUG ASSERT: "m_pControl || flags.testFlag(ControlFlag::NoAssertIfMissing)" in function void ControlProxy::initialize(ControlFlags) at /home/daniel/workspace/mixxx/src/control/controlproxy.cpp:37
critical [Main] DEBUG ASSERT: "valid() || flags.testFlag(ControlFlag::NoAssertIfMissing)" in function void ControlProxy::initialize(ControlFlags) at /home/daniel/workspace/mixxx/src/control/controlproxy.cpp:38
warning [Main] ControlDoublePrivate::getControl returning NULL for ( "[Channel3]" , "time_remaining" )
critical [Main] DEBUG ASSERT: "flags.testFlag(ControlFlag::NoAssertIfMissing)" in function static QSharedPointer<ControlDoublePrivate> ControlDoublePrivate::getControl(const ConfigKey&, ControlFlags, ControlObject*, bool, bool, bool, double) at /home/daniel/workspace/mixxx/src/control/control.cpp:152
critical [Main] DEBUG ASSERT: "m_pControl || flags.testFlag(ControlFlag::NoAssertIfMissing)" in function void ControlProxy::initialize(ControlFlags) at /home/daniel/workspace/mixxx/src/control/controlproxy.cpp:37
critical [Main] DEBUG ASSERT: "valid() || flags.testFlag(ControlFlag::NoAssertIfMissing)" in function void ControlProxy::initialize(ControlFlags) at /home/daniel/workspace/mixxx/src/control/controlproxy.cpp:38
debug [Main] Created QGLWidget. Context Valid: true Sharing: true
debug [Main] Created QGLWidget. Context Valid: true Sharing: true
debug [Main] Created QGLWidget. Context Valid: true Sharing: true
warning [Main] ControlDoublePrivate::getControl returning NULL for ( "[Channel4]" , "end_of_track" )
critical [Main] DEBUG ASSERT: "flags.testFlag(ControlFlag::NoAssertIfMissing)" in function static QSharedPointer<ControlDoublePrivate> ControlDoublePrivate::getControl(const ConfigKey&, ControlFlags, ControlObject*, bool, bool, bool, double) at /home/daniel/workspace/mixxx/src/control/control.cpp:152
critical [Main] DEBUG ASSERT: "m_pControl || flags.testFlag(ControlFlag::NoAssertIfMissing)" in function void ControlProxy::initialize(ControlFlags) at /home/daniel/workspace/mixxx/src/control/controlproxy.cpp:37
critical [Main] DEBUG ASSERT: "valid() || flags.testFlag(ControlFlag::NoAssertIfMissing)" in function void ControlProxy::initialize(ControlFlags) at /home/daniel/workspace/mixxx/src/control/controlproxy.cpp:38
warning [Main] ControlDoublePrivate::getControl returning NULL for ( "[Channel4]" , "time_remaining" )
critical [Main] DEBUG ASSERT: "flags.testFlag(ControlFlag::NoAssertIfMissing)" in function static QSharedPointer<ControlDoublePrivate> ControlDoublePrivate::getControl(const ConfigKey&, ControlFlags, ControlObject*, bool, bool, bool, double) at /home/daniel/workspace/mixxx/src/control/control.cpp:152
critical [Main] DEBUG ASSERT: "m_pControl || flags.testFlag(ControlFlag::NoAssertIfMissing)" in function void ControlProxy::initialize(ControlFlags) at /home/daniel/workspace/mixxx/src/control/controlproxy.cpp:37
critical [Main] DEBUG ASSERT: "valid() || flags.testFlag(ControlFlag::NoAssertIfMissing)" in function void ControlProxy::initialize(ControlFlags) at /home/daniel/workspace/mixxx/src/control/controlproxy.cpp:38

Unrelated. This is a known issue on main with a fresh profile that has already been reported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants