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

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

the user has "cutted" some files in the current archive

Definition at line 1497 of file karchiveur.cpp.

References CArchive::extractArchive(), slotRemoveSelectedFiles(), and view.

Referenced by initActions().

                            {
      QListViewItem* vi;
      QStrList urlstotransmitt;
      QString filetoextract;
      QString futuredirectory;
      QString tmp=NULL;
  int k;

  kdDebug()<<("IN:slotCutt\n");
  if(operation==NOARCHIVE)
      return;

      //We will extract the archive to a temp folder, so let's clean it
      process->clearArguments();
      *process << "rm" << "-fR" <<tmpdir;
      process->start(KProcess::Block);
      process->clearArguments();
      *process << "mkdir" << tmpdir;
      process->start(KProcess::Block);

      //Extract only the selected files
      archiveobj->extractArchive(tmpdir, EXTRACT_SELECTED_FILES,tmp);

      vi=view->firstChild();
      for(k=0;k<view->childCount();k++)
      {
            if((vi->isSelected())&&(strcmp(vi->text(0),"..")!=0)&&futuredirectory!=vi->text(6))
            {
                  futuredirectory=vi->text(6);
                  filetoextract+=vi->text(6);
                  if(vi->text(6).isEmpty()||vi->text(6).isNull()||vi->text(6)==" ")
                        filetoextract+=vi->text(0);
                  filetoextract=filetoextract.right(filetoextract.length()-1);
                  filetoextract=tmpdir+filetoextract;
//                      filetoextract+=vi->text(0);
                  urlstotransmitt.append(filetoextract);
                  kdDebug()<<QString("In cutt:addURL:%1*").arg(filetoextract)<<endl;
                  filetoextract="";
            }
            vi=vi->nextSibling();
      }
      QDragObject *d = new QUriDrag( urlstotransmitt, this );

      kapp->clipboard()->setData( d);

      KMessageBox::information(this, i18n("Paste these files in any application NOW."), "karchiveur");
      slotRemoveSelectedFiles();

}


Generated by  Doxygen 1.6.0   Back to index