diff --git a/src/qt_common/util/mod.cpp b/src/qt_common/util/mod.cpp index 1168bde2f6..f32076fada 100644 --- a/src/qt_common/util/mod.cpp +++ b/src/qt_common/util/mod.cpp @@ -43,6 +43,8 @@ QStringList GetModFolders(const QString& root, const QString& fallbackName) { QString name = QtCommon::Frontend::GetTextInput( tr("Mod Name"), tr("What should this mod be called?"), default_name); + if (name.isEmpty()) return {}; + // if std_path is empty, frontend_common could not determine mod type and/or name. // so we have to prompt the user and set up the structure ourselves if (paths.empty()) { diff --git a/src/yuzu/configuration/configure_per_game_addons.cpp b/src/yuzu/configuration/configure_per_game_addons.cpp index ecafa6826a..da84d23876 100644 --- a/src/yuzu/configuration/configure_per_game_addons.cpp +++ b/src/yuzu/configuration/configure_per_game_addons.cpp @@ -161,14 +161,14 @@ void ConfigurePerGameAddons::InstallMods(const QStringList& mods) { } } -void ConfigurePerGameAddons::InstallModPath(const QString& path) { - const auto mods = QtCommon::Mod::GetModFolders(path, {}); +void ConfigurePerGameAddons::InstallModPath(const QString& path, const QString &fallbackName) { + const auto mods = QtCommon::Mod::GetModFolders(path, fallbackName); if (mods.size() > 1) { ModSelectDialog* dialog = new ModSelectDialog(mods, this); connect(dialog, &ModSelectDialog::modsSelected, this, &ConfigurePerGameAddons::InstallMods); dialog->show(); - } else { + } else if (!mods.empty()) { InstallMods(mods); } } @@ -194,7 +194,7 @@ void ConfigurePerGameAddons::InstallModZip() { const QString extracted = QtCommon::Mod::ExtractMod(path); if (!extracted.isEmpty()) - InstallModPath(extracted); + InstallModPath(extracted, QFileInfo(path).baseName()); } void ConfigurePerGameAddons::changeEvent(QEvent* event) { diff --git a/src/yuzu/configuration/configure_per_game_addons.h b/src/yuzu/configuration/configure_per_game_addons.h index 3c7c0b0ff0..d2f361139b 100644 --- a/src/yuzu/configuration/configure_per_game_addons.h +++ b/src/yuzu/configuration/configure_per_game_addons.h @@ -44,7 +44,7 @@ public: public slots: void InstallMods(const QStringList &mods); - void InstallModPath(const QString& path); + void InstallModPath(const QString& path, const QString& fallbackName = {}); void InstallModFolder(); void InstallModZip(); diff --git a/src/yuzu/game/game_list.cpp b/src/yuzu/game/game_list.cpp index 48a6e10083..12a7fe6373 100644 --- a/src/yuzu/game/game_list.cpp +++ b/src/yuzu/game/game_list.cpp @@ -494,28 +494,27 @@ void GameList::ResetViewMode() { break; } + auto view = m_currentView->viewport(); + view->installEventFilter(this); + + // touch gestures + view->grabGesture(Qt::SwipeGesture); + view->grabGesture(Qt::PanGesture); + + // TODO: touch? + QScroller::grabGesture(view, QScroller::LeftMouseButtonGesture); + + auto scroller = QScroller::scroller(view); + QScrollerProperties props; + props.setScrollMetric(QScrollerProperties::HorizontalOvershootPolicy, + QScrollerProperties::OvershootAlwaysOff); + props.setScrollMetric(QScrollerProperties::VerticalOvershootPolicy, + QScrollerProperties::OvershootAlwaysOff); + scroller->setScrollerProperties(props); + if (m_isTreeMode != newTreeMode) { m_isTreeMode = newTreeMode; - auto view = m_currentView->viewport(); - - view->installEventFilter(this); - - // touch gestures - view->grabGesture(Qt::SwipeGesture); - view->grabGesture(Qt::PanGesture); - - // TODO: touch? - QScroller::grabGesture(view, QScroller::LeftMouseButtonGesture); - - auto scroller = QScroller::scroller(view); - QScrollerProperties props; - props.setScrollMetric(QScrollerProperties::HorizontalOvershootPolicy, - QScrollerProperties::OvershootAlwaysOff); - props.setScrollMetric(QScrollerProperties::VerticalOvershootPolicy, - QScrollerProperties::OvershootAlwaysOff); - scroller->setScrollerProperties(props); - RefreshGameDirectory(); } }