Author Topic: BUG: [Linux/GNOME] "Cannot open os.cbp"  (Read 5991 times)

Offline Urxae

  • Regular
  • ***
  • Posts: 376
BUG: [Linux/GNOME] "Cannot open os.cbp"
« on: December 29, 2006, 09:22:56 pm »
[Berlios seems to be down (except for the svn subdomain) so I'm posting it here]

If I double-click a .cbp file in Nautilus, I get the following message:
Quote
Cannot open os.cbp

The filename "os.cbp" indicates that this file is of type "Code::Blocks Project". The contents of the file indicate that the file is of type "XML document". If you open this file, the file might present a security risk to your system.

Do not open the file unless you created the file yourself, or received the file from a trusted source. To open the file, rename the file to the correct extension for "XML document", then open the file normally. Alternatively, use the Open With menu to choose a specific application for the file.

So basically it's refusing to let Code::Blocks open a .cbp file because it's also an XML file.  :(

Fortunately, the fix is pretty simple. Apply this patch to trunk/src/setup/mime/codeblocks.xml:
Code
--- codeblocks.xml.old	2006-12-29 20:24:53.000000000 +0100
+++ /usr/share/mime/packages/codeblocks.xml 2006-12-29 20:23:43.000000000 +0100
@@ -3,9 +3,11 @@
   <mime-type type="application/x-codeblocks">
     <comment>Code::Blocks Project</comment>
     <glob pattern="*.cbp"/>
+    <sub-class-of type="application/xml"/>
   </mime-type>
   <mime-type type="application/x-codeblocks-workspace">
     <comment>Code::Blocks Workspace</comment>
     <glob pattern="*.workspace"/>
+    <sub-class-of type="application/xml"/>
   </mime-type>
 </mime-info>

(And then
Code
sudo update-mime-database /usr/share/mime && killall nautilus
to make sure it's using the new data, if you want to use it right away)

I'm using "svn build rev 3357 (2006-12-07 14:24:20) gcc 4.1.2 Linux/unicode" (Specifically, the Ubuntu Edgy build posted in this thread, IIRC)
I know this is a bit old, but it looks like the relevant file in SVN hasn't been touched since February, so I'm pretty sure this hasn't been fixed yet...

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: BUG: [Linux/GNOME] "Cannot open os.cbp"
« Reply #1 on: December 29, 2006, 10:38:50 pm »
Thanks for the tip Urxae :)
(and welcome back - we haven't seen you around for almost a year ;)).
Be patient!
This bug will be fixed soon...

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5529
Re: BUG: [Linux/GNOME] "Cannot open os.cbp"
« Reply #2 on: December 29, 2006, 11:29:52 pm »
committed this change, thanks

Offline Urxae

  • Regular
  • ***
  • Posts: 376
Re: BUG: [Linux/GNOME] "Cannot open os.cbp"
« Reply #3 on: December 30, 2006, 12:12:01 am »
Thanks for the tip Urxae :)
(and welcome back - we haven't seen you around for almost a year ;)).

And you still remember me? :P (Has it really been that long? Yep, Jan 25)

I still use C::B (I've added the nightlies RSS feed to Thunderbird). But I've since switched from C++ to D, so now it hurts to look at C++ code :P.

committed this change, thanks

Just as fast as I remember :).

Though having the solution gift-wrapped probably made a difference in that department :lol: