Logo Search packages:      
Sourcecode: basket version File versions  Download package

void Basket::insertItem ( Item item  )  [slot]

Items manipulation

Definition at line 944 of file basket.cpp.

References KDirWatch::addFile(), computeShownItems(), Item::fullPath(), Item::isAMirror(), Item::match(), Container::postStatusbarMessage(), and ContainerSystemTray::updateToolTip().

Referenced by ItemFactory::createItemText(), and ItemFactory::dropItem().

{
      m_emptyHelp->hide();

      plugItem(item, m_insertAtItem, m_insertAfter);

      item->reparent( viewport(), QPoint(0,0), true );
      addChild(item);
      bool match = item->match( ((DecoratedBasket*)parent())->searchData() ); // TODO: Add feedback when dropped and hidden
      item->setShown(match);                                                  //       Or cancel search and ensureVisible(item)
      if (match) {
            m_countShown++;
            computeShownItems();
      } else
            Global::mainContainer->postStatusbarMessage( i18n("The new item do not match the search and isn't shown.") );

      m_lastInsertedItem = item;
      if (item->isAMirror())
            m_watcher->addFile(item->fullPath());

      connect( item, SIGNAL(wantDelete(Item*)),           this, SLOT(delItem(Item*))              );
      connect( item, SIGNAL(wantPaste(QClipboard::Mode)), this, SLOT(pasteItem(QClipboard::Mode)) );

      if (isAClipboard())
            checkClipboard();

      resetInsertTo();
//    if (m_isLoaded) { // Basket::loadItems() will do that ONCE all items are loaded
            emit changedSelectedItems(); // FIXME: use insetad: emit countSelectedChanged(this);
            relayoutItems();
            recolorizeItems();
//    }
      if (hasFocus()) // In case there were no item, we should focus the new one
            focusAnItem();

      if (Global::tray)
            Global::tray->updateToolTip();
}


Generated by  Doxygen 1.6.0   Back to index