Re: [spice-gtk 1/2] clipboard: Add fixup_clipboard_text helper

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

 



On Mon, Aug 15, 2016 at 12:37:51PM +0200, Pavel Grunt wrote:
> Hi Christophe,
> 
> On Wed, 2016-08-10 at 12:26 +0200, Christophe Fergeau wrote:
> > This makes clipboard_received_cb a bit shorter, and will be useful
> > in the next commit.
> > ---
> >  src/spice-gtk-session.c | 63 +++++++++++++++++++++++++++++-------------------
> > -
> >  1 file changed, 38 insertions(+), 25 deletions(-)
> > 
> > diff --git a/src/spice-gtk-session.c b/src/spice-gtk-session.c
> > index 6cdae87..1343302 100644
> > --- a/src/spice-gtk-session.c
> > +++ b/src/spice-gtk-session.c
> > @@ -910,6 +910,43 @@ static gboolean
> > check_clipboard_size_limits(SpiceGtkSession *session,
> >      return TRUE;
> >  }
> >  
> > +static char *fixup_clipboard_text(SpiceGtkSession *self, const char *text,
> > int *len)
> 
> In my opinion would be better if the function worked with
> 'const GtkSelectionData *' instead of text & len pair. Or keep len as output
> only parameter ?

After the second patch, we don't have a GtkSelectionData instance we can
pass to that method, so this would not be so convenient. I can change
fixup_clipboard_text() to return a GString though if you think it would
make things more readable. Or I can add a comment explaining what the
method is doing, and that 'len' may be modified.

Christophe

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]