summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/executableslist.cpp11
-rw-r--r--src/executableslist.h8
-rw-r--r--src/mainwindow.cpp6
3 files changed, 25 insertions, 0 deletions
diff --git a/src/executableslist.cpp b/src/executableslist.cpp
index 210737a0..cc942012 100644
--- a/src/executableslist.cpp
+++ b/src/executableslist.cpp
@@ -113,6 +113,17 @@ Executable &ExecutablesList::find(const QString &title)
}
+Executable &ExecutablesList::findByBinary(const QFileInfo &info)
+{
+ for (std::vector<Executable>::iterator iter = m_Executables.begin(); iter != m_Executables.end(); ++iter) {
+ if (info == iter->m_BinaryInfo) {
+ return *iter;
+ }
+ }
+ throw std::runtime_error("invalid info");
+}
+
+
std::vector<Executable>::iterator ExecutablesList::findExe(const QString &title)
{
for (std::vector<Executable>::iterator iter = m_Executables.begin(); iter != m_Executables.end(); ++iter) {
diff --git a/src/executableslist.h b/src/executableslist.h
index 09023a04..c09c8f72 100644
--- a/src/executableslist.h
+++ b/src/executableslist.h
@@ -94,6 +94,14 @@ public:
Executable &find(const QString &tilte);
/**
+ * @brief find an executable by a fileinfo structure
+ * @param info the info object to search for
+ * @return the executable
+ * @exception runtime_error will throw an exception if the name is not correct
+ */
+ Executable &findByBinary(const QFileInfo &info);
+
+ /**
* @brief determine if an executable exists
* @param title the title of the executable to look up
* @return true if the executable exists, false otherwise
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 8f23c0fa..7d602d9e 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -5409,6 +5409,12 @@ HANDLE MainWindow::startApplication(const QString &executable, const QStringList
if (cwd.length() == 0) {
currentDirectory = binary.absolutePath();
}
+ try {
+ const Executable &exe = m_ExecutablesList.findByBinary(binary);
+ steamAppID = exe.m_SteamAppID;
+ } catch (const std::runtime_error&) {
+ // nop
+ }
} else {
// only a file name, search executables list
try {