Ejemplo n.º 1
0
void CEditFileListDlg::slot_del()
{
  ConstFileList::iterator it;
  int n = lstFiles->currentItem();
  int i = 0;

  for (it = m_lFileList->begin(); i != n && it != m_lFileList->end(); it++, i++)
    ;

  if (i == n)
  {  
     free((void*)*it);
     m_lFileList->erase(it);
     emit file_deleted(m_lFileList->size());
  }

  lstFiles->setCurrentItem(n);
  lstFiles->removeItem(n);
  
}
Ejemplo n.º 2
0
void
DjVuFileCache::del_file(const DjVuFile * file)
{
   DEBUG_MSG("DjVuFileCache::del_file(): Removing an item from cache\n");
   DEBUG_MAKE_INDENT(3);

   GCriticalSectionLock lock(&class_lock);

   for(GPosition pos=list;pos;++pos)
      if (list[pos]->get_file()==file)
      {
	 GP<DjVuFile> file=list[pos]->get_file();
	 cur_size-=list[pos]->get_size();
	 list.del(pos);
	 file_deleted(file);
	 break;
      }
   if (cur_size<0) cur_size=calculate_size();
   DEBUG_MSG("current cache size=" << cur_size << "\n");
}