solid: remove redundant file existence check in audio interface helper method

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2021-07-05 03:08:54 +03:00
parent 7f5c2abfe8
commit 2a13a7aa8c

View file

@ -309,8 +309,6 @@ QString UdevAudioInterfacePrivate::deviceName(char type)
QByteArray UdevAudioInterfacePrivate::grepHelper(const QString& path, const QByteArray& grepValue)
{
QFile file(path);
if (file.exists()) {
if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
QByteArray line = file.readLine();
while(!line.isNull()) {
@ -323,9 +321,5 @@ QByteArray UdevAudioInterfacePrivate::grepHelper(const QString& path, const QByt
} else {
qDebug() << "grepHelper: Cannot open file: " << path;
}
} else {
qDebug() << "grepHelper: File does not exists: " << path;
}
return QByteArray();
}