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

Fix various compiler warnings in main branch #3320

Merged
merged 7 commits into from
Nov 15, 2020

Conversation

Holzhaus
Copy link
Member

No description provided.

Fixes:

    src/widget/wsearchrelatedtracksmenu.cpp:79:5: error: Pass a context object as 2nd singleShot parameter [-Wclazy-connect-3arg-lambda]
        addAction(
        ^
Fixes:

    src/widget/wsearchrelatedtracksmenu.cpp:98:5: error: auto deduced to be QStringBuilder instead of QString. Possible crash. [-Wclazy-auto-unexpected-qstringbuilder]
        const auto actionTextPrefixWithSeparator =
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        const QString actionTextPrefixWithSeparator
    src/widget/wsearchrelatedtracksmenu.cpp:321:13: error: auto deduced to be QStringBuilder instead of QString. Possible crash. [-Wclazy-auto-unexpected-qstringbuilder]
                const auto locationPathWithTerminator =
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                const QString locationPathWithTerminator
Fixes:

    src/library/dao/playlistdao.cpp:177:9: error: c++11 range-loop might detach Qt container (QList) [-Wclazy-range-loop]
            for (const auto& trackId : getTrackIds(playlistId)) {
            ^
@uklotzde
Copy link
Contributor

Thanks for taking this task, Jan! It was also on my list, but didn't have to time to start it ;)

// TODO: QSet<T>::fromList(const QList<T>&) is deprecated and should be
// replaced with QSet<T>(list.begin(), list.end()).
// However, the proposed alternative has just been introduced in Qt
// 5.14. Until the minimum required Qt version of Mixx is increased,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// 5.14. Until the minimum required Qt version of Mixx is increased,
// 5.14. Until the minimum required Qt version of Mixxx is increased,

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.

LGTM

@@ -78,6 +78,7 @@ void WSearchRelatedTracksMenu::addTriggerSearchAction(
elidableTextSuffix);
addAction(
mixxx::escapeTextPropertyWithoutShortcuts(elidedActionText),
this,
Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch 👍 This is easy to get wrong. Though here it is not essential, because everything happens in the UI thread.

@@ -95,7 +96,7 @@ QString WSearchRelatedTracksMenu::elideActionText(
// This should never fail
return actionTextPrefix;
}
const auto actionTextPrefixWithSeparator =
const QString actionTextPrefixWithSeparator =
Copy link
Contributor

Choose a reason for hiding this comment

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

This warning is a false positive if at least one argument is a QString as is here. But it doesn't hurt to be explicit.

@uklotzde
Copy link
Contributor

Waiting for at least one of the macOS builds to finish, just in case.

@uklotzde
Copy link
Contributor

@Be-ing I'll fix the typo right before merging.

@uklotzde
Copy link
Contributor

There are many more of those "Mixx" typos that need to be fixed separately starting with 2.3.

@uklotzde
Copy link
Contributor

macOS build passed. Merging.

@uklotzde uklotzde merged commit c441512 into mixxxdj:main Nov 15, 2020
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