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

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

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 | « no previous file | third_party/xdg-utils/scripts/xdg-settings.in » ('j') | 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 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 binary="`which "$1"`" 516 binary="`which "$1"`"
517 base="`basename "$1"`" 517 base="`basename "$1"`"
518 IFS=: 518 IFS=:
519 for dir in $search; do 519 for dir in $search; do
520 unset IFS 520 unset IFS
521 [ "$dir" -a -d "$dir/applications" ] || continue 521 [ "$dir" -a -d "$dir/applications" ] || continue
522 for file in "$dir"/applications/*.desktop; do 522 for file in "$dir"/applications/*.desktop; do
523 [ -r "$file" ] || continue 523 [ -r "$file" ] || continue
524 # Check to make sure it's worth the processing 524 # Check to make sure it's worth the processing
525 grep -q "^Exec.*$base" "$file" || continue 525 grep -q "^Exec.*$base" "$file" || continue
526 # Make sure it's a visible desktop file (e.g. not "preferred-web-bro wser.desktop")
527 grep -q "^NoDisplay=true" "$file" && continue
526 command="`grep "^Exec\(\[[^]=]*]\)\?=" "$file" | cut -d= -f 2- | fir st_word`" 528 command="`grep "^Exec\(\[[^]=]*]\)\?=" "$file" | cut -d= -f 2- | fir st_word`"
527 full="`which "$command"`" 529 full="`which "$command"`"
528 if [ x"$full" = x"$binary" ]; then 530 if [ x"$full" = x"$binary" ]; then
529 # Fix any double slashes that got added path composition 531 # Fix any double slashes that got added path composition
530 echo "$file" | sed -e 's,//*,/,g' 532 echo "$file" | sed -e 's,//*,/,g'
531 return 533 return
532 fi 534 fi
533 done 535 done
534 done 536 done
535 } 537 }
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
808 ;; 810 ;;
809 811
810 generic) 812 generic)
811 dispatch_generic "$@" 813 dispatch_generic "$@"
812 ;; 814 ;;
813 815
814 *) 816 *)
815 exit_failure_operation_impossible "unknown desktop environment" 817 exit_failure_operation_impossible "unknown desktop environment"
816 ;; 818 ;;
817 esac 819 esac
OLDNEW
« no previous file with comments | « no previous file | third_party/xdg-utils/scripts/xdg-settings.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698