1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
diff --git a/ares/desktop-ui/desktop-ui.cpp b/ares/desktop-ui/desktop-ui.cpp
@@ -26,10 +26,20 @@
location = {Path::userData(), "ares/", name};
if(inode::exists(location)) return location;
- // On non-windows platforms, after exhausting other options,
- // default to userData, on Windows, default to program dir
+ // On non-windows platforms, this time check the shared
+ // data directory, on Windows, default to program dir,
// this ensures Portable mode is the default on Windows platforms.
#if !defined(PLATFORM_WINDOWS)
+ string shared_location = {Path::sharedData(), "ares/", name};
+ if(inode::exists(shared_location)) return shared_location;
+
+ // XXX: Change settings.bml location to match Ares' default behavior.
+ if(directory::exists({Path::userSettings(), "ares/"})) {
+ file::copy({Path::userSettings(), "ares/settings.bml"}, {Path::userData(), "ares/settings.bml"});
+ }
+
+ // On non-windows platforms, after exhausting other options,
+ // default to userData.
directory::create({Path::userData(), "ares/"});
return {Path::userData(), "ares/", name};
#else
diff --git a/ares/mia/mia.cpp b/ares/mia/mia.cpp
@@ -26,10 +26,15 @@
location = {Path::userData(), "ares/", name};
if(inode::exists(location)) return location;
- // On non-windows platforms, after exhausting other options,
- // default to userData, on Windows, default to program dir
+ // On non-windows platforms, this time check the shared
+ // data directory, on Windows, default to program dir
// this ensures Portable mode is the default on Windows platforms.
#if !defined(PLATFORM_WINDOWS)
+ string shared_location = {Path::sharedData(), "ares/", name};
+ if(inode::exists(shared_location)) return shared_location;
+
+ // On non-windows platforms, after exhausting other options,
+ // default to userData
directory::create({Path::userData(), "ares/"});
return {Path::userData(), "ares/", name};
#else
|