File mintmenu_remove-apt-cache.patch of Package mintmenu

diff -upr mintmenu-orig/usr/lib/linuxmint/mintMenu/mintMenuConfig.glade mintmenu/usr/lib/linuxmint/mintMenu/mintMenuConfig.glade
--- mintmenu-orig/usr/lib/linuxmint/mintMenu/mintMenuConfig.glade	2014-11-27 13:21:50.000000000 +0100
+++ mintmenu/usr/lib/linuxmint/mintMenu/mintMenuConfig.glade	2015-03-31 12:01:34.505031236 +0200
@@ -1128,25 +1128,6 @@
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkCheckButton" id="use_apt">
-                        <property name="label" translatable="yes">Search for packages to install</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                        <property name="use_action_appearance">False</property>
-                        <property name="draw_indicator">True</property>
-                      </object>
-                      <packing>
-                        <property name="right_attach">2</property>
-                        <property name="top_attach">6</property>
-                        <property name="bottom_attach">7</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options"/>
-                        <property name="x_padding">5</property>
-                      </packing>
-                    </child>
-                    <child>
                       <object class="GtkCheckButton" id="remember_filter">
                         <property name="label" translatable="yes">Remember the last category or search</property>
                         <property name="visible">True</property>
diff -upr mintmenu-orig/usr/lib/linuxmint/mintMenu/mintMenuConfig.py mintmenu/usr/lib/linuxmint/mintMenu/mintMenuConfig.py
--- mintmenu-orig/usr/lib/linuxmint/mintMenu/mintMenuConfig.py	2014-11-27 13:21:50.000000000 +0100
+++ mintmenu/usr/lib/linuxmint/mintMenu/mintMenuConfig.py	2015-03-31 12:04:08.485460732 +0200
@@ -54,7 +54,6 @@ class mintMenuConfig( object ):
         self.builder.get_object("showCategoryIcons").set_label(_("Show category icons"))
         self.builder.get_object("hover").set_label(_("Hover"))
         self.builder.get_object("remember_filter").set_label(_("Remember the last category or search"))
-        self.builder.get_object("use_apt").set_label(_("Search for packages to install"))
         self.builder.get_object("swapGeneric").set_label(_("Swap name and generic name"))
 
         self.builder.get_object("label11").set_text(_("Border width:"))
@@ -118,7 +117,6 @@ class mintMenuConfig( object ):
 
         self.startWithFavorites = self.builder.get_object( "startWithFavorites" )
         self.showAppComments = self.builder.get_object( "showAppComments" )
-        self.useAPT = self.builder.get_object( "use_apt" )
         self.showCategoryIcons = self.builder.get_object( "showCategoryIcons" )
         self.showRecentPlugin = self.builder.get_object( "showRecentPlugin" )
         self.showApplicationsPlugin = self.builder.get_object( "showApplicationsPlugin" )
@@ -202,7 +200,6 @@ class mintMenuConfig( object ):
 
         self.bindGSettingsValueToWidget( self.settings, "bool", "start-with-favorites", self.startWithFavorites, "toggled", self.startWithFavorites.set_active, self.startWithFavorites.get_active )
         self.bindGSettingsValueToWidget( self.settingsApplications, "bool", "show-application-comments", self.showAppComments, "toggled", self.showAppComments.set_active, self.showAppComments.get_active )
-        self.bindGSettingsValueToWidget( self.settingsApplications, "bool", "use-apt", self.useAPT, "toggled", self.useAPT.set_active, self.useAPT.get_active )
         self.bindGSettingsValueToWidget( self.settingsApplications, "bool", "show-category-icons", self.showCategoryIcons, "toggled", self.showCategoryIcons.set_active, self.showCategoryIcons.get_active )
         self.bindGSettingsValueToWidget( self.settingsApplications, "bool", "categories-mouse-over", self.hover, "toggled", self.hover.set_active, self.hover.get_active )
         self.bindGSettingsValueToWidget( self.settingsApplications, "bool", "swap-generic-name", self.swapGeneric, "toggled", self.swapGeneric.set_active, self.swapGeneric.get_active )
