summaryrefslogtreecommitdiffstats
path: root/tdefilereplace/tdefilereplaceview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tdefilereplace/tdefilereplaceview.cpp')
-rw-r--r--tdefilereplace/tdefilereplaceview.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/tdefilereplace/tdefilereplaceview.cpp b/tdefilereplace/tdefilereplaceview.cpp
index cc9d1773..c4d6c1bc 100644
--- a/tdefilereplace/tdefilereplaceview.cpp
+++ b/tdefilereplace/tdefilereplaceview.cpp
@@ -43,7 +43,8 @@
using namespace whatthisNameSpace;
-TDEFileReplaceView::TDEFileReplaceView(RCOptions* info, TQWidget *parent,const char *name):TDEFileReplaceViewWdg(parent,name)
+TDEFileReplaceView::TDEFileReplaceView(RCOptions* info, TQWidget *parent,const char *name) :
+ TDEFileReplaceViewWdg(parent,name)
{
m_option = info;
@@ -54,6 +55,9 @@ TDEFileReplaceView::TDEFileReplaceView(RCOptions* info, TQWidget *parent,const c
connect(m_lvResults_2, TQT_SIGNAL(mouseButtonClicked(int, TQListViewItem *, const TQPoint &, int)), this, TQT_SLOT(slotMouseButtonClicked(int, TQListViewItem *, const TQPoint &)));
connect(m_lvStrings, TQT_SIGNAL(doubleClicked(TQListViewItem *)), this, TQT_SLOT(slotStringsEdit()));
connect(m_lvStrings_2, TQT_SIGNAL(doubleClicked(TQListViewItem *)), this, TQT_SLOT(slotStringsEdit()));
+ // connect header events
+ connect(m_lvResults->header(), TQT_SIGNAL(clicked(int)), this,TQT_SLOT(slotResultHeaderClicked(int)));
+ connect(m_lvResults_2->header(), TQT_SIGNAL(clicked(int)), this,TQT_SLOT(slotResultHeaderClicked(int)));
whatsThis();
}
@@ -308,6 +312,21 @@ void TDEFileReplaceView::slotResultTreeReduce()
expand(lviRoot, false);
}
+void TDEFileReplaceView::slotResultHeaderClicked(int sortCol)
+{
+ TDEListView *lv = getResultsView();
+ int oldSortCol = lv->columnSorted();
+
+ if (oldSortCol == -1 || sortCol != oldSortCol)
+ {
+ lv->setSorting(sortCol, true);
+ }
+ else
+ {
+ lv->setSorting(sortCol, lv->ascendingSort());
+ }
+}
+
void TDEFileReplaceView::slotStringsAdd()
{
KeyValueMap oldMap(m_option->m_mapStringsView);