summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2015-01-24 10:31:59 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2015-01-24 10:31:59 +0900
commitfa18be205188cadee927d2c115856c5ab8e8896f (patch)
tree72cd6992a61fc2fc1632e07ef242ee3ddc6574bd
parent1b697b6bf7c1e3bd0f9b6d0bb9cdf5b47b7ebc13 (diff)
downloadtdewebdev-fa18be205188cadee927d2c115856c5ab8e8896f.tar.gz
tdewebdev-fa18be205188cadee927d2c115856c5ab8e8896f.zip
Added support for column sorting in TDEFileReplace. This resolves bug 2321.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
-rw-r--r--tdefilereplace/tdefilereplaceview.cpp21
-rw-r--r--tdefilereplace/tdefilereplaceview.h14
2 files changed, 27 insertions, 8 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);
diff --git a/tdefilereplace/tdefilereplaceview.h b/tdefilereplace/tdefilereplaceview.h
index cf738964..b542563e 100644
--- a/tdefilereplace/tdefilereplaceview.h
+++ b/tdefilereplace/tdefilereplaceview.h
@@ -58,13 +58,6 @@ class TDEFileReplaceView : public TDEFileReplaceViewWdg
{
Q_OBJECT
- private:
- TDEPopupMenu* m_menuResult;
- RCOptions* m_option;
- TDEListViewItem* m_lviCurrent;
- TDEListView* m_rv,
- * m_sv;
-
public://Constructors
TDEFileReplaceView(RCOptions* info, TQWidget *parent,const char *name);
@@ -92,6 +85,7 @@ class TDEFileReplaceView : public TDEFileReplaceViewWdg
void slotResultDelete();
void slotResultTreeExpand();
void slotResultTreeReduce();
+ void slotResultHeaderClicked(int sortCol);
void slotStringsAdd();
void slotQuickStringsAdd(const TQString& quickSearch, const TQString& quickReplace);
void slotStringsDeleteItem();
@@ -112,6 +106,12 @@ class TDEFileReplaceView : public TDEFileReplaceViewWdg
/*signals:
void resetActions();
void searchingOnlyMode(bool);*/
+
+ private:
+ TDEPopupMenu *m_menuResult;
+ RCOptions *m_option;
+ TDEListViewItem *m_lviCurrent;
+ TDEListView *m_rv, * m_sv;
};
#endif // TDEFILEREPLACEVIEW_H