<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>2325</bug_id>
          
          <creation_ts>2012-04-18 08:51:06 +0000</creation_ts>
          <short_desc>[Hob] &quot;View files&quot; does not work on my 32bit Ubuntu 11.04</short_desc>
          <delta_ts>2013-10-03 13:56:14 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>Hob</product>
          <component>hob</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Low</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>1.2 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jiajun Xu">jiajun.xu</reporter>
          <assigned_to name="Shane Wang">shane.wang</assigned_to>
          <cc>andreea.b.proca</cc>
    
    <cc>dongxiao.xu</cc>
    
    <cc>jessica.zhang</cc>
    
    <cc>jiajun.xu</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>20627</commentid>
    <comment_count>0</comment_count>
    <who name="Jiajun Xu">jiajun.xu</who>
    <bug_when>2012-04-18 08:51:06 +0000</bug_when>
    <thetext>tree/branch: poky/master
commit: 720fe9e371eef16da19df0885188aa0341ad2090

On my 32bit Ubuntu 11.04, I find that if an image is build finished or I open an image with icon &quot;Images&quot; and open it, the &quot;View files&quot; icon does not work. No window pop up with following error. The issue does not happen on Ubuntu 11.10 and Fedora 16.

######
Warning: unknown mime-type for &quot;//home/jxu49/osel/poky/hob2/tmp/deploy/images&quot; -- using &quot;application/octet-stream&quot;
Error: no &quot;view&quot; mailcap rules found for type &quot;application/octet-stream&quot;
######</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20648</commentid>
    <comment_count>1</comment_count>
    <who name="Shane Wang">shane.wang</who>
    <bug_when>2012-04-18 13:36:22 +0000</bug_when>
    <thetext>That is a bug for xdg-open. Jiajun is using xdg-open 1.0.1. On my Ubuntu 10.10 x86_64, the version of xdg-open is 1.0.2 and I don&apos;t have that issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20649</commentid>
    <comment_count>2</comment_count>
    <who name="Shane Wang">shane.wang</who>
    <bug_when>2012-04-18 13:38:19 +0000</bug_when>
    <thetext>Here is the diff between two xdg-opens.

--- /usr/bin/xdg-open.orig      2010-03-11 23:54:02.000000000 -0800
+++ /usr/bin/xdg-open   2012-04-18 20:42:18.341913133 -0700
@@ -200,7 +200,7 @@
 }

 #------------------------------------------------------------
-# Exit script on insufficient permission to read a specified file
+# Exit script on insufficient permission to write a specified file

 exit_failure_file_permission_write()
 {
@@ -277,7 +277,7 @@
             ;;

             --version)
-            echo &quot;xdg-open 1.0.1&quot;
+            echo &quot;xdg-open 1.0.2&quot;
             exit_success
             ;;
         esac
