Enable compiler warnings

Fix all the unused variable warnings
Disable incomplete translations
Compile the translation files
Add qt_* translations not part of Qt (from VirutalBox)

git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@289 b624d157-de02-0410-bad0-e51aec6abb33
This commit is contained in:
sniperbeamer
2009-03-18 12:09:20 +00:00
parent 4a64bd61e4
commit e3dcd73b89
39 changed files with 13474 additions and 71 deletions

View File

@@ -44,11 +44,11 @@ KeepassEntryView::KeepassEntryView(QWidget* parent):QTreeWidget(parent){
updateColumns();
header()->setSortIndicator(config->columnSort(), config->columnSortOrder());
connect(header(),SIGNAL(sectionResized(int,int,int)),this,SLOT(OnColumnResized(int,int,int)));
connect(header(),SIGNAL(sectionResized(int,int,int)),this,SLOT(OnColumnResized()));
connect(this,SIGNAL(itemSelectionChanged()),this,SLOT(OnItemsChanged()));
connect(&ClipboardTimer, SIGNAL(timeout()), this, SLOT(OnClipboardTimeOut()));
connect(header(),SIGNAL(sectionClicked(int)),this,SLOT(OnHeaderSectionClicked(int)));
connect(header(),SIGNAL(sectionMoved(int,int,int)),this,SLOT(OnColumnMoved(int,int,int)));
connect(header(),SIGNAL(sectionMoved(int,int,int)),this,SLOT(OnColumnMoved()));
Clipboard=QApplication::clipboard();
ContextMenu=new QMenu(this);
setAlternatingRowColors(config->alternatingRowColors());
@@ -260,7 +260,7 @@ void KeepassEntryView::OnNewEntry(){
}
else
NewEntry=db->newEntry(CurrentGroup);
CEditEntryDlg dlg(db,NewEntry,this,true,true);
CEditEntryDlg dlg(db,NewEntry,this,true);
if(!dlg.exec()){
db->deleteLastEntry();
}
@@ -473,9 +473,9 @@ void KeepassEntryView::updateIcons(){
}
void KeepassEntryView::setEntry(IEntryHandle* entry){
/*void KeepassEntryView::setEntry(IEntryHandle* entry){
}
}*/
void KeepassEntryView::updateColumns(){
setColumnCount(0);
@@ -529,7 +529,7 @@ void KeepassEntryView::refreshItems(){
updateEntry(Items.at(i));
}
void KeepassEntryView::OnColumnMoved(int LogIndex,int OldVisIndex,int NewVisIndex){
void KeepassEntryView::OnColumnMoved(){
for(int i=0;i<header()->count();i++){
ColumnOrder[columnListIndex(header()->logicalIndex(i))]=i;
}
@@ -595,7 +595,7 @@ int KeepassEntryView::columnListIndex(int LogicalIndex){
}
void KeepassEntryView::OnColumnResized(int lindex, int Old, int New){
void KeepassEntryView::OnColumnResized(){
if(!AutoResizeColumns)return;
for(int i=0;i<header()->count();i++){
ColumnSizes[columnListIndex(i)]=header()->sectionSize(i);

View File

@@ -47,7 +47,7 @@ class KeepassEntryView:public QTreeWidget{
void setCurrentEntry(IEntryHandle* entry);
inline IGroupHandle* getCurrentGroup() { return CurrentGroup; };
private:
void setEntry(IEntryHandle* entry);
//void setEntry(IEntryHandle* entry);
void updateEntry(EntryViewItem*);
void editEntry(EntryViewItem*);
void createItems(QList<IEntryHandle*>& entries);
@@ -73,7 +73,7 @@ class KeepassEntryView:public QTreeWidget{
void mouseMoveEvent(QMouseEvent *event);
private slots:
void OnColumnResized(int index,int OldSize, int NewSize);
void OnColumnResized();
void OnHeaderSectionClicked(int index);
void OnGroupChanged(IGroupHandle* group);
void OnShowSearchResults();
@@ -92,7 +92,7 @@ class KeepassEntryView:public QTreeWidget{
void OnAutoType();
#endif
void removeDragItems();
void OnColumnMoved(int LogIndex,int OldVisIndex,int NewVisIndex);
void OnColumnMoved();
void OnEditOpenUrl();
void OnEditCopyUrl();

View File

@@ -105,7 +105,7 @@ void KeepassGroupView::OnHideSearchResults(){
void KeepassGroupView::OnNewGroup(){
CGroup NewGroup;
CEditGroupDialog dlg(db,&NewGroup,parentWidget(),true);
CEditGroupDialog dlg(db,&NewGroup,parentWidget());
if(dlg.exec())
createGroup(NewGroup.Title, NewGroup.Image, NULL);
}
@@ -113,7 +113,7 @@ void KeepassGroupView::OnNewGroup(){
void KeepassGroupView::OnNewSubgroup(){
GroupViewItem* parent=(GroupViewItem*)currentItem();
CGroup NewGroup;
CEditGroupDialog dlg(db,&NewGroup,parentWidget(),true);
CEditGroupDialog dlg(db,&NewGroup,parentWidget());
if(dlg.exec())
createGroup(NewGroup.Title, NewGroup.Image, parent);
}
@@ -151,7 +151,7 @@ void KeepassGroupView::createGroup(const QString& title, quint32 image, GroupVie
void KeepassGroupView::OnEditGroup(){
GroupViewItem* item=(GroupViewItem*)currentItem();
CEditGroupDialog dlg(db,item->GroupHandle,parentWidget(),true);
CEditGroupDialog dlg(db,item->GroupHandle,parentWidget());
int r=dlg.exec();
if(r){
item->setIcon(0,db->icon(item->GroupHandle->image()));
@@ -212,6 +212,7 @@ void KeepassGroupView::dragEnterEvent ( QDragEnterEvent * event ){
void KeepassGroupView::dragLeaveEvent ( QDragLeaveEvent * event ){
Q_UNUSED(event);
if(LastHoverItem){
LastHoverItem->setBackgroundColor(0,QApplication::palette().color(QPalette::Base));
LastHoverItem->setForeground(0,QBrush(QApplication::palette().color(QPalette::Text)));

View File

@@ -68,6 +68,7 @@ void WaitAnimationWidget::refreshAnimation(){
}
void WaitAnimationWidget::paintEvent(QPaintEvent* event){
Q_UNUSED(event);
if(timer.isActive()){
QPainter painter(this);
painter.setRenderHints(QPainter::Antialiasing,true);
@@ -82,6 +83,7 @@ void WaitAnimationWidget::paintEvent(QPaintEvent* event){
}
void WaitAnimationWidget::resizeEvent(QResizeEvent* event){
Q_UNUSED(event);
float r;
if(width()>height())
r=height()/2;

View File

@@ -342,8 +342,8 @@ QList<Translation> getAllTranslations(){
QDir dir(paths[i]);
QStringList TrFiles=dir.entryList(QStringList()<<"*.qm",QDir::Files);
for (int j=0;j<TrFiles.size();j++){
if (filename.exactMatch(TrFiles[j]) && tmpTranslator.load(TrFiles[j],paths[i]) &&
!names.contains(filename.cap(1)))
if (filename.exactMatch(TrFiles[j]) && TrFiles[j]!="keepassx-xx_XX.qm" &&
tmpTranslator.load(TrFiles[j],paths[i]) && !names.contains(filename.cap(1)))
{
Translation t;
t.nameCode = filename.cap(1);