Please enable JavaScript to use RhodeCode Enterprise
##// END OF EJS Templates
Alexandre Leroux
- Thu, 07 Sep 2017 09:33:14
Show More
0
core/include/Variable/VariableModel.h
core/include/Variable/VariableModel.h
+8
0
@@
-28,6
+28,14
public:
28
28
explicit VariableModel ( QObject * parent = nullptr );
29
29
30
30
/**
31
* Adds an existing variable in the model.
32
* @param variable the variable to add.
33
* @remarks the variable's name is modified to avoid name duplicates
34
* @remarks this method does nothing if the variable already exists in the model
35
*/
36
void addVariable ( std :: shared_ptr < Variable > variable ) noexcept ;
37
38
/**
31
39
* Creates a new variable in the model
32
40
* @param name the name of the new variable
33
41
* @param dateTime the dateTime of the new variable
0
core/src/Variable/VariableController.cpp
core/src/Variable/VariableController.cpp
+3
0
@@
-194,6
+194,9
VariableController::cloneVariable(std::shared_ptr<Variable> variable) noexcept
194
194
// Clones variable
195
195
auto duplicate = variable -> clone ();
196
196
197
// Adds clone to model
198
impl -> m_VariableModel -> addVariable ( duplicate );
199
197
200
return duplicate ;
198
201
}
199
202
0
core/src/Variable/VariableModel.cpp
core/src/Variable/VariableModel.cpp
+9
-5
@@
-62,19
+62,23
VariableModel::VariableModel(QObject *parent)
62
62
{
63
63
}
64
64
65
std :: shared_ptr < Variable > VariableModel :: createVariable ( const QString & name ,
66
const SqpRange & dateTime ,
67
const QVariantHash & metadata ) noexcept
65
void VariableModel :: addVariable ( std :: shared_ptr < Variable > variable ) noexcept
68
66
{
69
67
auto insertIndex = rowCount ();
70
68
beginInsertRows ({}, insertIndex , insertIndex );
71
69
72
auto variable = std :: make_shared < Variable > ( name , dateTime , metadata );
73
74
70
impl -> m_Variables . push_back ( variable );
75
71
connect ( variable . get (), & Variable :: updated , this , & VariableModel :: onVariableUpdated );
76
72
77
73
endInsertRows ();
74
}
75
76
std :: shared_ptr < Variable > VariableModel :: createVariable ( const QString & name ,
77
const SqpRange & dateTime ,
78
const QVariantHash & metadata ) noexcept
79
{
80
auto variable = std :: make_shared < Variable > ( name , dateTime , metadata );
81
addVariable ( variable );
78
82
79
83
return variable ;
80
84
}
Site-wide shortcuts
/
Use quick search box
g h
Goto home page
g g
Goto my private gists page
g G
Goto my public gists page
g 0-9
Goto bookmarked items from 0-9
n r
New repository page
n g
New gist page
Repositories
g s
Goto summary page
g c
Goto changelog page
g f
Goto files page
g F
Goto files page with file search activated
g p
Goto pull requests page
g o
Goto repository settings
g O
Goto repository access permissions settings
t s
Toggle sidebar on some pages