Преглед изворни кода

refactor: move encoding file location and use app assets

Alan Tsui пре 1 година
родитељ
комит
5e3f065bbb

+ 1 - 0
application.fam

@@ -9,4 +9,5 @@ App(
     fap_icon="images/barcode_10.png",
     fap_icon="images/barcode_10.png",
     fap_icon_assets="images",
     fap_icon_assets="images",
     fap_icon_assets_symbol="barcode_app",
     fap_icon_assets_symbol="barcode_app",
+    fap_file_assets="barcode_encoding_files",
 )
 )

+ 4 - 7
barcode_app.h

@@ -23,20 +23,17 @@
 #define BARCODE_HEIGHT 50
 #define BARCODE_HEIGHT 50
 #define BARCODE_Y_START 3
 #define BARCODE_Y_START 3
 
 
-//the folder where the encodings are located
-#define BARCODE_DATA_FILE_DIR_PATH EXT_PATH("apps_data/barcode_data")
-
 //the folder where the codabar encoding table is located
 //the folder where the codabar encoding table is located
-#define CODABAR_DICT_FILE_PATH BARCODE_DATA_FILE_DIR_PATH "/codabar_encodings.txt"
+#define CODABAR_DICT_FILE_PATH APP_ASSETS_PATH("codabar_encodings.txt")
 
 
 //the folder where the code 39 encoding table is located
 //the folder where the code 39 encoding table is located
-#define CODE39_DICT_FILE_PATH BARCODE_DATA_FILE_DIR_PATH "/code39_encodings.txt"
+#define CODE39_DICT_FILE_PATH APP_ASSETS_PATH("code39_encodings.txt")
 
 
 //the folder where the code 128 encoding table is located
 //the folder where the code 128 encoding table is located
-#define CODE128_DICT_FILE_PATH BARCODE_DATA_FILE_DIR_PATH "/code128_encodings.txt"
+#define CODE128_DICT_FILE_PATH APP_ASSETS_PATH("code128_encodings.txt")
 
 
 //the folder where the code 128 C encoding table is located
 //the folder where the code 128 C encoding table is located
-#define CODE128C_DICT_FILE_PATH BARCODE_DATA_FILE_DIR_PATH "/code128c_encodings.txt"
+#define CODE128C_DICT_FILE_PATH APP_ASSETS_PATH("code128c_encodings.txt")
 
 
 //the folder where the user stores their barcodes
 //the folder where the user stores their barcodes
 #define DEFAULT_USER_BARCODES EXT_PATH("apps_data/barcodes")
 #define DEFAULT_USER_BARCODES EXT_PATH("apps_data/barcodes")

+ 0 - 0
encoding_tables/codabar_encodings.txt → barcode_encoding_files/codabar_encodings.txt


+ 0 - 0
encoding_tables/code128_encodings.txt → barcode_encoding_files/code128_encodings.txt


+ 0 - 0
encoding_tables/code128c_encodings.txt → barcode_encoding_files/code128c_encodings.txt


+ 0 - 0
encoding_tables/code39_encodings.txt → barcode_encoding_files/code39_encodings.txt