[Bug 58912] File Open gives "Could not import file of type text/x-chdr"

Roger Larsson roger.larsson at norran.net
Thu Jun 12 00:52:04 UTC 2003


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
     
http://bugs.kde.org/show_bug.cgi?id=58912     
roger.larsson at norran.net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |minor
             Status|RESOLVED                    |REOPENED
           Priority|NOR                         |VLO
         Resolution|INVALID                     |
            Version|unspecified                 |CVS



------- Additional Comments From roger.larsson at norran.net  2003-06-12 00:50 -------
Tracked this down a little. 
 
kdevelop/src/partcontroller.cpp editDocument() line:236 
  // load the appropriate part factory like chosen in the editor-chooser part 
  // (Note: KTextEditor/Document is the editor in MDI mode. KTextEditor/Editor is the editor in 
SDI mode. 
  //        But KTextEditor/Editor doesn't work for the Kate part on KDE-3.0.x, so better use 
KTextEditor/Document anyway.) 
  QString services[] = {"KTextEditor/Document", "KParts/ReadWritePart", 
"KParts/ReadOnlyPart"}; 
  QString classnames[] = {"KTextEditor::Document", "KParts::ReadWritePart", 
"KParts::ReadOnlyPart"}; 
  for (uint i=0; i<3; ++i) 
  { 
    factory = findPartFactory(mimeType, services[i], preferred); 
    if (factory) 
    { 
      className = classnames[i]; 
      break; 
    } 
  } 
 
I exit from this function with i=2, "KParts/ReadOnlyPart", "KParts::ReadOnlyPart"! 
when everything works it exits with i=0, "KTextEditor/Document", "KTextEditor::Document" 
and "KTextEditor::Document" gets modified into "KTextEditor::Editor" 
 
When opening the corresponding part KateDocument is used, but for me koffice 
will be the matching plugin - koffice! (koffice can't import filter text/x-chdr...) 
 
So findPartFactory() is suspected... I have again tried to remove files to no avail... 
more later... 
 
But I wonder if it is not the MIME type rewrite a few lines up that is the real cause? 
  if (mimeType.startsWith("text/") 
      || mimeType == "application/x-zerosize" 
      || mimeType == "application/x-desktop" 
      || mimeType == "application/x-kdevelop" || mimeType == "application/x-kdevelop-project" 
      || mimeType == "image/x-xpm" 
      || mimeType == "application/x-perl") 
  { 
      mimeType = "text/plain"; 
      kapp->config()->setGroup("Editor"); 
      preferred = kapp->config()->readEntry("EmbeddedKTextEditor", ""); 
  } else if( mimeType.startsWith("inode/") ){ 
      return; 
  } 
It gets translated into text/plain before editor opens - I might have something 
wrong there - in that case the debug messages are all wrong since the part 
is opened without this MIME type info => reopen!




More information about the KDevelop-devel mailing list