mobile-datovka.pro 13.9 KB
Newer Older
1
QT += qml quick quickcontrols2 network xml sql widgets svg
2

3 4 5 6
android {
	QT += androidextras
}

7 8
TEMPLATE = app
APP_NAME = Datovka
9 10
# winphone|winrt target.
winphone|winrt {
Martin Straka's avatar
Martin Straka committed
11
    VERSION = 1.6.1.0
12
} else {
Martin Straka's avatar
Martin Straka committed
13
    VERSION = 1.6.1
14
}
15 16
DESCRIPTION = "Mobile client for ISDS"

17 18 19 20 21
isEmpty(OBJECTS_DIR) {
	OBJECTS_DIR = objects
}
CONFIG += object_parallel_to_source

22 23 24 25 26 27 28 29 30 31 32 33
DEFINES += \
    DEBUG=1 \
    VERSION=\\\"$${VERSION}\\\" \
    APP_NAME=\\\"$${APP_NAME}\\\"

winphone|winrt|win32 {
    RC_FILE = res/datovka.rc
    DEFINES += \
        __func__=__FUNCTION__
} else {
    QMAKE_CXXFLAGS += \
        -g -O0 -std=c++11 \
34 35
        -Wall -Wextra -pedantic \
        -Wdate-time -Wformat -Werror=format-security
36 37
    SOURCES += \
        src/crypto/crypto.c \
38
        src/datovka_shared/crypto/crypto_trusted_certs.c \
39
        src/datovka_shared/crypto/crypto_pin.c \
40 41
        src/datovka_shared/crypto/crypto_pwd.c \
        src/datovka_shared/crypto/crypto_wrapped.cpp
42 43
    HEADERS += \
        src/crypto/crypto.h \
44
        src/datovka_shared/crypto/crypto_trusted_certs.h \
45
        src/datovka_shared/crypto/crypto_pin.h \
46 47
        src/datovka_shared/crypto/crypto_pwd.h \
        src/datovka_shared/crypto/crypto_wrapped.h
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
    LIBS += \
        -lcrypto
}

# Additional import path used to resolve
# QML modules in code model of Qt Creator
QML_IMPORT_PATH =

# Supported languages
LANGUAGES = en cs

TRANSLATIONS += res/locale/datovka_en.ts \
    res/locale/datovka_cs.ts

