Bug 172941 - DocumentController stores opened state for mimetypes it can not handle
Summary: DocumentController stores opened state for mimetypes it can not handle
Status: RESOLVED NOT A BUG
Alias: None
Product: kdevplatform
Classification: Developer tools
Component: shell (show other bugs)
Version: unspecified
Platform: Unlisted Binaries Unspecified
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-16 12:19 UTC by mbreugel
Modified: 2008-10-16 13:02 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
patch (571 bytes, patch)
2008-10-16 12:20 UTC, mbreugel
Details

Note You need to log in before you can comment on or make changes to this bug.
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.