Renamed project file to keepassx.pro

Minor code changes

git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@191 b624d157-de02-0410-bad0-e51aec6abb33
master
sniperbeamer 17 years ago
parent daaa9b866a
commit a2836d3183
  1. 0
      keepassx.pro
  2. 4
      src/crypto/blowfish.cpp
  3. 8
      src/crypto/yarrow.cpp
  4. 36
      src/main.cpp

@ -28,8 +28,8 @@
* *
*/ */
#include <string.h> #include <cstring>
#include <stdlib.h> #include <cstdlib>
#include "blowfish.h" #include "blowfish.h"

@ -20,10 +20,10 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/ ***************************************************************************/
#include <assert.h> #include <cassert>
#include <stdlib.h> #include <cstdlib>
#include <string.h> #include <cstring>
#include <time.h> #include <ctime>
#include "yarrow.h" #include "yarrow.h"
#include "random.h" #include "random.h"

@ -44,7 +44,6 @@ bool TrActive;
QString DetailViewTemplate; QString DetailViewTemplate;
bool EventOccurred; bool EventOccurred;
bool EventOccurredBlock = false; bool EventOccurredBlock = false;
EventListener* eventListener;
QPixmap* EntryIcons; QPixmap* EntryIcons;
IIconTheme* IconLoader=NULL; IIconTheme* IconLoader=NULL;
@ -77,7 +76,7 @@ int main(int argc, char **argv)
fileDlgHistory.load(); fileDlgHistory.load();
// PlugIns // PlugIns
#ifdef Q_WS_X11
if(config->integrPlugin()!=KpxConfig::NoIntegr){ if(config->integrPlugin()!=KpxConfig::NoIntegr){
QString LibName="libkeepassx-"; QString LibName="libkeepassx-";
if(config->integrPlugin()==KpxConfig::KDE) if(config->integrPlugin()==KpxConfig::KDE)
@ -103,14 +102,14 @@ int main(int argc, char **argv)
if(config->integrPlugin()==KpxConfig::KDE){ if(config->integrPlugin()==KpxConfig::KDE){
IKdeInit* kdeinit=qobject_cast<IKdeInit*>(plugin.instance()); IKdeInit* kdeinit=qobject_cast<IKdeInit*>(plugin.instance());
app=kdeinit->getMainAppObject(argc,argv); app=kdeinit->getMainAppObject(argc,argv);
if(!app)PluginLoadError=QObject::tr("Initialization failed."); if(!app) PluginLoadError = "Initialization failed.";
} }
if(config->integrPlugin()==KpxConfig::Gnome){ if(config->integrPlugin()==KpxConfig::Gnome){
IGnomeInit* ginit=qobject_cast<IGnomeInit*>(plugin.instance()); IGnomeInit* ginit=qobject_cast<IGnomeInit*>(plugin.instance());
if(!ginit->init(argc,argv)){ if(!ginit->init(argc,argv)){
KpxFileDialogs::setPlugin(NULL); KpxFileDialogs::setPlugin(NULL);
qWarning("GtkIntegrPlugin: Gtk init failed."); qWarning("GtkIntegrPlugin: Gtk init failed.");
PluginLoadError=QObject::tr("Initialization failed."); PluginLoadError = "Initialization failed.";
} }
} }
} }
@ -120,6 +119,7 @@ int main(int argc, char **argv)
PluginLoadError=QObject::tr("Could not locate library file."); PluginLoadError=QObject::tr("Could not locate library file.");
} }
} }
#endif
if(!app){ if(!app){
#if defined(Q_WS_X11) && defined(GLOBAL_AUTOTYPE) #if defined(Q_WS_X11) && defined(GLOBAL_AUTOTYPE)
app = new KeepassApplication(argc,argv); app = new KeepassApplication(argc,argv);
@ -137,23 +137,23 @@ int main(int argc, char **argv)
else else
loc=QLocale(args.language()); loc=QLocale(args.language());
QTranslator* translator = NULL; QTranslator* translator = new QTranslator;
QTranslator* qtTranslator=NULL; QTranslator* qtTranslator = new QTranslator;
translator=new QTranslator;
qtTranslator=new QTranslator;
if(loadTranslation(translator,"keepass-",loc.name(),QStringList() if(loadTranslation(translator,"keepass-",loc.name(),QStringList()
<< DataDir+"/i18n/" << DataDir+"/i18n/"
<< HomeDir)) << HomeDir))
{ {
app->installTranslator(translator); QApplication::installTranslator(translator);
TrActive=true; TrActive=true;
} }
else{ else{
if(loc.name()!="en_US") if(loc.name()!="en_US")
qWarning(QString("Kpx: No Translation found for '%1 (%2)' using 'English (UnitedStates)'") qWarning(CSTR(
QString("Kpx: No Translation found for '%1 (%2)' using 'English (UnitedStates)'")
.arg(QLocale::languageToString(loc.language())) .arg(QLocale::languageToString(loc.language()))
.arg(QLocale::countryToString(loc.country())).toAscii()); .arg(QLocale::countryToString(loc.country()))
));
delete translator; delete translator;
TrActive=false; TrActive=false;
} }
@ -163,12 +163,14 @@ int main(int argc, char **argv)
<< QLibraryInfo::location(QLibraryInfo::TranslationsPath) << QLibraryInfo::location(QLibraryInfo::TranslationsPath)
<< DataDir+"/i18n/" << DataDir+"/i18n/"
<< HomeDir)) << HomeDir))
app->installTranslator(qtTranslator); QApplication::installTranslator(qtTranslator);
else{ else{
if(loc.name()!="en_US") if(loc.name()!="en_US")
qWarning(QString("Qt: No Translation found for '%1 (%2)' using 'English (UnitedStates)'") qWarning(CSTR(
QString("Qt: No Translation found for '%1 (%2)' using 'English (UnitedStates)'")
.arg(QLocale::languageToString(loc.language())) .arg(QLocale::languageToString(loc.language()))
.arg(QLocale::countryToString(loc.country())).toAscii()); .arg(QLocale::countryToString(loc.country()))
));
delete qtTranslator; delete qtTranslator;
} }
} }
@ -180,7 +182,7 @@ int main(int argc, char **argv)
initYarrow(); //init random number generator initYarrow(); //init random number generator
SecString::generateSessionKey(); SecString::generateSessionKey();
eventListener = new EventListener(); EventListener* eventListener = new EventListener();
app->installEventFilter(eventListener); app->installEventFilter(eventListener);
QApplication::setQuitOnLastWindowClosed(false); QApplication::setQuitOnLastWindowClosed(false);
@ -201,8 +203,8 @@ void loadImages(){
QPixmap tmpImg(getImageFile("clientic.png")); QPixmap tmpImg(getImageFile("clientic.png"));
EntryIcons=new QPixmap[BUILTIN_ICONS]; EntryIcons=new QPixmap[BUILTIN_ICONS];
for(int i=0;i<BUILTIN_ICONS;i++){ for(int i=0;i<BUILTIN_ICONS;i++){
EntryIcons[i]=tmpImg.copy(i*16,0,16,16);} EntryIcons[i]=tmpImg.copy(i*16,0,16,16);
}
} }