[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
Revision: 4381
Author: blacksun
Date: 2016-03-16 17:39:23 +0100 (Wed, 16 Mar 2016)
Log Message:
-----------
Minor fix
Modified Paths:
--------------
trunk/sources/ElementsCollection/elementslocation.cpp
Modified: trunk/sources/ElementsCollection/elementslocation.cpp
===================================================================
--- trunk/sources/ElementsCollection/elementslocation.cpp 2016-03-16 15:21:46 UTC (rev 4380)
+++ trunk/sources/ElementsCollection/elementslocation.cpp 2016-03-16 16:39:23 UTC (rev 4381)
@@ -56,9 +56,12 @@
*/
ElementsLocation::ElementsLocation(const ElementsLocation &other) :
m_collection_path(other.m_collection_path),
- m_project(other.m_project)
-{
-}
+ m_file_system_path(other.m_file_system_path),
+ m_project(other.m_project),
+ m_xml(other.m_xml),
+ m_uuid(other.m_uuid),
+ m_icon(other.m_icon)
+{}
/**
* @brief ElementsLocation::ElementLocation
@@ -112,8 +115,12 @@
}
/**
- @return le nom de base de l'element
-*/
+ * @brief ElementsLocation::baseName
+ * @return The base name of the element or directory.
+ * Unlike ElementsLocation::fileName , this method don't return the extension name.
+ * For exemple if this location represent an element they return myElement.
+ * @see fileName()
+ */
QString ElementsLocation::baseName() const {
QRegExp regexp("^.*([^/]+)\\.elmt$");
if (regexp.exactMatch(m_collection_path)) {
@@ -631,16 +638,19 @@
/**
* @brief ElementLocation::fileName
- * @return Return the file name of this element whatever the storage system (file system, xml collection)
+ * @return Return the file name of the represented item, whatever the storage system (file system, xml collection)
+ * with is file extension.
+ * For example if this location represent an element, they return myElement.elmt.
+ * For a directory return myDirectory.
+ * @see baseName
*/
QString ElementsLocation::fileName() const
{
-// if (m_collection_path.isEmpty()) return QString();
+ if (m_collection_path.isEmpty()) return QString();
-// QStringList qsl = m_collection_path.split("/");
-// if (qsl.isEmpty()) return QString();
-// else return qsl.last();
- return baseName();
+ QStringList qsl = m_collection_path.split("/");
+ if (qsl.isEmpty()) return QString();
+ else return qsl.last();
}
/**