diff -upr mintmenu-orig/usr/lib/linuxmint/mintMenu/plugins/applications.py mintmenu/usr/lib/linuxmint/mintMenu/plugins/applications.py
--- mintmenu-orig/usr/lib/linuxmint/mintMenu/plugins/applications.py	2015-02-24 14:19:23.000000000 +0100
+++ mintmenu/usr/lib/linuxmint/mintMenu/plugins/applications.py	2015-03-31 12:16:10.779169622 +0200
@@ -292,7 +292,7 @@ class pluginclass( object ):
             self.settings.notifyAdd( "swap-generic-name", self.changeSwapGenericName )
             self.settings.notifyAdd( "show-category-icons", self.changeShowCategoryIcons )
             self.settings.notifyAdd( "show-application-comments", self.changeShowApplicationComments )
-            self.settings.notifyAdd( "use-apt", self.switchAPTUsage)
+#            self.settings.notifyAdd( "use-apt", self.switchAPTUsage)
             self.settings.notifyAdd( "fav-cols", self.changeFavCols )
             self.settings.notifyAdd( "remember-filter", self.changeRememberFilter)
 
@@ -332,7 +332,7 @@ class pluginclass( object ):
             #for f in mymenu.directory.AppDirs:
             #       self.menuFileMonitors.append( filemonitor.addMonitor(f, self.onMenuChanged, mymenu.directory.Filename ) )
                         
-        self.refresh_apt_cache()        
+#        self.refresh_apt_cache()        
         self.suggestions = []
         self.current_suggestion = None
         self.panel = "top"
@@ -340,10 +340,10 @@ class pluginclass( object ):
 
         self.builder.get_object("searchButton").connect( "button-press-event", self.searchPopup )
 
-    def refresh_apt_cache(self):
-        if self.useAPT:
-            os.system("mkdir -p %s/.linuxmint/mintMenu/" % home)
-            os.system("/usr/lib/linuxmint/mintMenu/plugins/get_apt_cache.py > %s/.linuxmint/mintMenu/apt.cache &" % home)            
+#    def refresh_apt_cache(self):
+#        if self.useAPT:
+#            os.system("mkdir -p %s/.linuxmint/mintMenu/" % home)
+#            os.system("/usr/lib/linuxmint/mintMenu/plugins/get_apt_cache.py > %s/.linuxmint/mintMenu/apt.cache &" % home)            
 
     def get_panel(self):
         panelsettings = Gio.Settings.new("org.mate.panel")
@@ -357,12 +357,12 @@ class pluginclass( object ):
                     self.panel = object_schema.get_string("toplevel-id")
                     self.panel_position = object_schema.get_int("position") + 1
 
-    def apturl_install(self, widget, pkg_name):
-		if os.path.exists("/usr/bin/apturl"):
-			os.system("/usr/bin/apturl apt://%s &" % pkg_name)
-		else:
-			os.system("xdg-open apt://" + pkg_name + " &")    
-		self.mintMenuWin.hide()
+#    def apturl_install(self, widget, pkg_name):
+#		if os.path.exists("/usr/bin/apturl"):
+#			os.system("/usr/bin/apturl apt://%s &" % pkg_name)
+#		else:
+#			os.system("xdg-open apt://" + pkg_name + " &")    
+#		self.mintMenuWin.hide()
     
     def __del__( self ):
         print u"Applications plugin deleted"
@@ -437,9 +437,9 @@ class pluginclass( object ):
             if isinstance( child, FavApplicationLauncher):
                 child.setIconSize( self.faviconsize )
                 
-    def switchAPTUsage( self, settings, key, args ):
-        self.useAPT = settings.get_boolean(key)
-        self.refresh_apt_cache()
+#    def switchAPTUsage( self, settings, key, args ):
+#        self.useAPT = settings.get_boolean(key)
+#        self.refresh_apt_cache()
 
     def changeRememberFilter( self, settings, key, args):
         self.rememberFilter = settings.get_boolean(key)
@@ -468,7 +468,7 @@ class pluginclass( object ):
             self.favoritesPositionOnGrid( fav )
 
     def RegenPlugin( self, *args, **kargs ):            
-        self.refresh_apt_cache()
+#        self.refresh_apt_cache()
         
         # save old config - this is necessary because the app will notified when it sets the default values and you don't want the to reload itself several times
         oldcategories_mouse_over = self.categories_mouse_over
