[Xfce4-commits] [panel-plugins/xfce4-clipman-plugin] 09/37: Show warning when clipboard is empty

noreply at xfce.org noreply at xfce.org
Mon Mar 23 23:30:04 CET 2020


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

o   c   h   o   s   i       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository panel-plugins/xfce4-clipman-plugin.

commit e6a86d4f02ff79c6ec2c8fdfc3a34c51ff4cabae
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Mon Mar 16 21:23:45 2020 +0100

    Show warning when clipboard is empty
---
 panel-plugin/xfce4-clipman-history.c | 62 +++++++++++++++++++++---------------
 1 file changed, 36 insertions(+), 26 deletions(-)

diff --git a/panel-plugin/xfce4-clipman-history.c b/panel-plugin/xfce4-clipman-history.c
index d94eec2..e1a7bed 100644
--- a/panel-plugin/xfce4-clipman-history.c
+++ b/panel-plugin/xfce4-clipman-history.c
@@ -197,38 +197,48 @@ clipman_history_treeview_init (MyPlugin *plugin)
   plugin->history = clipman_history_get ();
   list = clipman_history_get_list (plugin->history);
   //list = g_slist_reverse (list);
-
-  for (l = list, i = 0; l != NULL; l = l->next, i++)
+  if (list == NULL)
     {
-      item = l->data;
-
-      switch (item->type)
+      gtk_list_store_insert_with_values (liststore, &iter, 0,
+                                         COLUMN_PREVIEW, _("Clipboard is empty"),
+                                         COLUMN_TEXT, "",
+                                         -1);
+    }
+  else
+    {
+      for (l = list, i = 0; l != NULL; l = l->next, i++)
         {
-        case CLIPMAN_HISTORY_TYPE_TEXT:
-          gtk_list_store_insert_with_values (liststore, &iter, i,
-                                             COLUMN_PREVIEW, item->preview.text,
-                                             COLUMN_TEXT, item->content.text,
-                                             -1);
-          break;
-
-        case CLIPMAN_HISTORY_TYPE_IMAGE:
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-//          mi = gtk_image_menu_item_new ();
-//          image = gtk_image_new_from_pixbuf (item->preview.image);
-//          gtk_container_add (GTK_CONTAINER (mi), image);
-G_GNUC_END_IGNORE_DEPRECATIONS
-          break;
-
-        default:
-          DBG("Ignoring unknown history type %d", item->type);
-          continue;
+          item = l->data;
+
+          switch (item->type)
+            {
+            case CLIPMAN_HISTORY_TYPE_TEXT:
+              gtk_list_store_insert_with_values (liststore, &iter, i,
+                                                 COLUMN_PREVIEW, item->preview.text,
+                                                 COLUMN_TEXT, item->content.text,
+                                                 -1);
+              break;
+
+            case CLIPMAN_HISTORY_TYPE_IMAGE:
+    G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+    //          mi = gtk_image_menu_item_new ();
+    //          image = gtk_image_new_from_pixbuf (item->preview.image);
+    //          gtk_container_add (GTK_CONTAINER (mi), image);
+    G_GNUC_END_IGNORE_DEPRECATIONS
+              break;
+
+            default:
+              DBG("Ignoring unknown history type %d", item->type);
+              continue;
+            }
+
+    //      g_signal_connect (mi, "activate", G_CALLBACK (cb_set_clipboard), item);
+    //      g_object_set_data (G_OBJECT (mi), "paste-on-activate", GUINT_TO_POINTER (menu->priv->paste_on_activate));
         }
 
-//      g_signal_connect (mi, "activate", G_CALLBACK (cb_set_clipboard), item);
-//      g_object_set_data (G_OBJECT (mi), "paste-on-activate", GUINT_TO_POINTER (menu->priv->paste_on_activate));
+      g_slist_free (list);
     }
 
-  g_slist_free (list);
 
   return box;
 }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list