Bug 172941

Summary: DocumentController stores opened state for mimetypes it can not handle
Product: [Developer tools] kdevplatform Reporter: mbreugel <mbr.nxi>
Component: shellAssignee: kdevelop-bugs-null
Status: RESOLVED NOT A BUG    
Severity: normal CC: apaku
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Unlisted Binaries   
OS: Unspecified   
Latest Commit: Version Fixed In:
Attachments: patch

Description mbreugel 2008-10-16 12:19:39 UTC
Version:            (using KDE 4.1.2)
Installed from:    Unspecified Linux

Kdevplatform registers files it fails to open as 'opened'.

Steps to reproduce:

1/ boot kdevelop
2/ open the filesystem toolview
3/ browse to some image file + open it
4/ this will now be shown in the documents toolview and saved to the rc on exit

Below is a patch that fixes this. Probably it isn't enough to silently ignore this.

At least a warning and maybe an option to open it with an external viewer?

------------------------------------------------------


Index: documentcontroller.cpp
===================================================================
--- documentcontroller.cpp      (revision 869725)
+++ documentcontroller.cpp      (working copy)
@@ -346,6 +346,9 @@
                      d->documents[url] = idoc;
                 }
             }
+        } else {
+            // no plugin handles this mimetype, bail out
+            return 0;
         }
         if ( !d->documents.contains(url) && Core::self()->partManagerInternal()->isTextType(mimeType))
             d->documents[url] = new TextDocument(url, Core::self());
Comment 1 mbreugel 2008-10-16 12:20:31 UTC
Created attachment 27936 [details]
patch
Comment 2 Andreas Pakulat 2008-10-16 13:02:20 UTC
This is something for the mailinglist. We need to decide wether we want to embedd kparts or not.