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

bool Main_window::addFile (  ) [private, slot]

Add file to the copy list.

Returns:
Return true if succes

Definition at line 1817 of file Mwindow.cpp.

References AddingFolderThread, getDirectoryPath(), priorityLevel, AddFolderThread::setDir(), and AddFolderThread::setFileListDropped().

Referenced by Main_window().

{
      DEBUGCONSOLE(50,"Main_window::addFile","start");
      QStringList files = QFileDialog::getOpenFileNames(
            this,
            tr("Select one or more files to open"),
            "~/",
            tr("All files")+" (*)");
      QList<QUrl> url;
      DEBUGCONSOLE(90,"Main_window::addFile","number of argument: "+QString::number(files.size()));
      //quit if click on cancel
      if(files.isEmpty())
            return false;
      //load in url for parse in folder thread
      for (int i = 0; i < files.size(); ++i) {
            url << QUrl::fromLocalFile(fromPercentEncodingLocal(files.at(i)));
            DEBUGCONSOLE(30,"Main_window::addFile","argument["+QString::number(i)+"]: "+files.at(i));
            }
      //prompt the destination directory
      QString dir=getDirectoryPath(tr("Open target directory"));
      //quit if click on cancel
      if(dir=="")
            return false;
      setInternalDestination(dir);

      //set the url source to listing
      AddingFolderThread->setFileListDropped(url);
      //set the destination dir
      AddingFolderThread->setDir(dir,true);
      //start the scan the list
      AddingFolderThread->start(priorityLevel);
      return true;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index