src: use FilePath in FileSystem::getFileNamesFromDirectory

This commit is contained in:
malte_langkabel
2017-05-11 16:30:14 +02:00
parent 156c3d4b9f
commit 40157039b4
7 changed files with 43 additions and 27 deletions
+3 -3
View File
@@ -40,13 +40,13 @@ namespace utility
{
std::vector<std::string> extensions;
extensions.push_back(extension);
std::vector<std::string> fontFileNames = FileSystem::getFileNamesFromDirectory(path, extensions);
std::vector<FilePath> fontFilePaths = FileSystem::getFilePathsFromDirectory(path, extensions);
std::set<int> loadedFontIds;
for (const std::string& fontFileName: fontFileNames)
for (const FilePath& fontFilePath: fontFilePaths)
{
QFile file(fontFileName.c_str());
QFile file(fontFilePath.str().c_str());
if (file.open(QIODevice::ReadOnly))
{
int id = QFontDatabase::addApplicationFontFromData(file.readAll());
@@ -16,12 +16,7 @@ QtProjectWizzardContentPreferences::QtProjectWizzardContentPreferences(
, m_oldColorSchemeIndex(-1)
, m_newColorSchemeIndex(-1)
{
std::vector<std::string> colorSchemePaths =
FileSystem::getFileNamesFromDirectory(ResourcePaths::getColorSchemesPath(), std::vector<std::string>(1, ".xml"));
for (const std::string& colorScheme : colorSchemePaths)
{
m_colorSchemePaths.push_back(FilePath(colorScheme));
}
m_colorSchemePaths = FileSystem::getFilePathsFromDirectory(ResourcePaths::getColorSchemesPath(), std::vector<std::string>(1, ".xml"));
}
QtProjectWizzardContentPreferences::~QtProjectWizzardContentPreferences()