[virt-tools-list] [PATCH 1/4] virt-viewer-window: Remove useless tests for priv->window != NULL

Daniel P. Berrange berrange at redhat.com
Wed Mar 7 10:27:23 UTC 2012


On Mon, Mar 05, 2012 at 04:22:07PM +0100, Hans de Goede wrote:
> priv->window gets set on init and never unset, so there is no need to check
> for it.
> 
> Signed-off-by: Hans de Goede <hdegoede at redhat.com>
> ---
>  src/virt-viewer-window.c |    8 +-------
>  1 files changed, 1 insertions(+), 7 deletions(-)
> 
> diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c
> index 033229f..604bc97 100644
> --- a/src/virt-viewer-window.c
> +++ b/src/virt-viewer-window.c
> @@ -324,7 +324,7 @@ virt_viewer_window_desktop_resize(VirtViewerDisplay *display G_GNUC_UNUSED,
>                                    VirtViewerWindow *self)
>  {
>      VirtViewerWindowPrivate *priv = self->priv;
> -    if (priv->auto_resize && priv->window && !priv->fullscreen)
> +    if (priv->auto_resize && !priv->fullscreen)
>          virt_viewer_window_resize(self);
>  }
>  
> @@ -576,9 +576,6 @@ virt_viewer_window_disable_modifiers(VirtViewerWindow *self)
>      GSList *accels;
>      int i;
>  
> -    if (!priv->window)
> -        return;
> -
>      if (!priv->accel_enabled)
>          return;
>  
> @@ -615,9 +612,6 @@ virt_viewer_window_enable_modifiers(VirtViewerWindow *self)
>      GSList *accels;
>      int i;
>  
> -    if (!priv->window)
> -        return;
> -
>      if (priv->accel_enabled)
>          return;
>  

ACK


Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the virt-tools-list mailing list