Ignore empty filenames when calculating absolute path

stl_dim
Marius Kintel 2010-07-07 00:48:46 +02:00
parent ee14c3f944
commit 021edd8aa7
1 changed files with 9 additions and 1 deletions

View File

@ -147,8 +147,16 @@ AbstractNode *Context::evaluate_module(const ModuleInstantiation *inst) const
return NULL;
}
/*!
Returns the absolute path to the given filename, unless it's empty.
*/
QString Context::get_absolute_path(const QString &filename) const
{
return QFileInfo(QDir(this->document_path), filename).absoluteFilePath();
if (!filename.isEmpty()) {
return QFileInfo(QDir(this->document_path), filename).absoluteFilePath();
}
else {
return filename;
}
}