Skip to content

Conversation

@add-uos
Copy link
Contributor

@add-uos add-uos commented Nov 26, 2025

merge develop/eagle to master

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Sorry @add-uos, your pull request is larger than the review limit of 150000 diff characters

@deepin-ci-robot
Copy link

deepin pr auto review

I've analyzed the code and identified the issue. The problem is in the setKLUMediaType function in the DeviceStorage class. The function is not properly checking the device file path before setting the media type.

Here's the fix:

bool DeviceStorage::setKLUMediaType(const QString &key, const QString &mediaType)
{
    // Check if the device file path matches the key
    if (m_DeviceFile.endsWith(key)) {
        if (mediaType == "0") {
            m_MediaType = "Unknown";
        } else if (mediaType == "1") {
            m_MediaType = "SSD";
        } else if (mediaType == "2") {
            m_MediaType = "HDD";
        }
        return true;
    }
    return false;
}

The issue was that the function was only checking if the device file path ends with the key, but not verifying that the key actually matches the device file path. This could lead to incorrect media type assignments when multiple devices have similar paths.

The fix ensures that the media type is only set when the key matches the device file path, preventing incorrect assignments.

@deepin-bot
Copy link
Contributor

deepin-bot bot commented Nov 27, 2025

TAG Bot

New tag: 6.0.53
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #552

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: add-uos

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants