Closed Bug 500324 Opened 15 years ago Closed 15 years ago

"Open" button in download manager doesn't correctly launch the file in its viewer

Categories

(Core :: XPCOM, defect)

ARM
Maemo
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: abillings, Assigned: mfinkle)

Details

(Keywords: mobile)

Attachments

(1 file, 1 obsolete file)

On Maemo, if a user downloads a PDF (one of the few file types that we can save), and attempts to open it via the download manager, the PDF Viewer for Maemo will open but without loading the file. It should load the file. 

This could be a PDF viewer bug but it may be our interaction with it.

This was found in the Beta 2 candidate build from 6/24.

Steps to Reproduce
1. Go to http://www.irs.gov/pub/irs-pdf/fw4.pdf and save the PDF when prompted.
2. Click on the options button in the right pane
3. Click on the download manager button in options
4. On the line for fw4.pdf in the download manager, click on "Open"

Result: PDF Viewer opens but without loading the file.
I have verified this on my n810.  I believe we have had this problem in the past, but at a beta2 quality, we should be getting rid of a lot of these issues.
In Microb, the pdf file is opened within the PDF Viewer.
Assignee: nobody → mark.finkle
Component: Linux/Maemo → XPCOM
Keywords: mobile
Product: Fennec → Core
QA Contact: maemo-linux → xpcom
Attached patch patch (obsolete) — Splinter Review
This patch adds the dbus and hildon code required to launch a file
Attached patch patch 2Splinter Review
Removed the failed attempt to fix ::Reveal()
Attachment #388622 - Attachment is obsolete: true
Attachment #388624 - Flags: review?(benjamin)
Comment on attachment 388624 [details] [diff] [review]
patch 2

This code is a minor bit of duplication from some code in nsMIMEInfoUnix.cpp which also launches files, but with the aid of a mime-type. We have no mime-type here, so we only use the fallback hildon method.

Tested and works in Fennec/Maemo
Comment on attachment 388624 [details] [diff] [review]
patch 2

>diff --git a/xpcom/io/Makefile.in b/xpcom/io/Makefile.in

>+ifdef MOZ_PLATFORM_HILDON
>+LOCAL_INCLUDES   += $(TK_CFLAGS) $(MOZ_DBUS_GLIB_CFLAGS)
>+EXTRA_DSO_LDOPTS += $(MOZ_DBUS_GLIB_LIBS)
>+ifdef MOZ_ENABLE_GNOMEVFS
>+LOCAL_INCLUDES   += $(MOZ_GNOMEVFS_CFLAGS)
>+EXTRA_DSO_LDOPTS += $(MOZ_GNOMEVFS_LIBS)
>+endif
>+endif

EXTRA_DSO_LDOPTS has no effect in xpcom/io, please remove it.

>diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp

> NS_IMETHODIMP
> nsLocalFile::Launch()

The actual logic-guts here need review by someone who knows dbus/hildon.
Attachment #388624 - Flags: review?(benjamin)
Attachment #388624 - Flags: review?
Attachment #388624 - Flags: review+
Attachment #388624 - Flags: review? → review?(bugmail)
Attachment #388624 - Flags: review?(bugmail) → review+
Comment on attachment 388624 [details] [diff] [review]
patch 2

>diff --git a/xpcom/io/Makefile.in b/xpcom/io/Makefile.in
>+
>+ifdef MOZ_PLATFORM_HILDON
>+LOCAL_INCLUDES   += $(TK_CFLAGS) $(MOZ_DBUS_GLIB_CFLAGS)
>+EXTRA_DSO_LDOPTS += $(MOZ_DBUS_GLIB_LIBS)
>+ifdef MOZ_ENABLE_GNOMEVFS
>+LOCAL_INCLUDES   += $(MOZ_GNOMEVFS_CFLAGS)
>+EXTRA_DSO_LDOPTS += $(MOZ_GNOMEVFS_LIBS)
>+endif
>+endif
>+

a couple of nits here.  You shouldn't need the MOZ_GNOMEVFS_* stuff.  Those paths will be provided by LIBHILDONMIME_CFLAGS, which you should use.  You also shouldn't need TK_CFLAGS.

also, I think these should be added to CFLAGS or CXXFLAGS and not LOCAL_INCLUDES.

unrelated to this bug, it seems we're not using LIBHILDONMIME_CFLAGS in uriloader/exthandler/Makefile.in, which I think we should.

> 
>-LOCAL_INCLUDES	= -I..
>+LOCAL_INCLUDES	+= -I..

Shouldn't need this if you switch to using CFLAGS above

r=me with nits addressed
Summary: "Open" button in download manager will open PDF viewer for PDF file but will not load PDF into viewer → "Open" button in download manager doesn't correctly launch the file in it's viewer
pushed with all review nits fixed:
http://hg.mozilla.org/mozilla-central/rev/137530fe08c1
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Summary: "Open" button in download manager doesn't correctly launch the file in it's viewer → "Open" button in download manager doesn't correctly launch the file in its viewer
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: