fixed strange sort order in EntryView (Bug #7083)

git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@78 b624d157-de02-0410-bad0-e51aec6abb33
master
tariq 19 years ago
parent 931d8374a5
commit 17f2e85420
  1. 9
      src/lib/EntryView.cpp
  2. 3
      src/lib/EntryView.h

@ -29,6 +29,7 @@
#include <QTime>
#include <QApplication>
#include <QPainter>
#include <QPair>
#include "main.h"
#include "PwmConfig.h"
#include "EntryView.h"
@ -51,8 +52,8 @@ header()->setStretchLastSection(false);
connect(header(),SIGNAL(sectionResized(int,int,int)),this,SLOT(OnColumnResized(int,int,int)));
ContextMenu=new QMenu(this);
setAlternatingRowColors(config.AlternatingRowColors);
disconnect(header(),SIGNAL(sectionClicked(int)),this,SLOT(sortByColumn(int)));
//TODO: connect with custom sort function
}
KeepassEntryView::~KeepassEntryView(){
@ -358,8 +359,6 @@ drag->setPixmap(DragPixmap);
drag->start();
}
void KeepassEntryView::sortItems(int column,Qt::SortOrder order){};
void KeepassEntryView::paintEvent(QPaintEvent * event){
QTreeWidget::paintEvent(event);
@ -383,7 +382,7 @@ EntryViewItem::EntryViewItem(QTreeWidgetItem *parent, QTreeWidgetItem *preceding
}
bool EntryViewItem::operator<(EntryViewItem& other){
bool EntryViewItem::operator<(const QTreeWidgetItem& other)const{
if(QString::localeAwareCompare( text(treeWidget()->sortColumn()),other.text(treeWidget()->sortColumn())) < 0)
return true;
else

@ -41,7 +41,6 @@ public:
void updateColumns();
void refreshItems();
void showSearchResults(QList<Q_UINT32>& results);
virtual void sortItems(int column,Qt::SortOrder order);
Database* db;
vector<EntryViewItem*>Items;
QMenu *ContextMenu;
@ -74,7 +73,7 @@ EntryViewItem(QTreeWidget *parent, QTreeWidgetItem * preceding);
EntryViewItem(QTreeWidgetItem *parent);
EntryViewItem(QTreeWidgetItem *parent, QTreeWidgetItem * preceding);
CEntry* pEntry;
virtual bool operator<(EntryViewItem& other);
virtual bool operator<(const QTreeWidgetItem& other)const;
};