certmanager

certlistview.cpp
1 #include <config.h>
2 #include "certlistview.h"
3 #include <kurldrag.h>
4 #include <kdebug.h>
5 
6 CertKeyListView::CertKeyListView( const ColumnStrategy * strategy,
7  const DisplayStrategy * display,
8  TQWidget * parent, const char * name, WFlags f )
9  : Kleo::KeyListView( strategy, display, parent, name, f )
10 {
11  viewport()->setAcceptDrops( true );
12 }
13 
14 void CertKeyListView::contentsDragEnterEvent( TQDragEnterEvent * event )
15 {
16  //const char* fmt;
17  //for (int i=0; (fmt = event->format(i)); i++)
18  // kdDebug() << fmt << endl;
19 
20  // We only accept URL drops. We'll check the mimetype later on.
21  event->accept( TQUriDrag::canDecode( event ) );
22 }
23 
24 void CertKeyListView::contentsDragMoveEvent( TQDragMoveEvent * event )
25 {
26  event->accept( TQUriDrag::canDecode( event ) );
27 }
28 
29 
30 void CertKeyListView::contentsDragLeaveEvent( TQDragLeaveEvent * )
31 {
32  // Don't let TQListView do its stuff
33 }
34 
35 void CertKeyListView::contentsDropEvent( TQDropEvent * event )
36 {
37  KURL::List lst;
38  if ( KURLDrag::decode( event, lst ) ) {
39  event->accept();
40  emit dropped( lst );
41  }
42 }
43 
44 #include "certlistview.moc"