mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-03 23:39:40 +00:00
Merge branch '192-take2' into 'master'
Follow up to !192 See merge request OpenMW/openmw!1808
This commit is contained in:
commit
8644fcf5a4
2 changed files with 28 additions and 24 deletions
|
@ -44,10 +44,10 @@ namespace
|
||||||
QDir currentDir(path);
|
QDir currentDir(path);
|
||||||
if (!currentDir.entryInfoList(fileFilter, QDir::Files).empty()
|
if (!currentDir.entryInfoList(fileFilter, QDir::Files).empty()
|
||||||
|| !currentDir.entryInfoList(dirFilter, QDir::Dirs | QDir::NoDotAndDotDot).empty())
|
|| !currentDir.entryInfoList(dirFilter, QDir::Dirs | QDir::NoDotAndDotDot).empty())
|
||||||
dirs.push_back(currentDir.absolutePath());
|
dirs.push_back(currentDir.canonicalPath());
|
||||||
|
|
||||||
for (const auto& subdir : currentDir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot))
|
for (const auto& subdir : currentDir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot))
|
||||||
contentSubdirs(subdir.absoluteFilePath(), dirs);
|
contentSubdirs(subdir.canonicalFilePath(), dirs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -236,6 +236,10 @@ void Launcher::DataFilesPage::populateFileViews(const QString& contentModelName)
|
||||||
if (!globalDataDir.isEmpty())
|
if (!globalDataDir.isEmpty())
|
||||||
directories.insert(0, globalDataDir);
|
directories.insert(0, globalDataDir);
|
||||||
|
|
||||||
|
// normalize user supplied directories: resolve symlink, convert to native separator, make absolute
|
||||||
|
for (auto& currentDir : directories)
|
||||||
|
currentDir = QDir(QDir::cleanPath(currentDir)).canonicalPath();
|
||||||
|
|
||||||
// add directories, archives and content files
|
// add directories, archives and content files
|
||||||
directories.removeDuplicates();
|
directories.removeDuplicates();
|
||||||
for (const auto& currentDir : directories)
|
for (const auto& currentDir : directories)
|
||||||
|
@ -361,7 +365,7 @@ QStringList Launcher::DataFilesPage::selectedDirectoriesPaths() const
|
||||||
QStringList dirList;
|
QStringList dirList;
|
||||||
for (int i = 0; i < ui.directoryListWidget->count(); ++i)
|
for (int i = 0; i < ui.directoryListWidget->count(); ++i)
|
||||||
{
|
{
|
||||||
if (ui.directoryListWidget->item(i)->background() != Qt::gray)
|
if (ui.directoryListWidget->item(i)->flags() & Qt::ItemIsEnabled)
|
||||||
dirList.append(ui.directoryListWidget->item(i)->text());
|
dirList.append(ui.directoryListWidget->item(i)->text());
|
||||||
}
|
}
|
||||||
return dirList;
|
return dirList;
|
||||||
|
@ -581,7 +585,7 @@ QString Launcher::DataFilesPage::selectDirectory()
|
||||||
if (fileDialog.exec() == QDialog::Rejected)
|
if (fileDialog.exec() == QDialog::Rejected)
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
return fileDialog.selectedFiles()[0];
|
return QDir(fileDialog.selectedFiles()[0]).canonicalPath();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,8 +17,25 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTabWidget" name="tabWidget">
|
<widget class="QTabWidget" name="tabWidget">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>2</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
|
<widget class="QWidget" name="dataTab">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>Content Files</string>
|
||||||
|
</attribute>
|
||||||
|
<layout class="QGridLayout" name="dataTabLayout">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QWidget" name="contentSelectorWidget" native="true"/>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="label_3">
|
||||||
|
<property name="text">
|
||||||
|
<string><html><head/><body><p><span style=" font-style:italic;">note: content files that are not part of current Content List are </span><span style=" font-style:italic; background-color:#00ff00;">highlighted</span></p></body></html></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
<widget class="QWidget" name="dirTab">
|
<widget class="QWidget" name="dirTab">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
<string>Data Directories</string>
|
<string>Data Directories</string>
|
||||||
|
@ -137,23 +154,6 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="dataTab">
|
|
||||||
<attribute name="title">
|
|
||||||
<string>Content Files</string>
|
|
||||||
</attribute>
|
|
||||||
<layout class="QGridLayout" name="dataTabLayout">
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QWidget" name="contentSelectorWidget" native="true"/>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QLabel" name="label_3">
|
|
||||||
<property name="text">
|
|
||||||
<string><html><head/><body><p><span style=" font-style:italic;">note: content files that are not part of current Content List are </span><span style=" font-style:italic; background-color:#00ff00;">highlighted</span></p></body></html></string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<widget class="QWidget" name="tab_2">
|
<widget class="QWidget" name="tab_2">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
<string>Navigation mesh cache</string>
|
<string>Navigation mesh cache</string>
|
||||||
|
@ -212,7 +212,7 @@
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label_4">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Max size</string>
|
<string>Max size</string>
|
||||||
</property>
|
</property>
|
||||||
|
@ -261,7 +261,7 @@
|
||||||
<property name="flat">
|
<property name="flat">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
|
|
Loading…
Reference in a new issue