From c44d91043437cc453ac93a673b0fdd18314af612 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Wed, 10 Sep 2014 16:44:49 +0200 Subject: [PATCH] Store the filename only in the Dfn value. --HG-- branch : dfighter-tools --- .../src/plugins/georges_editor/dfn_browser_ctrl.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/code/studio/src/plugins/georges_editor/dfn_browser_ctrl.cpp b/code/studio/src/plugins/georges_editor/dfn_browser_ctrl.cpp index 9e2c86a56..c406b549a 100644 --- a/code/studio/src/plugins/georges_editor/dfn_browser_ctrl.cpp +++ b/code/studio/src/plugins/georges_editor/dfn_browser_ctrl.cpp @@ -26,6 +26,8 @@ #include "nel/georges/form_dfn.h" +#include + namespace { enum EntryEnum @@ -248,7 +250,15 @@ void DFNBrowserCtrl::onEnumValueChanged( QtProperty *p, int v ) void DFNBrowserCtrl::onFileValueChanged( QtProperty *p, const QString &v ) { NLGEORGES::CFormDfn::CEntry &entry = m_dfn->getEntry( m_idx ); - entry.setFilename( v.toUtf8().constData() ); + QFileInfo info( v ); + if( !info.exists() ) + return; + + entry.setFilename( info.fileName().toUtf8().constData() ); + + blockSignals( true ); + m_fileMgr->setValue( p, info.fileName() ); + blockSignals( false ); Q_EMIT valueChanged( p->propertyName(), v ); }