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

List:       kde-devel
Subject:    const-correctness in part.h
From:       "Christian Loose" <Christian.Loose () hamburg ! de>
Date:       2001-08-22 17:55:41
[Download RAW message or body]

Hi!

I was just looking at the source code of the kpart-library, when I came
across the
member functions widget() and manager(). I think, they should be declared
const,
because they don't change the internal state of the Part-class. Please apply
the attached
patch when you go conform with my opinion, because I don' t have access to
cvs.

I hope, I helped....

Bye
Christian

Index: kparts/part.cpp
===================================================================
RCS file: /home/kde/kdelibs/kparts/part.cpp,v
retrieving revision 1.95
diff -u -3 -p -u -r1.95 part.cpp
--- kparts/part.cpp 2001/07/17 13:04:58 1.95
+++ kparts/part.cpp 2001/08/21 18:27:38
@@ -144,7 +144,7 @@ void Part::embed( QWidget * parentWidget
widget()->reparent( parentWidget, 0, QPoint( 0, 0 ), true );
}
-QWidget *Part::widget()
+QWidget *Part::widget() const
{
return m_widget;
}
@@ -154,7 +154,7 @@ void Part::setManager( PartManager *mana
m_manager = manager;
}
-PartManager *Part::manager()
+PartManager *Part::manager() const
{
return m_manager;
}
Index: kparts/part.h
===================================================================
RCS file: /home/kde/kdelibs/kparts/part.h,v
retrieving revision 1.81
diff -u -3 -p -u -r1.81 part.h
--- kparts/part.h 2001/04/11 18:25:56 1.81
+++ kparts/part.h 2001/08/21 18:27:38
@@ -155,7 +155,7 @@ public:
/**
* @return The widget defined by this part, set by @ref setWidget().
*/
- virtual QWidget *widget();
+ virtual QWidget *widget() const;
/**
* @internal
@@ -166,7 +166,7 @@ public:
/**
* Returns the part manager handling this part, if any (0L otherwise).
*/
- PartManager * manager();
+ PartManager * manager() const;
/**
* @internal

 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

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

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