Bug 62276 (suse47276)

Summary: images don't work in gnome docs in khelpcenter
Product: [openSUSE] SUSE Linux 10.1 Reporter: Chris Lahey <clahey>
Component: KDEAssignee: Will Stephenson <wstephenson>
Status: RESOLVED WONTFIX QA Contact: E-mail List <kde-maintainers>
Severity: Major    
Priority: P5 - None CC: kde-maintainers, mike, richard.bos, stefan.bruens
Version: Final   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: gnome-xml-support-for-kdoctools-part2.diff
alternative patch
kdoctools-picture-in-submenu.diff take two
third try

Description Chris Lahey 2004-10-15 08:29:58 UTC
In general, anything in a subdirectory won't be found.

Same bug in ximian bugzilla:

http://bugzilla.ximian.com/show_bug.cgi?id=68396
Comment 1 Chris Lahey 2004-10-15 08:29:58 UTC
<!-- SBZ_reproduce  -->
Run gnome-terminal, hit F1, go to the next page.  Note missing images.
Comment 2 Chris Lahey 2004-10-15 08:31:39 UTC
Created attachment 25039 [details]
gnome-xml-support-for-kdoctools-part2.diff

Fixes the bug.	Named to match the patch already in kdelibs.  Also does some
language clean up.
Comment 3 Stephan Kulow 2004-10-19 15:45:43 UTC
Sorry, I missed the patch somehow. There are two things I don't understand. 
First is the strange slash loop - what is it trying to do? 
 
And then you remove the fallback - this for sure breaks KDE. 
-    langs.append( "en" ); 
-    langs.remove( "C" ); 
Comment 4 Chris Lahey 2004-10-20 00:43:44 UTC
The strange slash loop is ignoring initial slashes.  It looks for the first non
slash character and then finds the first slash after that.  Specifically, it
walks along looking for the next slash character and only stops when the next
slash character is more than one byte forward.

I didn't just remove it, I reimplemented it below.

+        if ( *it == "en_US" || *it == "C")
             *it = "en";

This way, the "C" to "en" conversion happens in place in the string.  And you're
less likely to get dupliated "en".  I guess you might want the "en" to always be
there.  In that case, I would suggest checking if that *it = "en"; ever matched
and if not, then append "en".  Actually, doing the same for the GNOME section
might not be such a bad idea.  In fact, this processing could happen before the
GNOME section, and then the GNOME section would just be checking for "en" and
treating it as "C".
Comment 5 Stephan Kulow 2004-10-20 04:25:44 UTC
I think I understand what your loop does now. A comment might be in place 
though :) 
 
Right, the .append("en") is pretty unrelated to the .remove("C") - it's not a 
search+replace. If your lang list is "de_DE", "de", you still want to see 
something if there is no translated version - which is very likely for 
screenshots in KDE. 
Comment 6 Chris Lahey 2004-10-20 04:37:18 UTC
Yeah, that totally does make sense.  I do think it's still useful to include "C"
in the search & replace below and just only add en if it wasn't there already. 
This way ordering would be preserved.

Would you be willing to make that change and then move this above the GNOME part
(so that the "en" gets added at the end before the GNOME processing (which of
course gets treated as "C", but...)) or should I do this and submit a new patch?
Comment 7 Luis Villa 2004-10-21 22:53:13 UTC
Poke? Ping?
Comment 8 Adrian Schröter 2004-10-21 23:01:19 UTC
WIP, I spend some minutes with it today and there still some issues.  
And I do not understand some attempts from the patch, but I had no real time 
yet to really work on it. 
Comment 9 Adrian Schröter 2004-10-24 20:22:31 UTC
Created attachment 25355 [details]
alternative patch

what about this patch ? it has little less risk of an endless loop and adds
fallback search pathes for different languages.

Would this one be okay ?
Comment 10 Chris Lahey 2004-10-24 23:38:57 UTC
There's a couple things I don't like about this patch.

The one involving GNOME is that you're still losing ordering information for GNOME.  No matter how early "en" appears in the list, English GNOME docs won't be searched until the end.

Also, I think you broke KDE docs a bit.  You've removed the code to change en_US to en, which was getting used for KDE docs.  It seems like this will break KDE's stuff.  I think you want to add something like your language length > 2 thing in GNOME to the KDE section.