@@ -506,7 +506,7 @@ class pluginclass( object ):
         self.showcategoryicons = self.settings.get( "bool", "show-category-icons")
         self.categoryhoverdelay = self.settings.get( "int", "category-hover-delay")
         self.showapplicationcomments = self.settings.get( "bool", "show-application-comments")
-        self.useAPT = self.settings.get( "bool", "use-apt")
+#        self.useAPT = self.settings.get( "bool", "use-apt")
         self.rememberFilter = self.settings.get( "bool", "remember-filter")
 
         self.lastActiveTab =  self.settings.get( "int", "last-active-tab")
@@ -678,76 +678,76 @@ class pluginclass( object ):
         #self.applicationsBox.add(self.last_separator)
         #self.suggestions.append(self.last_separator)            
 
-    def add_apt_filter_results(self, keyword):
-        try:   
-            # Wait to see if the keyword has changed.. before doing anything
-            current_keyword = keyword
-            current_keyword = self.searchEntry.get_text()
-            if keyword != current_keyword:
-                return            
-            found_packages = []
-            found_in_name = []
-            found_elsewhere = []
-            keywords = keyword.split(" ")
-            command = "cat %(home)s/.linuxmint/mintMenu/apt.cache" % {'home':home}
-            for word in keywords:
-                command = "%(command)s | grep %(word)s" % {'command':command, 'word':word}            
-            pkgs = commands.getoutput(command)
-            pkgs = pkgs.split("\n")
-            num_pkg_found = 0
-            for pkg in pkgs:
-                values = string.split(pkg, "###")
-                if len(values) == 4:
-                    status = values[0]
-                    if (status == "ERROR"):
-                        print "Could not refresh APT cache"
-                    elif (status == "CACHE"):
-                        name = values[1]
-                        summary = values[2]
-                        description = values[3].replace("~~~", "\n")
-                        package = PackageDescriptor(name, summary, description)
-                        #See if all keywords are in the name (so we put these results at the top of the list)
-                        some_found = False
-                        some_not_found = False
-                        for word in keywords:
-                            if word in package.name:
-                                some_found = True
-                            else:
-                                some_not_found = True
-                        if some_found and not some_not_found:
-                            found_in_name.append(package)
-                        else:                        
-                            found_elsewhere.append(package)                                        
-                        num_pkg_found+=1
-                    else:
-                        print "Invalid status code: " + status
+#    def add_apt_filter_results(self, keyword):
+#        try:   
+#            # Wait to see if the keyword has changed.. before doing anything
+#            current_keyword = keyword
+#            current_keyword = self.searchEntry.get_text()
+#            if keyword != current_keyword:
+#                return            
+#            found_packages = []
+#            found_in_name = []
+#            found_elsewhere = []
+#            keywords = keyword.split(" ")
+#            command = "cat %(home)s/.linuxmint/mintMenu/apt.cache" % {'home':home}
+#            for word in keywords:
+#                command = "%(command)s | grep %(word)s" % {'command':command, 'word':word}            
+#            pkgs = commands.getoutput(command)
+#            pkgs = pkgs.split("\n")
+#            num_pkg_found = 0
+#            for pkg in pkgs:
+#                values = string.split(pkg, "###")
+#                if len(values) == 4:
+#                    status = values[0]
+#                    if (status == "ERROR"):
+#                        print "Could not refresh APT cache"
+#                    elif (status == "CACHE"):
+#                        name = values[1]
+#                        summary = values[2]
+#                        description = values[3].replace("~~~", "\n")
+#                        package = PackageDescriptor(name, summary, description)
+#                        #See if all keywords are in the name (so we put these results at the top of the list)
+#                        some_found = False
+#                        some_not_found = False
+#                        for word in keywords:
+#                            if word in package.name:
+#                                some_found = True
+#                            else:
+#                                some_not_found = True
+#                        if some_found and not some_not_found:
+#                            found_in_name.append(package)
+#                        else:                        
+#                            found_elsewhere.append(package)                                        
+#                        num_pkg_found+=1
+#                    else:
+#                        print "Invalid status code: " + status
                 
