Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract static library and separate main function #324

Merged
merged 4 commits into from
Oct 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ moc_*.cpp
qrc_*.cpp
ui_*.h
localization/*.qm
build/
2 changes: 1 addition & 1 deletion appdmg.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"background": "artwork/icon.png",
"icon-size": 80,
"contents": [
{ "x": 64, "y": 64, "type": "file", "path": "src/QtPass.app" },
{ "x": 64, "y": 64, "type": "file", "path": "main/QtPass.app" },
{ "x": 428, "y": 64, "type": "link", "path": "/Applications" },
{ "x": 64, "y": 448, "type": "file", "path": "README.rtf" },
{ "x": 428, "y": 448, "type": "file", "path": "LICENSE" }
Expand Down
2 changes: 1 addition & 1 deletion localization/localization_ar_MA.ts
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ p, li { white-space: pre-wrap; }
<context>
<name>QObject</name>
<message>
<location filename="../src/main.cpp" line="78"/>
<location filename="../main/main.cpp" line="78"/>
<source>LTR</source>
<translatorcomment>Flips interface</translatorcomment>
<translation>RTL</translation>
Expand Down
2 changes: 1 addition & 1 deletion localization/localization_cs_CZ.ts
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ p, li { white-space: pre-wrap; }
<context>
<name>QObject</name>
<message>
<location filename="../src/main.cpp" line="78"/>
<location filename="../main/main.cpp" line="78"/>
<source>LTR</source>
<translation>LTR</translation>
</message>
Expand Down
2 changes: 1 addition & 1 deletion localization/localization_de_DE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ Neues Passwort-Datei:
<context>
<name>QObject</name>
<message>
<location filename="../src/main.cpp" line="78"/>
<location filename="../main/main.cpp" line="78"/>
<source>LTR</source>
<translation>LTR</translation>
</message>
Expand Down
2 changes: 1 addition & 1 deletion localization/localization_de_LU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,7 @@ Neues Passwort-Datei:
<context>
<name>QObject</name>
<message>
<location filename="../src/main.cpp" line="78"/>
<location filename="../main/main.cpp" line="78"/>
<source>LTR</source>
<translation>LTR</translation>
</message>
Expand Down
2 changes: 1 addition & 1 deletion localization/localization_el_GR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ p, li { white-space: pre-wrap; }
<context>
<name>QObject</name>
<message>
<location filename="../src/main.cpp" line="78"/>
<location filename="../main/main.cpp" line="78"/>
<source>LTR</source>
<translation type="unfinished"></translation>
</message>
Expand Down
2 changes: 1 addition & 1 deletion localization/localization_en_GB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ p, li { white-space: pre-wrap; }
<context>
<name>QObject</name>
<message>
<location filename="../src/main.cpp" line="78"/>
<location filename="../main/main.cpp" line="78"/>
<source>LTR</source>
<translation>LTR</translation>
</message>
Expand Down
2 changes: 1 addition & 1 deletion localization/localization_en_US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ p, li { white-space: pre-wrap; }
<context>
<name>QObject</name>
<message>
<location filename="../src/main.cpp" line="78"/>
<location filename="../main/main.cpp" line="78"/>
<source>LTR</source>
<translation>LTR</translation>
</message>
Expand Down
2 changes: 1 addition & 1 deletion localization/localization_es_ES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ p, li { white-space: pre-wrap; }
<context>
<name>QObject</name>
<message>
<location filename="../src/main.cpp" line="78"/>
<location filename="../main/main.cpp" line="78"/>
<source>LTR</source>
<translation></translation>
</message>
Expand Down
2 changes: 1 addition & 1 deletion localization/localization_fr_BE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ p, li { white-space: pre-wrap; }
<context>
<name>QObject</name>
<message>
<location filename="../src/main.cpp" line="78"/>
<location filename="../main/main.cpp" line="78"/>
<source>LTR</source>
<translation>GAD</translation>
</message>
Expand Down
2 changes: 1 addition & 1 deletion localization/localization_fr_FR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ p, li { white-space: pre-wrap; }
<context>
<name>QObject</name>
<message>
<location filename="../src/main.cpp" line="78"/>
<location filename="../main/main.cpp" line="78"/>
<source>LTR</source>
<translation>GAD</translation>
</message>
Expand Down
2 changes: 1 addition & 1 deletion localization/localization_fr_LU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ p, li { white-space: pre-wrap; }
<context>
<name>QObject</name>
<message>
<location filename="../src/main.cpp" line="78"/>
<location filename="../main/main.cpp" line="78"/>
<source>LTR</source>
<translation>GAD</translation>
</message>
Expand Down
2 changes: 1 addition & 1 deletion localization/localization_gl_ES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ p, li { white-space: pre-wrap; }
<context>
<name>QObject</name>
<message>
<location filename="../src/main.cpp" line="78"/>
<location filename="../main/main.cpp" line="78"/>
<source>LTR</source>
<translation type="unfinished"></translation>
</message>
Expand Down
2 changes: 1 addition & 1 deletion localization/localization_he_IL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ p, li { white-space: pre-wrap; }
<context>
<name>QObject</name>
<message>
<location filename="../src/main.cpp" line="78"/>
<location filename="../main/main.cpp" line="78"/>
<source>LTR</source>
<translatorcomment>Flips interface</translatorcomment>
<translation>RTL</translation>
Expand Down
2 changes: 1 addition & 1 deletion localization/localization_hu_HU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ p, li { white-space: pre-wrap; }
<context>
<name>QObject</name>
<message>
<location filename="../src/main.cpp" line="78"/>
<location filename="../main/main.cpp" line="78"/>
<source>LTR</source>
<translation></translation>
</message>
Expand Down
2 changes: 1 addition & 1 deletion localization/localization_it_IT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ p, li { white-space: pre-wrap; }
<context>
<name>QObject</name>
<message>
<location filename="../src/main.cpp" line="78"/>
<location filename="../main/main.cpp" line="78"/>
<source>LTR</source>
<translation></translation>
</message>
Expand Down
2 changes: 1 addition & 1 deletion localization/localization_lb_LU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ p, li { white-space: pre-wrap; }
<context>
<name>QObject</name>
<message>
<location filename="../src/main.cpp" line="78"/>
<location filename="../main/main.cpp" line="78"/>
<source>LTR</source>
<translation type="unfinished"></translation>
</message>
Expand Down
2 changes: 1 addition & 1 deletion localization/localization_nl_BE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ p, li { white-space: pre-wrap; }
<context>
<name>QObject</name>
<message>
<location filename="../src/main.cpp" line="78"/>
<location filename="../main/main.cpp" line="78"/>
<source>LTR</source>
<translation>LTR</translation>
</message>
Expand Down
2 changes: 1 addition & 1 deletion localization/localization_nl_NL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ p, li { white-space: pre-wrap; }
<context>
<name>QObject</name>
<message>
<location filename="../src/main.cpp" line="78"/>
<location filename="../main/main.cpp" line="78"/>
<source>LTR</source>
<translation>LTR</translation>
</message>
Expand Down
2 changes: 1 addition & 1 deletion localization/localization_pl_PL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ p, li { white-space: pre-wrap; }
<context>
<name>QObject</name>
<message>
<location filename="../src/main.cpp" line="78"/>
<location filename="../main/main.cpp" line="78"/>
<source>LTR</source>
<translation type="unfinished"></translation>
</message>
Expand Down
2 changes: 1 addition & 1 deletion localization/localization_pt_PT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ p, li { white-space: pre-wrap; }
<context>
<name>QObject</name>
<message>
<location filename="../src/main.cpp" line="78"/>
<location filename="../main/main.cpp" line="78"/>
<source>LTR</source>
<translation>LTR</translation>
</message>
Expand Down
2 changes: 1 addition & 1 deletion localization/localization_ru_RU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ p, li { white-space: pre-wrap; }
<context>
<name>QObject</name>
<message>
<location filename="../src/main.cpp" line="78"/>
<location filename="../main/main.cpp" line="78"/>
<source>LTR</source>
<translation>LTR</translation>
</message>
Expand Down
2 changes: 1 addition & 1 deletion localization/localization_sv_SE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ p, li { white-space: pre-wrap; }
<context>
<name>QObject</name>
<message>
<location filename="../src/main.cpp" line="78"/>
<location filename="../main/main.cpp" line="78"/>
<source>LTR</source>
<translation></translation>
</message>
Expand Down
2 changes: 1 addition & 1 deletion localization/localization_zh_CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ p, li { white-space: pre-wrap; }
<context>
<name>QObject</name>
<message>
<location filename="../src/main.cpp" line="78"/>
<location filename="../main/main.cpp" line="78"/>
<source>LTR</source>
<translation>从左到右</translation>
</message>
Expand Down
File renamed without changes.
27 changes: 27 additions & 0 deletions main/main.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
!include(../qtpass.pri) { error("Couldn't find the qtpass.pri file!") }

TEMPLATE = app
QT += core gui

CONFIG += c++11
LIBS = -L"$$OUT_PWD/../src/$(OBJECTS_DIR)" -lqtpass $$LIBS
INCLUDEPATH += ../src

macx {
TARGET = QtPass
} else {
TARGET = qtpass
}

SOURCES += main.cpp

isEmpty(PREFIX) {
PREFIX = $$(PREFIX)
}

isEmpty(PREFIX) {
PREFIX = /usr/local
}
target.path = $$PREFIX/bin/

INSTALLS += target
77 changes: 75 additions & 2 deletions qtpass.pri
Original file line number Diff line number Diff line change
@@ -1,7 +1,80 @@
VERSION = 1.2.0-pre

TEMPLATE = subdirs

CONFIG(coverage) {
QMAKE_LFLAGS += --coverage
QMAKE_CXXFLAGS += --coverage
}

CONFIG(debug, debug|release) {
QMAKE_CXXFLAGS += -g -c -Wall -O0
QMAKE_LFLAGS += -O0
}

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

clang|gcc:QMAKE_CXXFLAGS_WARN_ON += -Wno-unknown-pragmas

nosingleapp {
QMAKE_CXXFLAGS += -DSINGLE_APP=0
} else {
QT += network
QMAKE_CXXFLAGS += -DSINGLE_APP=1
}

DEFINES += "VERSION=\"\\\"$$VERSION\\\"\""

CODECFORSRC = UTF-8
CODECFORTR = UTF-8

macx {
QMAKE_MAC_SDK = macosx
QT += svg
}

isEmpty(QMAKE_LRELEASE) {
win32|os2:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]\\lrelease.exe
else:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease
unix {
!exists($$QMAKE_LRELEASE) {
greaterThan(QT_MAJOR_VERSION, 4) {
QMAKE_LRELEASE = lrelease-qt5
} else {
QMAKE_LRELEASE = lrelease-qt4
}
}
} else {
!exists($$QMAKE_LRELEASE) { QMAKE_LRELEASE = lrelease }
}
}

isEmpty(QMAKE_LUPDATE) {
win32|os2:QMAKE_LUPDATE = $$[QT_INSTALL_BINS]\\lupdate.exe
else:QMAKE_LUPDATE = $$[QT_INSTALL_BINS]/lupdate
unix {
!exists($$QMAKE_LUPDATE) {
greaterThan(QT_MAJOR_VERSION, 4) {
QMAKE_LUPDATE = lupdate-qt5
} else {
QMAKE_LUPDATE = lupdate-qt4
}
}
} else {
!exists($$QMAKE_LUPDATE) { QMAKE_LUPDATE = lupdate }
}
}

win32 {
RC_FILE = ../windows.rc
static {
QMAKE_LFLAGS += -static-libgcc -static-libstdc++
}
gcc:QMAKE_LFLAGS += -Wl,--dynamicbase -Wl,--nxcompat
msvc:QMAKE_LFLAGS += /DYNAMICBASE /NXCOMPAT
LIBS += -lmpr -lbcrypt
} else:macx {
ICON = ../artwork/icon.icns
QMAKE_INFO_PLIST = ../qtpass.plist
} else:bsd {
LIBS += -L/usr/local/lib
}

32 changes: 31 additions & 1 deletion qtpass.pro
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
!include(qtpass.pri) { error("Couldn't find the qtpass.pri file!") }

SUBDIRS += src tests
TEMPLATE = subdirs
SUBDIRS += src tests main
tests.depends = src
main.depends = tests

OTHER_FILES += LICENSE \
README.md \
Expand Down Expand Up @@ -55,3 +57,31 @@ CONFIG(coverage) {
QMAKE_CLEAN += src/$$OBJECTS_DIR/*.gc?? src/*.gcov
QMAKE_DISTCLEAN += -r src/$$OBJECTS_DIR/lcov/
}

TRANSLATIONS += localization/localization_nl_NL.ts \
localization/localization_de_DE.ts \
localization/localization_es_ES.ts \
localization/localization_gl_ES.ts \
localization/localization_hu_HU.ts \
localization/localization_sv_SE.ts \
localization/localization_pl_PL.ts \
localization/localization_ru_RU.ts \
localization/localization_he_IL.ts \
localization/localization_zh_CN.ts \
localization/localization_ar_MA.ts \
localization/localization_fr_FR.ts \
localization/localization_fr_BE.ts \
localization/localization_nl_BE.ts \
localization/localization_fr_LU.ts \
localization/localization_de_LU.ts \
localization/localization_lb_LU.ts \
localization/localization_en_GB.ts \
localization/localization_en_US.ts \
localization/localization_el_GR.ts \
localization/localization_cs_CZ.ts \
localization/localization_it_IT.ts \
localization/localization_pt_PT.ts

system($$QMAKE_LUPDATE $$_PRO_FILE_)
system($$QMAKE_LRELEASE $$_PRO_FILE_)

2 changes: 1 addition & 1 deletion release-mac
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ sed 's/CHANGELOG\.md/https:\/\/qtpass.org\/docs\/md__c_h_a_n_g_e_l_o_g.html/' <
sed 's/\[\!.*//' < README.changelog > README.clean
pandoc --standalone --from=markdown_github --to=rtf --output=README.rtf README.clean FAQ.md CONTRIBUTING.md CHANGELOG.md
doxygen
qmake CONFIG+=release && make && macdeployqt src/QtPass.app && appdmg appdmg.json src/QtPass.dmg
qmake CONFIG+=release && make && macdeployqt src/QtPass.app && appdmg appdmg.json main/QtPass.dmg
Loading