Commit c1f06eaa authored by David Faure's avatar David Faure
Browse files

Fix "QFSFileEngine::open: No file name specified" warning

Summary:
The transition repository returns an empty string in
assetPreferredListPath(), which QFile doesn't really like.

Test Plan: Builds

Reviewers: mardelle

Differential Revision: https://phabricator.kde.org/D22279
parent b8d7393b
Pipeline #4893 failed with stage
in 1 second
......@@ -42,10 +42,10 @@ template <typename AssetType> void AbstractAssetsRepository<AssetType>::init()
setlocale(LC_NUMERIC_MASK, nullptr);
#endif
// Parse effects blacklist
// Parse blacklist
parseAssetList(assetBlackListPath(), m_blacklist);
// Parse preferred effects' list
// Parse preferred list
parseAssetList(assetPreferredListPath(), m_preferred_list);
// Retrieve the list of MLT's available assets.
......@@ -113,6 +113,8 @@ template <typename AssetType> void AbstractAssetsRepository<AssetType>::init()
template <typename AssetType> void AbstractAssetsRepository<AssetType>::parseAssetList(const QString &filePath, QSet<QString> &destination)
{
if (filePath.isEmpty())
return;
QFile assetFile(filePath);
if (assetFile.open(QIODevice::ReadOnly)) {
QTextStream stream(&assetFile);
......@@ -123,7 +125,6 @@ template <typename AssetType> void AbstractAssetsRepository<AssetType>::parseAss
destination.insert(line);
}
}
assetFile.close();
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment