diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2019-06-20 23:02:54 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2019-06-20 23:02:54 +0900 |
commit | a58ed210742d83bf1ce96194083eb925298b02c5 (patch) | |
tree | 41e71ce333b6de55c702ef0f59ae06e0b8e3f958 /tdefilereplace/tdefilereplaceview.cpp | |
parent | 281f1ab591a1321cfd700f5a8e54da3541498a52 (diff) | |
download | tdeutils-a58ed210742d83bf1ce96194083eb925298b02c5.tar.gz tdeutils-a58ed210742d83bf1ce96194083eb925298b02c5.zip |
tdefilereplace: improved logic for string add/edit/remove dialog.
Removed the string edit action which is now no longer required.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'tdefilereplace/tdefilereplaceview.cpp')
-rw-r--r-- | tdefilereplace/tdefilereplaceview.cpp | 59 |
1 files changed, 6 insertions, 53 deletions
diff --git a/tdefilereplace/tdefilereplaceview.cpp b/tdefilereplace/tdefilereplaceview.cpp index e7bfd87..aa73fa8 100644 --- a/tdefilereplace/tdefilereplaceview.cpp +++ b/tdefilereplace/tdefilereplaceview.cpp @@ -68,8 +68,8 @@ TDEFileReplaceView::TDEFileReplaceView(RCOptions* info, TQWidget *parent,const c connect(m_lvResults_2->header(), TQT_SIGNAL(clicked(int)), this,TQT_SLOT(slotResultHeaderClicked(int))); // string listview: connect events - connect(m_lvStrings, TQT_SIGNAL(doubleClicked(TQListViewItem *)), this, TQT_SLOT(slotStringsEdit())); - connect(m_lvStrings_2, TQT_SIGNAL(doubleClicked(TQListViewItem *)), this, TQT_SLOT(slotStringsEdit())); + connect(m_lvStrings, TQT_SIGNAL(doubleClicked(TQListViewItem *)), this, TQT_SLOT(slotStringsAdd())); + connect(m_lvStrings_2, TQT_SIGNAL(doubleClicked(TQListViewItem *)), this, TQT_SLOT(slotStringsAdd())); whatsThis(); } @@ -390,25 +390,14 @@ void TDEFileReplaceView::slotResultHeaderClicked(int sortCol) void TDEFileReplaceView::slotStringsAdd() { - KeyValueMap oldMap(m_option->m_mapStringsView); - - KAddStringDlg addStringDlg(m_option, false); - + KAddStringDlg addStringDlg(m_option); if(!addStringDlg.exec()) + { return; - - KeyValueMap addedStringsMap(m_option->m_mapStringsView); - KeyValueMap::Iterator itMap; - - for(itMap = oldMap.begin(); itMap != oldMap.end(); ++itMap) - addedStringsMap.insert(itMap.key(),itMap.data()); - - m_option->m_mapStringsView = addedStringsMap; - + } raiseResultsView(); raiseStringsView(); - - loadMapIntoView(addedStringsMap); + loadMapIntoView(m_option->m_mapStringsView); emit updateGUI(); } @@ -437,42 +426,6 @@ void TDEFileReplaceView::slotQuickStringsAdd(const TQString& quickSearch, const } } -void TDEFileReplaceView::slotStringsEdit() -{ - KeyValueMap oldMap(m_option->m_mapStringsView); - if(oldMap.isEmpty()) return; - bool oldSearchFlagValue = m_option->m_searchingOnlyMode; - - oldMap.remove(m_sv->currentItem()->text(0)); - - m_option->m_mapStringsView.clear(); - - m_option->m_mapStringsView.insert(m_sv->currentItem()->text(0), m_sv->currentItem()->text(1)); - - KAddStringDlg addStringDlg(m_option, true); - - if(!addStringDlg.exec()) - return; - - KeyValueMap newMap(m_option->m_mapStringsView); - if(oldSearchFlagValue == m_option->m_searchingOnlyMode) - { - KeyValueMap::Iterator itMap; - - //merges the two maps - for(itMap = oldMap.begin(); itMap != oldMap.end(); ++itMap) - newMap.insert(itMap.key(),itMap.data()); - } - - m_option->m_mapStringsView = newMap; - - raiseResultsView(); - raiseStringsView(); - - loadMapIntoView(newMap); - emit updateGUI(); -} - void TDEFileReplaceView::slotStringsSave() { // Check there are strings in the list |