diff options
author | Mavridis Philippe <mavridisf@gmail.com> | 2021-11-06 20:52:57 +0200 |
---|---|---|
committer | TDE Gitea <gitea@mirror.git.trinitydesktop.org> | 2021-11-09 08:25:33 +0000 |
commit | fa49e53a2374ca04d51925b983aea587303097a0 (patch) | |
tree | b5e2ec05bdf514d0c8ad41fccef8259cf12ddfba /tdeui/keditlistbox.cpp | |
parent | 88413aaa75cee53adc0477ebdb39f55f867e2a77 (diff) | |
download | tdelibs-fa49e53a2374ca04d51925b983aea587303097a0.tar.gz tdelibs-fa49e53a2374ca04d51925b983aea587303097a0.zip |
Added alternative added(), removed(), renamed() variants.
Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
Diffstat (limited to 'tdeui/keditlistbox.cpp')
-rw-r--r-- | tdeui/keditlistbox.cpp | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/tdeui/keditlistbox.cpp b/tdeui/keditlistbox.cpp index 4b224ede0..142c4b437 100644 --- a/tdeui/keditlistbox.cpp +++ b/tdeui/keditlistbox.cpp @@ -175,11 +175,13 @@ void KEditListBox::typedSomething(const TQString& text) // but TT disagree with me on this one (it's been that way since ages ... grrr) bool block = m_listBox->signalsBlocked(); const TQString& oldText = currentText(); + int item = currentItem(); m_listBox->blockSignals( true ); - m_listBox->changeItem(text, currentItem()); + m_listBox->changeItem(text, item); m_listBox->blockSignals( block ); emit changed(); emit renamed(oldText, text); + emit renamed(item, oldText, text); } } @@ -280,7 +282,8 @@ void KEditListBox::addItem() m_lineEdit->clear(); m_lineEdit->blockSignals(block); - m_listBox->setSelected(currentItem(), false); + int item = currentItem(); + m_listBox->setSelected(item, false); if (!alreadyInList) { @@ -289,7 +292,8 @@ void KEditListBox::addItem() m_listBox->insertItem(currentTextLE); m_listBox->blockSignals( block ); emit changed(); - emit added( currentTextLE ); + emit added( currentTextLE ); + emit added( item, currentTextLE ); } } @@ -302,18 +306,19 @@ int KEditListBox::currentItem() const void KEditListBox::removeItem() { - int selected = m_listBox->currentItem(); + int item = m_listBox->currentItem(); - if ( selected >= 0 ) + if ( item >= 0 ) { - TQString removedText = m_listBox->currentText(); + TQString removedText = m_listBox->currentText(); - m_listBox->removeItem( selected ); + m_listBox->removeItem( item ); if ( count() > 0 ) - m_listBox->setSelected( TQMIN( selected, count() - 1 ), true ); + m_listBox->setSelected( TQMIN( item, count() - 1 ), true ); emit changed(); - emit removed( removedText ); + emit removed( removedText ); + emit removed( item, removedText ); } if ( servRemoveButton && m_listBox->currentItem() == -1 ) |