From: Rejean Loyer Date: Mon, 17 Jun 2013 19:26:04 +0000 (-0400) Subject: ide; fixed opening media file from find in file output. sorts out the mess left by... X-Git-Tag: 0.44.08~110 X-Git-Url: http://ecere.com/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=261ffb2db2dd7d2a126d9856a4befbc73aaf03e7;p=sdk ide; fixed opening media file from find in file output. sorts out the mess left by e853a19fd919c5063e9c36b9b724fe004ab6fc9c and 15e8c4687c299c61fb5d21cf0e4715db88a3d554. closes #941. --- diff --git a/ide/src/ide.ec b/ide/src/ide.ec index cc298ba..cc47298 100644 --- a/ide/src/ide.ec +++ b/ide/src/ide.ec @@ -2539,33 +2539,29 @@ class IDEWorkSpace : Window { if(fileAttribs.isFile) { - CodeEditor codeEditor = (CodeEditor)OpenFile(path, normal, true, "", no, normal, false); - if(codeEditor && line) + char ext[MAX_EXTENSION]; + GetExtension(path, ext); + if(!strcmp(ext, "mp3") || !strcmp(ext, "flac") || !strcmp(ext, "ogg") || !strcmp(ext, "avi") || !strcmp(ext, "mkv")) + ShellOpen(path); + else if(!strcmp(ext, "a") || !strcmp(ext, "o") || !strcmp(ext, "lib") || !strcmp(ext, "dll") || !strcmp(ext, "exe")) { - char ext[MAX_EXTENSION]; - GetExtension(path, ext); - if(!strcmp(ext, "mp3") || !strcmp(ext, "flac") || !strcmp(ext, "ogg") || !strcmp(ext, "avi") || !strcmp(ext, "mkv")) - ShellOpen(path); - else if(!strcmp(ext, "a") || !strcmp(ext, "o") || !strcmp(ext, "lib") || !strcmp(ext, "dll") || !strcmp(ext, "exe")) - { - char dirPath[MAX_LOCATION]; - StripLastDirectory(path, dirPath); - ShellOpen(dirPath); - } - else + char dirPath[MAX_LOCATION]; + StripLastDirectory(path, dirPath); + ShellOpen(dirPath); + } + else + { + CodeEditor codeEditor = (CodeEditor)OpenFile(path, normal, true, ext, no, normal, false); + if(codeEditor && line) { - CodeEditor codeEditor = (CodeEditor)OpenFile(path, normal, true, "", no, normal, false); - if(codeEditor && line) - { - EditBox editBox = codeEditor.editBox; - editBox.GoToLineNum(line - 1); - editBox.GoToPosition(editBox.line, line - 1, col ? (col - 1) : 0); - } + EditBox editBox = codeEditor.editBox; + editBox.GoToLineNum(line - 1); + editBox.GoToPosition(editBox.line, line - 1, col ? (col - 1) : 0); } } - else if(fileAttribs.isDirectory) - ShellOpen(path); } + else if(fileAttribs.isDirectory) + ShellOpen(path); } void OnRedraw(Surface surface)