From kde-commits Fri May 31 21:09:52 2013 From: Emmanuel Lepage Vallee Date: Fri, 31 May 2013 21:09:52 +0000 To: kde-commits Subject: [sflphone-kde/abstractmodels] src: [ #25290 ] Fix SEGFAULT on Fedora 18 when performing hangup Message-Id: <20130531210952.A7D4AA6067 () git ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=137003460106648 Git commit 59649d5da15f37e7e0167b8172c2ff3f5536bf50 by Emmanuel Lepage Vall= ee. Committed on 31/05/2013 at 23:09. Pushed by lepagevalleeemmanuel into branch 'abstractmodels'. [ #25290 ] Fix SEGFAULT on Fedora 18 when performing hangup M +1 -1 src/lib/call.cpp M +1 -1 src/lib/callmodel.cpp M +1 -1 src/widgets/callviewoverlaytoolbar.cpp http://commits.kde.org/sflphone-kde/59649d5da15f37e7e0167b8172c2ff3f5536bf50 diff --git a/src/lib/call.cpp b/src/lib/call.cpp index ffc296e..a9de240 100644 --- a/src/lib/call.cpp +++ b/src/lib/call.cpp @@ -171,7 +171,7 @@ Call::Call(QString confId, QString account): HistoryTre= eBackend(HistoryTreeBacke m_pStopTimeStamp(0),m_pStartTimeStamp(0),m_pContact(nullptr),m_pImModel= (nullptr),m_ConfId(confId),m_Account(account),m_CurrentState(Call::State::C= ONFERENCE), m_pTimer(nullptr) { - m_isConference =3D m_ConfId.isEmpty(); + m_isConference =3D !m_ConfId.isEmpty(); = if (m_isConference) { time_t curTime; diff --git a/src/lib/callmodel.cpp b/src/lib/callmodel.cpp index 4ff6d24..3414909 100644 --- a/src/lib/callmodel.cpp +++ b/src/lib/callmodel.cpp @@ -495,7 +495,7 @@ QVariant CallModel::data( const QModelIndex& idx, int r= ole) const if (!idx.isValid()) return QVariant(); Call* call =3D nullptr; - if (!idx.parent().isValid() && m_lInternalModel[idx.row()]) + if (!idx.parent().isValid() && m_lInternalModel.size() > idx.row() && m= _lInternalModel[idx.row()]) call =3D m_lInternalModel[idx.row()]->call_real; else if (idx.parent().isValid() && m_lInternalModel.size() > idx.parent= ().row()) { InternalStruct* intList =3D m_lInternalModel[idx.parent().row()]; diff --git a/src/widgets/callviewoverlaytoolbar.cpp b/src/widgets/callviewo= verlaytoolbar.cpp index bbeba40..ab89c8d 100644 --- a/src/widgets/callviewoverlaytoolbar.cpp +++ b/src/widgets/callviewoverlaytoolbar.cpp @@ -145,7 +145,7 @@ ObserverToolButton* CallViewOverlayToolbar::createButto= n(ExtendedAction* action) void CallViewOverlayToolbar::updateState() { const QModelIndex& index =3D m_pParent->selectionModel()->currentIndex(= ); - if (index.isValid()) { + if (index.isValid() && CallModel::instance()->rowCount()) { if (!m_pParent->selectionModel()->hasSelection()) { m_pParent->selectionModel()->setCurrentIndex(index,QItemSelection= Model::SelectCurrent); }