summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-05-20 18:32:37 -0500
committerSlávek Banko <slavek.banko@axis.cz>2013-05-30 13:41:49 +0200
commit6eac96c4dd6fc80088193e53801ad3da957e4138 (patch)
tree2a34e0a96f3127d422859e25bbe6110fa9982625
parentaaa6198c4f2a1f7974e45b57524bbd4d8bfa40aa (diff)
downloadtdelibs-6eac96c4dd6fc80088193e53801ad3da957e4138.tar.gz
tdelibs-6eac96c4dd6fc80088193e53801ad3da957e4138.zip
Fix invalid toolbar data structure size declarations
This cleans up a slew of Valgrind memcheck warnings (cherry picked from commit b1c819c3238e94960154915f1ae14131fdb25cf8)
-rw-r--r--kdeui/ktoolbar.cpp7
-rw-r--r--kdeui/ktoolbarbutton.cpp65
2 files changed, 40 insertions, 32 deletions
diff --git a/kdeui/ktoolbar.cpp b/kdeui/ktoolbar.cpp
index b569a2ec6..fec97dea1 100644
--- a/kdeui/ktoolbar.cpp
+++ b/kdeui/ktoolbar.cpp
@@ -88,6 +88,7 @@ public:
m_enableContext = true;
+ m_parent = NULL;
m_xmlguiClient = 0;
oldPos = TQt::DockUnmanaged;
@@ -225,7 +226,8 @@ KToolBar::~KToolBar()
void KToolBar::init( bool readConfig, bool honorStyle )
{
- d = new KToolBarPrivate;
+ d = new KToolBarPrivate();
+
setFullSize( true );
d->m_honorStyle = honorStyle;
context = 0;
@@ -1915,8 +1917,9 @@ void KToolBar::loadState( const TQDomElement &element )
// Apply transparent-toolbar-moving setting (ok, this is global to the mainwindow,
// but we do it only if there are toolbars...)
// KDE4: move to KMainWindow
- if ( transparentSetting() != !mw->opaqueMoving() )
+ if ( transparentSetting() != !mw->opaqueMoving() ) {
mw->setOpaqueMoving( !transparentSetting() );
+ }
}
int KToolBar::dockWindowIndex()
diff --git a/kdeui/ktoolbarbutton.cpp b/kdeui/ktoolbarbutton.cpp
index a2d3c27fe..ac0b8ba7e 100644
--- a/kdeui/ktoolbarbutton.cpp
+++ b/kdeui/ktoolbarbutton.cpp
@@ -53,8 +53,32 @@ template class TQIntDict<KToolBarButton>;
class KToolBarButtonPrivate
{
public:
- KToolBarButtonPrivate()
- {
+ KToolBarButtonPrivate();
+ ~KToolBarButtonPrivate();
+
+ int m_id;
+ bool m_buttonDown;
+ bool m_noStyle;
+ bool m_isSeparator;
+ bool m_isRadio;
+ bool m_highlight;
+ bool m_isRaised;
+ bool m_isActive;
+
+ TQString m_iconName;
+
+ KToolBar *m_parent;
+ KToolBar::IconText m_iconText;
+ int m_iconSize;
+ TQSize size;
+
+ TQPoint m_mousePressPos;
+
+ KInstance *m_instance;
+};
+
+KToolBarButtonPrivate::KToolBarButtonPrivate()
+{
m_buttonDown = false;
m_noStyle = false;
@@ -70,37 +94,18 @@ public:
m_parent = 0;
m_instance = KGlobal::instance();
- }
- ~KToolBarButtonPrivate()
- {
- }
-
- int m_id;
- bool m_buttonDown : 1;
- bool m_noStyle: 1;
- bool m_isSeparator: 1;
- bool m_isRadio: 1;
- bool m_highlight: 1;
- bool m_isRaised: 1;
- bool m_isActive: 1;
-
- TQString m_iconName;
-
- KToolBar *m_parent;
- KToolBar::IconText m_iconText;
- int m_iconSize;
- TQSize size;
-
- TQPoint m_mousePressPos;
+}
- KInstance *m_instance;
-};
+KToolBarButtonPrivate::~KToolBarButtonPrivate()
+{
+ //
+}
// This will construct a separator
KToolBarButton::KToolBarButton( TQWidget *_parent, const char *_name )
: TQToolButton( _parent , _name)
{
- d = new KToolBarButtonPrivate;
+ d = new KToolBarButtonPrivate();
resize(6,6);
hide();
@@ -112,7 +117,7 @@ KToolBarButton::KToolBarButton( const TQString& _icon, int _id,
const TQString &_txt, KInstance *_instance )
: TQToolButton( _parent, _name ), d( 0 )
{
- d = new KToolBarButtonPrivate;
+ d = new KToolBarButtonPrivate();
d->m_id = _id;
TQToolButton::setTextLabel(_txt);
@@ -146,7 +151,7 @@ KToolBarButton::KToolBarButton( const TQPixmap& pixmap, int _id,
const TQString& txt)
: TQToolButton( _parent, name ), d( 0 )
{
- d = new KToolBarButtonPrivate;
+ d = new KToolBarButtonPrivate();
d->m_id = _id;
TQToolButton::setTextLabel(txt);
@@ -507,7 +512,7 @@ void KToolBarButton::drawButton( TQPainter *_painter )
{
TQPixmap pixmap = iconSet().pixmap( TQIconSet::Automatic,
isEnabled() ? (d->m_isActive ? TQIconSet::Active : TQIconSet::Normal) :
- TQIconSet::Disabled,
+ TQIconSet::Disabled,
isOn() ? TQIconSet::On : TQIconSet::Off );
if( !pixmap.isNull())
{