File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -184,36 +184,37 @@ void ApplicationList::Clear()
184184
185185bool ApplicationList::FindDefaultWindowsEditor ()
186186{
187+ bool foundOne = false ;
187188 const QString appPath (getenv (" ProgramFiles" ));
188189 const QString notepadppPath = appPath + " \\ Notepad++\\ notepad++.exe" ;
189- if (QFileInfo (notepadppPath).isExecutable ()) {
190+ if (QFileInfo (notepadppPath).exists () && QFileInfo (notepadppPath). isExecutable ()) {
190191 Application app;
191192 app.setName (" Notepad++" );
192193 app.setPath (" \" " + notepadppPath + " \" " );
193194 app.setParameters (" -n(line) (file)" );
194195 AddApplication (app);
195- return true ;
196+ foundOne = true ;
196197 }
197198
198199 const QString notepadTwoPath = appPath + " \\ Notepad2\\ Notepad2.exe" ;
199- if (QFileInfo (notepadTwoPath).isExecutable ()) {
200+ if (QFileInfo (notepadTwoPath).exists () && QFileInfo (notepadTwoPath). isExecutable ()) {
200201 Application app;
201202 app.setName (" Notepad2" );
202203 app.setPath (" \" " + notepadTwoPath + " \" " );
203204 app.setParameters (" /g (line) (file)" );
204205 AddApplication (app);
205- return true ;
206+ foundOne = true ;
206207 }
207208
208209 const QString windowsPath (getenv (" windir" ));
209210 const QString notepadPath = windowsPath + " \\ system32\\ notepad.exe" ;
210- if (QFileInfo (notepadPath).isExecutable ()) {
211+ if (QFileInfo (notepadPath).exists () && QFileInfo (notepadPath). isExecutable ()) {
211212 Application app;
212213 app.setName (" Notepad" );
213214 app.setPath (notepadPath);
214215 app.setParameters (" (file)" );
215216 AddApplication (app);
216- return true ;
217+ foundOne = true ;
217218 }
218- return false ;
219+ return foundOne ;
219220}
You can’t perform that action at this time.
0 commit comments