diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-08-23 14:30:12 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-08-23 14:30:12 +0300 |
commit | 3b31ab31eb52578693acee07fdcf84fbeff72707 (patch) | |
tree | 954933c8f2db93aebe855a9a2d3baed3ae48a8a8 /src | |
parent | 863adf9118ae98a42bbbbd556087a437aba62329 (diff) |
Cleanup: Use ".binary" for binary files
Diffstat (limited to 'src')
-rw-r--r-- | src/app.c | 16 | ||||
-rw-r--r-- | src/gmcerts.c | 4 | ||||
-rw-r--r-- | src/ui/macos.m | 4 |
3 files changed, 12 insertions, 12 deletions
@@ -60,20 +60,20 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ | |||
60 | iDeclareType(App) | 60 | iDeclareType(App) |
61 | 61 | ||
62 | #if defined (iPlatformApple) | 62 | #if defined (iPlatformApple) |
63 | #define EMB_BIN "../../Resources/resources.bin" | 63 | #define EMB_BIN "../../Resources/resources.binary" |
64 | static const char *dataDir_App_ = "~/Library/Application Support/fi.skyjake.Lagrange"; | 64 | static const char *dataDir_App_ = "~/Library/Application Support/fi.skyjake.Lagrange"; |
65 | #endif | 65 | #endif |
66 | #if defined (iPlatformMsys) | 66 | #if defined (iPlatformMsys) |
67 | #define EMB_BIN "../resources.bin" | 67 | #define EMB_BIN "../resources.binary" |
68 | static const char *dataDir_App_ = "~/AppData/Roaming/fi.skyjake.Lagrange"; | 68 | static const char *dataDir_App_ = "~/AppData/Roaming/fi.skyjake.Lagrange"; |
69 | #endif | 69 | #endif |
70 | #if defined (iPlatformLinux) | 70 | #if defined (iPlatformLinux) |
71 | #define EMB_BIN "../../share/lagrange/resources.bin" | 71 | #define EMB_BIN "../../share/lagrange/resources.binary" |
72 | #define EMB_BIN2 "../resources.bin" /* try from build dir as well */ | ||
73 | static const char *dataDir_App_ = "~/.config/lagrange"; | 72 | static const char *dataDir_App_ = "~/.config/lagrange"; |
74 | #endif | 73 | #endif |
74 | #define EMB_BIN2 "../resources.binary" /* fallback from build/executable dir */ | ||
75 | static const char *prefsFileName_App_ = "prefs.cfg"; | 75 | static const char *prefsFileName_App_ = "prefs.cfg"; |
76 | static const char *stateFileName_App_ = "state.bin"; | 76 | static const char *stateFileName_App_ = "state.binary"; |
77 | 77 | ||
78 | struct Impl_App { | 78 | struct Impl_App { |
79 | iCommandLine args; | 79 | iCommandLine args; |
@@ -274,9 +274,9 @@ static void init_App_(iApp *d, int argc, char **argv) { | |||
274 | load_Bookmarks(d->bookmarks, dataDir_App_); | 274 | load_Bookmarks(d->bookmarks, dataDir_App_); |
275 | #if defined (iHaveLoadEmbed) | 275 | #if defined (iHaveLoadEmbed) |
276 | /* Load the resources from a file. */ { | 276 | /* Load the resources from a file. */ { |
277 | if (!load_Embed(concatPath_CStr(cstr_String(execPath_App()), "../resources.bin"))) { | 277 | if (!load_Embed(concatPath_CStr(cstr_String(execPath_App()), EMB_BIN))) { |
278 | if (!load_Embed(concatPath_CStr(cstr_String(execPath_App()), EMB_BIN))) { | 278 | if (!load_Embed(concatPath_CStr(cstr_String(execPath_App()), EMB_BIN2))) { |
279 | fprintf(stderr, "failed to load resources.bin: %s\n", strerror(errno)); | 279 | fprintf(stderr, "failed to load resources: %s\n", strerror(errno)); |
280 | exit(-1); | 280 | exit(-1); |
281 | } | 281 | } |
282 | } | 282 | } |
diff --git a/src/gmcerts.c b/src/gmcerts.c index 58ddfd0c..cc7e9702 100644 --- a/src/gmcerts.c +++ b/src/gmcerts.c | |||
@@ -35,7 +35,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ | |||
35 | 35 | ||
36 | static const char *filename_GmCerts_ = "trusted.txt"; | 36 | static const char *filename_GmCerts_ = "trusted.txt"; |
37 | static const char *identsDir_GmCerts_ = "idents"; | 37 | static const char *identsDir_GmCerts_ = "idents"; |
38 | static const char *identsFilename_GmCerts_ = "idents.bin"; | 38 | static const char *identsFilename_GmCerts_ = "idents.binary"; |
39 | 39 | ||
40 | iDeclareClass(TrustEntry) | 40 | iDeclareClass(TrustEntry) |
41 | 41 | ||
@@ -197,7 +197,6 @@ static void save_GmCerts_(const iGmCerts *d) { | |||
197 | deinit_String(&line); | 197 | deinit_String(&line); |
198 | } | 198 | } |
199 | iRelease(f); | 199 | iRelease(f); |
200 | saveIdentities_GmCerts_(d); | ||
201 | iEndCollect(); | 200 | iEndCollect(); |
202 | } | 201 | } |
203 | 202 | ||
@@ -317,6 +316,7 @@ void init_GmCerts(iGmCerts *d, const char *saveDir) { | |||
317 | 316 | ||
318 | void deinit_GmCerts(iGmCerts *d) { | 317 | void deinit_GmCerts(iGmCerts *d) { |
319 | iGuardMutex(&d->mtx, { | 318 | iGuardMutex(&d->mtx, { |
319 | saveIdentities_GmCerts_(d); | ||
320 | iForEach(PtrArray, i, &d->idents) { | 320 | iForEach(PtrArray, i, &d->idents) { |
321 | delete_GmIdentity(i.ptr); | 321 | delete_GmIdentity(i.ptr); |
322 | } | 322 | } |
diff --git a/src/ui/macos.m b/src/ui/macos.m index 2cb43eae..0e4927ee 100644 --- a/src/ui/macos.m +++ b/src/ui/macos.m | |||
@@ -150,8 +150,8 @@ static void appearanceChanged_MacOS_(NSString *name) { | |||
150 | const iBool isDark = [name containsString:@"Dark"]; | 150 | const iBool isDark = [name containsString:@"Dark"]; |
151 | const iBool isHighContrast = [name containsString:@"HighContrast"]; | 151 | const iBool isHighContrast = [name containsString:@"HighContrast"]; |
152 | postCommandf_App("os.theme.changed dark:%d contrast:%d", isDark ? 1 : 0, isHighContrast ? 1 : 0); | 152 | postCommandf_App("os.theme.changed dark:%d contrast:%d", isDark ? 1 : 0, isHighContrast ? 1 : 0); |
153 | printf("Effective appearance changed: %s\n", [name cStringUsingEncoding:NSUTF8StringEncoding]); | 153 | // printf("Effective appearance changed: %s\n", [name cStringUsingEncoding:NSUTF8StringEncoding]); |
154 | fflush(stdout); | 154 | // fflush(stdout); |
155 | } | 155 | } |
156 | 156 | ||
157 | - (void)setAppearance:(NSString *)name { | 157 | - (void)setAppearance:(NSString *)name { |