GUI: Add detection for geany and Qtcreator as editor application

This commit is contained in:
Akhilesh Nema 2016-01-15 09:33:04 +01:00 committed by Daniel Marjamäki
parent 966d078dcc
commit 6c1ac1bd53
1 changed files with 9 additions and 0 deletions

View File

@ -66,6 +66,8 @@ bool ApplicationList::LoadSettings()
AddApplication(app);
defapp = 0;
}
CheckAndAddApplication("/usr/bin/geany","geany","+(line) (file)");
CheckAndAddApplication("/usr/bin/qtcreator","Qt Creator","-client (file):(line)");
// use as default for kde environments
if (QFileInfo("/usr/bin/kate").isExecutable()) {
Application app;
@ -219,5 +221,12 @@ bool ApplicationList::FindDefaultWindowsEditor()
if (CheckAndAddApplication(windowsPath + "\\system32\\notepad.exe", "Notepad", "(file)"))
foundOne = true;
QString regPath = "HKEY_CLASSES_ROOT\\Applications\\QtProject.QtCreator.pro\\shell\\Open\\command";
QSettings registry(regPath, QSettings::NativeFormat);
QString qtCreatorRegistry = registry.value("Default", QString()).toString();
QString qtCreatorPath = qtCreatorRegistry.left(qtCreatorRegistry.indexOf(".exe") + 4);
if (!qtCreatorRegistry.isEmpty() && CheckAndAddApplication(qtCreatorPath, "Qt Creator", "-client (file):(line)")) {
foundOne = true;
}
return foundOne;
}