Bug 79794

Summary: KDevelop 3.0.2 crashes when opening a .ui file.
Product: [Applications] kdevelop Reporter: jsu2
Component: generalAssignee: KDevelop Developers <kdevelop-devel>
Status: RESOLVED FIXED    
Severity: crash CC: barlad2004, john, paul
Priority: NOR    
Version: 3.0.2   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description jsu2 2004-04-17 04:31:43 UTC
Version:           3.0.2 (using KDE KDE 3.2.1)
Installed from:    Compiled From Sources
Compiler:          gcc (GCC) 3.3.3 (Debian 20040320) 
OS:          Linux

When I try to open the sigcreatedlg.ui (from http://women.kde.org/articles/tutorials/kdevelop3/) file with KDevelop 3.0.2, it crashes my Debian desktop with the following output:

kdevelop (file view): FileTreeViewWidgetImpl::slotSelectionChanged()
kdevelop (core): [virtual void PartController::editDocument(const KURL&, int, int)] file:/home/js1/sigcreate/src/sigcreatedlg.ui linenum -1
KCrash: Application 'kdevelop' crashing...
Unable to start Dr. Konqi

This did not happen when I worked on the tutorial on my debian laptop which is running Qt 3.3.0, KDE 3.2.0, and KDevelop 3.0.1.  All three of those tools were built on the laptop using gcc 3.3.2 (Debian). 

The sigcreatedlg.ui that's crashing KDevelop 3.0.2 was created on my laptop (KDevelop 3.0.1).  On the laptop, KDevelop is able to launch Qt Designer without any problems.
Comment 1 Jens Dagerbo 2004-04-17 05:32:57 UTC
What happens if you click on the same file in Konqueror (to embed KUIViewer there)? Does that also crash? In that case, it's KUIViewer crashing.

Note that 'designer' has to be the preferred application to open .ui files for it to open when you click a .ui file in KDevelop.
Comment 2 jsu2 2004-04-17 05:41:27 UTC
On 17 Apr 2004, Jens Dagerbo wrote:

> ------- You are receiving this mail because: -------
> You reported the bug, or are watching the reporter.
>       
> http://bugs.kde.org/show_bug.cgi?id=79794      
> 
> 
> 
> 
> ------- Additional Comments From jens.dagerbo swipnet se  2004-04-17 05:32 -------
> What happens if you click on the same file in Konqueror (to embed KUIViewer there)? Does that also crash? In that case, it's KUIViewer crashing.
> 

Actually, I only have kdelibs installed, so I don't have konqueror.

Comment 3 Jens Dagerbo 2004-04-17 05:55:59 UTC
If you enter "application/x-designer" as servicetype in the KDevelop PartExplorer tool (in the Tools menu, make sure it's loaded: configure kdevelop->plugins), what are the results?
Comment 4 jsu2 2004-04-17 06:50:58 UTC
On 17 Apr 2004, Jens Dagerbo wrote:

> ------- Additional Comments From jens.dagerbo swipnet se  2004-04-17 05:55 -------
> If you enter "application/x-designer" as servicetype in the KDevelop PartExplorer tool (in the Tools menu, make sure it's loaded: configure kdevelop->plugins), what are the results?
> 

Settings|Configure KDevelop...|Plugins show that "Part Explorer tool" is 
checked to be loaded at startup.

When I type application/x-designer into the "KDE service type:" textbox
under Tools|Parts Explorer, I get a dialog widget that says:

"No service found matching the criteria!"

When I did it on my laptop system, the "Results" textbox in the Parts 
Explorer actually shows something useful.  

I'm a bit surprised at how different my laptop system looks as compared
to the desktop system.  I know they are slightly different versions, but
I'm pretty sure I configured them (Qt, kdelibs, and kdevelop) the same 
way.  Gcc between the two is slightly different as well.

Comment 5 Jens Dagerbo 2004-04-17 10:54:42 UTC
You could do a search for 'x-designer.desktop' on your failing system and see if the mimetype really isn't installed. (It should be, it comes with kdelibs. Typically: /opt/kde/share/mimelnk/application/x-designer.desktop)

The thing is, if you don't have it, then kdelibs cannot have been fully installed -> unpredictable things happen.
If you do have it and KDE still doesn't know about it, then KDE isn't correctly set up -> unpredictable things happen.

In other words, it sounds like it's likely to be a system specific problem - not a bug that we can fix.
Comment 6 jsu2 2004-04-17 17:55:34 UTC
On 17 Apr 2004, Jens Dagerbo wrote:

> You could do a search for 'x-designer.desktop' on your failing system and see if the mimetype really isn't installed. (It should be, it comes with kdelibs. Typically: /opt/kde/share/mimelnk/application/x-designer.desktop)
> 

# locate x-designer.desktop
/usr/local/kde/share/mimelnk/application/x-designer.desktop
/usr/local/src/kdelibs-3.2.1/mimetypes/application/x-designer.desktop

> The thing is, if you don't have it, then kdelibs cannot have been fully installed -> unpredictable things happen.
> If you do have it and KDE still doesn't know about it, then KDE isn't correctly set up -> unpredictable things happen.
> 

Just as reference, the configure line of config.log for kdelibs looks like:

  ./configure --prefix=/usr/local/kde --without-arts --disable-debug

for both my desktop (kdelibs 3.2.1) and my laptop (kdelibs 3.2.0).

The only difference I can think of in the build process is the desktop 
is a SMP system and I did use "make -j3".  

> In other words, it sounds like it's likely to be a system specific problem - not a bug that we can fix.
> 

Perhaps this is a kdelibs bug?  I just realized I forgot to mention my
laptop is a "pure" Debian system while the desktop was knoppix.  I don't
think that should matter much since I removed relevant kde packages and
have the environment variable set to my own installation.  I may try
installing the desktop system with a debian install CD instead of knoppix.

Comment 7 Daniel Thaler 2004-04-18 20:03:41 UTC
This crash happend for me also.
I did not have any application associated with .ui files.
Then I opened my .ui file with konqueror, got the 'open with' dialog,
and selected to alway open ui files with designer.

IOW I dont think this is a kdelibs problem, merely poor (or no ?) error handling by kdevelop.
Comment 8 Sascha Cunz 2004-04-18 20:40:44 UTC
Well, though i cannot really explain why this should crash ( and we'll probably not be able to debug it, if we can't reproduce it since you got debugging facilities turned off )

but it might help to run "kbuildsycoca" from a terminal.
Comment 9 Jens Dagerbo 2004-04-18 21:39:58 UTC
CVS commit by dagerbo: 

Don't crash when there is no preferred handler for application/x-designer

CCMAIL: 79794@bugs.kde.org


  M +1 -1      partcontroller.cpp   1.126


--- kdevelop/src/partcontroller.cpp  #1.125:1.126
@@ -303,5 +303,5 @@ void PartController::editDocument(const 
         {
                 KService::Ptr preferredApp = KServiceTypeProfile::preferredService( MimeType->name(), "Application" );
-                if ( preferredApp->desktopEntryName() == "designer" )
+                if ( preferredApp && preferredApp->desktopEntryName() == "designer" )
                 {
                         KRun::runURL(url, MimeType->name() );


Comment 10 Jens Dagerbo 2004-04-18 21:45:50 UTC
CVS commit by dagerbo: 

Don't crash when there is no preferred handler for application/x-designer 
 
CCMAIL: 79794-done@bugs.kde.org 


  M +1 -1      partcontroller.cpp   1.111.2.4


--- kdevelop/src/partcontroller.cpp  #1.111.2.3:1.111.2.4
@@ -299,5 +299,5 @@ void PartController::editDocument(const 
   {
     KService::Ptr preferredApp = KServiceTypeProfile::preferredService( mimeType, "Application" );
-    if ( preferredApp->desktopEntryName() == "designer" )
+    if ( preferredApp && preferredApp->desktopEntryName() == "designer" )
     {
       KRun::runURL(url, mimeType);


Comment 11 Jens Dagerbo 2004-04-18 21:55:08 UTC
Thanks for that hint, Daniel. Should work now.

Workaround until this fix comes into a release: make sure the .ui (application/x-designer) mimetype is associated with something.
Comment 12 jsu2 2004-04-30 03:07:38 UTC
I just compiled kdelibs 3.2.0 and kdevelop 3.0.1 on the same debian system, and everything works.  When I clicked on the .ui file, kdevelop asked me what application I wanted to use to open the file.  I entered designer, and it fired right up.
Comment 13 Sascha Cunz 2004-04-30 03:26:43 UTC
Of course, you're right. It won't work in KDevelop 3.0.1.

It was fixed after the KDevelop 3.0.3 ( = KDE3.2.2 ) release.
The fix is backported to the KDE3.2 branch - but since then there was no release, yet. I will be available with KDevelop >= 3.0.4.

Closing again, as the bug is still fixed.
Comment 14 jsu2 2004-04-30 04:47:39 UTC
On 30 Apr 2004, Sascha Cunz wrote:

> ------- Additional Comments From mail sacu de  2004-04-30 03:26 -------
> Of course, you're right. It won't work in KDevelop 3.0.1.
> 

To be clear, KDevelop 3.0.1 does indeed work properly.  It was 3.0.2 and
3.0.3 that does not.

> It was fixed after the KDevelop 3.0.3 ( = KDE3.2.2 ) release.
> The fix is backported to the KDE3.2 branch - but since then there was no release, yet. I will be available with KDevelop >= 3.0.4.
> 

I'm a bit surprised that something that did work in 3.0.1 stopped working
in 3.0.2 and 3.0.3.  

> Closing again, as the bug is still fixed.
> 

I'll just have to use 3.0.1 until 3.0.4 comes out.  

Comment 15 Jens Dagerbo 2004-04-30 13:21:54 UTC
>> I'll just have to use 3.0.1 until 3.0.4 comes out. <<

No, see workaround in comment #11.
 
Comment 16 jsu2 2004-05-01 04:42:13 UTC
On 30 Apr 2004, Jens Dagerbo wrote:

> >> I'll just have to use 3.0.1 until 3.0.4 comes out. <<
> 
> No, see workaround in comment #11.
> 

Comment 11 refers to Comment 7 (http://bugs.kde.org/show_bug.cgi?id=79794#c7)
which suggests using konqueror.  I only have kdelibs installed, which does
not come with konqueror.  Or, are you referring to the patches in Comments
9 and 10?

Comment 17 Jens Dagerbo 2004-05-04 20:38:23 UTC
*** Bug 80914 has been marked as a duplicate of this bug. ***
Comment 18 Jens Dagerbo 2004-05-20 14:30:18 UTC
*** Bug 81720 has been marked as a duplicate of this bug. ***
Comment 19 Jens Dagerbo 2004-06-18 01:21:34 UTC
*** Bug 83529 has been marked as a duplicate of this bug. ***