Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(353)

Side by Side Diff: third_party/xdg-utils/scripts/xdg-settings.in

Issue 159738: Linux: skip invisible desktop files when looking up the default browser. (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/
Patch Set: Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/xdg-utils/scripts/xdg-settings ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/sh 1 #!/bin/sh
2 #--------------------------------------------- 2 #---------------------------------------------
3 # xdg-settings 3 # xdg-settings
4 # 4 #
5 # Utility script to get various settings from the desktop environment. 5 # Utility script to get various settings from the desktop environment.
6 # 6 #
7 # Refer to the usage() function below for usage. 7 # Refer to the usage() function below for usage.
8 # 8 #
9 # Copyright 2009, Google Inc. 9 # Copyright 2009, Google Inc.
10 # 10 #
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 binary="`which "$1"`" 208 binary="`which "$1"`"
209 base="`basename "$1"`" 209 base="`basename "$1"`"
210 IFS=: 210 IFS=:
211 for dir in $search; do 211 for dir in $search; do
212 unset IFS 212 unset IFS
213 [ "$dir" -a -d "$dir/applications" ] || continue 213 [ "$dir" -a -d "$dir/applications" ] || continue
214 for file in "$dir"/applications/*.desktop; do 214 for file in "$dir"/applications/*.desktop; do
215 [ -r "$file" ] || continue 215 [ -r "$file" ] || continue
216 # Check to make sure it's worth the processing 216 # Check to make sure it's worth the processing
217 grep -q "^Exec.*$base" "$file" || continue 217 grep -q "^Exec.*$base" "$file" || continue
218 # Make sure it's a visible desktop file (e.g. not "preferred-web-bro wser.desktop")
219 grep -q "^NoDisplay=true" "$file" && continue
218 command="`grep "^Exec\(\[[^]=]*]\)\?=" "$file" | cut -d= -f 2- | fir st_word`" 220 command="`grep "^Exec\(\[[^]=]*]\)\?=" "$file" | cut -d= -f 2- | fir st_word`"
219 full="`which "$command"`" 221 full="`which "$command"`"
220 if [ x"$full" = x"$binary" ]; then 222 if [ x"$full" = x"$binary" ]; then
221 # Fix any double slashes that got added path composition 223 # Fix any double slashes that got added path composition
222 echo "$file" | sed -e 's,//*,/,g' 224 echo "$file" | sed -e 's,//*,/,g'
223 return 225 return
224 fi 226 fi
225 done 227 done
226 done 228 done
227 } 229 }
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 ;; 502 ;;
501 503
502 generic) 504 generic)
503 dispatch_generic "$@" 505 dispatch_generic "$@"
504 ;; 506 ;;
505 507
506 *) 508 *)
507 exit_failure_operation_impossible "unknown desktop environment" 509 exit_failure_operation_impossible "unknown desktop environment"
508 ;; 510 ;;
509 esac 511 esac
OLDNEW
« no previous file with comments | « third_party/xdg-utils/scripts/xdg-settings ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698