Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OBITools3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
23
Issues
23
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
OBITools
OBITools3
Commits
70e056a2
Commit
70e056a2
authored
Nov 24, 2016
by
Celine Mercier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
It is now impossible to open or clone a view that is not finished (= has
been closed at least once)
parent
8abbfa20
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
3 deletions
+20
-3
src/obiview.c
src/obiview.c
+18
-3
src/obiview.h
src/obiview.h
+2
-0
No files found.
src/obiview.c
View file @
70e056a2
...
...
@@ -1169,7 +1169,7 @@ Obiview_p obi_new_view(OBIDMS_p dms, const char* view_name, Obiview_p view_to_cl
}
view
->
dms
=
dms
;
view
->
read_only
=
0
;
view
->
read_only
=
false
;
// Create view file
if
(
create_obiview_file
(
dms
,
view_name
)
<
0
)
...
...
@@ -1187,16 +1187,19 @@ Obiview_p obi_new_view(OBIDMS_p dms, const char* view_name, Obiview_p view_to_cl
return
NULL
;
}
// Flag the view as being a work in progress
(
view
->
infos
)
->
finished
=
false
;
// Write used size in view file for initial structure
(
view
->
infos
)
->
used_size
=
sizeof
(
Obiview_infos_t
);
// Clone view to clone if there is one
if
(
view_to_clone
!=
NULL
)
{
if
(
!
(
view_to_clone
->
read_only
)
)
if
(
(
view_to_clone
->
infos
)
->
finished
==
false
)
{
obi_set_errno
(
OBIVIEW_ERROR
);
obidebug
(
1
,
"
\n
A view can not be cloned if it is not
read-only
"
);
obidebug
(
1
,
"
\n
A view can not be cloned if it is not
finished
"
);
obi_view_unmap_file
(
view
->
dms
,
view
->
infos
);
free
(
view
);
return
NULL
;
...
...
@@ -1634,6 +1637,15 @@ Obiview_p obi_open_view(OBIDMS_p dms, const char* view_name)
// Map view file
view
->
infos
=
obi_view_map_file
(
dms
,
view_name
);
// Check that the view is finished and can be opened
if
((
view
->
infos
)
->
finished
==
false
)
{
obidebug
(
1
,
"
\n
Error opening a view: the view is not finished"
);
obi_view_unmap_file
(
view
->
dms
,
view
->
infos
);
free
(
view
);
return
NULL
;
}
// Open the line selection associated with the view
if
((
view
->
infos
)
->
all_lines
)
view
->
line_selection
=
NULL
;
...
...
@@ -1983,6 +1995,9 @@ int obi_close_view(Obiview_p view)
}
}
// Flag the view as finished
(
view
->
infos
)
->
finished
=
true
;
// Free the column dictionary
ht_free
(
view
->
column_dict
);
...
...
src/obiview.h
View file @
70e056a2
...
...
@@ -94,6 +94,8 @@ typedef struct Obiview_infos {
*/
Alias_column_pair_t
column_references
[
MAX_NB_OPENED_COLUMNS
];
/**< References (name, version and alias) for all the columns in the view.
*/
bool
finished
;
/** Whether the view is finished and can be read.
*/
char
comments
[];
/**< Comments, additional informations on the view.
*/
}
Obiview_infos_t
,
*
Obiview_infos_p
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment