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

Library-layout fix GUI lag #1740

Closed
wants to merge 12 commits into from
Closed

Library-layout fix GUI lag #1740

wants to merge 12 commits into from

Conversation

jmigual
Copy link
Contributor

@jmigual jmigual commented Jul 5, 2018

Fix bug re-introduced in #1714

However there's a problem when adding tracks as the signal tracksAdded(QSet<TrackId>) from TrackDAO does not provide all the ids for the new added tracks and only a small subsample.

Does anyone have an idea of why this may happen? Am I using the proper signal to see if new tracks have been added?

@jmigual
Copy link
Contributor Author

jmigual commented Jul 6, 2018

The build fails because it does not find the method intersects from QSet. Which version of Qt 5 are we using for POSIX builds? Qt 5.6 already has this method in its documentation.

@Be-ing
Copy link
Contributor

Be-ing commented Jul 6, 2018

The build fails because it does not find the method intersects from QSet. Which version of Qt 5 are we using for POSIX builds? Qt 5.6 already has this method in its documentation.

It looks like Travis is using an ancient version of Ubuntu stuck on Qt 5.2. Edit .travis.yml to update it.

Travis' macOS builds are using Qt 5.11. I am not sure why those are failing, but it is not related to this PR. I attempted to fix that in #1722.

Copy link
Contributor

@Be-ing Be-ing left a comment

Choose a reason for hiding this comment

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

Thank you for continuing to work on this.

Please move all SQL code into a separate class. There should be zero SQL in GUI classes. Refer to #1304 for an example.

However there's a problem when adding tracks as the signal tracksAdded(QSet) from TrackDAO does not provide all the ids for the new added tracks and only a small subsample.

I can confirm that adding tracks to the tree is not working. I tried rescanning my library to add new tracks. While they appeared in the track table, they did not appear in the tree.

@@ -86,8 +86,8 @@ class TreeItem final {
m_label = label;
}

