cleaned up qmake project file, improved mac app bundle generation
git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@161 b624d157-de02-0410-bad0-e51aec6abb33
Before Width: | Height: | Size: 271 B After Width: | Height: | Size: 271 B |
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 634 B After Width: | Height: | Size: 634 B |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 754 B After Width: | Height: | Size: 754 B |
Before Width: | Height: | Size: 818 B After Width: | Height: | Size: 818 B |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 213 B After Width: | Height: | Size: 213 B |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 206 B After Width: | Height: | Size: 206 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 214 B After Width: | Height: | Size: 214 B |
Before Width: | Height: | Size: 183 B After Width: | Height: | Size: 183 B |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
24
src/main.cpp
|
@ -70,6 +70,7 @@ QHash<QString,QIcon*>IconCache;
|
||||||
KpxConfig *config;
|
KpxConfig *config;
|
||||||
QString AppDir;
|
QString AppDir;
|
||||||
QString HomeDir;
|
QString HomeDir;
|
||||||
|
QString DataDir;
|
||||||
QString PluginLoadError;
|
QString PluginLoadError;
|
||||||
bool TrActive;
|
bool TrActive;
|
||||||
QString DetailViewTemplate;
|
QString DetailViewTemplate;
|
||||||
|
@ -97,6 +98,12 @@ int main(int argc, char **_argv)
|
||||||
#else
|
#else
|
||||||
HomeDir = QDir::homePath()+"/.keepassx";
|
HomeDir = QDir::homePath()+"/.keepassx";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined Q_WS_MACX
|
||||||
|
DataDir=AppDir+"/../Resources/keepassx";
|
||||||
|
#else
|
||||||
|
DataDir=AppDir+"/../share/keepassx";
|
||||||
|
#endif
|
||||||
bool ArgMin = false;
|
bool ArgMin = false;
|
||||||
bool ArgLock = false;
|
bool ArgLock = false;
|
||||||
parseCmdLineArgs(argc,argv,ArgFile,ArgCfg,ArgLang,ArgMin,ArgLock);
|
parseCmdLineArgs(argc,argv,ArgFile,ArgCfg,ArgLang,ArgMin,ArgLock);
|
||||||
|
@ -182,8 +189,7 @@ int main(int argc, char **_argv)
|
||||||
qtTranslator=new QTranslator;
|
qtTranslator=new QTranslator;
|
||||||
|
|
||||||
if(loadTranslation(translator,"keepass-",loc.name(),QStringList()
|
if(loadTranslation(translator,"keepass-",loc.name(),QStringList()
|
||||||
<< AppDir+"/../share/keepass/i18n/"
|
<< DataDir+"/i18n/"
|
||||||
<< AppDir+"/share/i18n/"
|
|
||||||
<< HomeDir))
|
<< HomeDir))
|
||||||
{
|
{
|
||||||
app->installTranslator(translator);
|
app->installTranslator(translator);
|
||||||
|
@ -201,8 +207,7 @@ int main(int argc, char **_argv)
|
||||||
if(TrActive){
|
if(TrActive){
|
||||||
if(loadTranslation(qtTranslator,"qt_",loc.name(),QStringList()
|
if(loadTranslation(qtTranslator,"qt_",loc.name(),QStringList()
|
||||||
<< QLibraryInfo::location(QLibraryInfo::TranslationsPath)
|
<< QLibraryInfo::location(QLibraryInfo::TranslationsPath)
|
||||||
<< AppDir+"/../share/keepass/i18n/"
|
<< DataDir+"/i18n/"
|
||||||
<< AppDir+"/share/i18n/"
|
|
||||||
<< HomeDir))
|
<< HomeDir))
|
||||||
app->installTranslator(qtTranslator);
|
app->installTranslator(qtTranslator);
|
||||||
else{
|
else{
|
||||||
|
@ -321,10 +326,8 @@ void openBrowser(const QString& UrlString){
|
||||||
}
|
}
|
||||||
|
|
||||||
QString getImageFile(const QString& name){
|
QString getImageFile(const QString& name){
|
||||||
if (QFile::exists(AppDir+"/../share/keepass/icons/"+name))
|
if (QFile::exists(DataDir+"/icons/"+name))
|
||||||
return AppDir+"/../share/keepass/icons/"+name;
|
return DataDir+"/icons/"+name;
|
||||||
else if (QFile::exists(AppDir+"/share/icons/"+name))
|
|
||||||
return AppDir+"/share/icons/"+name;
|
|
||||||
else{
|
else{
|
||||||
QMessageBox::critical(0,QApplication::translate("Main","Error"),
|
QMessageBox::critical(0,QApplication::translate("Main","Error"),
|
||||||
QApplication::translate("Main","File '%1' could not be found.")
|
QApplication::translate("Main","File '%1' could not be found.")
|
||||||
|
@ -501,12 +504,13 @@ QString applicationFilePath()
|
||||||
});
|
});
|
||||||
|
|
||||||
return filePath.filePath();
|
return filePath.filePath();
|
||||||
|
|
||||||
#elif defined(Q_WS_MAC)
|
#elif defined(Q_WS_MAC)
|
||||||
|
|
||||||
CFURLRef bundleURL(CFBundleCopyExecutableURL(CFBundleGetMainBundle()));
|
CFURLRef bundleURL(CFBundleCopyExecutableURL(CFBundleGetMainBundle()));
|
||||||
assert(bundleURL);
|
//assert(bundleURL);
|
||||||
CFStringRef cfPath(CFURLCopyFileSystemPath(bundleURL, kCFURLPOSIXPathStyle));
|
CFStringRef cfPath(CFURLCopyFileSystemPath(bundleURL, kCFURLPOSIXPathStyle));
|
||||||
assert(cfPath);
|
//assert(cfPath);
|
||||||
CFIndex length = CFStringGetLength(cfPath);
|
CFIndex length = CFStringGetLength(cfPath);
|
||||||
const UniChar *chars = CFStringGetCharactersPtr(cfPath);
|
const UniChar *chars = CFStringGetCharactersPtr(cfPath);
|
||||||
if (chars)
|
if (chars)
|
||||||
|
|
|
@ -61,6 +61,7 @@ extern QString PluginLoadError;
|
||||||
extern KpxConfig *config;
|
extern KpxConfig *config;
|
||||||
extern QString AppDir;
|
extern QString AppDir;
|
||||||
extern QString HomeDir;
|
extern QString HomeDir;
|
||||||
|
extern QString DataDir;
|
||||||
extern bool TrActive;
|
extern bool TrActive;
|
||||||
extern QString DetailViewTemplate;
|
extern QString DetailViewTemplate;
|
||||||
extern QPixmap *EntryIcons;
|
extern QPixmap *EntryIcons;
|
||||||
|
|
96
src/src.pro
|
@ -1,35 +1,34 @@
|
||||||
|
|
||||||
DEPENDPATH += crypto \
|
CONFIG = qt uic resources thread stl warn_off release
|
||||||
dialogs \
|
QT += xml
|
||||||
export \
|
|
||||||
forms \
|
|
||||||
import \
|
|
||||||
lib \
|
|
||||||
translations \
|
|
||||||
res
|
|
||||||
|
|
||||||
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
|
MOC_DIR = ../build/moc
|
||||||
UI_DIR = ../build/ui
|
UI_DIR = ../build/ui
|
||||||
OBJECTS_DIR = ../build
|
OBJECTS_DIR = ../build
|
||||||
RCC_DIR = ../build/rcc
|
RCC_DIR = ../build/rcc
|
||||||
|
|
||||||
INSTALLS += target data
|
isEqual(DEBUG,1) {
|
||||||
data.files += ../share/keepass/*
|
CONFIG += debug
|
||||||
TARGET = ../bin/keepassx
|
}
|
||||||
|
|
||||||
unix : !macx : !isEqual(QMAKE_WIN32,1) {
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
# Platform Specific: Unix (except MacOS X)
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
unix : !macx {
|
||||||
isEmpty(PREFIX):PREFIX = /usr
|
isEmpty(PREFIX):PREFIX = /usr
|
||||||
|
|
||||||
!isEqual(AUTOTYPE,0) {
|
!isEqual(AUTOTYPE,0) {
|
||||||
DEFINES += AUTOTYPE
|
DEFINES += AUTOTYPE
|
||||||
!isEqual(GLOBAL_AUTOTYPE,0) {
|
!isEqual(GLOBAL_AUTOTYPE,0) {
|
||||||
DEFINES += GLOBAL_AUTOTYPE
|
DEFINES += GLOBAL_AUTOTYPE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
target.path = $${PREFIX}/bin
|
TARGET = ../bin/keepassx
|
||||||
data.path = $${PREFIX}/share/keepass
|
TARGET.path = $${PREFIX}/bin
|
||||||
|
data.path = $${PREFIX}/share
|
||||||
pixmaps.files = ../share/pixmaps/*
|
pixmaps.files = ../share/pixmaps/*
|
||||||
pixmaps.path = $${PREFIX}/share/pixmaps
|
pixmaps.path = $${PREFIX}/share/pixmaps
|
||||||
desktop.files = ../share/applications/*
|
desktop.files = ../share/applications/*
|
||||||
|
@ -44,30 +43,58 @@ unix : !macx : !isEqual(QMAKE_WIN32,1) {
|
||||||
SOURCES += Application_X11.cpp
|
SOURCES += Application_X11.cpp
|
||||||
HEADERS += Application_X11.h
|
HEADERS += Application_X11.h
|
||||||
}
|
}
|
||||||
|
isEqual(BUILD_FOR_LSB,1) {
|
||||||
|
QMAKE_CXX = lsbcc
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
# Platform Specific: MacOS X
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
macx {
|
macx {
|
||||||
isEmpty(PREFIX):PREFIX = /Applications
|
isEmpty(PREFIX):PREFIX = /Applications
|
||||||
target.path = $${PREFIX}
|
TARGET = ../bin/KeePassX
|
||||||
data.path = $${PREFIX}/keepassx.app/Contents/share/keepass
|
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
|
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"
|
isEmpty(PREFIX):PREFIX = "C:/Program files/KeePassX"
|
||||||
|
TARGET = ../bin/KeePassX
|
||||||
target.path = $${PREFIX}
|
TARGET.path = $${PREFIX}
|
||||||
data.path = $${PREFIX}/share
|
data.path = $${PREFIX}/share
|
||||||
RC_FILE = ../share/ico/keepassx.rc
|
RC_FILE = ../share/ico/keepassx.rc
|
||||||
QMAKE_LINK_OBJECT_SCRIPT = $${OBJECTS_DIR}/$${QMAKE_LINK_OBJECT_SCRIPT}
|
QMAKE_LINK_OBJECT_SCRIPT = $${OBJECTS_DIR}/$${QMAKE_LINK_OBJECT_SCRIPT}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
data.files += ../share/keepassx
|
||||||
|
INSTALLS += TARGET data
|
||||||
|
|
||||||
contains(DEFINES,GLOBAL_AUTOTYPE) {
|
contains(DEFINES,GLOBAL_AUTOTYPE) {
|
||||||
FORMS += forms/AutoTypeDlg.ui
|
FORMS += forms/AutoTypeDlg.ui
|
||||||
HEADERS += dialogs/AutoTypeDlg.h
|
HEADERS += dialogs/AutoTypeDlg.h
|
||||||
SOURCES += dialogs/AutoTypeDlg.cpp
|
SOURCES += dialogs/AutoTypeDlg.cpp
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FORMS += forms/EditGroupDlg.ui \
|
FORMS += forms/EditGroupDlg.ui \
|
||||||
forms/SearchDlg.ui \
|
forms/SearchDlg.ui \
|
||||||
forms/AboutDlg.ui \
|
forms/AboutDlg.ui \
|
||||||
|
@ -210,30 +237,3 @@ SOURCES += lib/UrlLabel.cpp \
|
||||||
dialogs/ManageBookmarksDlg.cpp
|
dialogs/ManageBookmarksDlg.cpp
|
||||||
|
|
||||||
RESOURCES += res/resources.qrc
|
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
|
|
||||||
}
|
|
||||||
|
|