[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: koffice/kexi/kexidb/drivers/mySQL
From:       David Faure <dfaure () klaralvdalens-datakonsult ! se>
Date:       2004-02-26 14:49:25
Message-ID: 200402261549.25459.dfaure () klaralvdalens-datakonsult ! se
[Download RAW message or body]

On Thursday 26 February 2004 15:48, Matt Rogers wrote:
> On Thursday 26 February 2004 08:45 am, David Faure wrote:
> > On Thursday 26 February 2004 15:43, Matt Rogers wrote:
> > > On Thursday 26 February 2004 08:16 am, Jaroslaw Staniek wrote:
> > > > CVS commit by staniek:
> > > >
> > > > compile fix, thx dfaure
> > > >
> > > >
> > > >   M +1 -1      mysqlcursor.cpp   1.13
> > > >
> > > >
> > > > --- koffice/kexi/kexidb/drivers/mySQL/mysqlcursor.cpp  #1.12:1.13
> > > > @@ -52,5 +52,5 @@ MySqlCursor::~MySqlCursor() {
> > > >  bool MySqlCursor::drv_open(const QString& statement) {
> > > >
> > > > -        MySqlConnection *conn=(MySqlConnection*)m_conn;
> > > > +        MySqlConnection *conn=static_cast<MySqlConnection*>(
> > > > static_cast<Connection*>(m_conn) ); if ( (!conn)  || (!conn->m_mysql))
> > > > { //should never happen, but who knows
> > >
> > > The double cast here seems redundant, but I haven't looked at the code.
> > > Shouldn't m_conn already be a Connection pointer?
> >
> > If you looked at the code, you'd notice it's a QGuardedPtr.
> 
> that's what i get for not looking at the code. :/

Besides, if it was a Connection*, then it would have compiled in the first place,
and no commit would have been done ;-)

Anyway. I wish QGuardedPtr had an explicit accessor for the pointer inside it
(other than &(*foo) or anything equally ugly), to remove the need for such casts.

-- 
David Faure -- faure@kde.org, dfaure@klaralvdalens-datakonsult.se
Qt/KDE/KOffice developer
Klarälvdalens Datakonsult AB, Platform-independent software solutions

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic