[Scummvm-git-logs] scummvm branch-2-6 -> 797408bbe76213f729f59c401e38f0e6e6c7cda2
sev-
noreply at scummvm.org
Sat Jul 2 20:39:52 UTC 2022
This automated email contains information about 8 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
27872d79a9 COMMON: Adding default iconspath functionality
e216e01769 COMMON: Add getDefaultIconPath() for Windows
b6bedc46b3 COMMON: Renaming getDefaultIconPath() -> getDefaultIconsPath()
da2434a2a1 COMMON: Adding comment for default path methods
7515b6db22 COMMON: Putting Icons in a subdirectory if in Win32 portable mode
6ff9cde60c COMMON: Adding prefix to POSIX icon path
80cc43a1d2 COMMON: Restructuring how ApplicationSupport path is calculated and putting in Icons subdirectory
797408bbe7 COMMON: Adding endline to macosx_wrapper.mm
Commit: 27872d79a970c90639955d9e2fd298215414be77
https://github.com/scummvm/scummvm/commit/27872d79a970c90639955d9e2fd298215414be77
Author: Thunderforge (wjherrmann at gmail.com)
Date: 2022-07-02T22:37:48+02:00
Commit Message:
COMMON: Adding default iconspath functionality
It's for macOS only right now.
Changed paths:
backends/platform/sdl/macosx/macosx.cpp
backends/platform/sdl/macosx/macosx.h
backends/platform/sdl/posix/posix.cpp
backends/platform/sdl/posix/posix.h
backends/platform/sdl/sdl.cpp
backends/platform/sdl/sdl.h
gui/downloadiconsdialog.cpp
gui/gui-manager.cpp
gui/options.cpp
diff --git a/backends/platform/sdl/macosx/macosx.cpp b/backends/platform/sdl/macosx/macosx.cpp
index 0809ab0d686..1c3ef7349f8 100644
--- a/backends/platform/sdl/macosx/macosx.cpp
+++ b/backends/platform/sdl/macosx/macosx.cpp
@@ -261,6 +261,21 @@ Common::String OSystem_MacOSX::getDefaultLogFileName() {
return Common::String(prefix) + "/Library/Logs/scummvm.log";
}
+Common::String OSystem_MacOSX::getDefaultIconPath() {
+ const char *prefix = getenv("HOME");
+ if (prefix == nullptr) {
+ return Common::String();
+ }
+
+ const Common::String appSupportFolder = Common::String(prefix) + "/Library/Application Support/ScummVM";
+
+ if (!Posix::assureDirectoryExists(appSupportFolder)) {
+ return Common::String();
+ }
+
+ return appSupportFolder;
+}
+
Common::String OSystem_MacOSX::getScreenshotsPath() {
// If the user has configured a screenshots path, use it
const Common::String path = OSystem_SDL::getScreenshotsPath();
diff --git a/backends/platform/sdl/macosx/macosx.h b/backends/platform/sdl/macosx/macosx.h
index 858e5865191..39b5be253da 100644
--- a/backends/platform/sdl/macosx/macosx.h
+++ b/backends/platform/sdl/macosx/macosx.h
@@ -48,7 +48,7 @@ public:
GraphicsManagerType getDefaultGraphicsManager() const override;
#endif
- //Screenshots
+ Common::String getDefaultIconPath() override;
Common::String getScreenshotsPath() override;
protected:
diff --git a/backends/platform/sdl/posix/posix.cpp b/backends/platform/sdl/posix/posix.cpp
index fc68bf016b6..4577912ea74 100644
--- a/backends/platform/sdl/posix/posix.cpp
+++ b/backends/platform/sdl/posix/posix.cpp
@@ -235,6 +235,31 @@ Common::String OSystem_POSIX::getXdgUserDir(const char *name) {
return directoryPath;
}
+Common::String OSystem_POSIX::getDefaultIconPath() {
+ Common::String iconsPath;
+
+ // On POSIX systems we follow the XDG Base Directory Specification for
+ // where to store files. The version we based our code upon can be found
+ // over here: https://specifications.freedesktop.org/basedir-spec/basedir-spec-0.8.html
+ const char *prefix = getenv("XDG_CACHE_HOME");
+ if (prefix == nullptr || !*prefix) {
+ prefix = getenv("HOME");
+ if (prefix == nullptr) {
+ return Common::String();
+ }
+
+ iconsPath = ".cache/";
+ }
+
+ iconsPath += "scummvm/icons";
+
+ if (!Posix::assureDirectoryExists(iconsPath, prefix)) {
+ return Common::String();
+ }
+
+ return iconsPath;
+}
+
Common::String OSystem_POSIX::getScreenshotsPath() {
// If the user has configured a screenshots path, use it
const Common::String path = OSystem_SDL::getScreenshotsPath();
diff --git a/backends/platform/sdl/posix/posix.h b/backends/platform/sdl/posix/posix.h
index 3e8028e020e..2bf745873b8 100644
--- a/backends/platform/sdl/posix/posix.h
+++ b/backends/platform/sdl/posix/posix.h
@@ -35,6 +35,7 @@ public:
void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0) override;
+ Common::String getDefaultIconPath() override;
Common::String getScreenshotsPath() override;
protected:
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index a751360422b..53d63bd3e71 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -302,6 +302,8 @@ void OSystem_SDL::initBackend() {
_presence = new DiscordPresence();
#endif
+ ConfMan.registerDefault("iconspath", this->getDefaultIconPath());
+
_inited = true;
BaseBackend::initBackend();
@@ -754,6 +756,14 @@ Common::SaveFileManager *OSystem_SDL::getSavefileManager() {
#endif
}
+//Not specified in base class
+Common::String OSystem_SDL::getDefaultIconPath() {
+ Common::String path = ConfMan.get("iconspath");
+ if (!path.empty() && !path.hasSuffix("/"))
+ path += "/";
+ return path;
+}
+
//Not specified in base class
Common::String OSystem_SDL::getScreenshotsPath() {
Common::String path = ConfMan.get("screenshotpath");
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index f7dd0b8a2e0..1d2ea18511d 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -90,7 +90,7 @@ public:
Common::TimerManager *getTimerManager() override;
Common::SaveFileManager *getSavefileManager() override;
- //Screenshots
+ virtual Common::String getDefaultIconPath();
virtual Common::String getScreenshotsPath();
#if defined(USE_OPENGL_GAME) || defined(USE_OPENGL_SHADERS)
diff --git a/gui/downloadiconsdialog.cpp b/gui/downloadiconsdialog.cpp
index 5c07714ed00..063f1da0445 100644
--- a/gui/downloadiconsdialog.cpp
+++ b/gui/downloadiconsdialog.cpp
@@ -369,7 +369,8 @@ void DownloadIconsDialog::setError(Common::U32String &msg) {
}
void DownloadIconsDialog::calculateList() {
- if (!ConfMan.hasKey("iconspath")) {
+ Common::String iconsPath = ConfMan.get("iconspath");
+ if (iconsPath.empty()) {
Common::U32String str(_("ERROR: No icons path set"));
setError(str);
return;
@@ -377,7 +378,8 @@ void DownloadIconsDialog::calculateList() {
// Scan all files in iconspath and remove present ones from the
// donwloaded files list
- Common::FSDirectory *iconDir = new Common::FSDirectory(ConfMan.get("iconspath"));
+ Common::FSDirectory *iconDir = new Common::FSDirectory(iconsPath);
+
Common::ArchiveMemberList iconFiles;
iconDir->listMatchingMembers(iconFiles, "gui-icons*.dat");
diff --git a/gui/gui-manager.cpp b/gui/gui-manager.cpp
index 0ed7abdfdb4..803051596d0 100644
--- a/gui/gui-manager.cpp
+++ b/gui/gui-manager.cpp
@@ -121,7 +121,7 @@ void GuiManager::initIconsSet() {
_iconsSet.clear();
- if (ConfMan.hasKey("iconspath")) {
+ if (!ConfMan.get("iconspath").empty()) {
Common::FSDirectory *iconDir = new Common::FSDirectory(ConfMan.get("iconspath"));
Common::ArchiveMemberList iconFiles;
diff --git a/gui/options.cpp b/gui/options.cpp
index 6fd512e32d8..86e07581433 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -2216,7 +2216,7 @@ void GlobalOptionsDialog::build() {
setPath(_savePath, "savepath", _("Default"));
setPath(_themePath, "themepath", _c("None", "path"));
- setPath(_iconPath, "iconspath", _c("None", "path"));
+ setPath(_iconPath, "iconspath", _("Default"));
setPath(_extraPath, "extrapath", _c("None", "path"));
#ifdef DYNAMIC_MODULES
@@ -2304,7 +2304,7 @@ void GlobalOptionsDialog::addPathsControls(GuiObject *boss, const Common::String
new ButtonWidget(boss, prefix + "IconButton", _("Icon Path:"), Common::U32String(), kChooseIconDirCmd);
else
new ButtonWidget(boss, prefix + "IconButton", _c("Icon Path:", "lowres"), Common::U32String(), kChooseIconDirCmd);
- _iconPath = new StaticTextWidget(boss, prefix + "IconPath", _c("None", "path"));
+ _iconPath = new StaticTextWidget(boss, prefix + "IconPath", _c("Default", "path"));
_iconPathClearButton = addClearButton(boss, prefix + "IconPathClearButton", kIconPathClearCmd);
@@ -2709,7 +2709,7 @@ void GlobalOptionsDialog::apply() {
changePath(_savePath, "savepath", _("Default"));
changePath(_themePath, "themepath", _c("None", "path"));
- changePath(_iconPath, "iconspath", _c("None", "path"));
+ changePath(_iconPath, "iconspath", _("Default"));
changePath(_extraPath, "extrapath", _c("None", "path"));
#ifdef DYNAMIC_MODULES
@@ -3001,7 +3001,7 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
_themePath->setLabel(_c("None", "path"));
break;
case kIconPathClearCmd:
- _iconPath->setLabel(_c("None", "path"));
+ _iconPath->setLabel(_("Default"));
break;
case kExtraPathClearCmd:
_extraPath->setLabel(_c("None", "path"));
Commit: e216e01769125edec6ebfb9fe17334b1177d1e5f
https://github.com/scummvm/scummvm/commit/e216e01769125edec6ebfb9fe17334b1177d1e5f
Author: Thunderforge (wjherrmann at gmail.com)
Date: 2022-07-02T22:37:52+02:00
Commit Message:
COMMON: Add getDefaultIconPath() for Windows
Changed paths:
backends/platform/sdl/win32/win32.cpp
backends/platform/sdl/win32/win32.h
diff --git a/backends/platform/sdl/win32/win32.cpp b/backends/platform/sdl/win32/win32.cpp
index 19bbcaaf3e5..e5570a004b3 100644
--- a/backends/platform/sdl/win32/win32.cpp
+++ b/backends/platform/sdl/win32/win32.cpp
@@ -253,6 +253,23 @@ Common::String OSystem_Win32::getSystemLanguage() const {
return OSystem_SDL::getSystemLanguage();
}
+Common::String OSystem_Win32::getDefaultIconPath() {
+ TCHAR iconsPath[MAX_PATH];
+
+ if (_isPortable) {
+ Win32::getProcessDirectory(iconsPath, MAX_PATH);
+ } else {
+ // Use the Application Data directory of the user profile
+ if (!Win32::getApplicationDataDirectory(iconsPath)) {
+ return Common::String();
+ }
+ _tcscat(iconsPath, TEXT("\\ScummVM\\Icons"));
+ CreateDirectory(iconsPath, nullptr);
+ }
+
+ return Win32::tcharToString(iconsPath);
+}
+
Common::String OSystem_Win32::getScreenshotsPath() {
// If the user has configured a screenshots path, use it
Common::String screenshotsPath = ConfMan.get("screenshotpath");
diff --git a/backends/platform/sdl/win32/win32.h b/backends/platform/sdl/win32/win32.h
index 2991f00cc5e..87f8fd4baf9 100644
--- a/backends/platform/sdl/win32/win32.h
+++ b/backends/platform/sdl/win32/win32.h
@@ -48,6 +48,7 @@ public:
Common::String getSystemLanguage() const override;
+ Common::String getDefaultIconPath() override;
Common::String getScreenshotsPath() override;
protected:
Commit: b6bedc46b342310f077010e8668f8dfe9d0a1a8b
https://github.com/scummvm/scummvm/commit/b6bedc46b342310f077010e8668f8dfe9d0a1a8b
Author: Thunderforge (wjherrmann at gmail.com)
Date: 2022-07-02T22:37:52+02:00
Commit Message:
COMMON: Renaming getDefaultIconPath() -> getDefaultIconsPath()
Changed paths:
backends/platform/sdl/macosx/macosx.cpp
backends/platform/sdl/macosx/macosx.h
backends/platform/sdl/posix/posix.cpp
backends/platform/sdl/posix/posix.h
backends/platform/sdl/sdl.cpp
backends/platform/sdl/sdl.h
backends/platform/sdl/win32/win32.cpp
backends/platform/sdl/win32/win32.h
diff --git a/backends/platform/sdl/macosx/macosx.cpp b/backends/platform/sdl/macosx/macosx.cpp
index 1c3ef7349f8..3520f93e203 100644
--- a/backends/platform/sdl/macosx/macosx.cpp
+++ b/backends/platform/sdl/macosx/macosx.cpp
@@ -261,7 +261,7 @@ Common::String OSystem_MacOSX::getDefaultLogFileName() {
return Common::String(prefix) + "/Library/Logs/scummvm.log";
}
-Common::String OSystem_MacOSX::getDefaultIconPath() {
+Common::String OSystem_MacOSX::getDefaultIconsPath() {
const char *prefix = getenv("HOME");
if (prefix == nullptr) {
return Common::String();
diff --git a/backends/platform/sdl/macosx/macosx.h b/backends/platform/sdl/macosx/macosx.h
index 39b5be253da..6bbdd0f5564 100644
--- a/backends/platform/sdl/macosx/macosx.h
+++ b/backends/platform/sdl/macosx/macosx.h
@@ -48,7 +48,7 @@ public:
GraphicsManagerType getDefaultGraphicsManager() const override;
#endif
- Common::String getDefaultIconPath() override;
+ Common::String getDefaultIconsPath() override;
Common::String getScreenshotsPath() override;
protected:
diff --git a/backends/platform/sdl/posix/posix.cpp b/backends/platform/sdl/posix/posix.cpp
index 4577912ea74..0e1cb21230e 100644
--- a/backends/platform/sdl/posix/posix.cpp
+++ b/backends/platform/sdl/posix/posix.cpp
@@ -235,7 +235,7 @@ Common::String OSystem_POSIX::getXdgUserDir(const char *name) {
return directoryPath;
}
-Common::String OSystem_POSIX::getDefaultIconPath() {
+Common::String OSystem_POSIX::getDefaultIconsPath() {
Common::String iconsPath;
// On POSIX systems we follow the XDG Base Directory Specification for
diff --git a/backends/platform/sdl/posix/posix.h b/backends/platform/sdl/posix/posix.h
index 2bf745873b8..cc3ca5777da 100644
--- a/backends/platform/sdl/posix/posix.h
+++ b/backends/platform/sdl/posix/posix.h
@@ -35,7 +35,7 @@ public:
void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0) override;
- Common::String getDefaultIconPath() override;
+ Common::String getDefaultIconsPath() override;
Common::String getScreenshotsPath() override;
protected:
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index 53d63bd3e71..f7bd295237e 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -302,7 +302,7 @@ void OSystem_SDL::initBackend() {
_presence = new DiscordPresence();
#endif
- ConfMan.registerDefault("iconspath", this->getDefaultIconPath());
+ ConfMan.registerDefault("iconspath", this->getDefaultIconsPath());
_inited = true;
@@ -757,7 +757,7 @@ Common::SaveFileManager *OSystem_SDL::getSavefileManager() {
}
//Not specified in base class
-Common::String OSystem_SDL::getDefaultIconPath() {
+Common::String OSystem_SDL::getDefaultIconsPath() {
Common::String path = ConfMan.get("iconspath");
if (!path.empty() && !path.hasSuffix("/"))
path += "/";
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index 1d2ea18511d..ca30ee2a508 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -90,7 +90,7 @@ public:
Common::TimerManager *getTimerManager() override;
Common::SaveFileManager *getSavefileManager() override;
- virtual Common::String getDefaultIconPath();
+ virtual Common::String getDefaultIconsPath();
virtual Common::String getScreenshotsPath();
#if defined(USE_OPENGL_GAME) || defined(USE_OPENGL_SHADERS)
diff --git a/backends/platform/sdl/win32/win32.cpp b/backends/platform/sdl/win32/win32.cpp
index e5570a004b3..b1d524002ed 100644
--- a/backends/platform/sdl/win32/win32.cpp
+++ b/backends/platform/sdl/win32/win32.cpp
@@ -253,7 +253,7 @@ Common::String OSystem_Win32::getSystemLanguage() const {
return OSystem_SDL::getSystemLanguage();
}
-Common::String OSystem_Win32::getDefaultIconPath() {
+Common::String OSystem_Win32::getDefaultIconsPath() {
TCHAR iconsPath[MAX_PATH];
if (_isPortable) {
diff --git a/backends/platform/sdl/win32/win32.h b/backends/platform/sdl/win32/win32.h
index 87f8fd4baf9..d60281efa5a 100644
--- a/backends/platform/sdl/win32/win32.h
+++ b/backends/platform/sdl/win32/win32.h
@@ -48,7 +48,7 @@ public:
Common::String getSystemLanguage() const override;
- Common::String getDefaultIconPath() override;
+ Common::String getDefaultIconsPath() override;
Common::String getScreenshotsPath() override;
protected:
Commit: da2434a2a1cc79719eb10919021cea4088161398
https://github.com/scummvm/scummvm/commit/da2434a2a1cc79719eb10919021cea4088161398
Author: Thunderforge (wjherrmann at gmail.com)
Date: 2022-07-02T22:37:52+02:00
Commit Message:
COMMON: Adding comment for default path methods
Changed paths:
backends/platform/sdl/macosx/macosx.h
backends/platform/sdl/posix/posix.h
backends/platform/sdl/sdl.h
backends/platform/sdl/win32/win32.h
diff --git a/backends/platform/sdl/macosx/macosx.h b/backends/platform/sdl/macosx/macosx.h
index 6bbdd0f5564..0edd35e869a 100644
--- a/backends/platform/sdl/macosx/macosx.h
+++ b/backends/platform/sdl/macosx/macosx.h
@@ -48,6 +48,7 @@ public:
GraphicsManagerType getDefaultGraphicsManager() const override;
#endif
+ // Default paths
Common::String getDefaultIconsPath() override;
Common::String getScreenshotsPath() override;
diff --git a/backends/platform/sdl/posix/posix.h b/backends/platform/sdl/posix/posix.h
index cc3ca5777da..5623a8c84d6 100644
--- a/backends/platform/sdl/posix/posix.h
+++ b/backends/platform/sdl/posix/posix.h
@@ -35,6 +35,7 @@ public:
void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0) override;
+ // Default paths
Common::String getDefaultIconsPath() override;
Common::String getScreenshotsPath() override;
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index ca30ee2a508..8b073b4e816 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -90,6 +90,7 @@ public:
Common::TimerManager *getTimerManager() override;
Common::SaveFileManager *getSavefileManager() override;
+ // Default paths
virtual Common::String getDefaultIconsPath();
virtual Common::String getScreenshotsPath();
diff --git a/backends/platform/sdl/win32/win32.h b/backends/platform/sdl/win32/win32.h
index d60281efa5a..c39f4d7b9ea 100644
--- a/backends/platform/sdl/win32/win32.h
+++ b/backends/platform/sdl/win32/win32.h
@@ -48,6 +48,7 @@ public:
Common::String getSystemLanguage() const override;
+ // Default paths
Common::String getDefaultIconsPath() override;
Common::String getScreenshotsPath() override;
Commit: 7515b6db22be0eec41afb442a3639193acbb23a4
https://github.com/scummvm/scummvm/commit/7515b6db22be0eec41afb442a3639193acbb23a4
Author: Thunderforge (wjherrmann at gmail.com)
Date: 2022-07-02T22:37:52+02:00
Commit Message:
COMMON: Putting Icons in a subdirectory if in Win32 portable mode
Changed paths:
backends/platform/sdl/win32/win32.cpp
diff --git a/backends/platform/sdl/win32/win32.cpp b/backends/platform/sdl/win32/win32.cpp
index b1d524002ed..a03f9b4f9b5 100644
--- a/backends/platform/sdl/win32/win32.cpp
+++ b/backends/platform/sdl/win32/win32.cpp
@@ -258,6 +258,7 @@ Common::String OSystem_Win32::getDefaultIconsPath() {
if (_isPortable) {
Win32::getProcessDirectory(iconsPath, MAX_PATH);
+ _tcscat(iconsPath, TEXT("\\Icons\\"));
} else {
// Use the Application Data directory of the user profile
if (!Win32::getApplicationDataDirectory(iconsPath)) {
Commit: 6ff9cde60c38163cd64fd06eaeb796ec8758e812
https://github.com/scummvm/scummvm/commit/6ff9cde60c38163cd64fd06eaeb796ec8758e812
Author: Thunderforge (wjherrmann at gmail.com)
Date: 2022-07-02T22:37:52+02:00
Commit Message:
COMMON: Adding prefix to POSIX icon path
Co-authored-by: Le Philousophe <lephilousophe at users.noreply.github.com>
Changed paths:
backends/platform/sdl/posix/posix.cpp
diff --git a/backends/platform/sdl/posix/posix.cpp b/backends/platform/sdl/posix/posix.cpp
index 0e1cb21230e..522e0714190 100644
--- a/backends/platform/sdl/posix/posix.cpp
+++ b/backends/platform/sdl/posix/posix.cpp
@@ -257,7 +257,7 @@ Common::String OSystem_POSIX::getDefaultIconsPath() {
return Common::String();
}
- return iconsPath;
+ return Common::String::format("%s/%s", prefix, iconsPath.c_str());
}
Common::String OSystem_POSIX::getScreenshotsPath() {
Commit: 80cc43a1d20c6aa08a466bbe84f2ef6cdf91be70
https://github.com/scummvm/scummvm/commit/80cc43a1d20c6aa08a466bbe84f2ef6cdf91be70
Author: Thunderforge (wjherrmann at gmail.com)
Date: 2022-07-02T22:37:52+02:00
Commit Message:
COMMON: Restructuring how ApplicationSupport path is calculated and putting in Icons subdirectory
Changed paths:
backends/platform/sdl/macosx/macosx.cpp
backends/platform/sdl/macosx/macosx_wrapper.h
backends/platform/sdl/macosx/macosx_wrapper.mm
diff --git a/backends/platform/sdl/macosx/macosx.cpp b/backends/platform/sdl/macosx/macosx.cpp
index 3520f93e203..b422722a296 100644
--- a/backends/platform/sdl/macosx/macosx.cpp
+++ b/backends/platform/sdl/macosx/macosx.cpp
@@ -262,18 +262,13 @@ Common::String OSystem_MacOSX::getDefaultLogFileName() {
}
Common::String OSystem_MacOSX::getDefaultIconsPath() {
- const char *prefix = getenv("HOME");
- if (prefix == nullptr) {
- return Common::String();
- }
-
- const Common::String appSupportFolder = Common::String(prefix) + "/Library/Application Support/ScummVM";
+ const Common::String defaultIconsPath = getAppSupportPathMacOSX() + "/Icons";
- if (!Posix::assureDirectoryExists(appSupportFolder)) {
+ if (!Posix::assureDirectoryExists(defaultIconsPath)) {
return Common::String();
}
- return appSupportFolder;
+ return defaultIconsPath;
}
Common::String OSystem_MacOSX::getScreenshotsPath() {
diff --git a/backends/platform/sdl/macosx/macosx_wrapper.h b/backends/platform/sdl/macosx/macosx_wrapper.h
index 0af5ac09d9d..b454ff5d52c 100644
--- a/backends/platform/sdl/macosx/macosx_wrapper.h
+++ b/backends/platform/sdl/macosx/macosx_wrapper.h
@@ -30,5 +30,6 @@ Common::U32String getTextFromClipboardMacOSX();
bool setTextInClipboardMacOSX(const Common::U32String &text);
Common::String getDesktopPathMacOSX();
Common::String getResourceAppBundlePathMacOSX();
+Common::String getAppSupportPathMacOSX();
#endif
diff --git a/backends/platform/sdl/macosx/macosx_wrapper.mm b/backends/platform/sdl/macosx/macosx_wrapper.mm
index 0e4b7e903d0..68034e2a2ef 100644
--- a/backends/platform/sdl/macosx/macosx_wrapper.mm
+++ b/backends/platform/sdl/macosx/macosx_wrapper.mm
@@ -118,3 +118,14 @@ Common::String getResourceAppBundlePathMacOSX() {
return Common::String();
return Common::String([bundlePath fileSystemRepresentation]);
}
+
+Common::String getAppSupportPathMacOSX() {
+ // See comments in getDesktopPathMacOSX() as we use the same methods
+ NSArray *paths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES);
+ if ([paths count] == 0)
+ return Common::String();
+ NSString *path = [paths objectAtIndex:0];
+ if (path == nil)
+ return Common::String();
+ return Common::String([path fileSystemRepresentation]) + "/ScummVM";
+}
\ No newline at end of file
Commit: 797408bbe76213f729f59c401e38f0e6e6c7cda2
https://github.com/scummvm/scummvm/commit/797408bbe76213f729f59c401e38f0e6e6c7cda2
Author: Thunderforge (wjherrmann at gmail.com)
Date: 2022-07-02T22:37:52+02:00
Commit Message:
COMMON: Adding endline to macosx_wrapper.mm
Changed paths:
backends/platform/sdl/macosx/macosx_wrapper.mm
diff --git a/backends/platform/sdl/macosx/macosx_wrapper.mm b/backends/platform/sdl/macosx/macosx_wrapper.mm
index 68034e2a2ef..a98a6c0684b 100644
--- a/backends/platform/sdl/macosx/macosx_wrapper.mm
+++ b/backends/platform/sdl/macosx/macosx_wrapper.mm
@@ -128,4 +128,4 @@ Common::String getAppSupportPathMacOSX() {
if (path == nil)
return Common::String();
return Common::String([path fileSystemRepresentation]) + "/ScummVM";
-}
\ No newline at end of file
+}
More information about the Scummvm-git-logs
mailing list