Merge lp:~jeremywootten/pantheon-files/fix-1582432-open-desktopfiles-in-text-editor into lp:~elementary-apps/pantheon-files/trunk

Proposed by Jeremy Wootten
Status: Merged
Approved by: Cody Garver
Approved revision: 2161
Merged at revision: 2161
Proposed branch: lp:~jeremywootten/pantheon-files/fix-1582432-open-desktopfiles-in-text-editor
Merge into: lp:~elementary-apps/pantheon-files/trunk
Diff against target: 27 lines (+9/-6)
1 file modified
libcore/gof-file.c (+9/-6)
To merge this branch: bzr merge lp:~jeremywootten/pantheon-files/fix-1582432-open-desktopfiles-in-text-editor
Reviewer Review Type Date Requested Status
elementary Apps team Pending
Review via email: mp+295056@code.launchpad.net

Commit message

Do no execute an executable file when an app to "Open with" is supplied (lp:1582432)

Description of the change

When launching a file that is executable, do not execute it if an app to open it with is explicitly supplied.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libcore/gof-file.c'
2--- libcore/gof-file.c 2016-05-01 18:18:35 +0000
3+++ libcore/gof-file.c 2016-05-18 11:15:11 +0000
4@@ -2056,14 +2056,17 @@
5 g_return_val_if_fail (GOF_IS_FILE (file), FALSE);
6 g_return_val_if_fail (GDK_IS_SCREEN (screen), FALSE);
7
8- /* check if we should execute the file */
9- if (gof_file_is_executable (file))
10- return gof_file_execute (file, screen, NULL, &error);
11-
12 if (app_info != NULL)
13 app = g_app_info_dup (app_info);
14- if (app == NULL)
15- app = gof_file_get_default_handler (file);
16+
17+ /* Do not run executables if an app to open them with has been supplied */
18+ if (app == NULL) {
19+ /* check if we should execute the file */
20+ if (gof_file_is_executable (file))
21+ return gof_file_execute (file, screen, NULL, &error);
22+ else
23+ app = gof_file_get_default_handler (file);
24+ }
25 if (app == NULL)
26 {
27 //TODO

Subscribers

People subscribed via source and target branches

to all changes: