Re: [Development] Mime database size

2015-02-23 Thread Knoll Lars


On 22/02/15 19:20, David Faure david.fa...@kdab.com wrote:

On Thursday 19 February 2015 01:55:01 Kevin Kofler wrote:
 Arnaud Vrac wrote:
  Commit fbeeaf2 in qtbase adds QT_NO_MIMETYPE:
  
  The mime type stuff generates one of the biggest translation units in
  QtCore due to the compressed 1.7MB freedesktop.org.xml resource. With
  QT_NO_MIMETYPE, libQt5Core.so is almost 400Kb smaller (4.8MB-4.4MB
gcc
  4.9 stripped release build)
  
  It would be nice to be able to find a middle ground between disabling
the
  mime database completely and adding 1.7MB of data to Qt. The
  update-mime-database binary from the shared-mime-info package can
generate
  a binary file from the XML, which is 100KB large and still allows
finding
  the mimetype of any file. The only difference with the XML is that you
  don't have the translated pretty string for the mime type. The binary
file
  can also be mmapped and used for every request very efficiently,
instead
  of allocating all mime types data in memory.
 
 This won't help the other platforms, but on GNU/Linux, can't we just
use the
 system shared-mime-info database?

We do.

The builtin XML is for the case where it's not available (Windows/Mac) or
not 
found (reduced Linux system, e.g. some embedded linux systems).

Lars suggested long ago that we put the binary instead in QtCore (like
Giuseppe just did). This would be good for performance too - parsing this
XML 
is a horrible performance penalty. The reason I didn't do that yet is
that on 
systems without update-mime-database we still need to be able to parse
XML 
files (e.g. for additional mimetypes installed by applications), so the
current design (XML *or* binary backend) doesn't work for that, we need a
way 
to use both.

Yes, I still don’t like the fact we’re embedding a 1.7M xml file in Qt
Core at all. I’m not too fond of checking the binary file into the
repositories, but it’s probably still better than continuing with the XML
file.

David, I can’t see how the use case of the app installing additional mime
types is supported today (as there is no API to register additional XML
files or anything like that. So I can’t see how embedding the binary blob
instead of the XML file will give us a feature regression today.

Being able to skip embedding the DB altogether, in whichever form, as
suggested by Thiago, can help desktop linux distros on top of that.

Yes, that would be a nice feature in any case.

Cheers,
Lars



-- 
David Faure | david.fa...@kdab.com | Managing Director KDAB France
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.fr
KDAB - Qt Experts - Platform-independent software solutions

___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development

___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Mime database size

2015-02-23 Thread David Faure
On Monday 23 February 2015 14:39:49 Arnaud Vrac wrote:
 That's true, but the binary file in QStandardPaths::GenericDataLocation +
 mime/mime.cache should have been rebuilt with those additional XML files.

Only on systems with shared-mime-info installed.

The XML provider makes things work also on systems where shared-mime-info 
isn't installed - such as Windows and Mac OS X, typically (and Android, iOS, 
etc.)

-- 
David Faure | david.fa...@kdab.com | Managing Director KDAB France
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.fr
KDAB - Qt Experts - Platform-independent software solutions

___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Mime database size

2015-02-23 Thread Oswald Buddenhagen
On Mon, Feb 23, 2015 at 12:00:51PM +, Knoll Lars wrote:
 Yes, I still don’t like the fact we’re embedding a 1.7M xml file in Qt
 Core at all. I’m not too fond of checking the binary file into the
 repositories, but it’s probably still better than continuing with the XML
 file.
 
there is no such dichotomy. we can include the binary into the
distribution packages only, as we do with configure.exe and the
forwarding headers.

___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Mime database size

2015-02-23 Thread Sorvig Morten

 On 23 Feb 2015, at 13:00, Knoll Lars lars.kn...@theqtcompany.com wrote:
 
 
 Yes, I still don’t like the fact we’re embedding a 1.7M xml file in Qt
 Core at all. I’m not too fond of checking the binary file into the
 repositories, but it’s probably still better than continuing with the XML
 file.

For OS X I’d like to avoid the database dependency altogether. There is native 
API which might cover our use case:

