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

List:       kde-commits
Subject:    [sflphone-kde/abstractmodels] src: [ #25290 ] Fix SEGFAULT on Fedora 18 when performing hangup
From:       Emmanuel Lepage Vallee <emmanuel.lepage () savoirfairelinux ! com>
Date:       2013-05-31 21:09:52
Message-ID: 20130531210952.A7D4AA6067 () git ! kde ! org
[Download RAW message or body]

Git commit 59649d5da15f37e7e0167b8172c2ff3f5536bf50 by Emmanuel Lepage Vallee.
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): \
HistoryTreeBackend(HistoryTreeBacke  \
m_pStopTimeStamp(0),m_pStartTimeStamp(0),m_pContact(nullptr),m_pImModel(nullptr),m_ConfId(confId),m_Account(account),m_CurrentState(Call::State::CONFERENCE),
  m_pTimer(nullptr)
 {
-   m_isConference  = m_ConfId.isEmpty();
+   m_isConference  = !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 role) const
    if (!idx.isValid())
       return QVariant();
    Call* call = nullptr;
-   if (!idx.parent().isValid() && m_lInternalModel[idx.row()])
+   if (!idx.parent().isValid() && m_lInternalModel.size() > idx.row() && \
m_lInternalModel[idx.row()])  call = m_lInternalModel[idx.row()]->call_real;
    else if (idx.parent().isValid() && m_lInternalModel.size() > idx.parent().row()) \
{  InternalStruct* intList = m_lInternalModel[idx.parent().row()];
diff --git a/src/widgets/callviewoverlaytoolbar.cpp \
b/src/widgets/callviewoverlaytoolbar.cpp index bbeba40..ab89c8d 100644
--- a/src/widgets/callviewoverlaytoolbar.cpp
+++ b/src/widgets/callviewoverlaytoolbar.cpp
@@ -145,7 +145,7 @@ ObserverToolButton* \
CallViewOverlayToolbar::createButton(ExtendedAction* action)  void \
CallViewOverlayToolbar::updateState()  {
    const QModelIndex& index = m_pParent->selectionModel()->currentIndex();
-   if (index.isValid()) {
+   if (index.isValid() && CallModel::instance()->rowCount()) {
       if (!m_pParent->selectionModel()->hasSelection()) {
          m_pParent->selectionModel()->setCurrentIndex(index,QItemSelectionModel::SelectCurrent);
  }


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

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