mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-20 08:10:52 +01:00
Elements panels now display and highlight elements newly-integrated into projects.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.3@1697 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -135,6 +135,22 @@ bool ElementsLocation::addToPath(const QString &string) {
|
||||
return(true);
|
||||
}
|
||||
|
||||
/**
|
||||
@return the location of the parent category, or a copy of this location
|
||||
when it represents a root category.
|
||||
*/
|
||||
ElementsLocation ElementsLocation::parent() const {
|
||||
ElementsLocation copy(*this);
|
||||
QRegExp re1("^([a-z]+://)(.*)/*$");
|
||||
if (re1.exactMatch(path_)) {
|
||||
QString path_proto = re1.capturedTexts().at(1);
|
||||
QString path_path = re1.capturedTexts().at(2);
|
||||
QString parent_path = path_path.remove(QRegExp("/*[^/]+$"));
|
||||
copy.setPath(path_proto + parent_path);
|
||||
}
|
||||
return(copy);
|
||||
}
|
||||
|
||||
/**
|
||||
@return le projet de cet emplacement ou 0 si celui-ci n'est pas lie a
|
||||
un projet.
|
||||
|
||||
Reference in New Issue
Block a user