From kde-commits Fri May 31 22:17:47 2013 From: Emmanuel Lepage Vallee Date: Fri, 31 May 2013 22:17:47 +0000 To: kde-commits Subject: [sflphone-kde/abstractmodels] src: [ #24595 ] Fix some Coverity Scan issues Message-Id: <20130531221747.955E1A6067 () git ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=137003867607790 Git commit 32d6026f8fb37aa99e530b86b75bb0d15d20f8bf by Emmanuel Lepage Vall= ee. Committed on 01/06/2013 at 00:17. Pushed by lepagevalleeemmanuel into branch 'abstractmodels'. [ #24595 ] Fix some Coverity Scan issues M +1 -0 src/accountwizard.cpp M +3 -1 src/delegates/delegatedropoverlay.cpp M +1 -1 src/klib/configurationskeleton.cpp M +1 -1 src/klib/tipanimationwrapper.cpp M +1 -1 src/lib/account.cpp M +1 -1 src/lib/callmodel.cpp M +0 -1 src/widgets/categorizedtreeview.cpp M +4 -2 src/widgets/tips/ringingtip.cpp http://commits.kde.org/sflphone-kde/32d6026f8fb37aa99e530b86b75bb0d15d20f8bf diff --git a/src/accountwizard.cpp b/src/accountwizard.cpp index 14ee0ab..d0fe040 100644 --- a/src/accountwizard.cpp +++ b/src/accountwizard.cpp @@ -133,6 +133,7 @@ int AccountWizard::sendRequest(const QString& host, int= port, const QString& req } = fclose(f); + delete f; shutdown(s, 2); ::close(s); return 0; diff --git a/src/delegates/delegatedropoverlay.cpp b/src/delegates/delegate= dropoverlay.cpp index 9ef8a8a..35b5fb9 100644 --- a/src/delegates/delegatedropoverlay.cpp +++ b/src/delegates/delegatedropoverlay.cpp @@ -33,7 +33,7 @@ = ///Constructor DelegateDropOverlay::DelegateDropOverlay(QObject* parent):QObject(parent), -m_pTimer(0),m_Init(false),m_Reverse(1) +m_pTimer(0),m_Init(false),m_Reverse(1),m_lpButtons(nullptr) { const QColor color =3D QApplication::palette().base().color(); const bool dark =3D (color.red() > 128 && color.green() > 128 && color.= blue() > 128); @@ -52,6 +52,8 @@ DelegateDropOverlay::~DelegateDropOverlay() ///How to paint void DelegateDropOverlay::paintEvent(QPainter* painter, const QStyleOption= ViewItem& option, const QModelIndex& index) { + if (!m_lpButtons) + return; int step =3D index.data(ContactBackend::Role::DropState).toInt(); if ((step =3D=3D 1 || step =3D=3D -1) && m_lActiveIndexes.indexOf(index= ) =3D=3D -1) { m_lActiveIndexes << index; diff --git a/src/klib/configurationskeleton.cpp b/src/klib/configurationske= leton.cpp index 4d5931c..b15b57e 100644 --- a/src/klib/configurationskeleton.cpp +++ b/src/klib/configurationskeleton.cpp @@ -94,7 +94,7 @@ void ConfigurationSkeleton::readConfig() = kDebug() << "configurationManager.getCurrentAudioOutputPlugin() =3D " <= < configurationManager.getCurrentAudioOutputPlugin(); setAlsaPlugin(configurationManager.getCurrentAudioOutputPlugin()); - bool ok; + bool ok =3D false; QStringList devices =3D configurationManager.getCurrentAudioDevicesInde= x(); int inputDevice =3D0; if (devices.size() > 1) { diff --git a/src/klib/tipanimationwrapper.cpp b/src/klib/tipanimationwrappe= r.cpp index 1efb9ce..8b9b5b0 100644 --- a/src/klib/tipanimationwrapper.cpp +++ b/src/klib/tipanimationwrapper.cpp @@ -26,7 +26,7 @@ #include "tipmanager.h" = TipAnimationWrapper::TipAnimationWrapper(QObject* parent) : QObject(parent= ),m_MaxStep(15),m_Step(0),m_pTimer(nullptr),m_TipSize(QSize(0,0)), -m_pTip(nullptr),m_pCurrentTip(nullptr) +m_pTip(nullptr),m_pCurrentTip(nullptr),m_CurrentAnimation(Tip::TipAnimatio= n::None) { connect(parent, SIGNAL(sizeChanged(QRect,bool)) , this , SLOT(sizeChang= ed(QRect,bool)) ); connect(parent, SIGNAL(currentTipChanged(Tip*)) , this , SLOT(currentCh= anged(Tip*)) ); diff --git a/src/lib/account.cpp b/src/lib/account.cpp index 982284f..88fae80 100644 --- a/src/lib/account.cpp +++ b/src/lib/account.cpp @@ -533,7 +533,7 @@ void Account::setAccountDetails(const MapStringString& = m) { if (m_pAccountDetails) delete m_pAccountDetails; - *m_pAccountDetails =3D m; + m_pAccountDetails =3D new MapStringString(m); } = ///Set a specific detail diff --git a/src/lib/callmodel.cpp b/src/lib/callmodel.cpp index 3414909..6d88c30 100644 --- a/src/lib/callmodel.cpp +++ b/src/lib/callmodel.cpp @@ -37,7 +37,7 @@ //Define ///InternalStruct: internal representation of a call struct InternalStruct { - InternalStruct() : m_pParent(nullptr){} + InternalStruct() : m_pParent(nullptr),call_real(nullptr),conference(fal= se){} Call* call_real ; QModelIndex index ; QList m_lChildren; diff --git a/src/widgets/categorizedtreeview.cpp b/src/widgets/categorizedt= reeview.cpp index ba221ee..1204a0b 100644 --- a/src/widgets/categorizedtreeview.cpp +++ b/src/widgets/categorizedtreeview.cpp @@ -137,7 +137,6 @@ void CategorizedTreeView::startDrag(Qt::DropActions sup= portedActions) QMimeData *data =3D model()->mimeData(list); if (!data) return; - = = //Execute the drag QDrag *drag =3D new QDrag(this); diff --git a/src/widgets/tips/ringingtip.cpp b/src/widgets/tips/ringingtip.= cpp index 2217a4d..de01c37 100644 --- a/src/widgets/tips/ringingtip.cpp +++ b/src/widgets/tips/ringingtip.cpp @@ -34,8 +34,10 @@ #include = ///Constructor -RingingTip::RingingTip(QWidget* parent) : Tip(QString(),parent),m_pTimer(n= ullptr),m_Counter(0) - +RingingTip::RingingTip(QWidget* parent) : Tip(QString(),parent),m_pTimer(n= ullptr),m_Counter(0), +m_phoneOriginalSVG(nullptr),m_ring1OriginalSVG(nullptr),m_ring2OriginalSVG= (nullptr),m_ring3OriginalSVG(nullptr), +m_pPhoneR(nullptr),m_pRing1R(nullptr),m_pRing2R(nullptr),m_pRing3R(nullptr= ),m_pPhonePix(nullptr),m_pRing1Pix(nullptr), +m_pRing2Pix(nullptr) { setHasBackground(false); setHasText(false);