From ba940ba9bd0546a4685bae8a3cebb478fc00ef70 Mon Sep 17 00:00:00 2001 From: Kaj Wallin Date: Mon, 10 May 2010 09:00:42 +0300 Subject: [PATCH] Fixed couple bugs and memory leaks from panels Reviewed by: --- situare.supp | 19 ++++++++++++++++--- src/ui/friendlistpanel.cpp | 4 ++-- src/ui/mapviewscreen.cpp | 19 +------------------ src/ui/panelsidebar.cpp | 6 ++++-- src/ui/userpanel.cpp | 11 ++--------- 5 files changed, 25 insertions(+), 34 deletions(-) diff --git a/situare.supp b/situare.supp index 41685db..174a5a7 100644 --- a/situare.supp +++ b/situare.supp @@ -590,6 +590,19 @@ obj:/targets/FREMANTLE_X86/opt/lib/libQtWebKit.so.4.6.2 obj:/targets/FREMANTLE_X86/opt/lib/libQtWebKit.so.4.6.2 } - - - +{ + TransWrite_at_X11 + Memcheck:Param + write(buf) + obj:/targets/FREMANTLE_X86/lib/libpthread-2.5.so + fun:_X11TransWrite + obj:/targets/FREMANTLE_X86/usr/lib/libX11.so.6.2.0 + fun:_XReply + fun:XGetWindowProperty + obj:/targets/FREMANTLE_X86/opt/lib/libQtGui.so.4.6.2 + obj:/targets/FREMANTLE_X86/opt/lib/libQtGui.so.4.6.2 + obj:/targets/FREMANTLE_X86/opt/lib/libQtGui.so.4.6.2 + obj:/targets/FREMANTLE_X86/opt/lib/libQtGui.so.4.6.2 + fun:_ZN12QApplicationD1Ev + fun:main +} diff --git a/src/ui/friendlistpanel.cpp b/src/ui/friendlistpanel.cpp index 830f0e2..cfd2402 100644 --- a/src/ui/friendlistpanel.cpp +++ b/src/ui/friendlistpanel.cpp @@ -55,11 +55,11 @@ FriendListPanel::FriendListPanel(QWidget *parent) m_friendsPanelTransitionOpen = m_friendsPanelStateClosed->addTransition( m_friendsPanelExpandButton, SIGNAL(clicked()), m_friendsPanelStateOpened); - m_friendsPanelTransitionOpen->addAnimation(new QPropertyAnimation(this, "pos")); + m_friendsPanelTransitionOpen->addAnimation(new QPropertyAnimation(this, "pos", this)); m_friendsPanelTransitionClose = m_friendsPanelStateOpened->addTransition( m_friendsPanelExpandButton, SIGNAL(clicked()), m_friendsPanelStateClosed); - m_friendsPanelTransitionClose->addAnimation(new QPropertyAnimation(this, "pos")); + m_friendsPanelTransitionClose->addAnimation(new QPropertyAnimation(this, "pos", this)); m_friendsPanelStateMachine->start(); } diff --git a/src/ui/mapviewscreen.cpp b/src/ui/mapviewscreen.cpp index 54517e1..4e9f398 100644 --- a/src/ui/mapviewscreen.cpp +++ b/src/ui/mapviewscreen.cpp @@ -71,23 +71,6 @@ MapViewScreen::MapViewScreen(QWidget *parent) QHBoxLayout *mapViewLayout = new QHBoxLayout; - //DEBUG -// QVBoxLayout *mapControlLayout = new QVBoxLayout; -// QWidget *mapControl = new QWidget(this); -// mapControl->setLayout(mapControlLayout); -// search = new QPushButton("Search", this); -// zoomOut = new QPushButton("-", this); -// zoomIn = new QPushButton("+", this); -// mapControlLayout->addWidget(&latLine); -// mapControlLayout->addWidget(&lonLine); -// mapControlLayout->addWidget(search); -// mapControlLayout->addWidget(zoomIn); -// mapControlLayout->addWidget(zoomOut); -// mapViewLayout->addWidget(mapControl); -// connect(search, SIGNAL(clicked()), this, SLOT(searchMap())); -// connect(zoomIn, SIGNAL(clicked()), mapEngine, SLOT(zoomIn())); -// connect(zoomOut, SIGNAL(clicked()), mapEngine, SLOT(zoomOut())); - //DEBUG osmLicense = new QLabel(this); osmLicense->setAttribute(Qt::WA_TranslucentBackground, true); @@ -137,7 +120,7 @@ void MapViewScreen::friendsLocationsReady(QList &friendsList) void MapViewScreen::drawOsmLicense(int width, int height) { - qWarning() << __PRETTY_FUNCTION__ << width << "x" << height; + qDebug() << __PRETTY_FUNCTION__ << width << "x" << height; osmLicense->move(width - osmLicense->fontMetrics().width(OSM_LICENSE) - PANEL_PEEK_AMOUNT, height - osmLicense->fontMetrics().height()); } diff --git a/src/ui/panelsidebar.cpp b/src/ui/panelsidebar.cpp index 1865933..87d63c5 100644 --- a/src/ui/panelsidebar.cpp +++ b/src/ui/panelsidebar.cpp @@ -58,7 +58,9 @@ void PanelSideBar::paintEvent(QPaintEvent *) void PanelSideBar::reDrawSidebar(int width, int height) { + Q_UNUSED(height); qDebug() << __PRETTY_FUNCTION__; - if(this->objectName() == "left"); - this->move(width-21,0); + if(this->objectName() == "SidePanelRight") { + this->move(width-21,0); + } } diff --git a/src/ui/userpanel.cpp b/src/ui/userpanel.cpp index 3e8913f..4caeefb 100644 --- a/src/ui/userpanel.cpp +++ b/src/ui/userpanel.cpp @@ -34,13 +34,6 @@ UserInfoPanel::UserInfoPanel(QWidget *parent) m_userPanelVBox->addWidget(m_userPanelLabel); // this->setAutoFillBackground(true); -// this->setAttribute(Qt::WA_TranslucentBackground); -// this->setWindowOpacity(0.5); //DEFUNCT - -// QPalette userPanelPalette; -// userPanelPalette.setBrush(this->backgroundRole(), -// QBrush(QImage(":/res/personal_info_bckgrnd.png"))); -// this->setPalette(userPanelPalette); m_userPanelStateMachine = new QStateMachine(this); m_userPanelStateClosed = new QState(m_userPanelStateMachine); @@ -54,11 +47,11 @@ UserInfoPanel::UserInfoPanel(QWidget *parent) m_userPanelTransitionOpen = m_userPanelStateClosed->addTransition( m_userPanelExpandButton, SIGNAL(clicked()), m_userPanelStateOpened); - m_userPanelTransitionOpen->addAnimation(new QPropertyAnimation(this, "pos")); + m_userPanelTransitionOpen->addAnimation(new QPropertyAnimation(this, "pos", this)); m_userPanelTransitionClose = m_userPanelStateOpened->addTransition( m_userPanelExpandButton, SIGNAL(clicked()), m_userPanelStateClosed); - m_userPanelTransitionClose->addAnimation(new QPropertyAnimation(this, "pos")); + m_userPanelTransitionClose->addAnimation(new QPropertyAnimation(this, "pos", this)); m_userPanelStateMachine->start(); this->setObjectName("UserPanel"); -- 1.7.9.5