From 12ba41de2376625b99294282439c7e3989fb64fb Mon Sep 17 00:00:00 2001 From: cervenansky Date: Wed, 17 Jul 2013 23:44:20 +0200 Subject: [PATCH] clean move directory --- vv/CMakeLists.txt | 5 ----- vv/vvQPacsConnection.cxx | 25 ++++++++++++++++++++++--- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/vv/CMakeLists.txt b/vv/CMakeLists.txt index 7075ca1..9986789 100644 --- a/vv/CMakeLists.txt +++ b/vv/CMakeLists.txt @@ -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 diff --git a/vv/vvQPacsConnection.cxx b/vv/vvQPacsConnection.cxx index 7c7f395..6033825 100644 --- a/vv/vvQPacsConnection.cxx +++ b/vv/vvQPacsConnection.cxx @@ -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 vvQPacsConnection::getFileNames() { std::vector filenames; -- 2.47.1