From 3b31ab31eb52578693acee07fdcf84fbeff72707 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Sun, 23 Aug 2020 14:30:12 +0300 Subject: Cleanup: Use ".binary" for binary files --- src/app.c | 16 ++++++++-------- src/gmcerts.c | 4 ++-- src/ui/macos.m | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/app.c b/src/app.c index fe96a1f6..c91366c9 100644 --- a/src/app.c +++ b/src/app.c @@ -60,20 +60,20 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ iDeclareType(App) #if defined (iPlatformApple) -#define EMB_BIN "../../Resources/resources.bin" +#define EMB_BIN "../../Resources/resources.binary" static const char *dataDir_App_ = "~/Library/Application Support/fi.skyjake.Lagrange"; #endif #if defined (iPlatformMsys) -#define EMB_BIN "../resources.bin" +#define EMB_BIN "../resources.binary" static const char *dataDir_App_ = "~/AppData/Roaming/fi.skyjake.Lagrange"; #endif #if defined (iPlatformLinux) -#define EMB_BIN "../../share/lagrange/resources.bin" -#define EMB_BIN2 "../resources.bin" /* try from build dir as well */ +#define EMB_BIN "../../share/lagrange/resources.binary" static const char *dataDir_App_ = "~/.config/lagrange"; #endif +#define EMB_BIN2 "../resources.binary" /* fallback from build/executable dir */ static const char *prefsFileName_App_ = "prefs.cfg"; -static const char *stateFileName_App_ = "state.bin"; +static const char *stateFileName_App_ = "state.binary"; struct Impl_App { iCommandLine args; @@ -274,9 +274,9 @@ static void init_App_(iApp *d, int argc, char **argv) { load_Bookmarks(d->bookmarks, dataDir_App_); #if defined (iHaveLoadEmbed) /* Load the resources from a file. */ { - if (!load_Embed(concatPath_CStr(cstr_String(execPath_App()), "../resources.bin"))) { - if (!load_Embed(concatPath_CStr(cstr_String(execPath_App()), EMB_BIN))) { - fprintf(stderr, "failed to load resources.bin: %s\n", strerror(errno)); + if (!load_Embed(concatPath_CStr(cstr_String(execPath_App()), EMB_BIN))) { + if (!load_Embed(concatPath_CStr(cstr_String(execPath_App()), EMB_BIN2))) { + fprintf(stderr, "failed to load resources: %s\n", strerror(errno)); exit(-1); } } 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. */ static const char *filename_GmCerts_ = "trusted.txt"; static const char *identsDir_GmCerts_ = "idents"; -static const char *identsFilename_GmCerts_ = "idents.bin"; +static const char *identsFilename_GmCerts_ = "idents.binary"; iDeclareClass(TrustEntry) @@ -197,7 +197,6 @@ static void save_GmCerts_(const iGmCerts *d) { deinit_String(&line); } iRelease(f); - saveIdentities_GmCerts_(d); iEndCollect(); } @@ -317,6 +316,7 @@ void init_GmCerts(iGmCerts *d, const char *saveDir) { void deinit_GmCerts(iGmCerts *d) { iGuardMutex(&d->mtx, { + saveIdentities_GmCerts_(d); iForEach(PtrArray, i, &d->idents) { delete_GmIdentity(i.ptr); } 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) { const iBool isDark = [name containsString:@"Dark"]; const iBool isHighContrast = [name containsString:@"HighContrast"]; postCommandf_App("os.theme.changed dark:%d contrast:%d", isDark ? 1 : 0, isHighContrast ? 1 : 0); - printf("Effective appearance changed: %s\n", [name cStringUsingEncoding:NSUTF8StringEncoding]); - fflush(stdout); +// printf("Effective appearance changed: %s\n", [name cStringUsingEncoding:NSUTF8StringEncoding]); +// fflush(stdout); } - (void)setAppearance:(NSString *)name { -- cgit v1.2.3