-            found_packages.extend(found_in_name)
-            found_packages.extend(found_elsewhere)
-            if keyword == self.searchEntry.get_text() and len(found_packages) > 0:         
-                last_separator = Gtk.EventBox()
-                last_separator.add(Gtk.HSeparator())
-                last_separator.set_visible_window(False)
-                last_separator.set_size_request(-1, 20)       
-                last_separator.type = "separator"       
-                last_separator.show_all()
-                self.applicationsBox.add(last_separator)
-                self.suggestions.append(last_separator)
-                #Reduce the number of results to 10 max... it takes a HUGE amount of time to add the GTK box in the menu otherwise..
-                if len(found_packages) > 10:
-                    found_packages = found_packages[:10]
-                for pkg in found_packages:                        
-                    name = pkg.name
-                    for word in keywords: 
-                        if word != "":             
-                            name = name.replace(word, "<b>%s</b>" % word);
-                    suggestionButton = SuggestionButton(Gtk.STOCK_ADD, self.iconSize, "")
-                    suggestionButton.connect("clicked", self.apturl_install, pkg.name)
-                    suggestionButton.set_text(_("Install package '%s'") % name)
-                    suggestionButton.set_tooltip_text("%s\n\n%s\n\n%s" % (pkg.name, pkg.summary, pkg.description))
-                    suggestionButton.set_icon_size(self.iconSize)
-                    self.applicationsBox.add(suggestionButton)
-                    self.suggestions.append(suggestionButton)
+#            found_packages.extend(found_in_name)
+#            found_packages.extend(found_elsewhere)
+#            if keyword == self.searchEntry.get_text() and len(found_packages) > 0:         
+#                last_separator = Gtk.EventBox()
+#                last_separator.add(Gtk.HSeparator())
+#                last_separator.set_visible_window(False)
+#                last_separator.set_size_request(-1, 20)       
+#                last_separator.type = "separator"       
+#                last_separator.show_all()
+#                self.applicationsBox.add(last_separator)
+#                self.suggestions.append(last_separator)
+#                #Reduce the number of results to 10 max... it takes a HUGE amount of time to add the GTK box in the menu otherwise..
+#                if len(found_packages) > 10:
+#                    found_packages = found_packages[:10]
+#                for pkg in found_packages:                        
+#                    name = pkg.name
+#                    for word in keywords: 
+#                        if word != "":             
+#                            name = name.replace(word, "<b>%s</b>" % word);
+#                    suggestionButton = SuggestionButton(Gtk.STOCK_ADD, self.iconSize, "")
+#                    suggestionButton.connect("clicked", self.apturl_install, pkg.name)
+#                    suggestionButton.set_text(_("Install package '%s'") % name)
+#                    suggestionButton.set_tooltip_text("%s\n\n%s\n\n%s" % (pkg.name, pkg.summary, pkg.description))
+#                    suggestionButton.set_icon_size(self.iconSize)
+#                    self.applicationsBox.add(suggestionButton)
+#                    self.suggestions.append(suggestionButton)
                     #if cache != self.current_results:
                     #    self.current_results.append(pkg)
 
@@ -759,55 +759,55 @@ class pluginclass( object ):
             #    finally:
             #        gtk.gdk.threads_leave()           
                 
-        except Exception, detail:
-            print detail           
+#        except Exception, detail:
+#            print detail           
 
             
-    def add_apt_filter_results_sync(self, cache, keyword):
-        try:           
-            found_packages = []           
-            keywords = keyword.split(" ")
-            if cache is not None:
-                for pkg in cache:                      
-                    some_found = False
-                    some_not_found = False
-                    for word in keywords:
-                        if word in pkg.name:
-                            some_found = True
-                        else:
-                            some_not_found = True
-                    if some_found and not some_not_found:
-                        found_packages.append(pkg)                     
+#    def add_apt_filter_results_sync(self, cache, keyword):
+#        try:           
+#            found_packages = []           
+#            keywords = keyword.split(" ")
+#            if cache is not None:
+#                for pkg in cache:                      
+#                    some_found = False
+#                    some_not_found = False
+#                    for word in keywords:
+#                        if word in pkg.name:
+#                            some_found = True
+#                        else:
+#                            some_not_found = True
+#                    if some_found and not some_not_found:
+#                        found_packages.append(pkg)                     
                                                            
