Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
abcbfebf
Commit
abcbfebf
authored
3 years ago
by
Matthias Puchner
Browse files
Options
Downloads
Patches
Plain Diff
simplify code (rm indirections)
parent
6572fcc6
No related branches found
No related tags found
1 merge request
!397
Centralize item infos
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
GUI/Models/ItemFactory.cpp
+0
-5
0 additions, 5 deletions
GUI/Models/ItemFactory.cpp
GUI/Models/ItemFactory.h
+0
-4
0 additions, 4 deletions
GUI/Models/ItemFactory.h
GUI/Views/SampleDesigner/SampleTreeWidget.cpp
+2
-2
2 additions, 2 deletions
GUI/Views/SampleDesigner/SampleTreeWidget.cpp
with
2 additions
and
11 deletions
GUI/Models/ItemFactory.cpp
+
0
−
5
View file @
abcbfebf
...
...
@@ -40,8 +40,3 @@ SessionItem* GUI::Model::ItemFactory::CreateEmptyItem()
{
return
new
SessionItem
(
"ROOT_ITEM"
);
}
QStringList
GUI
::
Model
::
ItemFactory
::
ValidTopItemTypes
()
{
return
ItemCatalog
::
validTopItemTypes
();
}
This diff is collapsed.
Click to expand it.
GUI/Models/ItemFactory.h
+
0
−
4
View file @
abcbfebf
...
...
@@ -31,10 +31,6 @@ template <typename ItemType> ItemType* CreateItem(SessionItem* parent = nullptr)
//! create empty SessionItem that serves as a root item
SessionItem
*
CreateEmptyItem
();
//! retrieve list of all possible item types suitable for
QStringList
ValidTopItemTypes
();
template
<
typename
ItemType
>
ItemType
*
CreateItem
(
SessionItem
*
parent
)
{
return
dynamic_cast
<
ItemType
*>
(
CreateItem
(
ItemType
::
M_TYPE
,
parent
));
...
...
This diff is collapsed.
Click to expand it.
GUI/Views/SampleDesigner/SampleTreeWidget.cpp
+
2
−
2
View file @
abcbfebf
...
...
@@ -14,7 +14,7 @@
#include
"GUI/Views/SampleDesigner/SampleTreeWidget.h"
#include
"GUI/Models/FilterPropertyProxy.h"
#include
"GUI/Models/Item
Factory
.h"
#include
"GUI/Models/Item
Catalog
.h"
#include
"GUI/Models/SampleModel.h"
#include
"GUI/Views/SampleDesigner/ItemTreeView.h"
#include
<QAction>
...
...
@@ -64,7 +64,7 @@ void SampleTreeWidget::showContextMenu(const QPoint& pnt)
QModelIndex
parent_index
=
FilterPropertyProxy
::
toSourceIndex
(
treeView
()
->
indexAt
(
pnt
));
treeView
()
->
setCurrentIndex
(
parent_index
);
if
(
!
parent_index
.
isValid
())
{
addItemNames
=
GUI
::
Model
::
ItemFactory
::
V
alidTopItemTypes
().
toVector
();
addItemNames
=
ItemCatalog
::
v
alidTopItemTypes
().
toVector
();
}
else
{
addItemNames
=
m_sampleModel
->
acceptableDefaultItemTypes
(
parent_index
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment