From 1f860a199da587e3ddbf71424207302200d2a2f1 Mon Sep 17 00:00:00 2001 From: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> Date: Wed, 30 Apr 2008 14:48:04 -0400 Subject: [PATCH] Remove compilation warnings --- sflphone-gtk/src/menus.c | 12 +++++------- src/iaxvoiplink.cpp | 15 +++++++++------ src/managerimpl.cpp | 3 ++- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/sflphone-gtk/src/menus.c b/sflphone-gtk/src/menus.c index 82b3ca69b1..0b9be32f43 100644 --- a/sflphone-gtk/src/menus.c +++ b/sflphone-gtk/src/menus.c @@ -1,5 +1,6 @@ /* * Copyright (C) 2007 Savoir-Faire Linux inc. + * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify @@ -52,7 +53,6 @@ void update_menus() gtk_widget_set_sensitive( GTK_WIDGET(newCallMenu),FALSE); gtk_widget_set_sensitive( GTK_WIDGET(holdMenu), FALSE); gtk_widget_set_sensitive( GTK_WIDGET(copyMenu), FALSE); - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(holdMenu), FALSE); call_t * selectedCall = call_get_selected(active_calltree); if (selectedCall) @@ -68,7 +68,7 @@ void update_menus() gtk_widget_set_sensitive( GTK_WIDGET(hangUpMenu), TRUE); gtk_widget_set_sensitive( GTK_WIDGET(holdMenu), TRUE); gtk_widget_set_sensitive( GTK_WIDGET(newCallMenu),TRUE); - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(holdMenu), TRUE); + gtk_image_menu_item_set_image( GTK_IMAGE_MENU_ITEM ( holdMenu ), gtk_image_new_from_file( ICONS_DIR "/icon_unhold.svg")); break; case CALL_STATE_RINGING: gtk_widget_set_sensitive( GTK_WIDGET(pickUpMenu), TRUE); @@ -83,6 +83,7 @@ void update_menus() gtk_widget_set_sensitive( GTK_WIDGET(hangUpMenu), TRUE); gtk_widget_set_sensitive( GTK_WIDGET(holdMenu), TRUE); gtk_widget_set_sensitive( GTK_WIDGET(newCallMenu),TRUE); + gtk_image_menu_item_set_image( GTK_IMAGE_MENU_ITEM ( holdMenu ), gtk_image_new_from_file( ICONS_DIR "/icon_hold.svg")); break; case CALL_STATE_BUSY: case CALL_STATE_FAILURE: @@ -143,9 +144,6 @@ create_help_menu() menu = gtk_menu_new (); - /*menu_items = gtk_separator_menu_item_new (); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); - */ menu_items = gtk_image_menu_item_new_from_stock( GTK_STOCK_ABOUT, get_accel_group()); gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); g_signal_connect_swapped (G_OBJECT (menu_items), "activate", @@ -498,7 +496,7 @@ create_edit_menu() } /* ----------------------------------------------------------------- */ static void -view_dialpad (GtkCheckMenuItem *checkmenuitem, +view_dialpad (GtkImageMenuItem *imagemenuitem, void* foo) { gboolean state; @@ -516,7 +514,7 @@ view_dialpad (GtkCheckMenuItem *checkmenuitem, } static void -view_volume_controls (GtkCheckMenuItem *checkmenuitem, +view_volume_controls (GtkImageMenuItem *imagemenuitem, void* foo) { gboolean state; diff --git a/src/iaxvoiplink.cpp b/src/iaxvoiplink.cpp index a63b26f9d1..1cc5a5d264 100644 --- a/src/iaxvoiplink.cpp +++ b/src/iaxvoiplink.cpp @@ -26,7 +26,7 @@ #include "audio/audiolayer.h" #include <samplerate.h> -#include <iax/iax-client.h> +//#include <iax/iax-client.h> #include <math.h> #include <dlfcn.h> @@ -165,6 +165,7 @@ IAXVoIPLink::terminate() void IAXVoIPLink::terminateIAXCall() { + std::string reason = "Dumped Call"; ost::MutexLock m(_callMapMutex); CallMap::iterator iter = _callMap.begin(); IAXCall *call; @@ -172,7 +173,7 @@ IAXVoIPLink::terminateIAXCall() call = dynamic_cast<IAXCall*>(iter->second); if (call) { _mutexIAX.enterMutex(); - iax_hangup(call->getSession(), "Dumped Call"); + iax_hangup(call->getSession(), (char*)reason.c_str()); _mutexIAX.leaveMutex(); call->setSession(NULL); delete call; call = NULL; @@ -480,11 +481,11 @@ bool IAXVoIPLink::hangup(const CallID& id) { IAXCall* call = getIAXCall(id); - + std::string reason = "Dumped Call"; CHK_VALID_CALL; _mutexIAX.enterMutex(); - iax_hangup(call->getSession(), "Dumped Call"); + iax_hangup(call->getSession(), (char*) reason.c_str()); _mutexIAX.leaveMutex(); call->setSession(NULL); if (Manager::instance().isCurrentCall(id)) { @@ -549,11 +550,12 @@ bool IAXVoIPLink::refuse(const CallID& id) { IAXCall* call = getIAXCall(id); + std::string reason = "Call rejected manually."; CHK_VALID_CALL; _mutexIAX.enterMutex(); - iax_reject(call->getSession(), "Call rejected manually."); + iax_reject(call->getSession(), (char*) reason.c_str()); _mutexIAX.leaveMutex(); removeCall(id); } @@ -849,6 +851,7 @@ IAXVoIPLink::iaxHandlePrecallEvent(iax_event* event) { IAXCall* call = NULL; CallID id; + std::string reason = "Error ringing user."; switch(event->etype) { case IAX_EVENT_REGACK: @@ -910,7 +913,7 @@ IAXVoIPLink::iaxHandlePrecallEvent(iax_event* event) addCall(call); } else { // reject call, unable to add it - iax_reject(event->session, "Error ringing user."); + iax_reject(event->session, (char*)reason.c_str()); delete call; call = NULL; } diff --git a/src/managerimpl.cpp b/src/managerimpl.cpp index 69283c2920..5882c7ae41 100644 --- a/src/managerimpl.cpp +++ b/src/managerimpl.cpp @@ -607,6 +607,7 @@ ManagerImpl::peerHungupCall(const CallID& id) if (accountid == AccountNULL) { _debug("peerHungupCall: Call doesn't exists\n"); return; + } if (_dbus) _dbus->getCallManager()->callStateChanged(id, "HUNGUP"); if (isCurrentCall(id)) { @@ -615,7 +616,7 @@ ManagerImpl::peerHungupCall(const CallID& id) } removeWaitingCall(id); removeCallAccount(id); - } + } //THREAD=VoIP -- GitLab