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:
xavier
2012-04-28 16:45:16 +00:00
parent 1b52030484
commit fac1c5c2c4
10 changed files with 221 additions and 9 deletions

View File

@@ -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.