lupdate_only {
SOURCES += qml/*.qml \
64
    qml/components/*.qml \
Martin Straka's avatar
Martin Straka committed
65
    qml/dialogues/*.qml \
66 67 68
    qml/pages/*.qml
}

69
# Run lrelease to generate the qm files.
70
qtPrepareTool(LRELEASE, lrelease)
71 72 73 74 75
contains(QMAKE_HOST.os, Windows) {
    # Remove shell quotes and replace them with system quotes.
    LRELEASE=$$replace(LRELEASE, "'", "")
    LRELEASE=$$system_quote($$LRELEASE)
}
76 77 78 79
command = $$LRELEASE mobile-datovka.pro
system($$command)|error("Failed to run: $$command")

# Copy translation files at qmake invocation.
80 81 82
message(Copying Qt translation from $$system_path($$[QT_INSTALL_DATA]).)
system($$QMAKE_COPY $$system_path($$[QT_INSTALL_DATA]/translations/qtbase_cs.qm) $$system_path(res/locale/qtbase_cs.qm))
system($$QMAKE_COPY $$system_path($$[QT_INSTALL_DATA]/translations/qtbase_en.qm) $$system_path(res/locale/qtbase_en.qm))
83 84 85 86 87 88 89 90 91

TRANSLATIONS_FILES += \
    res/locale/qtbase_cs.qm \
    res/locale/qtbase_en.qm \
    res/locale/datovka_cs.qm \
    res/locale/datovka_en.qm

SOURCES += \
    src/accounts.cpp \
92
    src/auxiliaries/attachment_helper.cpp \
93
    src/auxiliaries/email_helper.cpp \
94
    src/datovka_shared/gov_services/helper.cpp \
95 96 97 98 99 100 101
    src/datovka_shared/gov_services/service/gov_mv_crr_vbh.cpp \
    src/datovka_shared/gov_services/service/gov_mv_ir_vp.cpp \
    src/datovka_shared/gov_services/service/gov_mv_rt_vt.cpp \
    src/datovka_shared/gov_services/service/gov_mv_rtpo_vt.cpp \
    src/datovka_shared/gov_services/service/gov_mv_skd_vp.cpp \
    src/datovka_shared/gov_services/service/gov_mv_vr_vp.cpp \
    src/datovka_shared/gov_services/service/gov_mv_zr_vp.cpp \
102
    src/datovka_shared/gov_services/service/gov_service_form_field.cpp \
103
    src/datovka_shared/gov_services/service/gov_service.cpp \
104
    src/datovka_shared/gov_services/service/gov_services_all.cpp \
105 106 107
    src/datovka_shared/gov_services/service/gov_szr_rob_vu.cpp \
    src/datovka_shared/gov_services/service/gov_szr_rob_vvu.cpp \
    src/datovka_shared/gov_services/service/gov_szr_ros_vv.cpp \
Martin Straka's avatar
Martin Straka committed
108
    src/datovka_shared/graphics/graphics.cpp \
109
    src/datovka_shared/io/records_management_db.cpp \
110
    src/datovka_shared/io/sqlite/db.cpp \
111
    src/datovka_shared/io/sqlite/db_single.cpp \
112
    src/datovka_shared/io/sqlite/table.cpp \
113
    src/datovka_shared/isds/account_interface.cpp \
114
    src/datovka_shared/isds/box_interface.cpp \
115
    src/datovka_shared/isds/error.cpp \
116 117 118
    src/datovka_shared/isds/internal_conversion.cpp \
    src/datovka_shared/isds/message_interface.cpp \
    src/datovka_shared/isds/type_conversion.cpp \
119
    src/datovka_shared/localisation/localisation.cpp \
120 121 122 123
    src/datovka_shared/log/global.cpp \
    src/datovka_shared/log/log.cpp \
    src/datovka_shared/log/log_c.cpp \
    src/datovka_shared/log/log_device.cpp \
124
    src/datovka_shared/log/memory_log.cpp \
125 126 127 128 129
    src/datovka_shared/records_management/conversion.cpp \
    src/datovka_shared/records_management/io/records_management_connection.cpp \
    src/datovka_shared/records_management/json/entry_error.cpp \
    src/datovka_shared/records_management/json/helper.cpp \
    src/datovka_shared/records_management/json/service_info.cpp \
130 131 132
    src/datovka_shared/records_management/json/stored_files.cpp \
    src/datovka_shared/records_management/json/upload_file.cpp \
    src/datovka_shared/records_management/json/upload_hierarchy.cpp \
133
    src/datovka_shared/records_management/models/upload_hierarchy_proxy_model.cpp \
134
    src/datovka_shared/settings/pin.cpp \
135
    src/datovka_shared/settings/records_management.cpp \
136
    src/datovka_shared/utility/strings.cpp \
137
    src/datovka_shared/worker/pool.cpp \
138
    src/dialogues/dialogues.cpp \
139 140
    src/dialogues/qml_dialogue_helper.cpp \
    src/dialogues/qml_input_dialogue.cpp \
141
    src/dialogues/qml_message_dialogue.cpp \
142
    src/dialogues/widget_input_dialogue.cpp \
143
    src/dialogues/widget_message_dialogue.cpp \
144
    src/files.cpp \
145
    src/global.cpp \
146 147
    src/gov_services/models/gov_form_list_model.cpp \
    src/gov_services/models/gov_service_list_model.cpp \
148
    src/gov_wrapper.cpp \
149
    src/io/filesystem.cpp \
150
    src/isds/isds_conversion.cpp \
151
    src/isds/isds_type_conversion.cpp \
Karel Slaný's avatar
Karel Slaný committed
152
    src/locker.cpp \
153
    src/log.cpp \
154 155 156
    src/main.cpp \
    src/messages.cpp \
    src/models/accountmodel.cpp \
157
    src/models/databoxmodel.cpp \
158
    src/models/filemodel.cpp \
159
    src/models/list_sort_filter_proxy_model.cpp \
160
    src/models/messagemodel.cpp \
Martin Straka's avatar
Martin Straka committed
161 162 163 164
    src/net/db_wrapper.cpp \
    src/net/isds_session.cpp \
    src/net/isds_wrapper.cpp \
    src/net/net_layer.cpp \
165
    src/qml_interaction/image_provider.cpp \
166
    src/qml_interaction/interaction_filesystem.cpp \
167
    src/qml_interaction/interaction_zfo_file.cpp \
168
    src/qml_interaction/message_info.cpp \
169
    src/qml_interaction/string_manipulation.cpp \
170
    src/qml_isds/message_interface.cpp \
171
    src/records_management/models/upload_hierarchy_list_model.cpp \
172
    src/records_management/models/upload_hierarchy_qml_proxy_model.cpp \
173
    src/records_management.cpp \
174
    src/settings.cpp \
Martin Straka's avatar
Martin Straka committed
175
    src/setwrapper.cpp \
176 177 178 179 180 181 182
    src/sqlite/account_db.cpp \
    src/sqlite/dbs.cpp \
    src/sqlite/db_tables.cpp \
    src/sqlite/file_db_container.cpp \
    src/sqlite/file_db.cpp \
    src/sqlite/message_db_container.cpp \
    src/sqlite/message_db.cpp \
Martin Straka's avatar
Martin Straka committed
183
    src/sqlite/zfo_db.cpp \
184
    src/worker/task_change_password.cpp \
185 186
    src/worker/task_download_account_info.cpp \
    src/worker/task_download_delivery_info.cpp \
187 188
    src/worker/task_download_message.cpp \
    src/worker/task_download_message_list.cpp \
189
    src/worker/task_find_databox.cpp \
190
    src/worker/task_find_databox_fulltext.cpp \
Martin Straka's avatar
Martin Straka committed
191
    src/worker/task_import_zfo.cpp \
192
    src/worker/task_keep_alive.cpp \
193
    src/worker/task_records_management_stored_messages.cpp \
194
    src/worker/task_send_message.cpp \
195
    src/worker/task_send_sms.cpp \
196 197 198 199 200 201
    src/xml/xml_authenticate_message.cpp \
    src/xml/xml_base.cpp \
    src/xml/xml_download_delivery_info.cpp \
    src/xml/xml_download_message.cpp \
    src/xml/xml_download_message_author.cpp \
    src/xml/xml_download_message_list.cpp \
202 203 204 205 206
    src/xml/xml_find_databox.cpp \
    src/xml/xml_find_databox_fulltext.cpp \
    src/xml/xml_get_db_owner_info.cpp \
    src/xml/xml_get_db_user_info.cpp \
    src/xml/xml_login.cpp \
207 208 209
    src/xml/xml_mark_message_as_read.cpp \
    src/xml/xml_parse_zfo.cpp \
    src/xml/xml_send_message.cpp \
210
    src/zfo.cpp
211 212 213

HEADERS += \
    src/accounts.h \
214
    src/auxiliaries/attachment_helper.h \
215
    src/auxiliaries/email_helper.h \
216
    src/common.h \
217
    src/datovka_shared/gov_services/helper.h \
218 219 220 221 222 223 224
    src/datovka_shared/gov_services/service/gov_mv_crr_vbh.h \
    src/datovka_shared/gov_services/service/gov_mv_ir_vp.h \
    src/datovka_shared/gov_services/service/gov_mv_rt_vt.h \
    src/datovka_shared/gov_services/service/gov_mv_rtpo_vt.h \
    src/datovka_shared/gov_services/service/gov_mv_skd_vp.h \
    src/datovka_shared/gov_services/service/gov_mv_vr_vp.h \
    src/datovka_shared/gov_services/service/gov_mv_zr_vp.h \
225
    src/datovka_shared/gov_services/service/gov_service_form_field.h \
226
    src/datovka_shared/gov_services/service/gov_service.h \
227
    src/datovka_shared/gov_services/service/gov_services_all.h \
228 229 230
    src/datovka_shared/gov_services/service/gov_szr_rob_vu.h \
    src/datovka_shared/gov_services/service/gov_szr_rob_vvu.h \
    src/datovka_shared/gov_services/service/gov_szr_ros_vv.h \
Martin Straka's avatar
Martin Straka committed
231
    src/datovka_shared/graphics/graphics.h \
232
    src/datovka_shared/io/records_management_db.h \
233
    src/datovka_shared/io/sqlite/db.h \
234
    src/datovka_shared/io/sqlite/db_single.h \
235
    src/datovka_shared/io/sqlite/table.h \
236
    src/datovka_shared/isds/account_interface.h \
237
    src/datovka_shared/isds/box_interface.h \
238
    src/datovka_shared/isds/error.h \
239 240 241 242
    src/datovka_shared/isds/internal_conversion.h \
    src/datovka_shared/isds/message_interface.h \
    src/datovka_shared/isds/type_conversion.h \
    src/datovka_shared/isds/types.h \
243
    src/datovka_shared/localisation/localisation.h \
244 245 246 247 248
    src/datovka_shared/log/global.h \
    src/datovka_shared/log/log_c.h \
    src/datovka_shared/log/log_common.h \
    src/datovka_shared/log/log_device.h \
    src/datovka_shared/log/log.h \
249
    src/datovka_shared/log/memory_log.h \
250 251 252 253 254
    src/datovka_shared/records_management/conversion.h \
    src/datovka_shared/records_management/io/records_management_connection.h \
    src/datovka_shared/records_management/json/entry_error.h \
    src/datovka_shared/records_management/json/helper.h \
    src/datovka_shared/records_management/json/service_info.h \
255 256 257
    src/datovka_shared/records_management/json/stored_files.h \
    src/datovka_shared/records_management/json/upload_file.h \
    src/datovka_shared/records_management/json/upload_hierarchy.h \
258
    src/datovka_shared/records_management/models/upload_hierarchy_proxy_model.h \
259
    src/datovka_shared/settings/pin.h \
260
    src/datovka_shared/settings/records_management.h \
261
    src/datovka_shared/utility/strings.h \
262
    src/datovka_shared/worker/pool.h \
263
    src/dialogues/dialogues.h \
264 265
    src/dialogues/qml_dialogue_helper.h \
    src/dialogues/qml_input_dialogue.h \
266
    src/dialogues/qml_message_dialogue.h \
267
    src/dialogues/widget_input_dialogue.h \
268
    src/dialogues/widget_message_dialogue.h \
269
    src/files.h \
270
    src/global.h \
271 272
    src/gov_services/models/gov_form_list_model.h \
    src/gov_services/models/gov_service_list_model.h \
273
    src/gov_wrapper.h \
274
    src/io/db_tables.h \
275
    src/io/filesystem.h \
276
    src/isds/isds_conversion.h \
277
    src/isds/isds_type_conversion.h \
Karel Slaný's avatar
Karel Slaný committed
278
    src/locker.h \
279
    src/log.h \
280 281
    src/messages.h \
    src/models/accountmodel.h \
282
    src/models/databoxmodel.h \
283
    src/models/filemodel.h \
284
    src/models/list_sort_filter_proxy_model.h \
285
    src/models/messagemodel.h \
Martin Straka's avatar
Martin Straka committed
286 287 288 289 290
    src/net/db_wrapper.h \
    src/net/isds_const.h \
    src/net/isds_session.h \
    src/net/isds_wrapper.h \
    src/net/net_layer.h \
291
    src/qml_interaction/image_provider.h \
292
    src/qml_interaction/interaction_filesystem.h \
293
    src/qml_interaction/interaction_zfo_file.h \
294
    src/qml_interaction/message_info.h \
295
    src/qml_interaction/string_manipulation.h \
296
    src/qml_isds/message_interface.h \
297
    src/records_management/models/upload_hierarchy_list_model.h \
298
    src/records_management/models/upload_hierarchy_qml_proxy_model.h \
299
    src/records_management.h \
300
    src/settings.h \
Martin Straka's avatar
Martin Straka committed
301
    src/setwrapper.h \
302 303 304 305 306 307 308
    src/sqlite/account_db.h \
    src/sqlite/dbs.h \
    src/sqlite/db_tables.h \
    src/sqlite/file_db_container.h \
    src/sqlite/file_db.h \
    src/sqlite/message_db_container.h \
    src/sqlite/message_db.h \
Martin Straka's avatar
Martin Straka committed
309
    src/sqlite/zfo_db.h \
310
    src/worker/emitter.h \
311
    src/worker/task.h \
312
    src/worker/task_change_password.h \
313 314
    src/worker/task_download_account_info.h \
    src/worker/task_download_delivery_info.h \
315 316
    src/worker/task_download_message.h \
    src/worker/task_download_message_list.h \
317
    src/worker/task_find_databox.h \
318
    src/worker/task_find_databox_fulltext.h \
Martin Straka's avatar
Martin Straka committed
319
    src/worker/task_import_zfo.h \
320
    src/worker/task_keep_alive.h \
321
    src/worker/task_records_management_stored_messages.h \
322
    src/worker/task_send_message.h \
323
    src/worker/task_send_sms.h \
324 325 326 327 328 329
    src/xml/xml_authenticate_message.h \
    src/xml/xml_base.h \
    src/xml/xml_download_delivery_info.h \
    src/xml/xml_download_message.h \
    src/xml/xml_download_message_author.h \
    src/xml/xml_download_message_list.h \
330 331 332 333 334
    src/xml/xml_find_databox.h \
    src/xml/xml_find_databox_fulltext.h \
    src/xml/xml_get_db_owner_info.h \
    src/xml/xml_get_db_user_info.h \
    src/xml/xml_login.h \
335 336 337
    src/xml/xml_mark_message_as_read.h \
    src/xml/xml_parse_zfo.h \
    src/xml/xml_send_message.h \
338
    src/zfo.h
339

340 341 342 343 344 345 346 347
android {
	SOURCES += \
	    src/os_android.cpp

	HEADERS += \
	    src/os_android.h
}

348 349 350 351 352 353 354 355 356 357 358
RESOURCES += \
    res/qml.qrc \
    res/translations.qrc

# osx target.
osx: ICON = res/datovka.icns

# linux target.
linux: ICON = res/datovka.png

# ios target.
359 360 361 362
ios {
    system(sed -e "s/@VERSION@/$${VERSION}/g" "ios/Info.tmp" > "ios/Info.plist")
    include(ios/ios.pri)
}
363 364

# android target.
Martin Straka's avatar
Martin Straka committed
365
android {
366
    contains(QMAKE_HOST.os, Windows) {
Martin Straka's avatar
Martin Straka committed
367 368
        system(sed.exe -e "s/@VERSION@/$${VERSION}/g" "android/AndroidManifest.tmp" > "android/AndroidManifest.xml")
    }
369
    contains(QMAKE_HOST.os, Linux) {
Martin Straka's avatar
Martin Straka committed
370 371
        system(sed -e "s/@VERSION@/$${VERSION}/g" "android/AndroidManifest.tmp" > "android/AndroidManifest.xml")
    }
372 373 374
    contains(QMAKE_HOST.os, Darwin) {
        system(sed -e "s/@VERSION@/$${VERSION}/g" "android/AndroidManifest.tmp" > "android/AndroidManifest.xml")
    }
Martin Straka's avatar
Martin Straka committed
375 376 377
    ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
    include(android/android.pri)
}
378 379 380 381 382 383 384 385

# winphone|winrt target.
winphone|winrt: include(winrt/winrt.pri)

# Default rules for deployment.
include(deployment.pri)

OTHER_FILES +=