http://stackoverflow.com/questions/300618/in-memory-mime-type-detection-with-cocoa-os-x

Morten






___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Mime database size

2015-02-23 Thread David Faure
On Monday 23 February 2015 12:00:51 Knoll Lars wrote:
 Yes, I still don’t like the fact we’re embedding a 1.7M xml file in Qt
 Core at all. I’m not too fond of checking the binary file into the
 repositories, but it’s probably still better than continuing with the XML
 file.

Yes. The binary file would be 109KB, much smaller already.

 David, I can’t see how the use case of the app installing additional mime
 types is supported today (as there is no API to register additional XML
 files or anything like that.

Trust me (or read the unit test), it works :-)
Additional XML files are found by looking at the filesystem, 
QStandardPaths::GenericDataLocation + mime/packages/, as per the mime spec.

 So I can’t see how embedding the binary blob
 instead of the XML file will give us a feature regression today.

See previous email. Can be fixed, of course, but it's a bit more effort
(I won't have time in the near future, but maybe later).

-- 
David Faure | david.fa...@kdab.com | Managing Director KDAB France
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.fr
KDAB - Qt Experts - Platform-independent software solutions

___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Mime database size

2015-02-23 Thread Arnaud Vrac
On Mon, Feb 23, 2015 at 2:11 PM, David Faure david.fa...@kdab.com wrote:

 On Monday 23 February 2015 12:00:51 Knoll Lars wrote:
  Yes, I still don’t like the fact we’re embedding a 1.7M xml file in Qt
  Core at all. I’m not too fond of checking the binary file into the
  repositories, but it’s probably still better than continuing with the XML
  file.

 Yes. The binary file would be 109KB, much smaller already.

  David, I can’t see how the use case of the app installing additional mime
  types is supported today (as there is no API to register additional XML
  files or anything like that.

 Trust me (or read the unit test), it works :-)
 Additional XML files are found by looking at the filesystem,
 QStandardPaths::GenericDataLocation + mime/packages/, as per the mime
 spec.


That's true, but the binary file in QStandardPaths::GenericDataLocation +
mime/mime.cache should have been rebuilt with those additional XML files.


  So I can’t see how embedding the binary blob
  instead of the XML file will give us a feature regression today.

 See previous email. Can be fixed, of course, but it's a bit more effort
 (I won't have time in the near future, but maybe later).


-- 
Arnaud Vrac
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Mime database size

2015-02-23 Thread Knoll Lars
On 23/02/15 10:08, Mathias Hasselmann math...@taschenorakel.de wrote:

Am 23.02.2015 um 08:11 schrieb Thiago Macieira:
 On Monday 23 February 2015 07:48:37 Mathias Hasselmann wrote:
 Am 17.02.2015 um 14:36 schrieb Cristian Adam:
 One could rewrite this small utility into Qt and then it would be
 available everywhere.

 Somehow I thought that one of the big benefits of free software and
open
 source is, that you _don't_ have to rewrite each and every simple tool.
 Obviously I've missed something.

 The problem is requiring glib on OS X and Windows in order to build Qt.

What's exactly the problem with glib on OS X or Windows?

It’s not about glib, but about how complex it will get to build Qt on
these platforms.

Cheers,
Lars


___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Mime database size

2015-02-23 Thread Thiago Macieira
On Monday 23 February 2015 10:08:43 Mathias Hasselmann wrote:
 Am 23.02.2015 um 08:11 schrieb Thiago Macieira:
  On Monday 23 February 2015 07:48:37 Mathias Hasselmann wrote:
  Am 17.02.2015 um 14:36 schrieb Cristian Adam:
  One could rewrite this small utility into Qt and then it would be
  available everywhere.
  
  Somehow I thought that one of the big benefits of free software and open
  source is, that you _don't_ have to rewrite each and every simple tool.
  Obviously I've missed something.
  
  The problem is requiring glib on OS X and Windows in order to build Qt.
 
 What's exactly the problem with glib on OS X or Windows?

Autoconf and libtool, for starters.

Just look at how difficult it was to get people to accept Perl as a dependency 
on Windows -- namely, the fact that it *isn't* acceptable to depend on Perl. 
So depending on sh  coreutils so an Autoconf configure script can be run is 
totally unacceptable.

Like Lars said, it's the complexity. We should be removing it, not adding 
more.
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Mime database size

2015-02-23 Thread Thiago Macieira
On Monday 23 February 2015 13:20:48 Oswald Buddenhagen wrote:
 On Mon, Feb 23, 2015 at 12:00:51PM +, Knoll Lars wrote:
  Yes, I still don’t like the fact we’re embedding a 1.7M xml file in Qt
  Core at all. I’m not too fond of checking the binary file into the
  repositories, but it’s probably still better than continuing with the XML
  file.
 
 there is no such dichotomy. we can include the binary into the
 distribution packages only, as we do with configure.exe and the
 forwarding headers.

Remember the discussion with Debian and Fedora packagers: it should be easy to 
rebuild the file as part of the build process.

Either way, we need to be able to do it for ourselves, when we build from Git. 
I'd rather not have the binary file in the Git repos if we can avoid it.
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Mime database size

2015-02-23 Thread Knoll Lars
On 23/02/15 15:37, Thiago Macieira thiago.macie...@intel.com wrote:

On Monday 23 February 2015 13:20:48 Oswald Buddenhagen wrote:
 On Mon, Feb 23, 2015 at 12:00:51PM +, Knoll Lars wrote:
  Yes, I still don’t like the fact we’re embedding a 1.7M xml file in Qt
  Core at all. I’m not too fond of checking the binary file into the
  repositories, but it’s probably still better than continuing with the
XML
  file.
 
 there is no such dichotomy. we can include the binary into the
 distribution packages only, as we do with configure.exe and the
 forwarding headers.

Remember the discussion with Debian and Fedora packagers: it should be
easy to 
rebuild the file as part of the build process.

Actually for the distributions we should change Qt to use the system
provided database, not our own copy. So that's almost orthogonal to what
we do on the other platforms.

Either way, we need to be able to do it for ourselves, when we build from
Git. 
I'd rather not have the binary file in the Git repos if we can avoid it.

I'd also prefer it, but I would (currently) like to avoid having a
dependency on update-mime-database in our toolchain. It's hard enough as
it is to maintain our build and packaging machines on Windows and OS X.

Cheers,
Lars

___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Mime database size

2015-02-23 Thread Mathias Hasselmann
Am 23.02.2015 um 08:11 schrieb Thiago Macieira:
 On Monday 23 February 2015 07:48:37 Mathias Hasselmann wrote:
 Am 17.02.2015 um 14:36 schrieb Cristian Adam:
 One could rewrite this small utility into Qt and then it would be
 available everywhere.

 Somehow I thought that one of the big benefits of free software and open
 source is, that you _don't_ have to rewrite each and every simple tool.
 Obviously I've missed something.

 The problem is requiring glib on OS X and Windows in order to build Qt.

What's exactly the problem with glib on OS X or Windows?

___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Mime database size

2015-02-23 Thread Adam Majer
On Mon, Feb 23, 2015 at 07:48:37AM +0100, Mathias Hasselmann wrote:
 Am 17.02.2015 um 14:36 schrieb Cristian Adam:
  One could rewrite this small utility into Qt and then it would be
  available everywhere.
 
 Somehow I thought that one of the big benefits of free software and open 
 source is, that you _don't_ have to rewrite each and every simple tool. 
 Obviously I've missed something.

By rewrite, he meant *port to*. So, you don't have to rewrite
anything, just port it to the API that is available on a given
platform. By porting it to Qt, then it would be automatically
available everywhere that Qt is available.

If the utility was not free open source, you would have to rewrite the
entire utility from scratch instead of just porting it.

- Adam

-- 
Adam Majer
ad...@zombino.com
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Mime database size

2015-02-23 Thread Cristian Adam
On Feb 24, 2015 8:06 AM, Adam Majer ad...@zombino.com wrote:

 By rewrite, he meant *port to*. So, you don't have to rewrite
 anything, just port it to the API that is available on a given
 platform. By porting it to Qt, then it would be automatically
 available everywhere that Qt is available.

 If the utility was not free open source, you would have to rewrite the
 entire utility from scratch instead of just porting it.

 - Adam

Yes, that's what I've meant.

Qt should have a tool (clang based?) to help port from GTK+ to Qt.

In the old days there were such a tool (obviously not clang based) for
porting from MFC to Qt.

Projects like Lxde would have been ported faster :)

Cheers,
Cristian.
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Mime database size

2015-02-22 Thread David Faure
On Thursday 19 February 2015 01:55:01 Kevin Kofler wrote:
 Arnaud Vrac wrote:
  Commit fbeeaf2 in qtbase adds QT_NO_MIMETYPE:
  
  The mime type stuff generates one of the biggest translation units in
  QtCore due to the compressed 1.7MB freedesktop.org.xml resource. With
  QT_NO_MIMETYPE, libQt5Core.so is almost 400Kb smaller (4.8MB-4.4MB gcc
  4.9 stripped release build)
  
  It would be nice to be able to find a middle ground between disabling the
  mime database completely and adding 1.7MB of data to Qt. The
  update-mime-database binary from the shared-mime-info package can generate
  a binary file from the XML, which is 100KB large and still allows finding
  the mimetype of any file. The only difference with the XML is that you
  don't have the translated pretty string for the mime type. The binary file
  can also be mmapped and used for every request very efficiently, instead
  of allocating all mime types data in memory.
 
 This won't help the other platforms, but on GNU/Linux, can't we just use the
 system shared-mime-info database?

We do.

The builtin XML is for the case where it's not available (Windows/Mac) or not 
found (reduced Linux system, e.g. some embedded linux systems).

Lars suggested long ago that we put the binary instead in QtCore (like 
Giuseppe just did). This would be good for performance too - parsing this XML 
is a horrible performance penalty. The reason I didn't do that yet is that on 
systems without update-mime-database we still need to be able to parse XML 
files (e.g. for additional mimetypes installed by applications), so the 
current design (XML *or* binary backend) doesn't work for that, we need a way 
to use both.

Being able to skip embedding the DB altogether, in whichever form, as 
suggested by Thiago, can help desktop linux distros on top of that.

-- 
David Faure | david.fa...@kdab.com | Managing Director KDAB France
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.fr
KDAB - Qt Experts - Platform-independent software solutions

___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Mime database size

2015-02-22 Thread Mathias Hasselmann
Am 17.02.2015 um 14:36 schrieb Cristian Adam:
 One could rewrite this small utility into Qt and then it would be
 available everywhere.

Somehow I thought that one of the big benefits of free software and open 
source is, that you _don't_ have to rewrite each and every simple tool. 
Obviously I've missed something.

Ciao,
Mathias
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Mime database size

2015-02-22 Thread André Somers
Mathias Hasselmann schreef op 23-2-2015 om 07:48:
 Am 17.02.2015 um 14:36 schrieb Cristian Adam:
 One could rewrite this small utility into Qt and then it would be
 available everywhere.
 Somehow I thought that one of the big benefits of free software and open
 source is, that you _don't_ have to rewrite each and every simple tool.
 Obviously I've missed something.
That only works if the writer of said tool decided to stick to libraries 
available on different platforms...

André

___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Mime database size

2015-02-22 Thread Thiago Macieira
On Monday 23 February 2015 07:48:37 Mathias Hasselmann wrote:
 Am 17.02.2015 um 14:36 schrieb Cristian Adam:
  One could rewrite this small utility into Qt and then it would be
  available everywhere.
 
 Somehow I thought that one of the big benefits of free software and open
 source is, that you _don't_ have to rewrite each and every simple tool.
 Obviously I've missed something.

The problem is requiring glib on OS X and Windows in order to build Qt.
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Mime database size

2015-02-18 Thread Konstantin Ritt
2015-02-19 9:52 GMT+04:00 Thiago Macieira thiago.macie...@intel.com:

 We might not be able to rely on it being there on all systems, but we could
 provide a configure switch that lets distributors say yes, I confirm it's
 always there, so don't bundle a copy.

 Similarly, we can provide a switch that says all locales are UTF-8, so
 optimise QString::to/fromLocal8Bit.


Sounds good to me.
Actually, I wonder why we didn't that years ago.

Regards,
Konstantin
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Mime database size

2015-02-18 Thread Thiago Macieira
On Thursday 19 February 2015 09:59:43 Konstantin Ritt wrote:
 Actually, I wonder why we didn't that years ago.

First, make it work. Then, make it more complex.
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Mime database size

2015-02-18 Thread Thiago Macieira
On Thursday 19 February 2015 01:55:01 Kevin Kofler wrote:
 Arnaud Vrac wrote:
  Commit fbeeaf2 in qtbase adds QT_NO_MIMETYPE:
  
  The mime type stuff generates one of the biggest translation units in
  QtCore due to the compressed 1.7MB freedesktop.org.xml resource. With
  QT_NO_MIMETYPE, libQt5Core.so is almost 400Kb smaller (4.8MB-4.4MB gcc
  4.9 stripped release build)
  
  It would be nice to be able to find a middle ground between disabling the
  mime database completely and adding 1.7MB of data to Qt. The
  update-mime-database binary from the shared-mime-info package can generate
  a binary file from the XML, which is 100KB large and still allows finding
  the mimetype of any file. The only difference with the XML is that you
  don't have the translated pretty string for the mime type. The binary file
  can also be mmapped and used for every request very efficiently, instead
  of allocating all mime types data in memory.
 
 This won't help the other platforms, but on GNU/Linux, can't we just use the
 system shared-mime-info database?

We might not be able to rely on it being there on all systems, but we could 
provide a configure switch that lets distributors say yes, I confirm it's 
always there, so don't bundle a copy.

Similarly, we can provide a switch that says all locales are UTF-8, so 
optimise QString::to/fromLocal8Bit.
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Mime database size

2015-02-18 Thread Kevin Kofler
Arnaud Vrac wrote:
 Commit fbeeaf2 in qtbase adds QT_NO_MIMETYPE:
 
 The mime type stuff generates one of the biggest translation units in
 QtCore due to the compressed 1.7MB freedesktop.org.xml resource. With
 QT_NO_MIMETYPE, libQt5Core.so is almost 400Kb smaller (4.8MB-4.4MB gcc
 4.9 stripped release build)
 
 It would be nice to be able to find a middle ground between disabling the
 mime database completely and adding 1.7MB of data to Qt. The
 update-mime-database binary from the shared-mime-info package can generate
 a binary file from the XML, which is 100KB large and still allows finding
 the mimetype of any file. The only difference with the XML is that you
 don't have the translated pretty string for the mime type. The binary file
 can also be mmapped and used for every request very efficiently, instead
 of allocating all mime types data in memory.

This won't help the other platforms, but on GNU/Linux, can't we just use the 
system shared-mime-info database?

Kevin Kofler

___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Mime database size

2015-02-17 Thread Cristian Adam
On Tue, Feb 17, 2015 at 1:48 PM, Иван Комиссаров abba...@gmail.com wrote:

 Do you think it's ok to store binary file in a git repo?

 2015-02-17 15:25 GMT+03:00 Giuseppe D'Angelo dange...@gmail.com:

 On 17 February 2015 at 13:22, Mark Gaiser mark...@gmail.com wrote:
  Glib and libxml also compile under windows.

 What's the need for windows compilation anyhow? The binary blob can be
 regenerated under Unix (when the .xml gets updated) and other
 platforms would just use it?


One could rewrite this small utility into Qt and then it would be available
everywhere.

Cheers,
Cristian.
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Mime database size

2015-02-17 Thread Иван Комиссаров
Hello, Arnaud Vrac. What tool should should generate binary cache on Mac
OS/Windows?

2015-02-17 13:56 GMT+03:00 Arnaud Vrac raw...@gmail.com:

 Here is the description of the binary file from the shared-mime-info spec:

 http://standards.freedesktop.org/shared-mime-info-spec/latest/ar01s02.html#idm140622087725744

 On Tue, Feb 17, 2015 at 11:51 AM, Arnaud Vrac raw...@gmail.com wrote:

 Commit fbeeaf2 in qtbase adds QT_NO_MIMETYPE:

 The mime type stuff generates one of the biggest translation units in
 QtCore due to the compressed 1.7MB freedesktop.org.xml resource. With
 QT_NO_MIMETYPE, libQt5Core.so is almost 400Kb smaller (4.8MB-4.4MB gcc 4.9
 stripped release build)

 It would be nice to be able to find a middle ground between disabling the
 mime database completely and adding 1.7MB of data to Qt. The
 update-mime-database binary from the shared-mime-info package can generate
 a binary file from the XML, which is 100KB large and still allows finding
 the mimetype of any file. The only difference with the XML is that you
 don't have the translated pretty string for the mime type. The binary file
 can also be mmapped and used for every request very efficiently, instead of
 allocating all mime types data in memory.

 --
 Arnaud Vrac




 --
 Arnaud Vrac

 ___
 Development mailing list
 Development@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/development


___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Mime database size

2015-02-17 Thread Arnaud Vrac
Here is the description of the binary file from the shared-mime-info spec:
http://standards.freedesktop.org/shared-mime-info-spec/latest/ar01s02.html#idm140622087725744

On Tue, Feb 17, 2015 at 11:51 AM, Arnaud Vrac raw...@gmail.com wrote:

 Commit fbeeaf2 in qtbase adds QT_NO_MIMETYPE:

 The mime type stuff generates one of the biggest translation units in
 QtCore due to the compressed 1.7MB freedesktop.org.xml resource. With
 QT_NO_MIMETYPE, libQt5Core.so is almost 400Kb smaller (4.8MB-4.4MB gcc 4.9
 stripped release build)

 It would be nice to be able to find a middle ground between disabling the
 mime database completely and adding 1.7MB of data to Qt. The
 update-mime-database binary from the shared-mime-info package can generate
 a binary file from the XML, which is 100KB large and still allows finding
 the mimetype of any file. The only difference with the XML is that you
 don't have the translated pretty string for the mime type. The binary file
 can also be mmapped and used for every request very efficiently, instead of
 allocating all mime types data in memory.

 --
 Arnaud Vrac




-- 
Arnaud Vrac
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Mime database size

2015-02-17 Thread Arnaud Vrac
On Tue, Feb 17, 2015 at 12:13 PM, Иван Комиссаров abba...@gmail.com wrote:

 Hello, Arnaud Vrac. What tool should should generate binary cache on Mac
 OS/Windows?


I think the update-mime-database binary can also be compiled for Windows
and Mac, but it unfortunately depends on glib and libxml.

Here is the source for update-mime-database:

http://cgit.freedesktop.org/xdg/shared-mime-info/tree/update-mime-database.c
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Mime database size

2015-02-17 Thread Mark Gaiser
On Tue, Feb 17, 2015 at 12:17 PM, Arnaud Vrac raw...@gmail.com wrote:

 On Tue, Feb 17, 2015 at 12:13 PM, Иван Комиссаров abba...@gmail.com
 wrote:

 Hello, Arnaud Vrac. What tool should should generate binary cache on Mac
 OS/Windows?


 I think the update-mime-database binary can also be compiled for Windows
 and Mac, but it unfortunately depends on glib and libxml.

 Here is the source for update-mime-database:


 http://cgit.freedesktop.org/xdg/shared-mime-info/tree/update-mime-database.c

 Glib and libxml also compile under windows.
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Mime database size

2015-02-17 Thread Иван Комиссаров
Do you think it's ok to store binary file in a git repo?

2015-02-17 15:25 GMT+03:00 Giuseppe D'Angelo dange...@gmail.com:

 On 17 February 2015 at 13:22, Mark Gaiser mark...@gmail.com wrote:
  Glib and libxml also compile under windows.

 What's the need for windows compilation anyhow? The binary blob can be
 regenerated under Unix (when the .xml gets updated) and other
 platforms would just use it?

 --
 Giuseppe D'Angelo
 ___
 Development mailing list
 Development@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/development

___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Mime database size

2015-02-17 Thread Giuseppe D'Angelo
On 17 February 2015 at 13:22, Mark Gaiser mark...@gmail.com wrote:
 Glib and libxml also compile under windows.

What's the need for windows compilation anyhow? The binary blob can be
regenerated under Unix (when the .xml gets updated) and other
platforms would just use it?

-- 
Giuseppe D'Angelo
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development