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

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

extract the selected files to trash and then remove them from the archive

Definition at line 1449 of file karchiveur.cpp.

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

Referenced by initActions(), and slotContextualMenuActivated().

                                                  {
  slotStatusMsg(i18n("Move all selected files to trash..."));

      if(operation!=NOARCHIVE)
      {
            int i;
            int k;
            QListViewItem *li=view->firstChild();
            QString txt;
            QString repTrash;
            KConfig conf("kdeglobals"); //To get the "trash" directory

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

            led->setColor(QColor("red"));
            repTrash=QDir::homeDirPath();
            repTrash+="/Desktop/Trash";
            conf.setGroup("Paths");
            repTrash=conf.readPathEntry("Trash",repTrash);
            k=view->childCount();

            for(i=0;i<k;i++)
            {
                  if(view->isSelected(li))
                  {
                        txt=li->text(6);
                        txt=txt.remove(0,1);
                        txt+=li->text(0);
                        archiveobj->extractArchive(repTrash, 9,txt);
                  }
                  if(i!=k)
                        li=li->nextSibling();
            }
      }

      slotRemoveSelectedFiles();

      led->setColor(QColor("green"));
  slotStatusMsg(IDS_STATUS_DEFAULT);
}


Generated by  Doxygen 1.6.0   Back to index