mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 13:30:34 +01:00
New element panel : user can drag & drop item from project collection to another project collection
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4371 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -125,22 +125,13 @@ ElementLocation ECHSFileToFile::copyElement(ElementLocation &source, ElementLoca
|
||||
|
||||
/******************************************************/
|
||||
|
||||
/**
|
||||
* @brief ECHSFileToXml::ECHSFileToXml
|
||||
* @param source
|
||||
* @param destination
|
||||
*/
|
||||
ECHSFileToXml::ECHSFileToXml(ElementLocation &source, ElementLocation &destination) :
|
||||
ECHSToXml::ECHSToXml(ElementLocation &source, ElementLocation &destination) :
|
||||
ECHStrategy(source, destination)
|
||||
{}
|
||||
|
||||
/**
|
||||
* @brief ECHSFileToXml::copy
|
||||
* @return
|
||||
*/
|
||||
ElementLocation ECHSFileToXml::copy()
|
||||
ElementLocation ECHSToXml::copy()
|
||||
{
|
||||
if (!(m_source.isFileSystem() && m_destination.isDirectory() && m_destination.isProject())) return ElementLocation();
|
||||
if (!(m_source.exist() && m_destination.isDirectory() && m_destination.isProject())) return ElementLocation();
|
||||
|
||||
//Check if the destination already have an item with the same name of the item to copy
|
||||
ElementLocation location(m_destination.projectCollectionPath() + "/" + m_source.fileName());
|
||||
@@ -186,7 +177,7 @@ ElementLocation ElementCollectionHandler::copy(ElementLocation &source, ElementL
|
||||
if (!source.exist() || !destination.exist() || destination.isElement()) return ElementLocation();
|
||||
|
||||
if (source.isFileSystem() && destination.isFileSystem()) m_strategy = new ECHSFileToFile(source, destination);
|
||||
else if (source.isFileSystem() && destination.isProject()) m_strategy = new ECHSFileToXml(source, destination);
|
||||
else if (destination.isProject()) m_strategy = new ECHSToXml(source, destination);
|
||||
|
||||
if (m_strategy)
|
||||
return m_strategy->copy();
|
||||
|
||||
Reference in New Issue
Block a user