diff --git a/src/main.cpp b/src/main.cpp index d53247e..3f6591b 100755 --- a/src/main.cpp +++ b/src/main.cpp @@ -358,7 +358,17 @@ const QIcon& getIcon(const QString& name){ if(CachedIcon) return *CachedIcon; QIcon* NewIcon=NULL; - if(IconLoader==NULL){ + if(IconLoader){ + NewIcon=new QIcon(IconLoader->getIcon(name)); + if(NewIcon->isNull()){ + delete NewIcon; + NewIcon=NULL; + } + else + IconCache.insert(name,NewIcon); + } + if(!NewIcon) + { QFileInfo IconFile(AppDir+"/../share/keepass/icons/"+name+".png"); if(!IconFile.isFile() || !IconFile.exists() || !IconFile.isReadable()){ ///TODO 0.2.3 error handling @@ -366,10 +376,7 @@ const QIcon& getIcon(const QString& name){ } NewIcon=new QIcon(AppDir+"/../share/keepass/icons/"+name+".png"); IconCache.insert(name,NewIcon); - } else { - NewIcon=new QIcon(IconLoader->getIcon(name)); - IconCache.insert(name,NewIcon); - } + } return *NewIcon; } diff --git a/src/plugins/kde/keepassx-kde.cpp b/src/plugins/kde/keepassx-kde.cpp index 532e029..a968b9c 100644 --- a/src/plugins/kde/keepassx-kde.cpp +++ b/src/plugins/kde/keepassx-kde.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2006 by Tarek Saidi * + * Copyright (C) 2005-2007 by Tarek Saidi * * tarek.saidi@arcor.de * * * * This program is free software; you can redistribute it and/or modify * @@ -24,9 +24,12 @@ #include #include #include +#include +#include #include "keepassx-kde.h" QHashIconMap; +int LastFilter; Q_EXPORT_PLUGIN2(keepassx_kde, KdePlugin) @@ -54,17 +57,40 @@ void createIconMap(){ IconMap["fileopen"]="document-open"; IconMap["filesave"]="document-save"; IconMap["filesaveas"]="document-save-as"; - IconMap["filesaveasdisabled"]="document-save-as"; ///FIXME + IconMap["filesaveasdisabled"]="document-save-as"; ///FIXME needs to be grayed to reflect it's status IconMap["generator"]="roll"; IconMap["groupsearch"]="file-find"; IconMap["help"]="help-contents"; IconMap["key"]="password"; IconMap["manual"]="help-contents"; + IconMap["newentry"]="kgpg-key3-kpgp"; + IconMap["newgroup"]="folder"; + IconMap["ok"]="ok"; + IconMap["openurl"]="network"; + IconMap["search"]="edit-find"; } -QString KdePlugin::openExistingFileDialog(QWidget* parent,QString title,QString dir,QStringList Filters,int SelectedFilter){ - return KFileDialog::getOpenFileName(); +QString convertFilters(const QStringList& qtfilters){ + QString kdefilters; + for(int i=0;i