mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
Properly show shaderpacks in export
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
(cherry picked from commit d625a28112)
This commit is contained in:
parent
993243b6a3
commit
6ef89db08e
3 changed files with 31 additions and 3 deletions
|
|
@ -266,7 +266,21 @@ bool FileIgnoreProxy::filterAcceptsRow(int sourceRow, const QModelIndex& sourceP
|
|||
|
||||
bool FileIgnoreProxy::ignoreFile(QFileInfo fileInfo) const
|
||||
{
|
||||
return m_ignoreFiles.contains(fileInfo.fileName()) || m_ignoreFilePaths.covers(relPath(fileInfo.absoluteFilePath()));
|
||||
if (m_ignoreFiles.contains(fileInfo.fileName())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
for (const auto& suffix : m_ignoreFilesSuffixes) {
|
||||
if (fileInfo.fileName().endsWith(suffix)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_ignoreFilePaths.covers(relPath(fileInfo.absoluteFilePath()))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool FileIgnoreProxy::filterFile(const QFileInfo& file) const
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ class FileIgnoreProxy : public QSortFilterProxyModel {
|
|||
|
||||
// list of file names that need to be removed completely from model
|
||||
inline QStringList& ignoreFilesWithName() { return m_ignoreFiles; }
|
||||
inline QStringList& ignoreFilesWithSuffix() { return m_ignoreFilesSuffixes; }
|
||||
// list of relative paths that need to be removed completely from model
|
||||
inline SeparatorPrefixTree<'/'>& ignoreFilesWithPath() { return m_ignoreFilePaths; }
|
||||
|
||||
|
|
@ -85,5 +86,6 @@ class FileIgnoreProxy : public QSortFilterProxyModel {
|
|||
const QString m_root;
|
||||
SeparatorPrefixTree<'/'> m_blocked;
|
||||
QStringList m_ignoreFiles;
|
||||
QStringList m_ignoreFilesSuffixes;
|
||||
SeparatorPrefixTree<'/'> m_ignoreFilePaths;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -95,6 +95,7 @@ ExportPackDialog::ExportPackDialog(MinecraftInstancePtr instance, QWidget* paren
|
|||
m_proxy->ignoreFilesWithPath().insert(FS::PathCombine(prefix, path));
|
||||
}
|
||||
m_proxy->ignoreFilesWithName().append({ ".DS_Store", "thumbs.db", "Thumbs.db" });
|
||||
m_proxy->ignoreFilesWithSuffix().append(".pw.toml");
|
||||
m_proxy->setSourceModel(model);
|
||||
m_proxy->loadBlockedPathsFromFile(ignoreFileName());
|
||||
|
||||
|
|
@ -103,8 +104,19 @@ ExportPackDialog::ExportPackDialog(MinecraftInstancePtr instance, QWidget* paren
|
|||
MinecraftInstance* mcInstance = dynamic_cast<MinecraftInstance*>(instance.get());
|
||||
if (mcInstance) {
|
||||
for (auto resourceModel : mcInstance->resourceLists()) {
|
||||
if (resourceModel && resourceModel->indexDir().exists())
|
||||
m_proxy->ignoreFilesWithPath().insert(instanceRoot.relativeFilePath(resourceModel->indexDir().absolutePath()));
|
||||
if (resourceModel == nullptr) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!resourceModel->indexDir().exists()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (resourceModel->indexDir() == resourceModel->indexDir()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
m_proxy->ignoreFilesWithPath().insert(instanceRoot.relativeFilePath(resourceModel->indexDir().absolutePath()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue