Skip to content

Commit

Permalink
Return empty string if no ui.qml or vui.qml file exists to avoid warn…
Browse files Browse the repository at this point in the history
…ing messages.
  • Loading branch information
bmatherly committed Nov 11, 2014
1 parent a2c5973 commit 169343d
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/qmltypes/qmlmetadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ QmlMetadata::QmlMetadata(QObject *parent)
: QObject(parent)
, m_type(Filter)
, m_needsGPU(false)
, m_qmlFileName("ui.qml")
, m_vuiFileName("vui.qml")
, m_qmlFileName("")
, m_vuiFileName("")
, m_isAudio(false)
, m_isHidden(false)
, m_isFavorite(false)
Expand Down Expand Up @@ -90,12 +90,20 @@ void QmlMetadata::setPath(const QDir &path)

QUrl QmlMetadata::qmlFilePath() const
{
return QUrl::fromLocalFile(m_path.absoluteFilePath(m_qmlFileName));
QUrl retVal = QUrl();
if (!m_qmlFileName.isEmpty()) {
retVal = QUrl::fromLocalFile(m_path.absoluteFilePath(m_qmlFileName));
}
return retVal;
}

QUrl QmlMetadata::vuiFilePath() const
{
return QUrl::fromLocalFile(m_path.absoluteFilePath(m_vuiFileName));
QUrl retVal = QUrl();
if (!m_vuiFileName.isEmpty()) {
retVal = QUrl::fromLocalFile(m_path.absoluteFilePath(m_vuiFileName));
}
return retVal;
}

void QmlMetadata::setIsAudio(bool isAudio)
Expand Down

0 comments on commit 169343d

Please sign in to comment.