The change you made to the search for / seems okay.  The other code had 0 chance of an infinite loop because the index increased by 1 on every iteration of the loop.  The biggest difference with your loop is that it allocates a new string for every initial slash, doesn't it?  Also, I can't tell whether changing fname is safe without seeing all the code (I'm remote right now), but I'm guessing it's fine.

I'll review this patch in more depth once I am not remote.
Comment 11 Adrian Schröter 2004-10-25 14:55:25 UTC
the en_US -> en change does happen via the .left(2) line. 
 
I do not see, why there should be a double allocation. fname is anyway only a 
local variable, so it is no mem leak at least. (QString does anyway share the 
memory, if the strings are still equal). 
Comment 12 Adrian Schröter 2004-10-25 23:49:02 UTC
Created attachment 25376 [details]
kdoctools-picture-in-submenu.diff take two

After Stephan explained the problem to me ....

What about this patch, it should solve all issues ?
Comment 13 Adrian Schröter 2004-10-27 00:20:40 UTC
Created attachment 25421 [details]
third try

after discussion on irc.

I didn't tested this patch at all yet, does it look okay for you anyway ?
Comment 14 Chris Lahey 2004-10-27 00:24:32 UTC
This looks pretty good, but the GNOME stuff should come before the lang list is modified (remove C, add en).  Is there some reason this can't happen?
Comment 15 Adrian Schröter 2004-10-27 21:43:12 UTC
the reason is that it doesn't change anything from the current behaviour in 
SLES9 in that way, so it is way more risk free to submit it in this way. 
Actually we would not even need the addedC flag and the last if append C line 
because of this. but let's stay that to be sure. 
 
Is it okay for you, when I do submit this now for SLES9 ? 
Comment 16 Chris Lahey 2004-10-28 03:28:31 UTC
Except that right now in SLES9, the gnome reading stuff does come before the
lang list is modified.  If anything, by moving it below, you're changing the
sles9 behavior, aren't you?
Comment 17 Stephan Kulow 2004-11-08 22:50:24 UTC
Chris: can you please suggest a patch to got into 9.3 so we can get this bug 
fixed after NLD9 is done? 
Comment 18 Ben Kahn 2005-06-17 20:14:59 UTC
This is a terrible bug in our docs.  We should get this into NLD9 SP2.
Comment 19 Gary Ekker 2005-06-20 16:07:47 UTC
Since no one ever agreed on an acceptable patch, It hasn't been done to my
knowledge for STABLE, and this is a SLES package not an NLD package, I'm moving
this to future. SLES only takes blocker fixes after RC1.
Comment 20 Rodrigo Moya 2005-07-14 11:05:00 UTC
Can any KDE maintainer comment on the patches? Does the fix look ok?
Comment 21 Stephan Kulow 2005-07-14 13:07:50 UTC
there is no final patch here and I'm not sure KDE didn't change too much in 
between 
Comment 22 JP Rosevear 2006-02-15 19:33:19 UTC
I rechecked, its still broken for gnome-terminal and eog case for Code 10, see the "Getting Started" pages in both.  
Comment 23 Dirk Mueller 2006-02-20 11:20:55 UTC
ok, which patch in particular are we discussing for inclusion?
Comment 24 Stephan Kulow 2006-02-28 14:14:43 UTC
Chris is no longer @ximian
Comment 25 JP Rosevear 2006-03-20 21:47:01 UTC
For the proposed inclusion patch, I'd say the KDE team needs to review the comments and assess again if any of the patches are even useable for code 10 and then just weight the merits since adrian and chris tried several approaches.
Comment 26 JP Rosevear 2006-03-24 14:08:52 UTC
Oops, no longer needinfo
Comment 27 Will Stephenson 2007-01-30 08:26:17 UTC
*** Bug 71672 has been marked as a duplicate of this bug. ***
Comment 28 Will Stephenson 2007-01-30 08:27:04 UTC
Also in NLD9
Comment 29 Will Stephenson 2007-04-20 09:33:24 UTC
*** Bug 265998 has been marked as a duplicate of this bug. ***
Comment 30 Stephan Kulow 2007-05-04 10:41:47 UTC
We won't fix that anymore for NLD and for code10 we don't use khelpcenter anymore for gnome docs, so the patch shouldn't be necessary at all.