diff --git a/backends/taskbar/macosx/macosx-taskbar.mm b/backends/taskbar/macosx/macosx-taskbar.mm index 4255931352e..91f09d17077 100644 --- a/backends/taskbar/macosx/macosx-taskbar.mm +++ b/backends/taskbar/macosx/macosx-taskbar.mm @@ -125,13 +125,13 @@ void MacOSXTaskbarManager::setOverlayIcon(const Common::String &name, const Comm return; } - Common::String path = getIconPath(name, ".png"); + Common::Path path = getIconPath(name, ".png"); if (path.empty()) return; initOverlayIconView(); - CFStringRef imageFile = CFStringCreateWithCString(0, path.c_str(), kCFStringEncodingASCII); + CFStringRef imageFile = CFStringCreateWithCString(0, path.toString(Common::Path::kNativeSeparator).c_str(), kCFStringEncodingASCII); NSImage *image = [[NSImage alloc] initWithContentsOfFile:(NSString *)imageFile]; [_overlayIconView setImage:image]; [image release]; @@ -232,9 +232,9 @@ void MacOSXTaskbarManager::addRecent(const Common::String &name, const Common::S [dict setObject:(NSString *)desc forKey:@"description"]; // Icon - Common::String iconPath = getIconPath(name, ".png"); + Common::Path iconPath = getIconPath(name, ".png"); if (!iconPath.empty()) { - CFStringRef icon = CFStringCreateWithCString(0, iconPath.c_str(), kCFStringEncodingASCII); + CFStringRef icon = CFStringCreateWithCString(0, iconPath.toString(Common::Path::kNativeSeparator).c_str(), kCFStringEncodingASCII); [dict setObject:(NSString *)icon forKey:@"icon"]; CFRelease(icon); } diff --git a/backends/taskbar/win32/win32-taskbar.cpp b/backends/taskbar/win32/win32-taskbar.cpp index 1d147343179..50c3b94d1f3 100644 --- a/backends/taskbar/win32/win32-taskbar.cpp +++ b/backends/taskbar/win32/win32-taskbar.cpp @@ -121,11 +121,11 @@ void Win32TaskbarManager::setOverlayIcon(const Common::String &name, const Commo } // Compute full icon path - Common::String iconPath = getIconPath(name, ".ico"); + Common::Path iconPath = getIconPath(name, ".ico"); if (iconPath.empty()) return; - TCHAR *tIconPath = Win32::stringToTchar(iconPath); + TCHAR *tIconPath = Win32::stringToTchar(iconPath.toString(Common::Path::kNativeSeparator)); HICON pIcon = (HICON)::LoadImage(nullptr, tIconPath, IMAGE_ICON, 16, 16, LR_LOADFROMFILE); free(tIconPath); if (!pIcon) { @@ -298,11 +298,11 @@ void Win32TaskbarManager::addRecent(const Common::String &name, const Common::St link->SetPath(path); link->SetArguments(game); - Common::String iconPath = getIconPath(name, ".ico"); + Common::Path iconPath = getIconPath(name, ".ico"); if (iconPath.empty()) { link->SetIconLocation(path, 0); // No game-specific icon available } else { - LPWSTR icon = Win32::ansiToUnicode(iconPath.c_str()); + LPWSTR icon = Win32::ansiToUnicode(iconPath.toString(Common::Path::kNativeSeparator).c_str()); link->SetIconLocation(icon, 0); diff --git a/common/taskbar.h b/common/taskbar.h index 00c569460a8..3483ad96183 100644 --- a/common/taskbar.h +++ b/common/taskbar.h @@ -154,7 +154,7 @@ protected: * @param extension The icon extension * @return The icon path (or "" if no icon was found) */ - Common::String getIconPath(const Common::String &target, const Common::String &extension) { + Common::Path getIconPath(const Common::String &target, const Common::String &extension) { // We first try to look for a iconspath configuration variable then // fallback to the extra path // @@ -196,7 +196,7 @@ return (path); \ } #undef TRY_ICON_PATH - return ""; + return Common::Path(); } };