[Libreoffice-commits] .: Branch 'feature/tubes2' - 3 commits - tubes/inc tubes/qa tubes/source

Eike Rathke erack at kemper.freedesktop.org
Mon Mar 26 14:55:42 PDT 2012


 tubes/inc/tubes/manager.hxx         |    3 ---
 tubes/qa/test_manager.cxx           |    8 --------
 tubes/source/approver.c             |   28 ++++++++++++++++++----------
 tubes/source/file-transfer-helper.c |    8 ++++++++
 tubes/source/manager.cxx            |   12 ------------
 5 files changed, 26 insertions(+), 33 deletions(-)

New commits:
commit 60fdff033ba2f38063c2a14f01a22c89e7d166b5
Author: Eike Rathke <erack at redhat.com>
Date:   Mon Mar 26 23:54:58 2012 +0200

    cleanout flushLoop
    
    relict from testing era, not needed anymore

diff --git a/tubes/inc/tubes/manager.hxx b/tubes/inc/tubes/manager.hxx
index 8ba3a02..74d0424 100644
--- a/tubes/inc/tubes/manager.hxx
+++ b/tubes/inc/tubes/manager.hxx
@@ -192,9 +192,6 @@ public:
     /** Iterate our GMainLoop, blocking, until the callback is done. */
     void                    iterateLoop( const TeleConference* pConference, ConferenceCallBackInvokedFunc pFunc );
 
-    /** Iterate our GMainLoop, non-blocking, until nothing pending. */
-    void                    flushLoop() const;
-
     /// "LibreOfficeWhatEver"
     static rtl::OString     getFullClientName();
 
diff --git a/tubes/qa/test_manager.cxx b/tubes/qa/test_manager.cxx
index ae9b713..dcfbb47 100644
--- a/tubes/qa/test_manager.cxx
+++ b/tubes/qa/test_manager.cxx
@@ -60,7 +60,6 @@ public:
     void testSendPacket();
     void testReceivePacket();
     void testSendFile();
-    void testFlushLoops();
     void testDestroyManager1();
     void testDestroyManager2();
     void testDestroyAccepterContact();
@@ -88,7 +87,6 @@ public:
     CPPUNIT_TEST( testSendPacket );
     CPPUNIT_TEST( testReceivePacket );
     CPPUNIT_TEST( testSendFile );
-    CPPUNIT_TEST( testFlushLoops );
     CPPUNIT_TEST( testDestroyManager1 );
     CPPUNIT_TEST( testDestroyManager2 );
     CPPUNIT_TEST( testDestroyAccepterContact );
@@ -346,12 +344,6 @@ void TestTeleTubes::testSendFile()
         maFileReceivedUri == "file:///tmp/LibreOffice-collab-test-config.ini");
 }
 
