diff options
Diffstat (limited to 'src/app.c')
-rw-r--r-- | src/app.c | 19 |
1 files changed, 11 insertions, 8 deletions
@@ -74,25 +74,26 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ | |||
74 | iDeclareType(App) | 74 | iDeclareType(App) |
75 | 75 | ||
76 | #if defined (iPlatformApple) | 76 | #if defined (iPlatformApple) |
77 | #define EMB_BIN "../../Resources/resources.binary" | 77 | #define EMB_BIN "../../Resources/resources.lgr" |
78 | static const char *dataDir_App_ = "~/Library/Application Support/fi.skyjake.Lagrange"; | 78 | static const char *dataDir_App_ = "~/Library/Application Support/fi.skyjake.Lagrange"; |
79 | #endif | 79 | #endif |
80 | #if defined (iPlatformMsys) | 80 | #if defined (iPlatformMsys) |
81 | #define EMB_BIN "../resources.binary" | 81 | #define EMB_BIN "../resources.lgr" |
82 | static const char *dataDir_App_ = "~/AppData/Roaming/fi.skyjake.Lagrange"; | 82 | static const char *dataDir_App_ = "~/AppData/Roaming/fi.skyjake.Lagrange"; |
83 | #endif | 83 | #endif |
84 | #if defined (iPlatformLinux) || defined (iPlatformOther) | 84 | #if defined (iPlatformLinux) || defined (iPlatformOther) |
85 | #define EMB_BIN "../../share/lagrange/resources.binary" | 85 | #define EMB_BIN "../../share/lagrange/resources.lgr" |
86 | static const char *dataDir_App_ = "~/.config/lagrange"; | 86 | static const char *dataDir_App_ = "~/.config/lagrange"; |
87 | #endif | 87 | #endif |
88 | #if defined (LAGRANGE_EMB_BIN) /* specified in build config */ | 88 | #if defined (LAGRANGE_EMB_BIN) /* specified in build config */ |
89 | # undef EMB_BIN | 89 | # undef EMB_BIN |
90 | # define EMB_BIN LAGRANGE_EMB_BIN | 90 | # define EMB_BIN LAGRANGE_EMB_BIN |
91 | #endif | 91 | #endif |
92 | #define EMB_BIN2 "../resources.binary" /* fallback from build/executable dir */ | 92 | #define EMB_BIN2 "../resources.lgr" /* fallback from build/executable dir */ |
93 | static const char *prefsFileName_App_ = "prefs.cfg"; | 93 | static const char *prefsFileName_App_ = "prefs.cfg"; |
94 | static const char *stateFileName_App_ = "state.binary"; | 94 | static const char *oldStateFileName_App_ = "state.binary"; |
95 | static const char *downloadDir_App_ = "~/Downloads"; | 95 | static const char *stateFileName_App_ = "state.lgr"; |
96 | static const char *downloadDir_App_ = "~/Downloads"; | ||
96 | 97 | ||
97 | static const int idleThreshold_App_ = 1000; /* ms */ | 98 | static const int idleThreshold_App_ = 1000; /* ms */ |
98 | 99 | ||
@@ -265,7 +266,9 @@ static const char *magicTabDocument_App_ = "tabd"; | |||
265 | 266 | ||
266 | static iBool loadState_App_(iApp *d) { | 267 | static iBool loadState_App_(iApp *d) { |
267 | iUnused(d); | 268 | iUnused(d); |
268 | iFile *f = iClob(newCStr_File(concatPath_CStr(dataDir_App_, stateFileName_App_))); | 269 | const char *oldPath = concatPath_CStr(dataDir_App_, oldStateFileName_App_); |
270 | const char *path = concatPath_CStr(dataDir_App_, stateFileName_App_); | ||
271 | iFile *f = iClob(newCStr_File(fileExistsCStr_FileInfo(path) ? path : oldPath)); | ||
269 | if (open_File(f, readOnly_FileMode)) { | 272 | if (open_File(f, readOnly_FileMode)) { |
270 | char magic[4]; | 273 | char magic[4]; |
271 | readData_File(f, 4, magic); | 274 | readData_File(f, 4, magic); |