+ Fix transaction issues

This commit is contained in:
wmayer
2013-10-09 12:28:25 +02:00
parent d31a047095
commit 6389cc1d69
2 changed files with 18 additions and 0 deletions

View File

@@ -259,12 +259,21 @@ void TreeWidget::onStartEditing()
Gui::Document* doc = Gui::Application::Instance->getDocument(obj->getDocument());
MDIView *view = doc->getActiveView();
if (view) getMainWindow()->setActiveWindow(view);
// Always open a transaction here doesn't make much sense because:
// - many objects open transactions when really changing some properties
// - this leads to certain inconsistencies with the doubleClicked() method
// So, only the view provider class should decide what to do
#if 0
// open a transaction before starting edit mode
std::string cmd("Edit ");
cmd += obj->Label.getValue();
doc->openCommand(cmd.c_str());
bool ok = doc->setEdit(objitem->object(), edit);
if (!ok) doc->abortCommand();
#else
doc->setEdit(objitem->object(), edit);
#endif
}
}
}