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:
blacksun
2016-03-06 14:40:52 +00:00
parent 3192c8ccd7
commit 73e21c408d
6 changed files with 126 additions and 59 deletions

View File

@@ -233,8 +233,9 @@ bool ElementLocation::isElement() const {
* @brief ElementLocation::isDirectory
* @return true if this location represent a directory
*/
bool ElementLocation::isDirectory() const {
return !isElement();
bool ElementLocation::isDirectory() const
{
return (!isElement() && !m_collection_path.isEmpty());
}
/**
@@ -270,15 +271,17 @@ bool ElementLocation::exist() const
return m_project->embeddedElementCollection()->exist(collectionPath(false));
else
{
if (fileSystemPath().isEmpty()) return false;
if (isDirectory())
{
QDir dir(fileSystemPath());
return dir.exists();
}
else
{
else if (isElement())
return QFile::exists(fileSystemPath());
}
else
return false;
}
}