Bug 201162 - XML document preview doesn't work
Summary: XML document preview doesn't work
Status: RESOLVED FIXED
Alias: None
Product: ark
Classification: Applications
Component: general (show other bugs)
Version: 2.19
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Raphael Kubo da Costa
URL:
Keywords:
: 269885 274793 319881 328103 359323 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-07-22 23:09 UTC by Marc Collin
Modified: 2016-02-12 16:00 UTC (History)
17 users (show)

See Also:
Latest Commit:
Version Fixed In: 15.12.0


Attachments
zip with xml file (7.85 KB, application/zip)
2009-07-23 15:36 UTC, Marc Collin
Details
rar with xml file (1.26 KB, application/x-rar)
2009-07-23 15:37 UTC, Marc Collin
Details
the proper embedding settings (150.79 KB, image/png)
2013-05-19 23:59 UTC, Georg Herdt
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Collin 2009-07-22 23:09:54 UTC
Version:           2.13 (using 4.2.96 (KDE 4.2.96 (KDE 4.3 RC2)) "release 142", KDE:KDE4:Factory:Desktop / openSUSE_11.1)
Compiler:          gcc
OS:                Linux (i686) release 2.6.27.23-0.1-pae

when i try to preview a xml file, the viewer display nothing

the file is not empty
Comment 1 Raphael Kubo da Costa 2009-07-23 04:47:28 UTC
What file format were you using? Can you attach a file that presents this behaviour?
Comment 2 Marc Collin 2009-07-23 15:36:54 UTC
Created attachment 35569 [details]
zip with xml file
Comment 3 Marc Collin 2009-07-23 15:37:30 UTC
Created attachment 35570 [details]
rar with xml file
Comment 4 Marc Collin 2009-07-23 15:41:06 UTC
ark can't do a preview with some xml file in the zip and in the rar...
Comment 5 Raphael Kubo da Costa 2009-07-28 02:46:47 UTC
Technically, this is not a bug - Ark just previews your XML files with the default application associated with them, which happens to be Konqueror. However, Konqueror renders unstyled XML files as blank pages.

I have asked the kde-core-devel mailing list whether another application, such as Kate, should be used instead, but nothing has been decided yet.

For now, you can right-click an XML file, choose Properties and change your associations manually.
Comment 6 Raphael Kubo da Costa 2011-06-03 00:24:45 UTC
Reopening for now -- there have been other reports about the same issue, we should try to achieve a better solution.
Comment 7 Raphael Kubo da Costa 2011-06-03 00:25:16 UTC
*** Bug 269885 has been marked as a duplicate of this bug. ***
Comment 8 Raphael Kubo da Costa 2011-06-03 00:26:37 UTC
*** Bug 274793 has been marked as a duplicate of this bug. ***
Comment 9 Julien HENRY 2011-10-14 08:35:03 UTC
In file association for xml extension, kwrite was in first position and konqueror in second position, but still I got a blank content. I had to remove konqueror from the list of alternative to have something not blank. But still this is far from being perfect as it seems all xml tags are stripped. So I see a kind of serialization of all text nodes from my xml files.
Comment 10 Aaron Digulla 2011-11-02 10:50:17 UTC
Same problem: Ark 4.7.2 ignores file associations and it doesn't respond to right clicking on an entry like Dolphin, so I can neither change the default nor select a different viewer.
Comment 11 Marc Collin 2012-11-09 10:30:46 UTC
that should be gread if the preview will not open another application if kde team decide to use kwrite or kate...
Comment 12 Edward 2013-03-08 18:28:33 UTC
I have the same problem with Ark 2.19.  XML files already associated with Kate, but Ark still opens them as blank pages - it does not use Kate.
Comment 13 Raphael Kubo da Costa 2013-05-15 22:09:38 UTC
*** Bug 319881 has been marked as a duplicate of this bug. ***
Comment 14 Georg Herdt 2013-05-19 23:56:03 UTC
There seems to be a workaround/solution.
I am using 2.18 and KDE 4.8.5:
1) In system settings go to the file associations for XML.
    Maybe you want to check the associated file patterns ( it should include *.xml)
