Example #1
0
void FileBrowserWidget::emitFileSelectedSignal()
{
	KFileItemList itemList = m_dirOperator->selectedItems();
	for(KFileItemList::iterator it = itemList.begin(); it != itemList.end(); ++it) {
		emit(fileSelected(*it));
	}

	m_dirOperator->view()->clearSelection();
}
Example #2
0
void
SearchPane::searchMatches( const KFileItemList &list )
{
    for( KFileItemList::ConstIterator it = list.begin(), end = list.end(); it != end; ++it ) {
        if( (*it)->isDir() )
            m_dirs += (*it)->url();
        else if( m_filter.exactMatch( (*it)->name() ) )
            new KURLView::Item( (*it)->url(), static_cast<KURLView*>( m_listView ) );
    }
}
bool LicensePropsPlugin::supports( const KFileItemList& items )
{
    KFileItemList::const_iterator kit = items.begin();
    const KFileItemList::const_iterator kend = items.end();
    for ( ; kit != kend; ++kit )
    {
        bool isLocal = (*kit)->isLocalFile();
        // We only support local dirs
        if ( !(*kit)->isDir() || !isLocal )
            return false;
    }
    return true;
}
   void
   RemoteLister::_completed()
   {
      //m_directory is set to the directory we should operate on

      KFileItemList items = KDirLister::items();
      for( KFileItemList::ConstIterator it = items.begin(), end = items.end(); it != end; ++it )
      {
         if( (*it)->isDir() )
            m_store->stores += new Store( (*it)->url(), (*it)->name(), m_store );
         else
            m_store->directory->append( (*it)->name().local8Bit(), (*it)->size() / 1024 );

         ScanManager::s_files++;
      }


      if( m_store->stores.isEmpty() )
         //no directories to scan, so we need to append ourselves to the parent directory
         //propagate() will return the next ancestor that has stores left to be scanned, or root if we are done
         m_store = m_store->propagate();

      if( !m_store->stores.isEmpty() )
      {
         Store::List::Iterator first = m_store->stores.begin();
         const KURL url( (*first)->url );
         Store *currentStore = m_store;

         //we should operate with this store next time this function is called
         m_store = *first;

         //we don't want to handle this store again
         currentStore->stores.remove( first );

         //this returns _immediately_
         debug() << "scanning: " << url << endl;
         openURL( url );
      }
      else {

         debug() << "I think we're done\n";

         Q_ASSERT( m_root == m_store );

         delete this;
      }
   }
Example #5
0
void Capture::checkSeqBoundary(const KFileItemList & items)
{
    int newFileIndex;
    QString tempName;

    KFileItemList::const_iterator it = items.begin();
    const KFileItemList::const_iterator end = items.end();
    for ( ; it != end; ++it )
    {
        tempName = (*it).name();

        // find the prefix first
        if (tempName.startsWith(seqPrefix) == false || tempName.endsWith(".fits") == false)
            continue;

        if (seqPrefix.isEmpty() == false)
           tempName.remove(seqPrefix + "_");


        int usIndex = tempName.indexOf('_');

        if (usIndex == -1)
            usIndex = tempName.indexOf('.');

        tempName.remove(usIndex, tempName.size() - usIndex);

        bool indexOK = false;

        newFileIndex = tempName.toInt(&indexOK);


        if (indexOK && newFileIndex >= seqCount)
            seqCount = newFileIndex + 1;

        //qDebug() << "Now the tempName is " << tempName << " conversion is " << (indexOK ? "OK" : "Failed") << " and valu is " << newFileIndex
          //          << " and seqCount is " << seqCount << endl;
    }

    currentCCD->setSeqCount(seqCount);

}