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

List:       kde-commits
Subject:    [ring-kde/accountdlg_rewrite2] src: autocompletion: Remove zombie code
From:       Emmanuel Lepage Vallee <emmanuel.lepage () savoirfairelinux ! com>
Date:       2015-06-19 16:12:11
Message-ID: E1Z5ytn-0003ne-5o () scm ! kde ! org
[Download RAW message or body]

Git commit e41e9667419a8b42e25522ad9d7a7038e77799b1 by Emmanuel Lepage Vallee.
Committed on 17/06/2015 at 21:43.
Pushed by lepagevalleeemmanuel into branch 'accountdlg_rewrite2'.

autocompletion: Remove zombie code

The decision when the autocompletion is displayed is no longer
linked to the canvas manager. While this may cause some overlapping,
having multiple sources of decision caused its own set of issues.

The decision is now fully based on the CallModel selectionModel.

Refs #75815

M  +0    -12   src/eventmanager.cpp
M  +0    -1    src/eventmanager.h
M  +0    -1    src/view.cpp
M  +1    -8    src/widgets/autocompletion.cpp
M  +0    -2    src/widgets/autocompletion.h

http://commits.kde.org/ring-kde/e41e9667419a8b42e25522ad9d7a7038e77799b1

diff --git a/src/eventmanager.cpp b/src/eventmanager.cpp
index 49022ce..89a9488 100644
--- a/src/eventmanager.cpp
+++ b/src/eventmanager.cpp
@@ -599,18 +599,6 @@ void EventManager::slotIncomingCall(Call* call)
    }
 }
 
-void EventManager::slotAutoCompletionVisibility(bool visible,bool hasCall)
-{
-   Q_UNUSED(visible)
-   Q_UNUSED(hasCall)
-   //Show/Hide the autocompletion widget. This does this way due to legacy reasons
-   if (visible)
-      m_pParent->m_pCanvasManager->newEvent(CanvasObjectManager::CanvasEvent::CALL_DIALING_CHANGED);
-   else if (!hasCall)
-      m_pParent->m_pCanvasManager->newEvent(CanvasObjectManager::CanvasEvent::USER_CANCEL);
-   //The other is handled by call state changed
-}
-
 void EventManager::slotregistrationChanged(Account* a,bool reg)
 {
    Q_UNUSED(a)
diff --git a/src/eventmanager.h b/src/eventmanager.h
index e4b4ffd..3d8febd 100644
--- a/src/eventmanager.h
+++ b/src/eventmanager.h
@@ -79,7 +79,6 @@ public Q_SLOTS:
     *   according to the current state (window, item selected...)
     */
    void enter();
-   void slotAutoCompletionVisibility(bool,bool);
    /**
     *   Handles the behaviour when the user types something with
     *   the dialpad widget or his keyboard (normally it's a one char
diff --git a/src/view.cpp b/src/view.cpp
index 0d87daa..028b361 100644
--- a/src/view.cpp
+++ b/src/view.cpp
@@ -187,7 +187,6 @@ void View::loadAutoCompletion()
          m_pAutoCompletion = new AutoCompletion(m_pView);
          PhoneDirectoryModel::instance()->setCallWithAccount(ConfigurationSkeleton::autoCompleteUseAccount());
                
          m_pAutoCompletion->setUseUnregisteredAccounts(ConfigurationSkeleton::autoCompleteMergeNumbers());
                
-         connect(m_pAutoCompletion, SIGNAL(requestVisibility(bool,bool)), m_pEventManager, \
                SLOT(slotAutoCompletionVisibility(bool,bool)));
          connect(m_pAutoCompletion,SIGNAL(doubleClicked(ContactMethod*)),this,SLOT(slotAutoCompleteClicked(ContactMethod*)));
  }
    }
diff --git a/src/widgets/autocompletion.cpp b/src/widgets/autocompletion.cpp
index e886bc8..faae4db 100644
--- a/src/widgets/autocompletion.cpp
+++ b/src/widgets/autocompletion.cpp
@@ -128,7 +128,6 @@ AutoCompletion::AutoCompletion(QTreeView* parent) : QWidget(parent),m_Height(125
    m_pView->setModel(m_pModel);
    m_pView->setSelectionModel(m_pModel->selectionModel());
 
-   connect(m_pModel,SIGNAL(enabled(bool))  ,this, SLOT(slotVisibilityChange(bool))   );
    connect(m_pModel,SIGNAL(layoutChanged()),this, SLOT(slotLayoutChanged()));
    connect(m_pView,SIGNAL(doubleClicked(QModelIndex)),this,SLOT(slotDoubleClicked(QModelIndex)));
 
@@ -197,6 +196,7 @@ void AutoCompletion::slotCallStateChanged(Call::State s)
 {
    Q_UNUSED(s)
    Call* call = m_pModel->call();
+
    setVisible(call && call->lifeCycleState() == Call::LifeCycleState::CREATION);
 }
 
@@ -294,13 +294,6 @@ bool AutoCompletion::eventFilter(QObject *obj, QEvent *event)
    return QObject::eventFilter(obj, event);
 }
 
-void AutoCompletion::slotVisibilityChange(bool visible)
-{
-   if (!visible && ((!m_pModel->call()) || m_pModel->call()->lifeCycleState() != \
                Call::LifeCycleState::CREATION))
-      m_pModel->setCall(nullptr);
-   emit requestVisibility(visible,m_pModel->call()!=nullptr);
-}
-
 void AutoCompletion::slotDoubleClicked(const QModelIndex& idx)
 {
    Q_UNUSED(idx)
diff --git a/src/widgets/autocompletion.h b/src/widgets/autocompletion.h
index 543b289..469cc4a 100644
--- a/src/widgets/autocompletion.h
+++ b/src/widgets/autocompletion.h
@@ -75,12 +75,10 @@ public Q_SLOTS:
 private Q_SLOTS:
    void selectionChanged(const QModelIndex& idx = QModelIndex());
    void slotLayoutChanged();
-   void slotVisibilityChange(bool visible);
    void slotDoubleClicked(const QModelIndex& idx);
    void slotCallStateChanged(Call::State s);
 
 Q_SIGNALS:
-   void requestVisibility(bool visible, bool hasCall);
    void doubleClicked(ContactMethod* n);
 };
 


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

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