-void TestTeleTubes::testFlushLoops()
-{
-    mpManager1->flushLoop();
-    mpManager2->flushLoop();
-}
-
 void TestTeleTubes::testDestroyManager1()
 {
     delete mpManager1;
diff --git a/tubes/source/manager.cxx b/tubes/source/manager.cxx
index 73895f9..b9ecfd0 100644
--- a/tubes/source/manager.cxx
+++ b/tubes/source/manager.cxx
@@ -931,18 +931,6 @@ void TeleManager::iterateLoop( const TeleConference* pConference, ConferenceCall
 }
 
 
-void TeleManager::flushLoop() const
-{
-    if (pImpl->mpLoop)
-    {
-        GMainContext* pContext = g_main_loop_get_context( pImpl->mpLoop);
-        while (g_main_context_iteration( pContext, FALSE))
-        {
-        }
-    }
-}
-
-
 GMainLoop* TeleManager::getMainLoop() const
 {
     return pImpl->mpLoop;
commit d824a60f80c5d4055d5ce69a2dfcd40f8d5a00e6
Author: Eike Rathke <erack at redhat.com>
Date:   Mon Mar 26 23:31:58 2012 +0200

    silence WaE incompatible pointer type and unused parameters
    
    * "passing argument 1 of ‘gtk_message_dialog_format_secondary_markup’ from
      incompatible pointer type"
      * dialog was in fact constructed as GtkMessageDialog using
        gtk_message_dialog_new_with_markup(), so use it as such
    * "passing argument 1 of ‘gtk_widget_destroy’ from incompatible pointer type"
      * use GTK_WIDGET() on dialog GtkMessageDialog*
    * "passing argument 1 of ‘g_object_get_data’ from incompatible pointer type"
      * use G_OBJECT on dialog GtkWidget*
    * "passing argument 1 of ‘gtk_dialog_set_response_sensitive’ from incompatible
      pointer type"
      * use GTK_DIALOG on dialog GtkWidget*
    * "passing argument 1 of ‘gtk_message_dialog_set_image’ from incompatible
      pointer type" and "passing argument 1 of ‘gtk_dialog_add_buttons’ from
      incompatible pointer type"
      * use GTK_MESSAGE_DIALOG() on dialog GtkWidget*
    * "passing argument 1 of ‘g_object_set_data_full’ from incompatible pointer
      type"
      * use G_OBJECT() on dialog GtkWidget*:x
    * "passing argument 3 of ‘g_signal_connect_data’ from incompatible pointer
      type"
      * use G_CALLBACK() on dialog_response_cb
    * "passing argument 1 of ‘gtk_window_set_skip_taskbar_hint’ from incompatible
      pointer type"
      * use GTK_WINDOW() on dialog GtkWidget*
    
    How awful C is :-/  GtkMessageDialog is a GtkDialog is a GtkWindow is
    a GtkWidget is a GObject, but still ...

diff --git a/tubes/source/approver.c b/tubes/source/approver.c
index 5f4bbde..f5e5812 100644
--- a/tubes/source/approver.c
+++ b/tubes/source/approver.c
@@ -45,7 +45,7 @@ handle_with_cb (GObject *source,
     gpointer user_data)
 {
   TpChannelDispatchOperation *cdo = TP_CHANNEL_DISPATCH_OPERATION (source);
-  GtkDialog *dialog = GTK_DIALOG (user_data);
+  GtkMessageDialog *dialog = GTK_MESSAGE_DIALOG (user_data);
   GError *error = NULL;
 
   if (!tp_channel_dispatch_operation_handle_with_finish (cdo, result, &error))
@@ -59,7 +59,7 @@ handle_with_cb (GObject *source,
     }
 
   g_print ("HandleWith() succeeded\n");
-  gtk_widget_destroy (dialog);
+  gtk_widget_destroy (GTK_WIDGET (dialog));
 }
 
 static void
@@ -71,6 +71,8 @@ close_cb (GObject *source,
   TpChannelDispatchOperation *cdo = TP_CHANNEL_DISPATCH_OPERATION (source);
   GError *error = NULL;
 
+  (void)user_data;      /* suppress unused-parameter warning */
+
   if (!tp_channel_dispatch_operation_close_channels_finish (cdo, result, &error))
     {
       g_print ("Rejecting channels failed: %s\n", error->message);
@@ -87,9 +89,11 @@ dialog_response_cb (
     gint response_id,
     gpointer user_data)
 {
-    TpSimpleApprover *self = TP_SIMPLE_APPROVER (g_object_get_data (dialog, "client"));
+    TpSimpleApprover *self = TP_SIMPLE_APPROVER (g_object_get_data (G_OBJECT (dialog), "client"));
     TpChannelDispatchOperation *cdo = TP_CHANNEL_DISPATCH_OPERATION (user_data);
 
+    (void)self;     /* suppress unused-parameter warning (could remove TP_SIMPLE_APPROVER above?) */
+
     if (response_id == GTK_RESPONSE_ACCEPT)
     {
         g_print ("Approve channels\n");
@@ -97,8 +101,8 @@ dialog_response_cb (
         tp_channel_dispatch_operation_handle_with_async (cdo, NULL,
             handle_with_cb, dialog);
 
-        gtk_dialog_set_response_sensitive (dialog, GTK_RESPONSE_ACCEPT, FALSE);
-        gtk_dialog_set_response_sensitive (dialog, GTK_RESPONSE_REJECT, FALSE);
+        gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT, FALSE);
+        gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_REJECT, FALSE);
     }
     else
     {
@@ -131,18 +135,18 @@ show_dialog (
     {
         GtkWidget *avatar = gtk_image_new_from_file (g_file_get_path (avatar_file));
 
-        gtk_message_dialog_set_image (dialog, avatar);
+        gtk_message_dialog_set_image (GTK_MESSAGE_DIALOG (dialog), avatar);
     }
 
-    gtk_dialog_add_buttons (dialog,
+    gtk_dialog_add_buttons (GTK_DIALOG (dialog),
         "_Reject", GTK_RESPONSE_REJECT,
         "_Accept", GTK_RESPONSE_ACCEPT,
         NULL);
 
-    g_object_set_data_full (dialog, "client", g_object_ref (self), g_object_unref);
-    g_signal_connect (dialog, "response", dialog_response_cb, g_object_ref (cdo));
+    g_object_set_data_full (G_OBJECT (dialog), "client", g_object_ref (self), g_object_unref);
+    g_signal_connect (dialog, "response", G_CALLBACK (dialog_response_cb), g_object_ref (cdo));
 
-    gtk_window_set_skip_taskbar_hint (dialog, FALSE);
+    gtk_window_set_skip_taskbar_hint (GTK_WINDOW (dialog), FALSE);
 
     gtk_widget_show_all (dialog);
 }
@@ -159,6 +163,10 @@ add_dispatch_operation_cb (TpSimpleApprover *self,
     TpContact *target = NULL;
     GList *l;
 
+    (void)account;      /* suppress unused-parameter warning */
+    (void)connection;   /* suppress unused-parameter warning */
+    (void)user_data;    /* suppress unused-parameter warning */
+
     g_print ("Approving this batch of channels:\n");
 
     for (l = channels; l != NULL; l = g_list_next (l))
commit 3f23ffb2eb6f228087d0753d1edca51ae336a9ed
Author: Eike Rathke <erack at redhat.com>
Date:   Mon Mar 26 22:03:55 2012 +0200

    silence WaE unused-parameter

diff --git a/tubes/source/file-transfer-helper.c b/tubes/source/file-transfer-helper.c
index 8ee092e..107f103 100644
--- a/tubes/source/file-transfer-helper.c
+++ b/tubes/source/file-transfer-helper.c
@@ -709,6 +709,8 @@ ft_transfer_transferred_bytes_cb (TpFileTransferChannel *channel,
   EmpathyFTHandlerPriv *priv = handler->priv;
   guint64 bytes;
 
+  (void)pspec;      /* suppress unused-parameter warning */
+
   if (empathy_ft_handler_is_cancelled (handler))
     return;
 
@@ -811,6 +813,8 @@ ft_transfer_state_cb (TpFileTransferChannel *channel,
   TpFileTransferState state = tp_file_transfer_channel_get_state (
       channel, &reason);
 
+  (void)pspec;      /* suppress unused-parameter warning */
+
   if (state == TP_FILE_TRANSFER_STATE_COMPLETED)
     {
       priv->is_completed = TRUE;
@@ -1091,6 +1095,8 @@ ft_handler_read_async_cb (GObject *source,
   EmpathyFTHandler *handler = user_data;
   EmpathyFTHandlerPriv *priv = handler->priv;
 
+  (void)source;     /* suppress unused-parameter warning */
+
   DEBUG ("GFile read async CB.");
 
   stream = g_file_read_finish (priv->gfile, res, &error);
@@ -1293,6 +1299,8 @@ ft_handler_gfile_ready_cb (GObject *source,
   GTimeVal mtime;
   EmpathyFTHandlerPriv *priv = cb_data->handler->priv;
 
+  (void)source;     /* suppress unused-parameter warning */
+
   DEBUG ("Got GFileInfo.");
 
   info = g_file_query_info_finish (priv->gfile, res, &error);


More information about the Libreoffice-commits mailing list