예제 #1
0
bool FavoriteFolderView::acceptDrag(QDropEvent *e) const
{
    KMFolderTree *ft = mainWidget()->folderTree();
    assert(ft);
    if(e->provides("application/x-qlistviewitem") &&
            (e->source() == ft->viewport() || e->source() == viewport()))
        return true;
    return FolderTreeBase::acceptDrag(e);
}
예제 #2
0
void FavoriteFolderView::selectionChanged()
{
    KMFolderTreeItem *fti = static_cast<KMFolderTreeItem *>(selectedItem());
    if(!fti)
        return;
    KMFolderTree *ft = mainWidget()->folderTree();
    assert(ft);
    assert(fti);
    ft->showFolder(fti->folder());
    handleGroupwareFolder(fti);
}
예제 #3
0
void FavoriteFolderView::dropped(QDropEvent * e, QListViewItem * after)
{
  QListViewItem* afterItem = after;
  KMFolderTree *ft = mainWidget()->folderTree();
  assert( ft );
  if ( e->source() == ft->viewport() && e->provides( "application/x-qlistviewitem" ) ) {
    for ( QListViewItemIterator it( ft ); it.current(); ++it ) {
      if ( !it.current()->isSelected() )
        continue;
      KMFolderTreeItem *fti = static_cast<KMFolderTreeItem*>( it.current() );
      if ( !fti->folder() )
        continue;
      afterItem = addFolder( fti->folder(), prettyName( fti ), afterItem );
    }
    e->accept();
  }
}