[gnome-commander] noop: simplifying ngettext()



commit 04000dc8ff8a4a2a78afafb6c21d4eed33504144
Author: Piotr Eljasiak <epiotr src gnome org>
Date:   Sat Apr 2 23:19:28 2011 +0200

    noop: simplifying ngettext()

 src/gnome-cmd-search-dialog.cc |   18 ++++--------------
 1 files changed, 4 insertions(+), 14 deletions(-)
---
diff --git a/src/gnome-cmd-search-dialog.cc b/src/gnome-cmd-search-dialog.cc
index 03d5eb4..3c60dc9 100755
--- a/src/gnome-cmd-search-dialog.cc
+++ b/src/gnome-cmd-search-dialog.cc
@@ -401,20 +401,10 @@ static gboolean update_search_status_widgets (SearchData *data)
     {
         if (!data->dialog_destroyed)
         {
-            gchar *msg;
-            if (data->stopped)
-                msg = g_strdup_printf (
-                        ngettext("Found %d match - search aborted",
-                                 "Found %d matches - search aborted",
-                                  data->matches),
-                        data->matches);
-            else
-                msg = g_strdup_printf (
-                        ngettext(
-                            "Found %d match",
-                            "Found %d matches",
-                            data->matches),
-                        data->matches);
+            gchar *fmt = data->stopped ? ngettext("Found %d match - search aborted", "Found %d matches - search aborted", data->matches) :
+                                         ngettext("Found %d match", "Found %d matches", data->matches);
+
+            gchar *msg = g_strdup_printf (fmt, data->matches);
 
             set_statusmsg (data, msg);
             g_free (msg);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]