App: fix PropertyXLink file path saving

Also modified ProeprtyLinkItem to show file path as tooltip.
This commit is contained in:
Zheng, Lei
2019-11-02 13:02:12 +08:00
committed by wwmayer
parent a85ce1976c
commit b0c9325432
3 changed files with 20 additions and 10 deletions

View File

@@ -2902,6 +2902,8 @@ void PropertyXLink::setValue(App::DocumentObject *lValue,
if(lValue == owner)
throw Base::ValueError("self linking");
aboutToSetValue();
DocInfoPtr info;
const char *name = "";
if(lValue) {
@@ -2921,7 +2923,6 @@ void PropertyXLink::setValue(App::DocumentObject *lValue,
}
setFlag(LinkDetached,false);
aboutToSetValue();
#ifndef USE_OLD_DAG
if (!owner->testStatus(ObjectStatus::Destroy) && _pcScope!=LinkScope::Hidden) {
if(_pcLink)
@@ -2934,9 +2935,7 @@ void PropertyXLink::setValue(App::DocumentObject *lValue,
unlink();
docInfo = info;
}
if(docInfo)
filePath = docInfo->filePath();
else
if(!docInfo)
filePath.clear();
_pcLink=lValue;
if(docInfo && docInfo->pcDoc)
@@ -2981,9 +2980,7 @@ void PropertyXLink::setValue(std::string &&filename, std::string &&name,
unlink();
docInfo = info;
}
if(docInfo)
filePath = docInfo->filePath();
else
if(!docInfo)
filePath.clear();
if(docInfo && docInfo->pcDoc)
stamp=docInfo->pcDoc->LastModifiedDate.getValue();