summaryrefslogtreecommitdiffstats
path: root/tdefilereplace/tdefilereplaceview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tdefilereplace/tdefilereplaceview.cpp')
-rw-r--r--tdefilereplace/tdefilereplaceview.cpp59
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