27 void EmbeddedFilepath::evaluate(QString* foundRoot,
bool* found, QString* foundRelative, QString* foundAbsolute)
const 29 *foundRelative = mFilePath;
31 *foundRoot = mRoots.front();
32 *foundAbsolute = mFilePath;
35 foreach (QString root, mRoots)
37 root = QDir::cleanPath(root);
38 if (!mFilePath.isEmpty() && QDir(root).exists(mFilePath))
40 *foundRelative = QDir(root).relativeFilePath(mFilePath);
42 *foundAbsolute = QDir(root).absoluteFilePath(mFilePath);
45 if (foundRelative->contains(
".."))
48 *foundRelative = *foundAbsolute;
63 QString root, relative, absolute;
64 this->evaluate(&root, &found, &relative, &absolute);
72 QString root, relative, absolute;
73 this->evaluate(&root, &found, &relative, &absolute);
81 QString root, relative, absolute;
82 this->evaluate(&root, &found, &relative, &absolute);
90 QString root, relative, absolute;
91 this->evaluate(&root, &found, &relative, &absolute);
114 return mFilePath.getRelativeFilepath();
119 if (val == this->getValue())
122 mFilePath.setFilepath(val);
123 mStore.writeValue(mFilePath.getRelativeFilepath());
QStringList getRootPaths() const
return the root of the existing root, first if no existing.
QString getAbsoluteFilepath() const
return absolute filepath, select the existing root
EmbeddedFilepath getEmbeddedPath()
void setFilepath(QString filename)
relative to one of the root paths or absolute
virtual QString getDisplayName() const
name of data entity. Used for display to user.
virtual QString getValue() const
void appendRootPath(QString path)
QString getRelativeFilepath() const
return filepath relative to root.
virtual bool setValue(const QString &value)
QString getRootPath() const
return the root of the existing root, first if no existing.
Namespace for all CustusX production code.