]> Creatis software - clitk.git/commitdiff
clean move directory
authorcervenansky <frederic.cervenansky@creatis.insa-lyon.fr>
Wed, 17 Jul 2013 21:44:20 +0000 (23:44 +0200)
committercervenansky <frederic.cervenansky@creatis.insa-lyon.fr>
Wed, 17 Jul 2013 21:44:20 +0000 (23:44 +0200)
vv/CMakeLists.txt
vv/vvQPacsConnection.cxx

index 7075ca1235ddb9971de164cdec680887c0b60709..998678949445350b4841c8ab7d0d136f2f76b9d8 100644 (file)
@@ -7,11 +7,6 @@ if(COMMAND cmake_policy)
 endif(COMMAND cmake_policy)
 #=========================================================
 OPTION(CLITK_USE_PACS_CONNECTION "USE PACS CONNECTION"       OFF)
-IF (CLITK_USE_PACS_CONNECTION)
-       SET(CLITK_PACS_MOVE_PATH ${PROJECT_BINARY_DIR}/move)
-       file(MAKE_DIRECTORY ${CLITK_PACS_MOVE_PATH})
-       add_definitions( -DPACS_MOVE_PATH=${LIBINTERFACE_VERSION} )
-ENDIF()
 #=========================================================
 #List of vv tools to compile
 SET(vv_TOOLS
index 7c7f395eb0e081754c9228698993e823081d38e9..6033825c0a01ee407e399cbed9a28108e3afad3d 100644 (file)
@@ -364,16 +364,35 @@ void vvQPacsConnection::chooseServer(int index)
 
 void vvQPacsConnection::on_importButton_clicked()
        {
-       
+               setCursor(QCursor(Qt::WaitCursor));
+               QString path = QDir::homePath() +QString::fromStdString("/.move");
+               QDir dirpath (path);
+               if (dirpath.exists())
+               {
+                       QFileInfoList list = dirpath.entryInfoList( QDir::Files);
+                       QFileInfoList::iterator it_file = dirpath.entryInfoList( QDir::Files).begin();
+                       for(int i = 0; i < list.length() ; i++)
+                       {
+                                       QFile::remove(list.at(i).filePath());
+                       }
+               }
+               else
+               {
+                       dirpath.mkdir(path);
+               }
                bool didItWork =  gdcm::CompositeNetworkFunctions::CMove(m_adress.c_str(),atoi(m_port.c_str()),
                        gdcm::CompositeNetworkFunctions::ConstructQuery(mQFactory.getMoveQuery().theRoot, mQFactory.getMoveQuery().theLevel ,mQFactory.getMoveQuery().keys,true),
-                       getDicomClientPort(),  getDicomClientAETitle().c_str(), m_aetitle.c_str(), gets(CLITK_PACS_MOVE_PATH) );
+                       getDicomClientPort(),  getDicomClientAETitle().c_str(), m_aetitle.c_str(), path.toStdString().c_str() );
                gdcm::Directory theDir;
-               theDir.Load(gets(CLITK_PACS_MOVE_PATH));
+               theDir.Load(path.toStdString().c_str());
           m_files =    theDir.GetFilenames();
+          
           accept();
+         setCursor(QCursor(Qt::ArrowCursor));
        }
 
+
+
 std::vector <std::string> vvQPacsConnection::getFileNames()
 {
        std::vector <std::string> filenames;