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

Unified Diff: third_party/xdg-utils/scripts/xdg-settings

Issue 160184: Fix xdg-settings to work around bugs in xdg-mime and kdeinit. (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/
Patch Set: '' Created 11 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/xdg-utils/scripts/xdg-settings.in » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/xdg-utils/scripts/xdg-settings
===================================================================
--- third_party/xdg-utils/scripts/xdg-settings (revision 21489)
+++ third_party/xdg-utils/scripts/xdg-settings (working copy)
@@ -390,13 +390,29 @@
fi
}
+xdg_mime_fixup()
+{
+ # xdg-mime may use ktradertest, which will fork off a copy of kdeinit if
+ # one does not already exist. It will exit after about 15 seconds if no
+ # further processes need it around. But since it does not close its stdout,
+ # the shell (via grep) will wait around for kdeinit to exit. If we start a
+ # copy here, that copy will be used in xdg-mime and we will avoid waiting.
+ if [ "$DE" = kde -a -z "$XDG_MIME_FIXED" ]; then
+ ktradertest text/html Application > /dev/null 2>&1
+ # Only do this once, as we only need it once.
+ XDG_MIME_FIXED=yes
+ fi
+}
+
get_browser_mime()
{
+ xdg_mime_fixup
xdg-mime query default text/html
}
set_browser_mime()
{
+ xdg_mime_fixup
orig="`get_browser_mime`"
# Fixing the local desktop file can actually change the default browser all
# by itself, so we fix it only after querying to find the current default
« 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