File: certlistview.cpp

package info (click to toggle)
kdepim 4%3A3.3.2-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 57,460 kB
  • ctags: 49,988
  • sloc: cpp: 379,645; ansic: 34,747; sh: 12,064; perl: 4,878; makefile: 4,300; yacc: 2,655; lex: 342; awk: 342; xml: 53
file content (44 lines) | stat: -rw-r--r-- 1,144 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include <config.h>
#include "certlistview.h"
#include <kurldrag.h>
#include <kdebug.h>

CertKeyListView::CertKeyListView( const ColumnStrategy * strategy,
                                  const DisplayStrategy * display,
                                  QWidget * parent, const char * name, WFlags f )
  : Kleo::KeyListView( strategy, display, parent, name, f )
{
  viewport()->setAcceptDrops( true );
}

void CertKeyListView::contentsDragEnterEvent( QDragEnterEvent * event )
{
  //const char* fmt;
  //for (int i=0; (fmt = event->format(i)); i++)
  //  kdDebug() << fmt << endl;

  // We only accept URL drops. We'll check the mimetype later on.
  event->accept( QUriDrag::canDecode( event ) );
}

void CertKeyListView::contentsDragMoveEvent( QDragMoveEvent * event )
{
  event->accept( QUriDrag::canDecode( event ) );
}


void CertKeyListView::contentsDragLeaveEvent( QDragLeaveEvent * )
{
    // Don't let QListView do its stuff
}

void CertKeyListView::contentsDropEvent( QDropEvent * event )
{
  KURL::List lst;
  if ( KURLDrag::decode( event, lst ) ) {
    event->accept();
    emit dropped( lst );
  }
}

#include "certlistview.moc"