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

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

The user try to copy a karchiveur's file to the clipboard

Definition at line 1402 of file karchiveur.cpp.

References CArchive::extractArchive(), and view.

Referenced by initActions(), and slotContextualMenuActivated().

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

  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 copy:addURL:%1*").arg(filetoextract)<<endl;
                  filetoextract="";
            }
            vi=vi->nextSibling();
      }

      kapp->clipboard()->setData( new QUriDrag( urlstotransmitt, this ));

}


Generated by  Doxygen 1.6.0   Back to index