[Development] (long) thoughts on categorized logging (qLog)

2012-02-21 Thread Lincoln Ramsay
Hi all, There seems to be some confusion over what qLog is and is not. I suspect that the direction was perhaps mis-aligned slightly. Please allow me to try to summarize things. This is more of a vision thing and in writing this, parts of the implementation have been identified that should be

Re: [Development] QLog ( Work on qDebug and friends)

2012-02-21 Thread wolfgang.beck
OK, So we've now 2 options to set the config file. 1. QLOG_CONFIG_FILE environment variable 2. setDefaultConfigFile function. What do you mean with: ... and to supplying a QIODevice*? B.R. WB -Original Message- From: development-bounces+wolfgang.beck=nokia@qt-project.org [mailto:d

Re: [Development] QLog ( Work on qDebug and friends)

2012-02-21 Thread wolfgang.beck
We had this discussion before in the ML to add cool stuff like Log into local socked, syslog or whatever. This can be done later in an AddOn for example. Cheers, WB -Original Message- From: development-bounces+wolfgang.beck=nokia@qt-project.org [mailto:development-bounces+wolfgang.

Re: [Development] QLog ( Work on qDebug and friends)

2012-02-21 Thread wolfgang.beck
Why you want to use the categories somewhere else then QLog? You want to reinvent a mechanism to filter the categories then? If you don't filter what sense makes having the categories? I mean you still have qDebug and you can write whatever you like. Cheers, WB -Original Message- From:

Re: [Development] QLog ( Work on qDebug and friends)

2012-02-21 Thread wolfgang.beck
Yes David, Absolutely right. B.R. WB -Original Message- From: ext David Faure [mailto:david.fa...@kdab.com] Sent: Tuesday, February 21, 2012 8:08 PM To: Koehne Kai (Nokia-MP/Berlin) Cc: Beck Wolfgang (Nokia-MP/Brisbane); development@qt-project.org Subject: Re: [Development] QLog ( Wor

Re: [Development] QLog ( Work on qDebug and friends)

2012-02-21 Thread wolfgang.beck
> So how about adding another QtMsgType called QLogMsg, that qLog() uses? In > contrast to qDebug/QtDebugMsg, qLog/QtLogMsg messages would not be processed > by default, unless the configuration file (or an environment variable) says > so ... There is no need for this Kai. The macro will not ev

Re: [Development] QLog ( Work on qDebug and friends)

2012-02-21 Thread wolfgang.beck
QLOG ENABLED I guess you misunderstood me. QLog is enabled ONLY if a config file was found. We have 3 ways to define the config file: 1. Default using application name configuration default path and organization name for the path 2. Application developer can call the QLog function "setDefaultConf

Re: [Development] Mirror of Qt on github?

2012-02-21 Thread Rohan McGovern
Holger Hans Peter Freyther said: > Hi, > > my jenkins build server is having a lot of build issues due of gitorious.org > not being able to serve via the git protocol (git-daemon). One of the latest > failures can be seen here[1]. Should we try to have Gerrit replicate to > github.com or any other

[Development] Mirror of Qt on github?

2012-02-21 Thread Holger Hans Peter Freyther
Hi, my jenkins build server is having a lot of build issues due of gitorious.org not being able to serve via the git protocol (git-daemon). One of the latest failures can be seen here[1]. Should we try to have Gerrit replicate to github.com or any other more reliable git hosting provider? holger

Re: [Development] Deprecating QString::{v,}sprintf()

2012-02-21 Thread BRM
> From: Olivier Goffart > On Tuesday 21 February 2012 14:03:26 Marc Mutz wrote: >> On Tuesday February 21 2012, Marc Mutz wrote: >> > On Tuesday February 21 2012, Marc Mutz wrote: >> > > Hi, >> > > >> > > The QString header contains a ### about removing sprintf() in > 5.0, but >> > > it's

Re: [Development] Deprecating QString::{v,}sprintf()

2012-02-21 Thread Olivier Goffart
On Tuesday 21 February 2012 14:03:26 Marc Mutz wrote: > On Tuesday February 21 2012, Marc Mutz wrote: > > On Tuesday February 21 2012, Marc Mutz wrote: > > > Hi, > > > > > > The QString header contains a ### about removing sprintf() in 5.0, but > > > it's still there. I'd like to deprecate them. >

Re: [Development] Deprecating QString::{v,}sprintf()

2012-02-21 Thread Thiago Macieira
On terça-feira, 21 de fevereiro de 2012 18.28.44, Marc Mutz wrote: > It does use QLocale methods for formatting, and it supports the l modifier > to %s. For a port to QByteArray, we'd need to define what encoding to > assume (QString expects utf-8 on input, and we'd keep that, but we need to > dec

Re: [Development] Deprecating QString::{v,}sprintf()

2012-02-21 Thread Marc Mutz
On Tuesday February 21 2012, Marc Mutz wrote: > On Tuesday February 21 2012, you wrote: > > On Tue, Feb 21, 2012 at 3:20 PM, wrote: > > > Is there any reason why we cannot move QString::asprintf() to > > > QByteArray::asprintf() instead? > > > > If your data is already in a QString, you're going

Re: [Development] Deprecating QString::{v,}sprintf()

2012-02-21 Thread Marc Mutz
On Tuesday February 21 2012, you wrote: > On Tue, Feb 21, 2012 at 3:20 PM, wrote: > > Is there any reason why we cannot move QString::asprintf() to > > QByteArray::asprintf() instead? > > If your data is already in a QString, you're going to pay a rather > large penalty to copy it all to a byte a

Re: [Development] Deprecating QString::{v,}sprintf()

2012-02-21 Thread Thiago Macieira
On terça-feira, 21 de fevereiro de 2012 15.58.25, jan-arve.saet...@nokia.com wrote: > I'm not sure why qmake needs to work with QStrings though.. Because qmake was a port into C++ of the previous Perl-based build system called tmake[1]. Qt 2.3.1 [2] still used it, as you can see from the tools/Mak

Re: [Development] Changing qreal to a float

2012-02-21 Thread Thiago Macieira
On terça-feira, 21 de fevereiro de 2012 06.34.35, BRM wrote: > Perhaps a template is not the best option? > Perhaps an abstract/virtual class that is derived from for the various > classes would be better? Perhaps templates are not the best option, but a class with virtuals definitely isn't. I don

Re: [Development] Changing qreal to a float

2012-02-21 Thread Thiago Macieira
On terça-feira, 21 de fevereiro de 2012 15.40.16, jan-arve.saet...@nokia.com wrote: > Sorry for top-posting from my N9... > > > I was thinking the same, but I'm afraid we can't change it, since it would > cause too many subtle bugs. > The best thing I can think is to deprecate it, and add a QRectS

Re: [Development] Deprecating QString::{v,}sprintf()

2012-02-21 Thread jan-arve.saether
Sorry for top-posting again... I'm not sure I understand. The code that Marc fixed mostly needed to pay the penalty of converting the QString to a QByteArray. For the majority of the other cases, the code should have used tr().arg(). The code in qmake was however an exception, since it works w

Re: [Development] Changing qreal to a float

2012-02-21 Thread jan-arve.saether
Sorry for top-posting from my N9... I was thinking the same, but I'm afraid we can't change it, since it would cause too many subtle bugs. The best thing I can think is to deprecate it, and add a QRectS or QRectI, but I'm not utterly convinced... Jan-Arve 21.02.12 15:31 skrev ext Andreas A

Re: [Development] Deprecating QString::{v,}sprintf()

2012-02-21 Thread Robin Burchell
On Tue, Feb 21, 2012 at 3:20 PM, wrote: > Is there any reason why we cannot move QString::asprintf() to > QByteArray::asprintf() instead? If your data is already in a QString, you're going to pay a rather large penalty to copy it all to a byte array just to use that, and then convert it back. _

Re: [Development] Deprecating QString::{v,}sprintf()

2012-02-21 Thread Andreas Aardal Hanssen
2012/2/21 > return QString::asprintf("%d bytes", int(number)); > should be: > return tr("%n bytes", 0, number); > > Same here: > const QString num = QString::asprintf("%.1f KB/s", bytesPerSecond / > 1024.0); > should be: > const QString num = tr("%1 KB/s").arg(bytesPerSecond/1024.0, 0, 'f', 1); >

Re: [Development] Deprecating QString::{v,}sprintf()

2012-02-21 Thread Marc Mutz
On Tuesday February 21 2012, jan-arve.saet...@nokia.com wrote: > This leads me to my question: > Is there any reason why we cannot move QString::asprintf() to > QByteArray::asprintf() instead? I'd be fine with that. -- Marc Mutz | Senior Software Engineer KDAB (Deutschland) GmbH & Co.KG, a KDAB

Re: [Development] Changing qreal to a float

2012-02-21 Thread andre.poenitz
BRM [bm_witn...@yahoo.com] > Perhaps a template is not the best option? > Perhaps an abstract/virtual class that is derived from for the various > classes would be better? Not at all. The discuasion was initiiated by performance and size considerations. Andre' _

Re: [Development] Changing qreal to a float

2012-02-21 Thread BRM
> From: Thiago Macieira > On terça-feira, 21 de fevereiro de 2012 09.59.49, Marc Mutz wrote: >> A tangential question: should QRect be QBasicRect (in which case > it >> would  probably have a class invariant of right()-left()==width() instead >> of width()-1 as now. If there is a plan to move

Re: [Development] Changing qreal to a float

2012-02-21 Thread Andreas Aardal Hanssen
2012/2/21 Thiago Macieira > On terça-feira, 21 de fevereiro de 2012 09.59.49, Marc Mutz wrote: > > sure I'd like that), then keeping QRect and using QRectI = > QBasicRect > > could do the trick. > QRect must have the same semantics as it has today. Whether we want to add > a > *second* rectangle

Re: [Development] Deprecating QString::{v,}sprintf()

2012-02-21 Thread jan-arve.saether
ext Marc Mutz wrote on 2012-02-21: > > https://codereview.qt-project.org/#change,17062 > > The patch also nicely highlights how and where QString().sprintf() is > used in Qt itself, because it adjusts all callers. > This caught my interest, so I checked some of the callers to see how sprintf wa

Re: [Development] Deprecating QString::{v,}sprintf()

2012-02-21 Thread Thiago Macieira
On terça-feira, 21 de fevereiro de 2012 12.12.52, Marc Mutz wrote: > QString::arg() can't deal with va_lists. Are you proposing to disable > qDebug() for non-C++11-compilers? No, but I also fail to see why we need QString::sprintf for qDebug. qDebug should operate on char, not on UTF-16, and thu

Re: [Development] Deprecating QString::{v,}sprintf()

2012-02-21 Thread Marc Mutz
On Tuesday February 21 2012, Marc Mutz wrote: > On Tuesday February 21 2012, Marc Mutz wrote: > > Hi, > > > > The QString header contains a ### about removing sprintf() in 5.0, but > > it's still there. I'd like to deprecate them. > > > > I have a long-standing hate of the fact that QString::sprint

Re: [Development] QLog ( Work on qDebug and friends)

2012-02-21 Thread kai.koehne
> -Original Message- > From: development-bounces+kai.koehne=nokia@qt-project.org > [mailto:development-bounces+kai.koehne=nokia@qt-project.org] On > Behalf Of ext Thiago Macieira > Sent: Tuesday, February 21, 2012 11:13 AM > To: development@qt-project.org > Subject: Re: [Developmen

Re: [Development] QLog ( Work on qDebug and friends)

2012-02-21 Thread kai.koehne
> -Original Message- > From: development-bounces+kai.koehne=nokia@qt-project.org > [mailto:development-bounces+kai.koehne=nokia@qt-project.org] On > Behalf Of Potter Lorn (Nokia-MP/Brisbane) > Sent: Tuesday, February 21, 2012 11:47 AM > To: david.fa...@kdab.com > Cc: development@qt

Re: [Development] Deprecating QString::{v,}sprintf()

2012-02-21 Thread Marc Mutz
On Tuesday February 21 2012, Thiago Macieira wrote: > On terça-feira, 21 de fevereiro de 2012 10.56.41, Marc Mutz wrote: > > Bottomline: until we can expect variadic template support for Qt, I think > > we need to keep it. Many people have over the years tried to eradicate > > printf, but it's syn

Re: [Development] QSystemAlignedTimer to QtCore

2012-02-21 Thread Sergio Ahumada
On 02/20/2012 02:36 PM, ext Thiago Macieira wrote: > On segunda-feira, 20 de fevereiro de 2012 12.40.33, kranthi.kumar- > kunt...@nokia.com wrote: >> Hi, >> >> Ok, due to the fact that features have been freezed for Qt5.0 am proposing >> this to be an addon module. >> >> so am sending a request for

Re: [Development] QLog ( Work on qDebug and friends)

2012-02-21 Thread David Faure
On Tuesday 21 February 2012 10:47:18 lorn.pot...@nokia.com wrote: > On 21/02/2012, at 8:28 PM, ext David Faure wrote: > > On Tuesday 21 February 2012 10:21:29 lorn.pot...@nokia.com wrote: > >> On 21/02/2012, at 7:36 PM, ext David Faure wrote: > >>> On Tuesday 21 February 2012 06:28:38 wolfgang.b...

Re: [Development] QLog ( Work on qDebug and friends)

2012-02-21 Thread lorn.potter
On 21/02/2012, at 8:28 PM, ext David Faure wrote: > On Tuesday 21 February 2012 10:21:29 lorn.pot...@nokia.com wrote: >> On 21/02/2012, at 7:36 PM, ext David Faure wrote: >>> On Tuesday 21 February 2012 06:28:38 wolfgang.b...@nokia.com wrote: I'm preferring having QLog active only if a confi

Re: [Development] QLog ( Work on qDebug and friends)

2012-02-21 Thread David Faure
On Tuesday 21 February 2012 10:19:49 kai.koe...@nokia.com wrote: > > -Original Message- > > From: ext David Faure [mailto:david.fa...@kdab.com] > > > > Isn't the same information given by "a category is present in the > > QMessageLogContext"? All qLog calls are forced to get a category, ri

Re: [Development] QLog ( Work on qDebug and friends)

2012-02-21 Thread David Faure
On Tuesday 21 February 2012 10:21:29 lorn.pot...@nokia.com wrote: > On 21/02/2012, at 7:36 PM, ext David Faure wrote: > > On Tuesday 21 February 2012 06:28:38 wolfgang.b...@nokia.com wrote: > >> I'm preferring having QLog active only if a config file is there. > >> It doesn't make sense to me at al

Re: [Development] QLog ( Work on qDebug and friends)

2012-02-21 Thread lorn.potter
On 21/02/2012, at 7:36 PM, ext David Faure wrote: > On Tuesday 21 February 2012 06:28:38 wolfgang.b...@nokia.com wrote: >> I'm preferring having QLog active only if a config file is there. >> It doesn't make sense to me at all having an environment variable that can >> activate QLog but not confi

Re: [Development] QLog ( Work on qDebug and friends)

2012-02-21 Thread kai.koehne
> -Original Message- > From: ext David Faure [mailto:david.fa...@kdab.com] > Sent: Tuesday, February 21, 2012 11:08 AM > To: Koehne Kai (Nokia-MP/Berlin) > Cc: Beck Wolfgang (Nokia-MP/Brisbane); development@qt-project.org > Subject: Re: [Development] QLog ( Work on qDebug and friends) > >

Re: [Development] QLog ( Work on qDebug and friends)

2012-02-21 Thread Thiago Macieira
On terça-feira, 21 de fevereiro de 2012 10.02.23, kai.koe...@nokia.com wrote: > So how about adding another QtMsgType called QLogMsg, that qLog() uses? In > contrast to qDebug/QtDebugMsg, qLog/QtLogMsg messages would not be > processed by default, unless the configuration file (or an environment >

Re: [Development] QLog ( Work on qDebug and friends)

2012-02-21 Thread David Faure
On Tuesday 21 February 2012 10:02:23 kai.koe...@nokia.com wrote: > I agree with that: On the desktop it's quite handy to see also detailed > output on stderr/the shell (which one can redirect to a file if needed). > But I also think that qLog() messages shouldn't show up by default for > normal use

Re: [Development] Deprecating QString::{v,}sprintf()

2012-02-21 Thread Thiago Macieira
On terça-feira, 21 de fevereiro de 2012 10.56.41, Marc Mutz wrote: > Bottomline: until we can expect variadic template support for Qt, I think > we need to keep it. Many people have over the years tried to eradicate > printf, but it's syntax is just too compact. Add a C++11 proper function and le

Re: [Development] QLog ( Work on qDebug and friends)

2012-02-21 Thread kai.koehne
> -Original Message- > From: development-bounces+kai.koehne=nokia@qt-project.org > [mailto:development-bounces+kai.koehne=nokia@qt-project.org] On > Behalf Of ext David Faure > Sent: Tuesday, February 21, 2012 10:36 AM > To: Beck Wolfgang (Nokia-MP/Brisbane) > Cc: development@qt-pro

Re: [Development] Deprecating QString::{v,}sprintf()

2012-02-21 Thread Marc Mutz
On Tuesday February 21 2012, Thiago Macieira wrote: > On terça-feira, 21 de fevereiro de 2012 10.33.12, Marc Mutz wrote: > > 2. Add static QString::{v,}asprintf() > > Do we need them? You can't pass non-POD via ellipsis, so it's not very easy > to use. I'd much rather you invested time in a C++-sty

Re: [Development] Deprecating QString::{v,}sprintf()

2012-02-21 Thread Thiago Macieira
On terça-feira, 21 de fevereiro de 2012 10.33.12, Marc Mutz wrote: > 2. Add static QString::{v,}asprintf() Do we need them? You can't pass non-POD via ellipsis, so it's not very easy to use. I'd much rather you invested time in a C++-style formatting. We already have QString::arg(). -- Thiago Ma

Re: [Development] Deprecating QString::{v,}sprintf()

2012-02-21 Thread Marc Mutz
On Tuesday February 21 2012, Marc Mutz wrote: > Hi, > > The QString header contains a ### about removing sprintf() in 5.0, but it's > still there. I'd like to deprecate them. > > I have a long-standing hate of the fact that QString::sprintf() is not > static, so my preferred solution would be to ma

Re: [Development] QLog ( Work on qDebug and friends)

2012-02-21 Thread David Faure
On Tuesday 21 February 2012 06:28:38 wolfgang.b...@nokia.com wrote: > I'm preferring having QLog active only if a config file is there. > It doesn't make sense to me at all having an environment variable that can > activate QLog but not config file to activate the categories. As long there > is no

Re: [Development] Changing qreal to a float

2012-02-21 Thread Thiago Macieira
On terça-feira, 21 de fevereiro de 2012 09.59.49, Marc Mutz wrote: > A tangential question: should QRect be QBasicRect (in which case it > would probably have a class invariant of right()-left()==width() instead > of width()-1 as now. If there is a plan to move to CRect semantics (not > sure I'd l

Re: [Development] Changing qreal to a float

2012-02-21 Thread Thiago Macieira
On terça-feira, 21 de fevereiro de 2012 10.02.24, Marc Mutz wrote: > One would disallow compilers to instantiate the template with C++11 extern > templates (this would be a good idea for all templates, esp. those with > arguments constrained to just a few potential types). All other compilers: > wh

Re: [Development] Changing qreal to a float

2012-02-21 Thread Marc Mutz
On Tuesday February 21 2012, André Somers wrote: > Op 21-2-2012 9:35, Thiago Macieira schreef: > > On terça-feira, 21 de fevereiro de 2012 08.24.52, Samuel Rødal wrote: > >> Also, I guess we'll want convenience functions "QRectD QRectF::toRectD() > >> const" etc. Can that be done with the typedefs

Re: [Development] Changing qreal to a float

2012-02-21 Thread Marc Mutz
On Tuesday February 21 2012, Thiago Macieira wrote: > On terça-feira, 21 de fevereiro de 2012 08.24.52, Samuel Rødal wrote: > > Also, I guess we'll want convenience functions "QRectD QRectF::toRectD() > > const" etc. Can that be done with the typedefs proposed above, or does > > it require having "

Re: [Development] Changing qreal to a float

2012-02-21 Thread Thiago Macieira
On terça-feira, 21 de fevereiro de 2012 09.38.58, André Somers wrote: > Just wondering: while I think using templates for these classes is a > good idea in principle, will using such template magic as you are > suggesting here hurt compilation times, both of Qt itself and Qt > applications using th

[Development] Deprecating QString::{v,}sprintf()

2012-02-21 Thread Marc Mutz
Hi, The QString header contains a ### about removing sprintf() in 5.0, but it's still there. I'd like to deprecate them. I have a long-standing hate of the fact that QString::sprintf() is not static, so my preferred solution would be to make it static, but that silently breaks existing usage o

Re: [Development] Changing qreal to a float

2012-02-21 Thread André Somers
Op 21-2-2012 9:35, Thiago Macieira schreef: > On terça-feira, 21 de fevereiro de 2012 08.24.52, Samuel Rødal wrote: >> Also, I guess we'll want convenience functions "QRectD QRectF::toRectD() >> const" etc. Can that be done with the typedefs proposed above, or does >> it require having "QRectD QRec

Re: [Development] Changing qreal to a float

2012-02-21 Thread Thiago Macieira
On terça-feira, 21 de fevereiro de 2012 08.24.52, Samuel Rødal wrote: > Also, I guess we'll want convenience functions "QRectD QRectF::toRectD() > const" etc. Can that be done with the typedefs proposed above, or does > it require having "QRectD QRectD::toRectD() const" as well? With some template

Re: [Development] Proposing Sergey Dubitskiy for Approver Status

2012-02-21 Thread Thiago Macieira
On terça-feira, 21 de fevereiro de 2012 02.20.59, daniel.p...@nokia.com wrote: > I support this nomination. That means we'll hear objections to Sergey Dubitskiy becoming an Approver until March 20. -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Source Techno

Re: [Development] QLog ( Work on qDebug and friends)

2012-02-21 Thread Thiago Macieira
On terça-feira, 21 de fevereiro de 2012 07.15.48, wolfgang.b...@nokia.com wrote: > We have a default config file which uses a hardcoded filename but the path > to this file is created with the default config file path + organization > name + application name. I don't want this. Application names a