1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-30 09:15:38 +00:00

Merge branch 'minor-cleanup' into 'master'

Use dedicated function to convert QString to std::filesystem::path

See merge request OpenMW/openmw!2636
This commit is contained in:
psi29a 2023-01-21 16:36:07 +00:00
commit 757cf7098d
2 changed files with 4 additions and 5 deletions

View file

@ -258,9 +258,7 @@ void Launcher::DataFilesPage::populateFileViews(const QString& contentModelName)
}
// deactivate data-local and global data directory: they are always included
const auto tmp = currentDir.toUtf8();
if (currentDir == mDataLocal
|| std::filesystem::path(Misc::StringUtils::stringToU8String(tmp)) == globalDataDir)
if (currentDir == mDataLocal || Files::pathFromQString(currentDir) == globalDataDir)
{
auto flags = item->flags();
item->setFlags(flags & ~(Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled | Qt::ItemIsEnabled));
@ -725,7 +723,7 @@ void Launcher::DataFilesPage::addArchivesFromDir(const QString& path)
for (const auto& fileinfo : dir.entryInfoList())
{
const auto absPath = fileinfo.absoluteFilePath();
if (Bsa::CompressedBSAFile::detectVersion(absPath.toStdString()) == Bsa::BSAVER_UNKNOWN)
if (Bsa::CompressedBSAFile::detectVersion(Files::pathFromQString(absPath)) == Bsa::BSAVER_UNKNOWN)
continue;
const auto fileName = fileinfo.fileName();

View file

@ -1,6 +1,7 @@
#include "cellnameloader.hpp"
#include <components/esm3/loadcell.hpp>
#include <components/files/qtconversion.hpp>
QSet<QString> CellNameLoader::getCellNames(QStringList& contentPaths)
{
@ -12,7 +13,7 @@ QSet<QString> CellNameLoader::getCellNames(QStringList& contentPaths)
{
if (contentPath.endsWith(".omwscripts", Qt::CaseInsensitive))
continue;
esmReader.open(contentPath.toStdString());
esmReader.open(Files::pathFromQString(contentPath));
// Loop through all records
while (esmReader.hasMoreRecs())