summaryrefslogtreecommitdiff
path: root/src/settings.cpp
diff options
context:
space:
mode:
authorTannin <devnull@localhost>2014-01-04 16:05:39 +0100
committerTannin <devnull@localhost>2014-01-04 16:05:39 +0100
commit0ea7d99b9f2a2119abce2454ae4ed13fcf065895 (patch)
tree9d0262f7f6d06196c22873de6d58751ab6b4a130 /src/settings.cpp
parente45b747c82832d227b9ee3ae9dcb214c4c7f67b5 (diff)
parent6cffbd4f274106ac09d3729e104bf526141d7d79 (diff)
Merge
Diffstat (limited to 'src/settings.cpp')
-rw-r--r--src/settings.cpp9
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);