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

int Katalog::addItems ( const KURL &  mount,
QString  catalog,
bool  exploreArchives = false,
bool  getMetaInfo = false 
)

Adds the items found in mount to the catalog, creating it if not exist

Definition at line 284 of file katalog.cpp.

References findNode(), m_changed, m_currentUrl, m_document, m_exploreArchives, m_getMetaInfo, m_jobs, and m_rootElement.

{
  m_exploreArchives = exploreArchives;
  m_getMetaInfo = getMetaInfo;
  
  if(name.isNull() || name.isEmpty())
    return NAME_EMPTY;
    
  QDateTime date(QDate::currentDate(), QTime::currentTime());
    
  ListJob *job = listRecursive( mount, false );
  m_currentUrl = mount.path();
  QStringList list(name);
  QDomNode node = findNode(list);
  QDomElement el;
  if(node.isNull())
  {
    el = m_document.createElement(CATALOG);
    el.setAttribute("name", name);
    el.setAttribute("type", E_DIR);
    el.setAttribute("mimetype", "inode/directory");
    el.setAttribute("time", date.toTime_t());
    el.setAttribute("mount", mount.url());
    m_rootElement.appendChild(el);
  }
  else
    el = node.toElement();
  
  KURL u = job->url();
  QStringList l(name);
  m_jobs.append( KatalogJobItem(u, l));
  
  connect( job, SIGNAL( entries( KIO::Job *, const KIO::UDSEntryList & ) ),
           this, SLOT( slotEntries( KIO::Job *, const KIO::UDSEntryList & ) ) );
  connect( job, SIGNAL( result( KIO::Job * ) ),
           this, SLOT( slotResult( KIO::Job * ) ) );
  connect( job, SIGNAL( redirection( KIO::Job *, const KURL& ) ),
           this, SLOT( slotRedirection( KIO::Job *, const KURL& ) ) );
  
  m_changed = true;

  return SUCCESS;
}


Generated by  Doxygen 1.6.0   Back to index