mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-28 22:09:42 +00:00
Follow up to !192
This commit is contained in:
parent
66a96bfa5e
commit
ad1ab1c880
2 changed files with 28 additions and 24 deletions
|
@ -44,10 +44,10 @@ namespace
|
|||
QDir currentDir(path);
|
||||
if (!currentDir.entryInfoList(fileFilter, QDir::Files).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))
|
||||
contentSubdirs(subdir.absoluteFilePath(), dirs);
|
||||
contentSubdirs(subdir.canonicalFilePath(), dirs);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -236,6 +236,10 @@ void Launcher::DataFilesPage::populateFileViews(const QString& contentModelName)
|
|||
if (!globalDataDir.isEmpty())
|
||||
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
|
||||
directories.removeDuplicates();
|
||||
for (const auto& currentDir : directories)
|
||||
|
@ -361,7 +365,7 @@ QStringList Launcher::DataFilesPage::selectedDirectoriesPaths() const
|
|||
QStringList dirList;
|
||||
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());
|
||||
}
|
||||
return dirList;
|
||||
|
@ -581,7 +585,7 @@ QString Launcher::DataFilesPage::selectDirectory()
|
|||
if (fileDialog.exec() == QDialog::Rejected)
|
||||
return {};
|
||||
|
||||
return fileDialog.selectedFiles()[0];
|
||||
return QDir(fileDialog.selectedFiles()[0]).canonicalPath();
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -17,8 +17,25 @@
|
|||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>2</number>
|
||||
<number>0</number>
|
||||
</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">
|
||||
<attribute name="title">
|
||||
<string>Data Directories</string>
|
||||
|
@ -137,23 +154,6 @@
|
|||
</item>
|
||||
</layout>
|
||||
</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">
|
||||
<attribute name="title">
|
||||
<string>Navigation mesh cache</string>
|
||||
|
@ -212,7 +212,7 @@
|
|||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Max size</string>
|
||||
</property>
|
||||
|
@ -261,7 +261,7 @@
|
|||
<property name="flat">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
|
|
Loading…
Reference in a new issue