Ticket #284: Fix icon search.patch

File Fix icon search.patch, 732 bytes (added by Nathan Rennie-Waldock, 9 years ago)
  • winswitch/util/icon_cache.py

     
    8585                        dirs.remove("cursors")
    8686                for fname in files:
    8787                        lname = fname.lower()
    88                         if lname.endswith(".icon") or lname in pixmaps:
     88
     89                        key = lname
     90                        pos = key.rfind(".")
     91                        if pos>0:
     92                                key = key[:pos]
     93
     94                        if lname.endswith(".icon") or key in pixmaps:
    8995                                continue
    9096                        filepath = os.path.join(root, fname)
    91                         pos = lname.rfind(".")
    92                         if pos>0:
    93                                 noext = lname[:pos]
    94                                 pixmaps[noext] = filepath
    95                         else:
    96                                 pixmaps[lname] = filepath
     97                        pixmaps[key] = filepath
    9798                        count += 1
    9899        return count
    99100