From d26d0e8f96febee947f6a50fe9f491a7f9b2e826 Mon Sep 17 00:00:00 2001 From: sniperbeamer Date: Fri, 21 Mar 2008 22:17:54 +0000 Subject: [PATCH] Fixed sorting of date columns (closes #1861726, #1922311) Don't use entries in 'Backup' group for global auto-type (closes #1915664) git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@192 b624d157-de02-0410-bad0-e51aec6abb33 --- src/lib/AutoType_X11.cpp | 15 ++++++++++++++- src/lib/EntryView.cpp | 10 +++------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/lib/AutoType_X11.cpp b/src/lib/AutoType_X11.cpp index 801b65e..e9fa21f 100644 --- a/src/lib/AutoType_X11.cpp +++ b/src/lib/AutoType_X11.cpp @@ -44,6 +44,7 @@ class AutoTypePrivate{ inline static void sleepKeyStrokeDelay(){ sleep(config->autoTypeKeyStrokeDelay()); }; static void templateToKeysyms(const QString& Template, QList& KeySymList,IEntryHandle* entry); static void stringToKeysyms(const QString& string,QList& KeySymList); + static QString getRootGroupName(IEntryHandle* entry); }; @@ -193,8 +194,11 @@ void AutoType::performGlobal(){ QRegExp lineMatch("Auto-Type-Window(?:-(\\d+)|):([^\\n]+)", Qt::CaseInsensitive, QRegExp::RegExp2); QDateTime now = QDateTime::currentDateTime(); for (int i=0; iexpire()!=Date_Never && entries[i]->expire()expire()!=Date_Never && entries[i]->expire()comment(); @@ -564,3 +568,12 @@ void AutoTypePrivate::stringToKeysyms(const QString& string,QListgroup(); + int level = group->level(); + for (int i=0; iparent(); + + return group->title(); +} diff --git a/src/lib/EntryView.cpp b/src/lib/EntryView.cpp index c404797..df364d4 100644 --- a/src/lib/EntryView.cpp +++ b/src/lib/EntryView.cpp @@ -613,17 +613,13 @@ EntryViewItem::EntryViewItem(QTreeWidgetItem *parent, QTreeWidgetItem *preceding bool EntryViewItem::operator<(const QTreeWidgetItem& other)const{ int SortCol=treeWidget()->header()->sortIndicatorSection(); int ListIndex=((KeepassEntryView*)treeWidget())->columnListIndex(SortCol); - if(ListIndex < 5 || ListIndex==9 || ListIndex==10){ //columns with string values (Title, Username, Password, URL, Comment, Group) - if(QString::localeAwareCompare(text(SortCol),other.text(SortCol)) < 0) - return true; - else - return false; + if(ListIndex < 5 || ListIndex > 8){ //columns with string values (Title, Username, Password, URL, Comment, Group) + return (QString::localeAwareCompare(text(SortCol),other.text(SortCol)) < 0); } KpxDateTime DateThis; KpxDateTime DateOther; - - switch(SortCol){ + switch(ListIndex){ case 5: DateThis=EntryHandle->expire(); DateOther=((EntryViewItem&)other).EntryHandle->expire(); break;