Fix App logic in ViewProviders -> segfaults
This commit is contained in:
parent
bd13d33937
commit
83a0078bd5
|
@ -135,10 +135,3 @@ TechDraw::DrawView* ViewProviderDrawingView::getViewObject() const
|
|||
return dynamic_cast<TechDraw::DrawView*>(pcObject);
|
||||
}
|
||||
|
||||
bool ViewProviderDrawingView::onDelete(const std::vector<std::string> &items)
|
||||
{
|
||||
//int viewCount =
|
||||
static_cast<void> (getViewObject()->findParentPage()->removeView(getViewObject()));
|
||||
Gui::Selection().clearSelection();
|
||||
return ViewProviderDocumentObject::onDelete(items);
|
||||
}
|
||||
|
|
|
@ -63,7 +63,6 @@ public:
|
|||
virtual void startRestoring();
|
||||
virtual void finishRestoring();
|
||||
//@}
|
||||
virtual bool onDelete(const std::vector<std::string> &items);
|
||||
TechDraw::DrawView* getViewObject() const;
|
||||
};
|
||||
|
||||
|
|
|
@ -145,8 +145,6 @@ void ViewProviderPage::updateData(const App::Property* prop)
|
|||
bool ViewProviderPage::onDelete(const std::vector<std::string> &items)
|
||||
{
|
||||
if (!view.isNull()) {
|
||||
// TODO: if DrawingPage has children, they should be deleted too, since they are useless without the page.
|
||||
// logic is in the "this object has links are you sure" dialog
|
||||
Gui::getMainWindow()->removeWindow(view);
|
||||
Gui::getMainWindow()->activatePreviousWindow();
|
||||
view->deleteLater(); // Delete the drawing view;
|
||||
|
|
|
@ -141,16 +141,6 @@ bool ViewProviderProjGroupItem::doubleClicked(void)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool ViewProviderProjGroupItem::onDelete(const std::vector<std::string> &subList)
|
||||
{
|
||||
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.removeObject(\"%s\")"
|
||||
,getObject()->getNameInDocument());
|
||||
Gui::Command::commitCommand();
|
||||
Gui::Command::updateActive();
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
TechDraw::DrawProjGroupItem* ViewProviderProjGroupItem::getObject() const
|
||||
{
|
||||
|
|
|
@ -52,8 +52,6 @@ public:
|
|||
void setupContextMenu(QMenu*, QObject*, const char*);
|
||||
virtual void updateData(const App::Property*);
|
||||
|
||||
bool onDelete(const std::vector<std::string> &subList);
|
||||
|
||||
TechDraw::DrawProjGroupItem* getObject() const;
|
||||
void unsetEdit(int ModNum);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user