diff options
Diffstat (limited to 'src/settings.cpp')
| -rw-r--r-- | src/settings.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/settings.cpp b/src/settings.cpp index 8086672a..895094f7 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -102,6 +102,15 @@ bool Settings::pluginBlacklisted(const QString &fileName) const return m_PluginBlacklist.contains(fileName); } +void Settings::registerAsNXMHandler(bool force) +{ + std::wstring nxmPath = ToWString(QCoreApplication::applicationDirPath() + "/nxmhandler.exe"); + std::wstring executable = ToWString(QCoreApplication::applicationFilePath()); + std::wstring mode = force ? L"forcereg" : L"reg"; + ::ShellExecuteW(NULL, L"open", nxmPath.c_str(), + (mode + L" " + GameInfo::instance().getGameShortName() + L" \"" + executable + L"\"").c_str(), NULL, SW_SHOWNORMAL); +} + void Settings::registerPlugin(IPlugin *plugin) { m_Plugins.push_back(plugin); |
