mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-19 23:20:52 +01:00
Minor fix
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4381 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -56,9 +56,12 @@ ElementsLocation::~ElementsLocation() {
|
|||||||
*/
|
*/
|
||||||
ElementsLocation::ElementsLocation(const ElementsLocation &other) :
|
ElementsLocation::ElementsLocation(const ElementsLocation &other) :
|
||||||
m_collection_path(other.m_collection_path),
|
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
|
* @brief ElementsLocation::ElementLocation
|
||||||
@@ -112,8 +115,12 @@ bool ElementsLocation::operator!=(const ElementsLocation &other) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@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 {
|
QString ElementsLocation::baseName() const {
|
||||||
QRegExp regexp("^.*([^/]+)\\.elmt$");
|
QRegExp regexp("^.*([^/]+)\\.elmt$");
|
||||||
if (regexp.exactMatch(m_collection_path)) {
|
if (regexp.exactMatch(m_collection_path)) {
|
||||||
@@ -631,16 +638,19 @@ QString ElementsLocation::name()
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief ElementLocation::fileName
|
* @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
|
QString ElementsLocation::fileName() const
|
||||||
{
|
{
|
||||||
// if (m_collection_path.isEmpty()) return QString();
|
if (m_collection_path.isEmpty()) return QString();
|
||||||
|
|
||||||
// QStringList qsl = m_collection_path.split("/");
|
QStringList qsl = m_collection_path.split("/");
|
||||||
// if (qsl.isEmpty()) return QString();
|
if (qsl.isEmpty()) return QString();
|
||||||
// else return qsl.last();
|
else return qsl.last();
|
||||||
return baseName();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user