mirror of
https://github.com/scummvm/scummvm.git
synced 2026-05-21 05:40:43 +00:00
COMMON: Make themepath a Path object
This commit is contained in:
committed by
Eugene Sandulenko
parent
dc7fadef28
commit
bfc61439fb
@@ -206,7 +206,7 @@ AtariGraphicsManager::AtariGraphicsManager() {
|
||||
#ifndef DISABLE_FANCY_THEMES
|
||||
// make "themes" the default theme path
|
||||
if (!ConfMan.hasKey("themepath"))
|
||||
ConfMan.set("themepath", "themes");
|
||||
ConfMan.setPath("themepath", "themes");
|
||||
#endif
|
||||
|
||||
ConfMan.flushToDisk();
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace Networking {
|
||||
Common::Archive *HandlerUtils::getZipArchive() {
|
||||
// first search in themepath
|
||||
if (ConfMan.hasKey("themepath")) {
|
||||
const Common::FSNode &node = Common::FSNode(ConfMan.get("themepath"));
|
||||
const Common::FSNode &node = Common::FSNode(ConfMan.getPath("themepath"));
|
||||
if (node.exists() && node.isReadable() && node.isDirectory()) {
|
||||
Common::FSNode fileNode = node.getChild(ARCHIVE_NAME);
|
||||
if (fileNode.exists() && fileNode.isReadable() && !fileNode.isDirectory()) {
|
||||
|
||||
@@ -109,7 +109,7 @@ void OSystem_AmigaOS::initBackend() {
|
||||
ConfMan.registerDefault("gui_theme", "scummremastered");
|
||||
ConfMan.registerDefault("gui_scale", "125");
|
||||
ConfMan.registerDefault("extrapath", "extras/");
|
||||
ConfMan.registerDefault("themepath", "themes/");
|
||||
ConfMan.registerDefault("themepath", Common::Path("themes/"));
|
||||
// First time .ini defaults
|
||||
if (!ConfMan.hasKey("audio_buffer_size")) {
|
||||
ConfMan.set("audio_buffer_size", "2048");
|
||||
@@ -139,7 +139,7 @@ void OSystem_AmigaOS::initBackend() {
|
||||
ConfMan.set("extrapath", "extras/");
|
||||
}
|
||||
if (!ConfMan.hasKey("themepath")) {
|
||||
ConfMan.set("themepath", "themes/");
|
||||
ConfMan.setPath("themepath", "themes/");
|
||||
}
|
||||
OSystem_SDL::initBackend();
|
||||
}
|
||||
|
||||
@@ -65,13 +65,13 @@ void OSystem_KolibriOS::addSysArchivesToSearchSet(Common::SearchSet &s, int prio
|
||||
}
|
||||
|
||||
void OSystem_KolibriOS::initBackend() {
|
||||
Common::String defaultThemePath = _exePath.join("themes").toString();
|
||||
Common::Path defaultThemePath = _exePath.join("themes");
|
||||
Common::String defaultEngineData = _exePath.join("engine-data").toString();
|
||||
ConfMan.registerDefault("themepath", defaultThemePath);
|
||||
ConfMan.registerDefault("extrapath", defaultEngineData);
|
||||
|
||||
if (!ConfMan.hasKey("themepath")) {
|
||||
ConfMan.set("themepath", defaultThemePath);
|
||||
ConfMan.setPath("themepath", defaultThemePath);
|
||||
}
|
||||
if (!ConfMan.hasKey("extrapath")) {
|
||||
ConfMan.set("extrapath", defaultEngineData);
|
||||
|
||||
@@ -151,7 +151,7 @@ void OSystem_SDL_Miyoo::init() {
|
||||
void OSystem_SDL_Miyoo::initBackend() {
|
||||
ConfMan.registerDefault("fullscreen", true);
|
||||
ConfMan.registerDefault("aspect_ratio", true);
|
||||
ConfMan.registerDefault("themepath", "./themes");
|
||||
ConfMan.registerDefault("themepath", Common::Path("./themes"));
|
||||
ConfMan.registerDefault("extrapath", "./engine-data");
|
||||
ConfMan.registerDefault("gui_theme", "builtin");
|
||||
ConfMan.registerDefault("scale_factor", "1");
|
||||
@@ -163,7 +163,7 @@ void OSystem_SDL_Miyoo::initBackend() {
|
||||
ConfMan.setBool("aspect_ratio", true);
|
||||
}
|
||||
if (!ConfMan.hasKey("themepath")) {
|
||||
ConfMan.set("themepath", "./themes");
|
||||
ConfMan.setPath("themepath", "./themes");
|
||||
}
|
||||
if (!ConfMan.hasKey("extrapath")) {
|
||||
ConfMan.set("extrapath", "./engine-data");
|
||||
|
||||
@@ -119,7 +119,7 @@ void OSystem_SDL_Opendingux::initBackend() {
|
||||
ConfMan.registerDefault("fullscreen", true);
|
||||
#endif
|
||||
ConfMan.registerDefault("aspect_ratio", true);
|
||||
ConfMan.registerDefault("themepath", "./themes");
|
||||
ConfMan.registerDefault("themepath", Common::Path("./themes"));
|
||||
ConfMan.registerDefault("extrapath", "./engine-data");
|
||||
ConfMan.registerDefault("gui_theme", "builtin");
|
||||
ConfMan.registerDefault("scale_factor", "1");
|
||||
@@ -131,7 +131,7 @@ void OSystem_SDL_Opendingux::initBackend() {
|
||||
ConfMan.setBool("aspect_ratio", true);
|
||||
}
|
||||
if (!ConfMan.hasKey("themepath")) {
|
||||
ConfMan.set("themepath", "./themes");
|
||||
ConfMan.setPath("themepath", "./themes");
|
||||
}
|
||||
if (!ConfMan.hasKey("extrapath")) {
|
||||
ConfMan.set("extrapath", "./engine-data");
|
||||
|
||||
@@ -222,7 +222,7 @@ String TranslationManager::getLangById(int id) const {
|
||||
|
||||
bool TranslationManager::openTranslationsFile(File &inFile) {
|
||||
// First look in the Themepath if we can find the file.
|
||||
if (ConfMan.hasKey("themepath") && openTranslationsFile(FSNode(ConfMan.get("themepath")), inFile))
|
||||
if (ConfMan.hasKey("themepath") && openTranslationsFile(FSNode(ConfMan.getPath("themepath")), inFile))
|
||||
return true;
|
||||
|
||||
// Then try to open it using the SearchMan.
|
||||
|
||||
+1
-1
@@ -60,7 +60,7 @@ bool generateZipSet(SearchSet &searchSet, const char *defaultFile, const char *p
|
||||
dat = nullptr;
|
||||
|
||||
if (ConfMan.hasKey("themepath")) {
|
||||
FSNode *fs = new FSNode(normalizePath(ConfMan.get("themepath") + "/" + defaultFile, '/'));
|
||||
FSNode *fs = new FSNode(ConfMan.getPath("themepath").join(defaultFile).normalize());
|
||||
if (fs->exists()) {
|
||||
dat = makeZipArchive(*fs);
|
||||
}
|
||||
|
||||
+1
-1
@@ -1941,7 +1941,7 @@ void ThemeEngine::listUsableThemes(Common::List<ThemeDescriptor> &list) {
|
||||
#endif
|
||||
|
||||
if (ConfMan.hasKey("themepath"))
|
||||
listUsableThemes(Common::FSNode(ConfMan.get("themepath")), list);
|
||||
listUsableThemes(Common::FSNode(ConfMan.getPath("themepath")), list);
|
||||
|
||||
listUsableThemes(SearchMan, list);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user