Skip to content

Commit

Permalink
Handle backgrounds defined in ~/.cinnamon/backgrounds.xml
Browse files Browse the repository at this point in the history
  • Loading branch information
glebihan committed Sep 1, 2012
1 parent 66d347e commit 287a728
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion files/usr/lib/cinnamon-settings/cinnamon-settings.py
Expand Up @@ -293,7 +293,7 @@ def parse_xml_backgrounds_list(self, filename):
if rootNode.tag == "wallpapers":
for wallpaperNode in rootNode:
if wallpaperNode.tag == "wallpaper" and wallpaperNode.get("deleted") != "true":
wallpaperData = {}
wallpaperData = {"metadataFile": filename}
for prop in wallpaperNode:
if type(prop.tag) == str:
wallpaperData[prop.tag] = prop.text
Expand All @@ -308,6 +308,8 @@ def update_icon_view(self):
for i in os.listdir("/usr/share/gnome-background-properties"):
if i.endswith(".xml"):
pictures_list += self.parse_xml_backgrounds_list(os.path.join("/usr/share/gnome-background-properties", i))
if os.path.exists(os.path.join(os.getenv("HOME"), ".cinnamon", "backgrounds.xml")):
pictures_list += self.parse_xml_backgrounds_list(os.path.join(os.getenv("HOME"), ".cinnamon", "backgrounds.xml"))
self.icon_view.set_pictures_list(pictures_list)

class BackgroundSidePage (SidePage):
Expand Down

0 comments on commit 287a728

Please sign in to comment.