D22910: Replace obsolete QSignalMapper and qSort with non-obsolete code

Sebastian Gottfried noreply at phabricator.kde.org
Tue Aug 6 07:56:32 BST 2019


gottfried added a comment.


  I found two more spots which leak connections over time. These should be fixed.

INLINE COMMENTS

> resourcemodel.cpp:248
>  {
> -    connect(course, SIGNAL(titleChanged()), m_signalMapper, SLOT(map()));
> -    connect(course, SIGNAL(descriptionChanged()), m_signalMapper, SLOT(map()));
> -    connect(course, SIGNAL(keyboardLayoutNameChanged()), m_signalMapper, SLOT(map()));
> -    connect(course, SIGNAL(pathChanged()), m_signalMapper, SLOT(map()));
> -    connect(course, SIGNAL(sourceChanged()), m_signalMapper, SLOT(map()));
> +    connect(course, &DataIndexCourse::titleChanged, this, [=] { emitDataChanged(index); });
> +    connect(course, &DataIndexCourse::descriptionChanged, this, [=] { emitDataChanged(index); });

We need to disconnect here first, too.

> resourcemodel.cpp:257
>  {
> -    connect(keyboardLayout, SIGNAL(titleChanged()), m_signalMapper, SLOT(map()));
> -    connect(keyboardLayout, SIGNAL(nameChanged()), m_signalMapper, SLOT(map()));
> -    connect(keyboardLayout, SIGNAL(pathChanged()), m_signalMapper, SLOT(map()));
> -    connect(keyboardLayout, SIGNAL(sourceChanged()), m_signalMapper, SLOT(map()));
> +    connect(keyboardLayout, &DataIndexKeyboardLayout::titleChanged, this, [=] { emitDataChanged(index); });
> +    connect(keyboardLayout, &DataIndexKeyboardLayout::nameChanged, this, [=] { emitDataChanged(index); });

We need to disconnect here first, too.

REPOSITORY
  R336 KTouch

REVISION DETAIL
  https://phabricator.kde.org/D22910

To: yurchor, #kde_edu, gottfried
Cc: kde-edu, narvaez, apol
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-edu/attachments/20190806/f6fadec0/attachment.html>


More information about the kde-edu mailing list