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: add HID error message upon failed open #14184

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

acolombier
Copy link
Member

@acolombier acolombier commented Jan 18, 2025

Before this fix

 controller.traktorkontrols4mk3af083:warning [Controller] Failed. Trying to open with make, model & serial no: 6092 5920 "6EE2AF08"

With this fix

 controller.traktorkontrols4mk3af083:warning [Controller] Failed. Trying to open with make, model & serial no: 6092 5920 "6EE2AF08" : "Failed to open a device with path '/dev/hidraw10': No such file or directory"

I'm not very expert with QDebug formatting, so all ears for some improvement there! (remove the " or space at the left of : for example)

Copy link
Member

@daschuer daschuer left a comment

Choose a reason for hiding this comment

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

I think the most straight forward way for formatting is using QString.arg() and %1 ...


class LegacyControllerMapping;

namespace {
constexpr size_t kMaxHidErrorMessageSize = 512;
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
}
} // namespace

<< m_deviceInfo.getVendorId() << m_deviceInfo.getProductId()
<< m_deviceInfo.getSerialNumber();
qCWarning(m_logBase)
<< "Failed. Trying to open with make, model & serial no:"
Copy link
Member

Choose a reason for hiding this comment

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

make, model is hard to understand for me. How about:

Suggested change
<< "Failed. Trying to open with make, model & serial no:"
<< "Failed to open with ID (vendor product "serial"):

<< "(This may only open the first of multiple identical devices.)";
qCWarning(m_logBase)
<< "Unable to open specific HID device" << getName()
<< "Trying now with just make and model."
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<< "Trying now with just make and model."
<< "Trying now with just vendor and product ID."

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

Successfully merging this pull request may close these issues.

2 participants