##// END OF EJS Templates
Fix move of an event in another catalogue
trabillard -
r1379:99a785298325
parent child
Show More
@@ -19,6 +19,7 public:
19 19
20 20 /// Returns the catalogue represented by the item
21 21 std::shared_ptr<DBCatalogue> catalogue() const;
22 void replaceCatalogue(const std::shared_ptr<DBCatalogue> &catalogue);
22 23
23 24 private:
24 25 class CatalogueTreeItemPrivate;
@@ -133,6 +133,7 CatalogueSideBarWidget::CatalogueSideBarWidget(QWidget *parent)
133 133 connect(impl->m_TreeModel, &CatalogueTreeModel::itemDropped,
134 134 [this](auto index, auto mimeData, auto action) {
135 135 auto item = impl->m_TreeModel->item(index);
136
136 137 if (item && item->type() == CATALOGUE_ITEM_TYPE) {
137 138 auto catalogue = static_cast<CatalogueTreeItem *>(item)->catalogue();
138 139 this->setCatalogueChanges(catalogue, true);
@@ -144,9 +145,12 CatalogueSideBarWidget::CatalogueSideBarWidget(QWidget *parent)
144 145 mimeData->data(MIME_TYPE_SOURCE_CATALOGUE_LIST));
145 146 for (auto catalogue : sourceCatalogues) {
146 147 if (auto catalogueItem = impl->getCatalogueItem(catalogue)) {
148 catalogueItem->replaceCatalogue(catalogue);
147 149 this->setCatalogueChanges(catalogue, true);
148 150 }
149 151 }
152
153 this->emitSelection();
150 154 }
151 155 });
152 156
@@ -124,3 +124,8 std::shared_ptr<DBCatalogue> CatalogueTreeItem::catalogue() const
124 124 {
125 125 return impl->m_Catalogue;
126 126 }
127
128 void CatalogueTreeItem::replaceCatalogue(const std::shared_ptr<DBCatalogue> &catalogue)
129 {
130 impl->m_Catalogue = catalogue;
131 }
General Comments 0
You need to be logged in to leave comments. Login now