Qt: Source input profiles from program and user directory

This way Linux users as well as Windows users who use the Documents
user directory can use the shipped input profiles.
This commit is contained in:
Connor McLaughlin
2020-06-12 02:47:39 +10:00
parent 814edecd05
commit 8d2c7db224
4 changed files with 44 additions and 20 deletions

View File

@ -335,7 +335,7 @@ void ControllerSettingsWidget::onSaveProfileClicked()
return;
}
m_host_interface->saveInputProfile(m_host_interface->getPathForInputProfile(name));
m_host_interface->saveInputProfile(m_host_interface->getSavePathForInputProfile(name));
});
QAction* browse = menu.addAction(tr("Browse..."));

View File

@ -73,14 +73,11 @@ public:
/// Fills menu with save state info and handlers.
void populateGameListContextMenu(const char* game_code, QWidget* parent_window, QMenu* menu);
ALWAYS_INLINE QString getPathForInputProfile(const QString& name) const
ALWAYS_INLINE QString getSavePathForInputProfile(const QString& name) const
{
return QString::fromStdString(GetPathForInputProfile(name.toUtf8().constData()));
}
ALWAYS_INLINE std::vector<std::pair<std::string, std::string>> getInputProfileList() const
{
return GetInputProfileList();
return QString::fromStdString(GetSavePathForInputProfile(name.toUtf8().constData()));
}
ALWAYS_INLINE InputProfileList getInputProfileList() const { return GetInputProfileList(); }
void saveInputProfile(const QString& profile_path);
/// Returns a path relative to the user directory.