New Element Wizard : tree view only display directory

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4484 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2016-05-15 14:46:01 +00:00
parent 3261809227
commit 8dd3e7394a
7 changed files with 168 additions and 38 deletions

View File

@@ -25,7 +25,6 @@
#include "qetmessagebox.h"
#include "elementscategoryeditor.h"
#include "newelementwizard.h"
#include "elementscategory.h"
#include "xmlprojectelementcollectionitem.h"
#include "qetproject.h"
#include "qetelementeditor.h"
@@ -368,16 +367,18 @@ void ElementsCollectionWidget::newElement()
{
ElementCollectionItem *eci = elementCollectionItemForIndex(m_index_at_context_menu);
if (eci->type() != FileElementCollectionItem::Type) return;
if (eci->type() != FileElementCollectionItem::Type) {
return;
}
FileElementCollectionItem *feci = static_cast<FileElementCollectionItem*>(eci);
if(feci->isCommonCollection()) return;
ElementsCollectionItem *category = QETApp::collectionItem(ElementsLocation(feci->collectionPath()), false);
ElementsCategory *selected_category = category -> toCategory();
if (!selected_category) return;
if(feci->isCommonCollection()) {
return;
}
NewElementWizard elmt_wizard(this);
ElementsLocation loc(feci->collectionPath());
elmt_wizard.preselectedLocation(loc);
elmt_wizard.exec();
}