@@ -303,7 +303,8 @@
 {
     if [ x&quot;$KDE_FULL_SESSION&quot; = x&quot;true&quot; ]; then DE=kde;
     elif [ x&quot;$GNOME_DESKTOP_SESSION_ID&quot; != x&quot;&quot; ]; then DE=gnome;
-    elif xprop -root _DT_SAVE_MODE | grep &apos; = \&quot;xfce4\&quot;$&apos; &gt;/dev/null 2&gt;&amp;1; then DE=xfce;
+    elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager &gt; /dev/null 2&gt;&amp;1` ; then DE=gnome;
+    elif xprop -root _DT_SAVE_MODE 2&gt; /dev/null | grep &apos; = \&quot;xfce4\&quot;$&apos; &gt;/dev/null 2&gt;&amp;1; then DE=xfce;
     fi
 }

@@ -314,7 +315,7 @@

 kfmclient_fix_exit_code()
 {
-    version=`kde-config --version 2&gt;/dev/null | grep KDE`
+    version=`kde${KDE_SESSION_VERSION}-config --version 2&gt;/dev/null | grep KDE`
     major=`echo $version | sed &apos;s/KDE: \([0-9]\).*/\1/&apos;`
     minor=`echo $version | sed &apos;s/KDE: [0-9]*\.\([0-9]\).*/\1/&apos;`
     release=`echo $version | sed &apos;s/KDE: [0-9]*\.[0-9]*\.\([0-9]\).*/\1/&apos;`
@@ -324,12 +325,25 @@
     return 0
 }

-open_kde()
+# This handles backslashes but not quote marks.
+first_word()
 {
-    which kfmclient &gt;/dev/null || open_generic &quot;$1&quot;
+    read first rest
+    echo &quot;$first&quot;
+}

-    kfmclient exec &quot;$1&quot;
-    kfmclient_fix_exit_code $?
+open_kde()
+{
+    if kde-open -v 2&gt;/dev/null 1&gt;&amp;2; then
+        kde-open &quot;$1&quot;
+    else
+        if [ x&quot;$KDE_SESSION_VERSION&quot; = x&quot;4&quot; ]; then
+            kfmclient openURL &quot;$1&quot;
+        else
+            kfmclient exec &quot;$1&quot;
+            kfmclient_fix_exit_code $?
+        fi
+    fi

     if [ $? -eq 0 ]; then
         exit_success
@@ -340,7 +354,11 @@

 open_gnome()
 {
-    gnome-open &quot;$1&quot;
+    if gvfs-open --help 2&gt;/dev/null 1&gt;&amp;2; then
+        gvfs-open &quot;$1&quot;
+    else
+        gnome-open &quot;$1&quot;
+    fi

     if [ $? -eq 0 ]; then
         exit_success
@@ -360,38 +378,73 @@
     fi
 }

+open_generic_xdg_mime()
+{
+    filetype=`xdg-mime query filetype &quot;$1&quot; | sed &quot;s/;.*//&quot;`
+    default=`xdg-mime query default &quot;$filetype&quot;`
+    if [ -n &quot;$default&quot; ] ; then
+        xdg_user_dir=&quot;$XDG_DATA_HOME&quot;
+        [ -n &quot;$xdg_user_dir&quot; ] || xdg_user_dir=&quot;$HOME/.local/share&quot;
+
+        xdg_system_dirs=&quot;$XDG_DATA_DIRS&quot;
+        [ -n &quot;$xdg_system_dirs&quot; ] || xdg_system_dirs=/usr/local/share/:/usr/share/
+
+        for x in `echo &quot;$xdg_user_dir:$xdg_system_dirs&quot; | sed &apos;s/:/ /g&apos;`; do
+            file=&quot;$x/applications/$default&quot;
+            if [ -r &quot;$file&quot; ] ; then
+                command=&quot;`grep -E &quot;^Exec(\[[^]=]*])?=&quot; &quot;$file&quot; | cut -d= -f 2- | first_word`&quot;
+                command_exec=`which $command 2&gt;/dev/null`
+                if [ -x &quot;$command_exec&quot; ] ; then
+                    $command_exec &quot;$1&quot;
+                    if [ $? -eq 0 ]; then
+                        exit_success
+                    fi
+                fi
+            fi
+        done
+    fi
+}
+
 open_generic()
 {
-    # If it&apos;s a path or a file:/// URL, we can open it with run-mailcap
-    if which run-mailcap &gt;/dev/null &amp;&amp;
-       (echo &quot;$1&quot; | grep -q &apos;^file:///&apos; ||
-           ! echo &quot;$1&quot; | egrep -q &apos;^[a-zA-Z+\.\-]+:&apos;); then
-
-       local file
-       file=&quot;$1&quot;
-
-       # Decode URLs
-       if echo &quot;$file&quot; | grep -q &apos;^file:///&apos;; then
-           file=${file#file://}
-           file=$(echo &quot;$file&quot; | perl -pe &apos;s/%(..)/pack(&quot;c&quot;, hex($1))/eg&apos;)
-       fi
-
-       run-mailcap --action=view &quot;$file&quot;
-
-       if [ $? -eq 0 ]; then
-           exit_success
-       else
-           exit_failure_operation_failed
-       fi
+    # Paths or file:// URLs
+    if (echo &quot;$1&quot; | grep -q &apos;^file://&apos; ||
+        ! echo &quot;$1&quot; | egrep -q &apos;^[a-zA-Z+\.\-]+:&apos;); then
+
+        local file=&quot;$1&quot;
+
+        # Decode URLs
+        if echo &quot;$file&quot; | grep -q &apos;^file:///&apos;; then
+            file=${file#file://}
+            file=$(echo &quot;$file&quot; | perl -pe &apos;s/%(..)/pack(&quot;c&quot;, hex($1))/eg&apos;)
+        fi
+
+        check_input_file &quot;$file&quot;
+
+        open_generic_xdg_mime &quot;$file&quot;
+
+        if [ -f /etc/debian_version ] &amp;&amp;
+            which run-mailcap 2&gt;/dev/null 1&gt;&amp;2; then
+            run-mailcap --action=view &quot;$file&quot;
+            if [ $? -eq 0 ]; then
+                exit_success
+            fi
+        fi
+
+        if mimeopen -v 2&gt;/dev/null 1&gt;&amp;2; then
+            mimeopen -n &quot;$file&quot;
+            if [ $? -eq 0 ]; then
+                exit_success
+            fi
+        fi
     fi

     sensible-browser &quot;$1&quot;
-
     if [ $? -eq 0 ]; then
         exit_success
-    else
-        exit_failure_operation_failed
     fi
+
+    exit_failure_operation_impossible &quot;no method available for opening &apos;$1&apos;&quot;
 }

 [ x&quot;$1&quot; != x&quot;&quot; ] || exit_failure_syntax</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20650</commentid>
    <comment_count>3</comment_count>
    <who name="Shane Wang">shane.wang</who>
    <bug_when>2012-04-18 13:39:11 +0000</bug_when>
    <thetext>Please upgrade to the latest xdg-open, and I will mark it &quot;work for me&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20651</commentid>
    <comment_count>4</comment_count>
    <who name="Shane Wang">shane.wang</who>
    <bug_when>2012-04-18 13:41:41 +0000</bug_when>
    <thetext>By the way, I copy my xdg-open to Jiajun&apos;s machine, it works.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37561</commentid>
    <comment_count>5</comment_count>
    <who name="Andreea Brandusa Proca">andreea.b.proca</who>
    <bug_when>2013-10-03 13:56:14 +0000</bug_when>
    <thetext>Verified in master:a02280f99f05b1c21de2a78de9222a2f62a0dabc.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>