From b1bd6bb9ff7bf270bb54a8d6e675a9961f28d7f1 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Thu, 26 Apr 2018 16:26:10 +0200 Subject: [PATCH] GUI: Applicationlist: Add Microsoft Visual Studio Code (on Windows) (#1193) --- gui/applicationlist.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gui/applicationlist.cpp b/gui/applicationlist.cpp index 5c3358982..fb7d77654 100644 --- a/gui/applicationlist.cpp +++ b/gui/applicationlist.cpp @@ -252,5 +252,15 @@ bool ApplicationList::findDefaultWindowsEditor() } } + const QString regPathMSVSCode = "HKEY_CLASSES_ROOT\\Applications\\Code.exe\\shell\\open\\command"; + const QSettings registryMSVSCode(regPathMSVSCode, QSettings::NativeFormat); + const QString msvscodeRegistry = registryMSVSCode.value("Default", QString()).toString(); + if (!msvscodeRegistry.isEmpty()) { + const QString msvscodePath = msvscodeRegistry.left(msvscodeRegistry.indexOf(".exe") + 4).replace("\"", ""); + if (checkAndAddApplication(msvscodePath, "Microsoft VS Code", "-g (file):(line)")) { + foundOne = true; + } + } + return foundOne; }