summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-04 21:40:17 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-04 21:40:17 +0000
commite8718df676051d62167ab8d6c6cf71901df56b60 (patch)
tree4d44fb42ce4fd71395da87424e530bcd16477bc6 /base
parentc99cdf9b9edcf96a702ca732ec7a1716061558d0 (diff)
downloadchromium_src-e8718df676051d62167ab8d6c6cf71901df56b60.zip
chromium_src-e8718df676051d62167ab8d6c6cf71901df56b60.tar.gz
chromium_src-e8718df676051d62167ab8d6c6cf71901df56b60.tar.bz2
On Linux, look in $HOME/.icons for mime icons as well for backwards compatibility.
BUG=13001 TEST=Put an icon theme in $HOME/.icons, set it as the icon theme, and make sure Chromium picks it up on the download page. (May need to restart Chromium.) Review URL: http://codereview.chromium.org/119206 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17667 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/mime_util_linux.cc25
1 files changed, 14 insertions, 11 deletions
diff --git a/base/mime_util_linux.cc b/base/mime_util_linux.cc
index 7f7643b..4e849bf 100644
--- a/base/mime_util_linux.cc
+++ b/base/mime_util_linux.cc
@@ -398,18 +398,21 @@ void EnableSvgIcon(bool enable) {
// Add all the xdg icon directories.
void InitIconDir() {
Singleton<MimeUtilConstants>::get()->icon_dirs->clear();
- std::string xdg_data_dirs;
- char* env = getenv("XDG_DATA_HOME");
- if (!env) {
- env = getenv("HOME");
- if (env) {
- FilePath local_data_dir(env);
- local_data_dir = local_data_dir.AppendASCII(".local");
- local_data_dir = local_data_dir.AppendASCII("share");
- AddXDGDataDir(local_data_dir);
- }
- } else {
+ const char* home = getenv("HOME");
+ if (home) {
+ FilePath legacy_data_dir(home);
+ legacy_data_dir = legacy_data_dir.AppendASCII(".icons");
+ if (file_util::DirectoryExists(legacy_data_dir))
+ TryAddIconDir(legacy_data_dir);
+ }
+ const char* env = getenv("XDG_DATA_HOME");
+ if (env) {
AddXDGDataDir(FilePath(env));
+ } else if (home) {
+ FilePath local_data_dir(home);
+ local_data_dir = local_data_dir.AppendASCII(".local");
+ local_data_dir = local_data_dir.AppendASCII("share");
+ AddXDGDataDir(local_data_dir);
}
env = getenv("XDG_DATA_DIRS");