Added support for column sorting in TDEFileReplace. This resolves bug 2321.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/1/head
Michele Calgaro 10 years ago
parent 1b697b6bf7
commit fa18be2051

@ -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);

@ -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

Loading…
Cancel
Save