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

void KarchiveurApp::slotRemoveWithUndoSelectedFiles (  )  [protected, slot]

Remove form current archive the selected fies, with an undo option (i.e. extract to repundo, then remove)

Remove form current archive the selected files, with an undo option (i.e. extract to tmpdirundo, then remove)

Definition at line 676 of file karchiveur.cpp.

References CArchive::extractArchive(), CLed::setColor(), slotRemoveSelectedFiles(), slotStatusMsg(), and view.

Referenced by initActions().

                                                   {
  slotStatusMsg(i18n("Deleting selected files..."));

  if(operation!=NOARCHIVE)
  {
    int i;
    int k;
    QListViewItem *li=view->firstChild();
    QString file;
    QString repTrash;

    if(li==0)
    {
      led->setColor(QColor("orange"));
      slotStatusMsg(i18n("First select a file"));
      return;
    }

    led->setColor(QColor("red"));

    k=view->childCount();
    listUndo.clear();
    listRedo.clear();

    for(i=0;i<k;i++)
    {
            if(view->isSelected(li))
            {
                    file=li->text(6);
    if(file.startsWith("/"))
      file=file.remove(0,1);
                    file+=li->text(0);
                    listUndo.append(file);
                    kdDebug()<<QString("KarchiveurApp::slotRemoveWithUndoSelectedFiles of %1").arg(file)<<endl;
                    //listRedo.append(file);
                    archiveobj->extractArchive(tmpdirundo, EXTRACTONE_AND_BLOCK, file);
            }
            if(i!=k)
                    li=li->nextSibling();
    }
  }

  slotRemoveSelectedFiles();
  editUndo->setEnabled(true);
  editRedo->setEnabled(false);
  led->setColor(QColor("green"));
  slotStatusMsg(IDS_STATUS_DEFAULT);
}


Generated by  Doxygen 1.6.0   Back to index