summaryrefslogtreecommitdiff
path: root/src/modinfo.cpp
diff options
context:
space:
mode:
authorAl <26797547+Al12rs@users.noreply.github.com>2020-05-20 13:05:02 +0200
committerGitHub <noreply@github.com>2020-05-20 13:05:02 +0200
commitb7110cba2dceb172bf6a903f1c5de5ff1c460f11 (patch)
treeee3be3be522842c6ef42c14d48c822fa657333c9 /src/modinfo.cpp
parentc214b67ae784537d696a53c8cae00676eefd3841 (diff)
parentc391c2b584a309f64f87dd5e00b0083279e6211c (diff)
Merge pull request #1066 from Holt59/new-filetree
Update for the new file tree implementation and minor fixes
Diffstat (limited to 'src/modinfo.cpp')
-rw-r--r--src/modinfo.cpp27
1 files changed, 2 insertions, 25 deletions
diff --git a/src/modinfo.cpp b/src/modinfo.cpp
index 085eaf80..7f888bdc 100644
--- a/src/modinfo.cpp
+++ b/src/modinfo.cpp
@@ -25,11 +25,9 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include "modinfooverwrite.h"
#include "modinfoseparator.h"
-#include "installationtester.h"
#include "categories.h"
#include "modinfodialog.h"
#include "overwriteinfodialog.h"
-#include "filenamestring.h"
#include "versioninfo.h"
#include <iplugingame.h>
@@ -475,7 +473,7 @@ bool ModInfo::removeCategory(const QString &categoryName)
return true;
}
-QStringList ModInfo::categories()
+QStringList ModInfo::categories() const
{
QStringList result;
@@ -529,28 +527,7 @@ bool ModInfo::categorySet(int categoryID) const
void ModInfo::testValid()
{
- m_Valid = false;
- QDirIterator dirIter(absolutePath());
- while (dirIter.hasNext()) {
- dirIter.next();
- if (dirIter.fileInfo().isDir()) {
- if (InstallationTester::isTopLevelDirectory(dirIter.fileName())) {
- m_Valid = true;
- break;
- }
- } else {
- if (InstallationTester::isTopLevelSuffix(dirIter.fileName())) {
- m_Valid = true;
- break;
- }
- }
- }
-
- // NOTE: in Qt 4.7 it seems that QDirIterator leaves a file handle open if it is not iterated to the
- // end
- while (dirIter.hasNext()) {
- dirIter.next();
- }
+ m_Valid = doTestValid();
}
QUrl ModInfo::parseCustomURL() const