diff --git a/share/keepass/doc/css/style.css b/share/keepassx/doc/css/style.css similarity index 100% rename from share/keepass/doc/css/style.css rename to share/keepassx/doc/css/style.css diff --git a/share/keepass/doc/images/headerbackground.png b/share/keepassx/doc/images/headerbackground.png similarity index 100% rename from share/keepass/doc/images/headerbackground.png rename to share/keepassx/doc/images/headerbackground.png diff --git a/share/keepass/doc/images/logo.png b/share/keepassx/doc/images/logo.png similarity index 100% rename from share/keepass/doc/images/logo.png rename to share/keepassx/doc/images/logo.png diff --git a/share/keepass/doc/index.html b/share/keepassx/doc/index.html similarity index 100% rename from share/keepass/doc/index.html rename to share/keepassx/doc/index.html diff --git a/share/keepass/doc/keepassx.adp b/share/keepassx/doc/keepassx.adp similarity index 100% rename from share/keepass/doc/keepassx.adp rename to share/keepassx/doc/keepassx.adp diff --git a/share/keepass/icons/alarmclock.png b/share/keepassx/icons/alarmclock.png similarity index 100% rename from share/keepass/icons/alarmclock.png rename to share/keepassx/icons/alarmclock.png diff --git a/share/keepass/icons/appsettings.png b/share/keepassx/icons/appsettings.png similarity index 100% rename from share/keepass/icons/appsettings.png rename to share/keepassx/icons/appsettings.png diff --git a/share/keepass/icons/autotype.png b/share/keepassx/icons/autotype.png similarity index 100% rename from share/keepass/icons/autotype.png rename to share/keepassx/icons/autotype.png diff --git a/share/keepass/icons/bookmark.png b/share/keepassx/icons/bookmark.png similarity index 100% rename from share/keepass/icons/bookmark.png rename to share/keepassx/icons/bookmark.png diff --git a/share/keepass/icons/bookmark_add.png b/share/keepassx/icons/bookmark_add.png similarity index 100% rename from share/keepass/icons/bookmark_add.png rename to share/keepassx/icons/bookmark_add.png diff --git a/share/keepass/icons/bookmark_del.png b/share/keepassx/icons/bookmark_del.png similarity index 100% rename from share/keepass/icons/bookmark_del.png rename to share/keepassx/icons/bookmark_del.png diff --git a/share/keepass/icons/bookmark_edit.png b/share/keepassx/icons/bookmark_edit.png similarity index 100% rename from share/keepass/icons/bookmark_edit.png rename to share/keepassx/icons/bookmark_edit.png diff --git a/share/keepass/icons/bookmark_folder.png b/share/keepassx/icons/bookmark_folder.png similarity index 100% rename from share/keepass/icons/bookmark_folder.png rename to share/keepassx/icons/bookmark_folder.png diff --git a/share/keepass/icons/bookmark_this.png b/share/keepassx/icons/bookmark_this.png similarity index 100% rename from share/keepass/icons/bookmark_this.png rename to share/keepassx/icons/bookmark_this.png diff --git a/share/keepass/icons/clientic.png b/share/keepassx/icons/clientic.png similarity index 100% rename from share/keepass/icons/clientic.png rename to share/keepassx/icons/clientic.png diff --git a/share/keepass/icons/clock.png b/share/keepassx/icons/clock.png similarity index 100% rename from share/keepass/icons/clock.png rename to share/keepassx/icons/clock.png diff --git a/share/keepass/icons/cloneentry.png b/share/keepassx/icons/cloneentry.png similarity index 100% rename from share/keepass/icons/cloneentry.png rename to share/keepassx/icons/cloneentry.png diff --git a/share/keepass/icons/copypwd.png b/share/keepassx/icons/copypwd.png similarity index 100% rename from share/keepass/icons/copypwd.png rename to share/keepassx/icons/copypwd.png diff --git a/share/keepass/icons/copyusername.png b/share/keepassx/icons/copyusername.png similarity index 100% rename from share/keepass/icons/copyusername.png rename to share/keepassx/icons/copyusername.png diff --git a/share/keepass/icons/dbsearch.png b/share/keepassx/icons/dbsearch.png similarity index 100% rename from share/keepass/icons/dbsearch.png rename to share/keepassx/icons/dbsearch.png diff --git a/share/keepass/icons/dbsettings.png b/share/keepassx/icons/dbsettings.png similarity index 100% rename from share/keepass/icons/dbsettings.png rename to share/keepassx/icons/dbsettings.png diff --git a/share/keepass/icons/delete.png b/share/keepassx/icons/delete.png similarity index 100% rename from share/keepass/icons/delete.png rename to share/keepassx/icons/delete.png diff --git a/share/keepass/icons/deleteentry.png b/share/keepassx/icons/deleteentry.png similarity index 100% rename from share/keepass/icons/deleteentry.png rename to share/keepassx/icons/deleteentry.png diff --git a/share/keepass/icons/deletegroup.png b/share/keepassx/icons/deletegroup.png similarity index 100% rename from share/keepass/icons/deletegroup.png rename to share/keepassx/icons/deletegroup.png diff --git a/share/keepass/icons/dice.png b/share/keepassx/icons/dice.png similarity index 100% rename from share/keepass/icons/dice.png rename to share/keepassx/icons/dice.png diff --git a/share/keepass/icons/document.png b/share/keepassx/icons/document.png similarity index 100% rename from share/keepass/icons/document.png rename to share/keepassx/icons/document.png diff --git a/share/keepass/icons/down.png b/share/keepassx/icons/down.png similarity index 100% rename from share/keepass/icons/down.png rename to share/keepassx/icons/down.png diff --git a/share/keepass/icons/editentry.png b/share/keepassx/icons/editentry.png similarity index 100% rename from share/keepass/icons/editentry.png rename to share/keepassx/icons/editentry.png diff --git a/share/keepass/icons/editgroup.png b/share/keepassx/icons/editgroup.png similarity index 100% rename from share/keepass/icons/editgroup.png rename to share/keepassx/icons/editgroup.png diff --git a/share/keepass/icons/exit.png b/share/keepassx/icons/exit.png similarity index 100% rename from share/keepass/icons/exit.png rename to share/keepassx/icons/exit.png diff --git a/share/keepass/icons/expired.png b/share/keepassx/icons/expired.png similarity index 100% rename from share/keepass/icons/expired.png rename to share/keepassx/icons/expired.png diff --git a/share/keepass/icons/fileclose.png b/share/keepassx/icons/fileclose.png similarity index 100% rename from share/keepass/icons/fileclose.png rename to share/keepassx/icons/fileclose.png diff --git a/share/keepass/icons/filedelete.png b/share/keepassx/icons/filedelete.png similarity index 100% rename from share/keepass/icons/filedelete.png rename to share/keepassx/icons/filedelete.png diff --git a/share/keepass/icons/filenew.png b/share/keepassx/icons/filenew.png similarity index 100% rename from share/keepass/icons/filenew.png rename to share/keepassx/icons/filenew.png diff --git a/share/keepass/icons/fileopen.png b/share/keepassx/icons/fileopen.png similarity index 100% rename from share/keepass/icons/fileopen.png rename to share/keepassx/icons/fileopen.png diff --git a/share/keepass/icons/filesave.png b/share/keepassx/icons/filesave.png similarity index 100% rename from share/keepass/icons/filesave.png rename to share/keepassx/icons/filesave.png diff --git a/share/keepass/icons/filesaveas.png b/share/keepassx/icons/filesaveas.png similarity index 100% rename from share/keepass/icons/filesaveas.png rename to share/keepassx/icons/filesaveas.png diff --git a/share/keepass/icons/filesavedisabled.png b/share/keepassx/icons/filesavedisabled.png similarity index 100% rename from share/keepass/icons/filesavedisabled.png rename to share/keepassx/icons/filesavedisabled.png diff --git a/share/keepass/icons/generator.png b/share/keepassx/icons/generator.png similarity index 100% rename from share/keepass/icons/generator.png rename to share/keepassx/icons/generator.png diff --git a/share/keepass/icons/groupsearch.png b/share/keepassx/icons/groupsearch.png similarity index 100% rename from share/keepass/icons/groupsearch.png rename to share/keepassx/icons/groupsearch.png diff --git a/share/keepass/icons/help.png b/share/keepassx/icons/help.png similarity index 100% rename from share/keepass/icons/help.png rename to share/keepassx/icons/help.png diff --git a/share/keepass/icons/i18n.png b/share/keepassx/icons/i18n.png similarity index 100% rename from share/keepass/icons/i18n.png rename to share/keepassx/icons/i18n.png diff --git a/share/keepass/icons/keepassx.png b/share/keepassx/icons/keepassx.png similarity index 100% rename from share/keepass/icons/keepassx.png rename to share/keepassx/icons/keepassx.png diff --git a/share/keepass/icons/keepassx_large.png b/share/keepassx/icons/keepassx_large.png similarity index 100% rename from share/keepass/icons/keepassx_large.png rename to share/keepassx/icons/keepassx_large.png diff --git a/share/keepass/icons/keepassx_locked.png b/share/keepassx/icons/keepassx_locked.png similarity index 100% rename from share/keepass/icons/keepassx_locked.png rename to share/keepassx/icons/keepassx_locked.png diff --git a/share/keepass/icons/key.png b/share/keepassx/icons/key.png similarity index 100% rename from share/keepass/icons/key.png rename to share/keepassx/icons/key.png diff --git a/share/keepass/icons/lock.png b/share/keepassx/icons/lock.png similarity index 100% rename from share/keepass/icons/lock.png rename to share/keepassx/icons/lock.png diff --git a/share/keepass/icons/manual.png b/share/keepassx/icons/manual.png similarity index 100% rename from share/keepass/icons/manual.png rename to share/keepassx/icons/manual.png diff --git a/share/keepass/icons/newentry.png b/share/keepassx/icons/newentry.png similarity index 100% rename from share/keepass/icons/newentry.png rename to share/keepassx/icons/newentry.png diff --git a/share/keepass/icons/newgroup.png b/share/keepassx/icons/newgroup.png similarity index 100% rename from share/keepass/icons/newgroup.png rename to share/keepassx/icons/newgroup.png diff --git a/share/keepass/icons/ok.png b/share/keepassx/icons/ok.png similarity index 100% rename from share/keepass/icons/ok.png rename to share/keepassx/icons/ok.png diff --git a/share/keepass/icons/openurl.png b/share/keepassx/icons/openurl.png similarity index 100% rename from share/keepass/icons/openurl.png rename to share/keepassx/icons/openurl.png diff --git a/share/keepass/icons/pwd_hide.png b/share/keepassx/icons/pwd_hide.png similarity index 100% rename from share/keepass/icons/pwd_hide.png rename to share/keepassx/icons/pwd_hide.png diff --git a/share/keepass/icons/pwd_show.png b/share/keepassx/icons/pwd_show.png similarity index 100% rename from share/keepass/icons/pwd_show.png rename to share/keepassx/icons/pwd_show.png diff --git a/share/keepass/icons/restore.png b/share/keepassx/icons/restore.png similarity index 100% rename from share/keepass/icons/restore.png rename to share/keepassx/icons/restore.png diff --git a/share/keepass/icons/search.png b/share/keepassx/icons/search.png similarity index 100% rename from share/keepass/icons/search.png rename to share/keepassx/icons/search.png diff --git a/share/keepass/icons/swap.png b/share/keepassx/icons/swap.png similarity index 100% rename from share/keepass/icons/swap.png rename to share/keepassx/icons/swap.png diff --git a/share/keepass/icons/templates.png b/share/keepassx/icons/templates.png similarity index 100% rename from share/keepass/icons/templates.png rename to share/keepassx/icons/templates.png diff --git a/share/keepass/icons/text_block.png b/share/keepassx/icons/text_block.png similarity index 100% rename from share/keepass/icons/text_block.png rename to share/keepassx/icons/text_block.png diff --git a/share/keepass/icons/text_bold.png b/share/keepassx/icons/text_bold.png similarity index 100% rename from share/keepass/icons/text_bold.png rename to share/keepassx/icons/text_bold.png diff --git a/share/keepass/icons/text_center.png b/share/keepassx/icons/text_center.png similarity index 100% rename from share/keepass/icons/text_center.png rename to share/keepassx/icons/text_center.png diff --git a/share/keepass/icons/text_italic.png b/share/keepassx/icons/text_italic.png similarity index 100% rename from share/keepass/icons/text_italic.png rename to share/keepassx/icons/text_italic.png diff --git a/share/keepass/icons/text_left.png b/share/keepassx/icons/text_left.png similarity index 100% rename from share/keepass/icons/text_left.png rename to share/keepassx/icons/text_left.png diff --git a/share/keepass/icons/text_right.png b/share/keepassx/icons/text_right.png similarity index 100% rename from share/keepass/icons/text_right.png rename to share/keepassx/icons/text_right.png diff --git a/share/keepass/icons/text_under.png b/share/keepassx/icons/text_under.png similarity index 100% rename from share/keepass/icons/text_under.png rename to share/keepassx/icons/text_under.png diff --git a/share/keepass/icons/trashcan.png b/share/keepassx/icons/trashcan.png similarity index 100% rename from share/keepass/icons/trashcan.png rename to share/keepassx/icons/trashcan.png diff --git a/share/keepass/icons/up.png b/share/keepassx/icons/up.png similarity index 100% rename from share/keepass/icons/up.png rename to share/keepassx/icons/up.png diff --git a/share/keepass/license.html b/share/keepassx/license.html similarity index 100% rename from share/keepass/license.html rename to share/keepassx/license.html diff --git a/share/macx_bundle/icon.icns b/share/macx_bundle/icon.icns new file mode 100644 index 0000000..42ebe49 Binary files /dev/null and b/share/macx_bundle/icon.icns differ diff --git a/src/main.cpp b/src/main.cpp index cc03d27..22efab0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -70,6 +70,7 @@ QHashIconCache; KpxConfig *config; QString AppDir; QString HomeDir; +QString DataDir; QString PluginLoadError; bool TrActive; QString DetailViewTemplate; @@ -97,6 +98,12 @@ int main(int argc, char **_argv) #else HomeDir = QDir::homePath()+"/.keepassx"; #endif + +#if defined Q_WS_MACX + DataDir=AppDir+"/../Resources/keepassx"; +#else + DataDir=AppDir+"/../share/keepassx"; +#endif bool ArgMin = false; bool ArgLock = false; parseCmdLineArgs(argc,argv,ArgFile,ArgCfg,ArgLang,ArgMin,ArgLock); @@ -182,8 +189,7 @@ int main(int argc, char **_argv) qtTranslator=new QTranslator; if(loadTranslation(translator,"keepass-",loc.name(),QStringList() - << AppDir+"/../share/keepass/i18n/" - << AppDir+"/share/i18n/" + << DataDir+"/i18n/" << HomeDir)) { app->installTranslator(translator); @@ -201,8 +207,7 @@ int main(int argc, char **_argv) if(TrActive){ if(loadTranslation(qtTranslator,"qt_",loc.name(),QStringList() << QLibraryInfo::location(QLibraryInfo::TranslationsPath) - << AppDir+"/../share/keepass/i18n/" - << AppDir+"/share/i18n/" + << DataDir+"/i18n/" << HomeDir)) app->installTranslator(qtTranslator); else{ @@ -321,10 +326,8 @@ void openBrowser(const QString& UrlString){ } QString getImageFile(const QString& name){ - if (QFile::exists(AppDir+"/../share/keepass/icons/"+name)) - return AppDir+"/../share/keepass/icons/"+name; - else if (QFile::exists(AppDir+"/share/icons/"+name)) - return AppDir+"/share/icons/"+name; + if (QFile::exists(DataDir+"/icons/"+name)) + return DataDir+"/icons/"+name; else{ QMessageBox::critical(0,QApplication::translate("Main","Error"), QApplication::translate("Main","File '%1' could not be found.") @@ -501,12 +504,13 @@ QString applicationFilePath() }); return filePath.filePath(); - #elif defined(Q_WS_MAC) + #elif defined(Q_WS_MAC) + CFURLRef bundleURL(CFBundleCopyExecutableURL(CFBundleGetMainBundle())); - assert(bundleURL); + //assert(bundleURL); CFStringRef cfPath(CFURLCopyFileSystemPath(bundleURL, kCFURLPOSIXPathStyle)); - assert(cfPath); + //assert(cfPath); CFIndex length = CFStringGetLength(cfPath); const UniChar *chars = CFStringGetCharactersPtr(cfPath); if (chars) diff --git a/src/main.h b/src/main.h index 085aab2..ed86c27 100644 --- a/src/main.h +++ b/src/main.h @@ -61,6 +61,7 @@ extern QString PluginLoadError; extern KpxConfig *config; extern QString AppDir; extern QString HomeDir; +extern QString DataDir; extern bool TrActive; extern QString DetailViewTemplate; extern QPixmap *EntryIcons; diff --git a/src/src.pro b/src/src.pro index 2e7b803..1f67fb8 100644 --- a/src/src.pro +++ b/src/src.pro @@ -1,35 +1,34 @@ -DEPENDPATH += crypto \ - dialogs \ - export \ - forms \ - import \ - lib \ - translations \ - res +CONFIG = qt uic resources thread stl warn_off release +QT += xml -win32:QMAKE_WIN32 = 1 +DEPENDPATH += crypto dialogs export forms import lib translations res +INCLUDEPATH += . lib crypto plugins/interfaces export import dialogs MOC_DIR = ../build/moc UI_DIR = ../build/ui OBJECTS_DIR = ../build RCC_DIR = ../build/rcc -INSTALLS += target data -data.files += ../share/keepass/* -TARGET = ../bin/keepassx +isEqual(DEBUG,1) { + CONFIG += debug +} + -unix : !macx : !isEqual(QMAKE_WIN32,1) { +#------------------------------------------------------------------------------- +# Platform Specific: Unix (except MacOS X) +#------------------------------------------------------------------------------- +unix : !macx { isEmpty(PREFIX):PREFIX = /usr - !isEqual(AUTOTYPE,0) { DEFINES += AUTOTYPE !isEqual(GLOBAL_AUTOTYPE,0) { DEFINES += GLOBAL_AUTOTYPE } } - target.path = $${PREFIX}/bin - data.path = $${PREFIX}/share/keepass + TARGET = ../bin/keepassx + TARGET.path = $${PREFIX}/bin + data.path = $${PREFIX}/share pixmaps.files = ../share/pixmaps/* pixmaps.path = $${PREFIX}/share/pixmaps desktop.files = ../share/applications/* @@ -44,30 +43,58 @@ unix : !macx : !isEqual(QMAKE_WIN32,1) { SOURCES += Application_X11.cpp HEADERS += Application_X11.h } + isEqual(BUILD_FOR_LSB,1) { + QMAKE_CXX = lsbcc + } } + +#------------------------------------------------------------------------------- +# Platform Specific: MacOS X +#------------------------------------------------------------------------------- macx { isEmpty(PREFIX):PREFIX = /Applications - target.path = $${PREFIX} - data.path = $${PREFIX}/keepassx.app/Contents/share/keepass + TARGET = ../bin/KeePassX + TARGET.path = $${PREFIX} + data.path = Contents/Resources + isEmpty(QT_FRAMEWORK_DIR) : QT_FRAMEWORK_DIR = /Library/Frameworks + private_frameworks.files += $${QT_FRAMEWORK_DIR}/QtCore.framework + private_frameworks.files += $${QT_FRAMEWORK_DIR}/QtGui.framework + private_frameworks.files += $${QT_FRAMEWORK_DIR}/QtXml.framework + private_frameworks.path = Contents/Frameworks + QMAKE_BUNDLE_DATA += data private_frameworks LIBS += -framework CoreFoundation + ICON = ../share/macx_bundle/icon.icns + CONFIG += app_bundle + isEqual(ARCH,UNIVERSAL) : CONFIG += x86 ppc + isEqual(ARCH,INTEL) : CONFIG += x86 + isEqual(ARCH,PPC) : CONFIG += ppc } -isEqual(QMAKE_WIN32,1) { +#------------------------------------------------------------------------------- +# Platform Specific: Windows +#------------------------------------------------------------------------------- +win32 { + CONFIG += windows isEmpty(PREFIX):PREFIX = "C:/Program files/KeePassX" - - target.path = $${PREFIX} + TARGET = ../bin/KeePassX + TARGET.path = $${PREFIX} data.path = $${PREFIX}/share RC_FILE = ../share/ico/keepassx.rc QMAKE_LINK_OBJECT_SCRIPT = $${OBJECTS_DIR}/$${QMAKE_LINK_OBJECT_SCRIPT} } + +data.files += ../share/keepassx +INSTALLS += TARGET data + contains(DEFINES,GLOBAL_AUTOTYPE) { FORMS += forms/AutoTypeDlg.ui HEADERS += dialogs/AutoTypeDlg.h SOURCES += dialogs/AutoTypeDlg.cpp } + FORMS += forms/EditGroupDlg.ui \ forms/SearchDlg.ui \ forms/AboutDlg.ui \ @@ -210,30 +237,3 @@ SOURCES += lib/UrlLabel.cpp \ dialogs/ManageBookmarksDlg.cpp RESOURCES += res/resources.qrc -CONFIG = qt \ - uic \ - resources \ - thread \ - stl \ - warn_off -QT += xml -TEMPLATE = app -INCLUDEPATH += . \ - lib \ - crypto \ - plugins/interfaces \ - export \ - import \ - dialogs \ - ./ - -isEqual(RELEASE,1) { - CONFIG += release -} -else { - CONFIG += debug -} - -isEqual(QMAKE_WIN32,1) { - CONFIG += windows -}