Properly show shaderpacks in export
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
@@ -266,7 +266,21 @@ bool FileIgnoreProxy::filterAcceptsRow(int sourceRow, const QModelIndex& sourceP
|
|||||||
|
|
||||||
bool FileIgnoreProxy::ignoreFile(QFileInfo fileInfo) const
|
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
|
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
|
// list of file names that need to be removed completely from model
|
||||||
inline QStringList& ignoreFilesWithName() { return m_ignoreFiles; }
|
inline QStringList& ignoreFilesWithName() { return m_ignoreFiles; }
|
||||||
|
inline QStringList& ignoreFilesWithSuffix() { return m_ignoreFilesSuffixes; }
|
||||||
// list of relative paths that need to be removed completely from model
|
// list of relative paths that need to be removed completely from model
|
||||||
inline SeparatorPrefixTree<'/'>& ignoreFilesWithPath() { return m_ignoreFilePaths; }
|
inline SeparatorPrefixTree<'/'>& ignoreFilesWithPath() { return m_ignoreFilePaths; }
|
||||||
|
|
||||||
@@ -85,5 +86,6 @@ class FileIgnoreProxy : public QSortFilterProxyModel {
|
|||||||
const QString m_root;
|
const QString m_root;
|
||||||
SeparatorPrefixTree<'/'> m_blocked;
|
SeparatorPrefixTree<'/'> m_blocked;
|
||||||
QStringList m_ignoreFiles;
|
QStringList m_ignoreFiles;
|
||||||
|
QStringList m_ignoreFilesSuffixes;
|
||||||
SeparatorPrefixTree<'/'> m_ignoreFilePaths;
|
SeparatorPrefixTree<'/'> m_ignoreFilePaths;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -95,6 +95,7 @@ ExportPackDialog::ExportPackDialog(MinecraftInstancePtr instance, QWidget* paren
|
|||||||
m_proxy->ignoreFilesWithPath().insert(FS::PathCombine(prefix, path));
|
m_proxy->ignoreFilesWithPath().insert(FS::PathCombine(prefix, path));
|
||||||
}
|
}
|
||||||
m_proxy->ignoreFilesWithName().append({ ".DS_Store", "thumbs.db", "Thumbs.db" });
|
m_proxy->ignoreFilesWithName().append({ ".DS_Store", "thumbs.db", "Thumbs.db" });
|
||||||
|
m_proxy->ignoreFilesWithSuffix().append(".pw.toml");
|
||||||
m_proxy->setSourceModel(model);
|
m_proxy->setSourceModel(model);
|
||||||
m_proxy->loadBlockedPathsFromFile(ignoreFileName());
|
m_proxy->loadBlockedPathsFromFile(ignoreFileName());
|
||||||
|
|
||||||
@@ -103,8 +104,19 @@ ExportPackDialog::ExportPackDialog(MinecraftInstancePtr instance, QWidget* paren
|
|||||||
MinecraftInstance* mcInstance = dynamic_cast<MinecraftInstance*>(instance.get());
|
MinecraftInstance* mcInstance = dynamic_cast<MinecraftInstance*>(instance.get());
|
||||||
if (mcInstance) {
|
if (mcInstance) {
|
||||||
for (auto resourceModel : mcInstance->resourceLists()) {
|
for (auto resourceModel : mcInstance->resourceLists()) {
|
||||||
if (resourceModel && resourceModel->indexDir().exists())
|
if (resourceModel == nullptr) {
|
||||||
m_proxy->ignoreFilesWithPath().insert(instanceRoot.relativeFilePath(resourceModel->indexDir().absolutePath()));
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!resourceModel->indexDir().exists()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (resourceModel->indexDir() == resourceModel->indexDir()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_proxy->ignoreFilesWithPath().insert(instanceRoot.relativeFilePath(resourceModel->indexDir().absolutePath()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user