Apply suggestions from code review

Co-authored-by: Sefa Eyeoglu <contact@scrumplex.net>
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
This commit is contained in:
Rachel Powers 2023-01-13 13:11:20 -07:00
parent 574af2c795
commit f7b0ba88da
2 changed files with 4 additions and 5 deletions

View File

@ -266,7 +266,8 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv)
m_zipsToImport.append(QUrl::fromLocalFile(QFileInfo(zip_path).absoluteFilePath()));
}
for (auto zip_path : parser.positionalArguments()){ // treat unspesified positional arguments as import urls
// treat unspecified positional arguments as import urls
for (auto zip_path : parser.positionalArguments()) {
m_zipsToImport.append(QUrl::fromLocalFile(QFileInfo(zip_path).absoluteFilePath()));
}

View File

@ -1816,7 +1816,7 @@ void MainWindow::processURLs(QList<QUrl> urls)
{
// NOTE: This loop only processes one dropped file!
for (auto& url : urls) {
qDebug() << "Processing :" << url;
qDebug() << "Processing" << url;
// The isLocalFile() check below doesn't work as intended without an explicit scheme.
if (url.scheme().isEmpty())
@ -1832,9 +1832,7 @@ void MainWindow::processURLs(QList<QUrl> urls)
auto type = ResourceUtils::identify(localFileInfo);
// bool is_resource = type;
if (!(ResourceUtils::ValidResourceTypes.count(type) > 0)) { // probably instance/modpack
if (ResourceUtils::ValidResourceTypes.count(type) == 0) { // probably instance/modpack
addInstance(localFileName);
continue;
}