-            if len(found_packages) > 0:         
-                last_separator = Gtk.EventBox()
-                last_separator.add(Gtk.HSeparator())
-                last_separator.set_visible_window(False)
-                last_separator.set_size_request(-1, 20)
-                last_separator.type = "separator"
-                last_separator.show_all()
-                self.applicationsBox.add(last_separator)
-                self.suggestions.append(last_separator)
+#            if len(found_packages) > 0:         
+#                last_separator = Gtk.EventBox()
+#                last_separator.add(Gtk.HSeparator())
+#                last_separator.set_visible_window(False)
+#                last_separator.set_size_request(-1, 20)
+#                last_separator.type = "separator"
+#                last_separator.show_all()
+#                self.applicationsBox.add(last_separator)
+#                self.suggestions.append(last_separator)
             
-            for pkg in found_packages:
-                name = pkg.name
-                for word in keywords:
-                    if word != "":                    
-                        name = name.replace(word, "<b>%s</b>" % word);
-                suggestionButton = SuggestionButton(Gtk.STOCK_ADD, self.iconSize, "")
-                suggestionButton.connect("clicked", self.apturl_install, pkg.name)
-                suggestionButton.set_text(_("Install package '%s'") % name)
-                suggestionButton.set_tooltip_text("%s\n\n%s\n\n%s" % (pkg.name, pkg.summary.capitalize(), pkg.description))
-                suggestionButton.set_icon_size(self.iconSize)
-                self.applicationsBox.add(suggestionButton)
-                self.suggestions.append(suggestionButton)
+#            for pkg in found_packages:
+#                name = pkg.name
+#                for word in keywords:
+#                    if word != "":                    
+#                        name = name.replace(word, "<b>%s</b>" % word);
+#                suggestionButton = SuggestionButton(Gtk.STOCK_ADD, self.iconSize, "")
+#                suggestionButton.connect("clicked", self.apturl_install, pkg.name)
+#                suggestionButton.set_text(_("Install package '%s'") % name)
+#                suggestionButton.set_tooltip_text("%s\n\n%s\n\n%s" % (pkg.name, pkg.summary.capitalize(), pkg.description))
+#                suggestionButton.set_icon_size(self.iconSize)
+#                self.applicationsBox.add(suggestionButton)
+#                self.suggestions.append(suggestionButton)
                         
             #if len(found_packages) == 0:
             #    self.applicationsBox.remove(self.last_separator)
             #    self.suggestions.remove(self.last_separator)
                 
-        except Exception, detail:
-            print detail
+#        except Exception, detail:
+#            print detail
             
     def Filter( self, widget, category = None ):
         self.filterTimer = None
@@ -846,11 +846,11 @@ class pluginclass( object ):
                             #if (len(self.current_results) > 0):
                                 #self.add_apt_filter_results_sync(self.current_results, text)
                             #else:
-                            GLib.timeout_add (300, self.add_apt_filter_results, text)
+#                            GLib.timeout_add (300, self.add_apt_filter_results, text)
                         else:
                             self.current_results = []  
                             self.add_search_suggestions(text)
-                            GLib.timeout_add (300, self.add_apt_filter_results, text)
+#                            GLib.timeout_add (300, self.add_apt_filter_results, text)
 
                         self.current_suggestion = text
                     else:
diff -upr mintmenu-orig/usr/share/glib-2.0/schemas/com.linuxmint.mintmenu.gschema.xml mintmenu/usr/share/glib-2.0/schemas/com.linuxmint.mintmenu.gschema.xml
--- mintmenu-orig/usr/share/glib-2.0/schemas/com.linuxmint.mintmenu.gschema.xml	2014-03-18 12:50:00.000000000 +0100
+++ mintmenu/usr/share/glib-2.0/schemas/com.linuxmint.mintmenu.gschema.xml	2015-03-31 12:17:23.547845748 +0200
@@ -266,12 +266,6 @@
       <description></description>
     </key>
 
-    <key type="b" name="use-apt">
-      <default>true</default>
-      <summary></summary>
-      <description></description>
-    </key>
-
     <key type="i" name="last-active-tab">
       <default>0</default>
       <summary></summary>
openSUSE Build Service is sponsored by