inline const QString& getLabel() const {
count = getTrackCount();
Copy link
Contributor

Choose a reason for hiding this comment

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

Please do not make commits that do not compile. This makes it more cumbersome to use git bisect later. If you realize after you make a commit that it does not compile, use git commit --amend or git rebase -i to fix it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh sorry I won't do it again

@@ -86,8 +86,8 @@ class TreeItem final {
m_label = label;
}

inline const QString& getLabel() const {
count = getTrackCount();
inline const QString getLabel() const {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why doesn't this return a reference anymore?

@@ -102,6 +102,14 @@ TreeItem* TreeItem::appendChild(
return pChild;
}

TreeItem*TreeItem::insertChild(int row, const QString& label, const QVariant& data) {
Copy link
Contributor

Choose a reason for hiding this comment

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

"TreeItem*TreeItem::insertChild"? Does this commit compile?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am amazed that this does compile in fact. I will check it again and "fix" it just to avoid possible problems.

@daschuer
Copy link
Member

daschuer commented Jul 6, 2018

The build fails because it does not find the method intersects from QSet. Which version of Qt 5 are we using for POSIX builds? Qt 5.6 already has this method in its documentation.

Ubuntu Trusty, supported until April 2019 has Qt5.2.
Ubuntu Xenial, supported until April 2021 has QT5.5

The libraryredesign release 2.3 is scheduled for 2019-03-31 so I am afraid we should head for a alternative solution.

I propose to add a wrapper into util/compatibility.h and re-implement the function
https://github.com/qt/qtbase/blob/a37dd93defd91b79fb6730d0ff0515a66a0d3972/src/corelib/tools/qset.h#L313

@Be-ing
Copy link
Contributor

Be-ing commented Jul 6, 2018

Ubuntu Trusty, supported until April 2019 has Qt5.2.

Supported by Canonical, which is a company that pays people to continue to backport critical fixes to old packages. Applications have zero obligation to ensure their new versions work on old operating systems, nor is this common practice. Qt 5.2 was released in December 2013. Following the logic that new versions of Mixxx must support the oldest OS supported by Canonical, Mixxx cannot use new Qt features until 6 years after they have been released! I find that ridiculous. This isn't even what Canonical does. They don't ship major new versions of applications for LTS releases; they only make minimal fixes. Ubuntu's Trusty repositories still ship Mixxx 1.10.1.

I propose to add a wrapper into util/compatibility.h and re-implement the function

No. Qt has already implemented the function. We should not duplicate code. It is not applications' responsibility to overcompensate for a users' out of date system.

@Be-ing
Copy link
Contributor

Be-ing commented Jul 6, 2018

From Ubuntu's LTS policy:

we define the LTS to be:
Enterprise Focused: We are targeting server and multiple desktop installations, where the average user is moderately risk averse.
...
clearly state that it is not:
A Feature-Based Release: We will focus on hardening functionality of existing features, versus introducing new ones
Cutting Edge

This is the opposite of new Mixxx releases, which are focused on providing new features for use on personal laptops.

@daschuer
Copy link
Member

daschuer commented Jul 7, 2018

In the history of Mixxx we have always supported all supported Ubuntu version if possible with reasonable effort.
Here we are talking about just a few lines wrapping code, no reason to break Xenial for this, which is still the most used distribution.
I agree, that we can breake this strategy for really hard to solve issues.

@jmigual
Copy link
Contributor Author

jmigual commented Jul 7, 2018

Please move all SQL code into a separate class. There should be zero SQL in GUI classes. Refer to #1304 for an example.

Ok, I will move the code as soon as I can work on it again (until August)

Regarding the Qt issue I think that we should discuss it in the mailing list or Zulip and decide in a Qt version for the next release.
Can't we just deploy a different Qt version in Ubuntu with our binaries?

@daschuer
Copy link
Member

daschuer commented Jul 7, 2018

Can't we just deploy a different Qt version in Ubuntu with our binaries?

This might be get ripped off by the package maintainer. Here It is IMHO straight forward to backport the Qt 5.6 function. No need to ditch Xenial compatibility here.

@Be-ing
Copy link
Contributor

Be-ing commented Jul 7, 2018

Zulip discussion: https://mixxx.zulipchat.com/#narrow/stream/109171-development/topic/minimum.20requirements.20policy

In the history of Mixxx we have always supported all supported Ubuntu version if possible with reasonable effort.

And here we are publishing our first Qt5 release as upstream is starting to plan for Qt6.

Ok, I will move the code as soon as I can work on it again (until August)

Okay thank you. I recognize that will take a lot of work. It doesn't necessarily have to be done in this pull request. We'll never get database transactions out of the GUI thread or move to QML with such tight coupling of GUI classes and SQL code.

Can't we just deploy a different Qt version in Ubuntu with our binaries?

Statically linking a small library may be reasonable, but Qt is huge.

@uklotzde
Copy link
Contributor

uklotzde commented Jul 9, 2018

Did you knownotice that LibraryScanner hosts its own instance of TrackDAO in a separate thread? It forwards added tracks one by one to the main TrackDAO via databaseTrackAdded(). Unfortunately these tracks do not result in any tracksAdded() signal from the main TrackDAO, as far as I understand.

@nikmartin
Copy link
Contributor

FYI, because of this PR I built https://github.com/nikmartin/mixxxLibraryBuilder to build a large library of very small tagged, valid mp3 files to test this branch with. A 1,000,000 mp3 library is only .5gb

@github-actions
Copy link

This PR is marked as stale because it has been open 90 days with no activity.

@github-actions github-actions bot added the stale Stale issues that haven't been updated for a long time. label Oct 20, 2020
@ronso0 ronso0 marked this pull request as draft February 14, 2021 21:56
@Holzhaus
Copy link
Member

Holzhaus commented Apr 2, 2021

The minimum requirements issue should have fixed itself by now. This this PR still relevant or should we close this?

@ronso0
Copy link
Member

ronso0 commented Apr 2, 2021

The target branch is stale and unmergable IIRC due to major perfomrmance issues.
Can be closed IMO.

@ronso0 ronso0 closed this Apr 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Stale issues that haven't been updated for a long time.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants