[vlc-devel] commit: Skins2: Cosmetics and make better use of a test that's done anyway. (JP Dinger )

git version control git at videolan.org
Sat Dec 5 22:35:12 CET 2009


vlc | branch: master | JP Dinger <jpd at videolan.org> | Sat Nov 21 21:37:06 2009 +0100| [c2e9890077e5353b1aa66a4c34be19346d62ef6e] | committer: JP Dinger 

Skins2: Cosmetics and make better use of a test that's done anyway.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c2e9890077e5353b1aa66a4c34be19346d62ef6e
---

 modules/gui/skins2/x11/x11_dragdrop.cpp |   19 ++++++-------------
 1 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/modules/gui/skins2/x11/x11_dragdrop.cpp b/modules/gui/skins2/x11/x11_dragdrop.cpp
index fd77b6c..6e9fc78 100644
--- a/modules/gui/skins2/x11/x11_dragdrop.cpp
+++ b/modules/gui/skins2/x11/x11_dragdrop.cpp
@@ -120,18 +120,11 @@ void X11DragDrop::dndPosition( ldata_t data )
     event.xclient.message_type = typeAtom;
     event.xclient.format = 32;
     event.xclient.data.l[0] = m_wnd;
-    if( m_target != None )
-    {
-        // Accept the drop
-        event.xclient.data.l[1] = 1;
-    }
-    else
-    {
-        // Do not accept the drop
-        event.xclient.data.l[1] = 0;
-    }
-    int w = X11Factory::instance( getIntf() )->getScreenWidth();
-    int h = X11Factory::instance( getIntf() )->getScreenHeight();
+    // Accept the drop (1), or not (0).
+    event.xclient.data.l[1] = m_target != None ? 1 : 0;
+    OSFactory *pOsFactory = X11Factory::instance( getIntf() );
+    int w = pOsFactory->getScreenWidth();
+    int h = pOsFactory->getScreenHeight();
     event.xclient.data.l[2] = 0;
     event.xclient.data.l[3] = (w << 16) | h;
     event.xclient.data.l[4] = actionAtom;
@@ -174,8 +167,8 @@ void X11DragDrop::dndDrop( ldata_t data )
     if( buffer != NULL )
     {
         selection = buffer;
+        XFree( buffer );
     }
-    XFree( buffer );
 
     if( selection != "" )
     {




More information about the vlc-devel mailing list