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

void Main_window::setArguments ( QStringList  argumentsUltracopier )

Set the argument of the source and destination.

Parameters:
argumentsUltracopierthe source and the destination

Definition at line 1983 of file Mwindow.cpp.

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

{
      DEBUGCONSOLE(70,"Main_window::setArguments","start");
      if(AddingFolderThread->isRunning())
      {
            QMessageBox::warning(NULL, tr("Error"),
            tr("Wait the end of the previous folder adding. Thanks"),
            QMessageBox::Cancel,
            QMessageBox::Cancel);
      }
      else
      {
            #if (DEBUG_ULTRACOPIER>0)
            DEBUGCONSOLE(90,"Main_window::setArguments","number of argument: "+QString::number(argumentsUltracopier.size()));
            for (int i = 0; i < argumentsUltracopier.size(); ++i) {
                  DEBUGCONSOLE(90,"Main_window::setArguments","argument["+QString::number(i)+"]: "+argumentsUltracopier.at(i));
            }
            #endif
            if(argumentsUltracopier.last().endsWith("//"))
                  argumentsUltracopier.last().resize(argumentsUltracopier.last().size()-1);
            DEBUGCONSOLE(70,"Main_window::setArguments","Set source file or folder...");
            QList<QUrl> url;
            for (int i = 0; i < (argumentsUltracopier.size()-1); ++i)
            {
                  if(argumentsUltracopier.at(i)!="")
                  {
                        DEBUGCONSOLE(90,"Main_window::setArguments","argument["+QString::number(i)+"]: "+argumentsUltracopier.at(i));
                        url<<QUrl::fromLocalFile(argumentsUltracopier.at(i));
                  }
                  #if (DEBUG_ULTRACOPIER>0)
                  else
                        DEBUGCONSOLE(10,"Main_window::setArguments","argument["+QString::number(i)+"] is empty!");
                  #endif
            }
            if(!url.isEmpty() && argumentsUltracopier.last()!="")
            {
                  LastDestination=argumentsUltracopier.last();
                  DEBUGCONSOLE(90,"Main_window::setArguments","setDir("+LastDestination+",true)");
                  setInternalDestination(LastDestination);
                  AddingFolderThread->setDir(LastDestination,true);
                  AddingFolderThread->setFileListDropped(url);
                  AddingFolderThread->start(priorityLevel);
            }
            else
            {
                  #if (DEBUG_ULTRACOPIER>0)
                  if(url.isEmpty())
                        DEBUGCONSOLE(10,"Main_window::setArguments","url list is empty!");
                  if(argumentsUltracopier.last()=="")
                        DEBUGCONSOLE(10,"Main_window::setArguments","destination is empty!");
                  #endif
                  cancel_copy_window();
            }
      }
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index