replaced Q_UINT with quint

git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@80 b624d157-de02-0410-bad0-e51aec6abb33
This commit is contained in:
tariq
2006-04-29 11:24:33 +00:00
parent 74c7b86a89
commit 580a8f357b
29 changed files with 478 additions and 429 deletions

View File

@@ -79,7 +79,7 @@ if(c==1){
else
str="{USERNAME}{TAB}{PASSWORD}{ENTER}";
QList<Q_UINT16> Keys;
QList<quint16> Keys;
for(int i=0;i<str.size();i++){
if(str[i]=='{'){
int start=i;
@@ -1131,9 +1131,9 @@ tKeysymMap AutoType::KeysymMap[] =
{ 0x20ac, 0x20ac }, /* EuroSign € EURO SIGN */
};
Q_UINT16 AutoType::getKeysym(const QChar& c){
quint16 AutoType::getKeysym(const QChar& c){
int MapSize=sizeof(KeysymMap);
Q_UINT16 unicode=c.unicode();
quint16 unicode=c.unicode();
/* first check for Latin-1 characters (1:1 mapping) */
if ((unicode >= 0x0020 && unicode <= 0x007e) ||
(unicode >= 0x00a0 && unicode <= 0x00ff))
@@ -1148,4 +1148,4 @@ for(int i=0; i<MapSize;i++){
}
//Q_ASSERT(false);
return 0;
}
}

View File

@@ -35,8 +35,8 @@
#include "Database.h"
typedef struct tKeysymMap{
Q_UINT16 keysym;
Q_UINT16 unicode;
quint16 keysym;
quint16 unicode;
};
class AutoType:public QObject{
@@ -45,7 +45,7 @@ public:
static void perform(CEntry* entry,QString& errors);
private:
static tKeysymMap KeysymMap[];
static Q_UINT16 getKeysym(const QChar& unicode);
static quint16 getKeysym(const QChar& unicode);
static int getModifiers(Display*,KeySym,int);
static void pressModifiers(Display*,int,bool Press=true);
static void releaseModifiers(Display*,int);
@@ -58,4 +58,4 @@ private:
};
#endif
#endif

View File

@@ -19,7 +19,6 @@
***************************************************************************/
#include <math.h>
#include <QDragEnterEvent>
#include <QDragMoveEvent>
#include <QDragLeaveEvent>
@@ -58,7 +57,7 @@ setAlternatingRowColors(config.AlternatingRowColors);
KeepassEntryView::~KeepassEntryView(){
for(int i=0;i<ColumnSizes.size();i++){
config.ColumnSizes[i]=round(ColumnSizes[i]*10000.0f);
config.ColumnSizes[i]=(int)(ColumnSizes[i]*10000.0f);
}
}
@@ -122,7 +121,7 @@ if(SelectionIDs.size())
}
}
void KeepassEntryView::showSearchResults(QList<Q_UINT32>& results){
void KeepassEntryView::showSearchResults(QList<quint32>& results){
IsSearchGroup=true;
clear();
Items.clear();
@@ -260,7 +259,7 @@ int wx=0; int j=0;
for(int i=0;i<NUM_COLUMNS;i++){
if(!config.Columns[i])continue;
int NewWidth=round(ColumnSizes[i]*(float)w);
int NewWidth=(int)(ColumnSizes[i]*(float)w);
wx+=NewWidth;
header()->resizeSection(j++,NewWidth);
//add rounding difference (w-wx) to the last column
@@ -392,8 +391,30 @@ EntryViewItem::EntryViewItem(QTreeWidgetItem *parent, QTreeWidgetItem *preceding
bool EntryViewItem::operator<(const QTreeWidgetItem& other)const{
if(QString::localeAwareCompare( text(treeWidget()->sortColumn()),other.text(treeWidget()->sortColumn())) < 0)
return true;
else
return false;
int SortCol=treeWidget()->sortColumn();
if(SortCol < 5 || SortCol==9){ //columns with string values (Title, Username, Password, URL, Comment)
if(QString::localeAwareCompare(text(SortCol),other.text(SortCol)) < 0)
return true;
else
return false;
}
QDateTime *DateThis;
QDateTime *DateOther;
switch(SortCol){
case 5: DateThis=&pEntry->Expire;
DateOther=&((EntryViewItem&)other).pEntry->Expire;
break;
case 6: DateThis=&pEntry->Creation;
DateOther=&((EntryViewItem&)other).pEntry->Creation;
break;
case 7: DateThis=&pEntry->LastMod;
DateOther=&((EntryViewItem&)other).pEntry->LastMod;
break;
case 8: DateThis=&pEntry->LastAccess;
DateOther=&((EntryViewItem&)other).pEntry->LastAccess;
break;
default:Q_ASSERT(false);
}
return *DateThis < *DateOther;
}

View File

@@ -40,7 +40,7 @@ public:
void updateItems(unsigned int group);
void updateColumns();
void refreshItems();
void showSearchResults(QList<Q_UINT32>& results);
void showSearchResults(QList<quint32>& results);
Database* db;
vector<EntryViewItem*>Items;
QMenu *ContextMenu;

View File

@@ -24,8 +24,9 @@
// Local Includes
#include "IniReader.h"
#include <qglobal.h>
#if defined(WIN32)
#if defined(Q_WS_WIN)
#define iniEOL endl
#else
#define iniEOL '\r' << endl

View File

@@ -34,8 +34,8 @@ dev_random = fopen("/dev/urandom","r");}
if (dev_random==NULL){
srand(QTime(0,0,0).secsTo(QTime::currentTime()));
for(int i=0;i<NumBlocks*BlockSize;i++){
Q_UINT8 rnd=rand()%256;
((Q_UINT8*)buffer)[i]=rnd;
quint8 rnd=rand()%256;
((quint8*)buffer)[i]=rnd;
}
return;
}