Changeset 1558

Show
Ignore:
Timestamp:
11/14/08 16:47:29 (2 months ago)
Author:
astormont
Message:

Wine-doors now removes desktop entries for applications when they are uninstalled

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • wine-doors/trunk/src/application.py

    r1540 r1558  
    477477                                   self.app_pack['category'] ) 
    478478 
     479    def UninstallDesktopEntry( self ): 
     480        log.Log( "Uninstalling desktop entry for: %s" % self.app_pack['shortname'] ) 
     481        desktop_path = os.path.expanduser( "~/.local/share/applications/" ) 
     482        desktop_file = desktop_path + self.app_pack['desktop'].split("/")[-1] 
     483        if os.path.isfile( desktop_file ): 
     484            os.remove( desktop_file ) 
     485 
    479486    def InstallFile( self, resource_type, resource_file, run=None, icon=None, category=None ): 
    480487        desktop_path = os.path.expanduser( "~/.local/share/applications/" ) 
     
    580587        else: 
    581588            majorversion = self.app_pack['major_version'] 
    582              
     589         
     590        # Remove desktop entry, if there is one. 
     591        if self.app_pack['desktop']: 
     592            self.UninstallDesktopEntry() 
     593 
    583594        packlist.DelInstalled(self.app_pack['shortname'], majorversion) 
    584595