2) Switch to the tab "Embedding" 
3) Ensure that the radio button "Show file in embedded viewer" is selected.
4) change the order in the list "Services Preference Order". Put katepart on top of this list.
Of course you should have kate installed ..... ;-)
When you restart now ark and select an xml file a proper preview will appear ....
Maybe you want to check my screenshot ...
Comment 15 Georg Herdt 2013-05-19 23:59:08 UTC
Created attachment 79970 [details]
the proper embedding settings
Comment 16 Antonio Sánchez 2013-06-27 10:49:13 UTC
2.19 / 4.10.3
Same problem. 
Georg Herdt's workaround/solution works for me. Thanks!
Comment 17 Amichai Rothman 2013-08-01 11:03:41 UTC
Thanks for the workaround! It seems to work also without touching the radio buttons, I'm not sure what the difference is:

Open System Settings -> Open File Associations -> Select 'xml' -> Open 'Embedding' tab -> move 'Embedded Advanced Text Editor (katepart)' to the top of the list -> Apply.

I'd really like to see this made the default... I can't think of any case where viewing an XML file in an HTML viewer would be useful - it's usually just blank, and occasionally shows a few useless concatenated text strings.
Comment 18 Amichai Rothman 2013-08-01 11:04:20 UTC
*** This bug has been confirmed by popular vote. ***
Comment 19 Christoph Feck 2013-11-26 10:58:46 UTC
*** Bug 328103 has been marked as a duplicate of this bug. ***
Comment 20 nanmus 2013-11-26 12:11:54 UTC
I cannot believe that after four years since the initial bug report, I am reporting again the same bug!
Comment 21 Ragnar Thomsen 2015-10-08 16:33:53 UTC
Git commit f1cf10f25af245823f81b8ff457a04c7593dede7 by Ragnar Thomsen.
Committed on 08/10/2015 at 16:23.
Pushed by rthomsen into branch 'master'.

Add an "Open File" action

The action opens an archive entry with the associated application. This
was previously only possible through the "Open With" action, but this
required several clicks. The "Open With" action is renamed to
"Open File With" for consistency.  Currently, the Preview action is
still the default, i.e. when the user clicks an archive entry the
Preview action is called.

QSignalMapper is used to connect the signals from the Open File, Open
File With and Preview actions to the same slot.

As for Preview, the file is extracted to a QTemporaryDir and then
opened. The temporarily extracted file is monitored for changes using
QFileSystemWatcher and on change a KMessageBox is opened to query the
user if the archive should be updated with the modified file. If the
user accepts slotAddFiles() is called.

The previously unimplemented path argument of slotAddFiles() is used to
allow for updating a file in a subdirectory within the archive.
Related: bug 208330
FIXED-IN: 15.12.0
REVIEW: 125339
GUI:

M  +9    -5    part/ark_part.rc
M  +165  -65   part/part.cpp
M  +15   -11   part/part.h

http://commits.kde.org/ark/f1cf10f25af245823f81b8ff457a04c7593dede7
Comment 22 Elvis Angelaccio 2015-10-26 16:19:29 UTC
Git commit f2090934229ec25c16bdf84e808dfe7cee8a1cd1 by Elvis Angelaccio.
Committed on 26/10/2015 at 16:05.
Pushed by elvisangelaccio into branch 'master'.

Drop KHTML dependency and skip KHTMLPart when previewing

This drops the KHTML framework as dependency (which was actually needed only to
disable javascript and friends from the KHTMLPart) and drops the KHTMLPart as
well, when previewing an HTML or XML file. Now we always use the second available
service offer, which is the katepart by default, to preview those mimetypes.
The user can still render an HTML entry, by opening it in the browser with the
'Open File' action.
Related: bug 353786, bug 354182
FIXED-IN: 15.12.0

Differential Revision: D454

M  +1    -1    CMakeLists.txt
M  +1    -1    part/CMakeLists.txt
M  +13   -34   part/arkviewer.cpp
M  +0    -3    part/arkviewer.h

http://commits.kde.org/ark/f2090934229ec25c16bdf84e808dfe7cee8a1cd1
Comment 23 Elvis Angelaccio 2016-02-12 16:00:55 UTC
*** Bug 359323 has been marked as a duplicate of this bug. ***