fb: remove unnecessary casts

This commit is contained in:
Aleix Pol 2021-04-26 15:37:41 +02:00
parent 0b14af5624
commit af6f95b2eb

View file

@ -103,11 +103,14 @@ bool FramebufferBackend::initialize()
{
setSoftwareCursorForced(true);
QString framebufferDevice = deviceIdentifier().constData();
QByteArray framebufferDevice = deviceIdentifier();
if (framebufferDevice.isEmpty()) {
framebufferDevice = QString(Udev().listFramebuffers().at(0)->devNode());
const auto fbs = Udev().listFramebuffers();
if (fbs.size() > 0) {
framebufferDevice = fbs.at(0)->devNode();
}
int fd = open(framebufferDevice.toUtf8().constData(), O_RDWR | O_CLOEXEC);
}
int fd = open(framebufferDevice.constData(), O_RDWR | O_CLOEXEC);
qCDebug(KWIN_FB) << "Using frame buffer device:" << framebufferDevice;
if (fd < 0) {
qCWarning(KWIN_FB) << "failed to open frame buffer device:" << framebufferDevice;