This is an automated email from the git hooks/post-receive script.

gottcode pushed a commit to branch master
in repository panel-plugins/xfce4-whiskermenu-plugin.

commit 5190bf581ff71858d5c3dd3d4396fbb529d48f0a
Author: Graeme Gott <[email protected]>
Date:   Fri Feb 20 08:13:24 2015 -0500

    Search generic name as well.
---
 panel-plugin/launcher.cpp |   12 ++++++++++--
 panel-plugin/launcher.h   |    1 +
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/panel-plugin/launcher.cpp b/panel-plugin/launcher.cpp
index 581bfc2..be92835 100644
--- a/panel-plugin/launcher.cpp
+++ b/panel-plugin/launcher.cpp
@@ -171,6 +171,7 @@ Launcher::Launcher(GarconMenuItem* item) :
 
        // Create search text for display name
        m_search_name = normalize(m_display_name);
+       m_search_generic_name = normalize((m_display_name == name) ? 
generic_name : name);
 
        // Create search text for command
        const gchar* command = garcon_menu_item_get_command(m_item);
@@ -279,11 +280,18 @@ int Launcher::search(const Query& query)
                return match;
        }
 
+       match = query.match(m_search_generic_name);
+       if (match != G_MAXINT)
+       {
+               match += 10;
+               return match;
+       }
+
        // Sort matches in executables after matches in names
        match = query.match(m_search_command);
        if (match != G_MAXINT)
        {
-               match += 10;
+               match += 20;
                return match;
        }
 
@@ -291,7 +299,7 @@ int Launcher::search(const Query& query)
        match = query.match(m_search_comment);
        if (match != G_MAXINT)
        {
-               match += 20;
+               match += 30;
        }
        return match;
 }
diff --git a/panel-plugin/launcher.h b/panel-plugin/launcher.h
index 2c99b31..e3fd43a 100644
--- a/panel-plugin/launcher.h
+++ b/panel-plugin/launcher.h
@@ -70,6 +70,7 @@ private:
        GarconMenuItem* m_item;
        const gchar* m_display_name;
        std::string m_search_name;
+       std::string m_search_generic_name;
        std::string m_search_comment;
        std::string m_search_command;
 };

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
Xfce4-commits mailing list
[email protected]
https://mail.xfce.org/mailman/listinfo/xfce4-commits

Reply via email to