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
vite
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
solverstack
vite
Commits
328662f6
Commit
328662f6
authored
May 23, 2019
by
Philippe SWARTVAGHER
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix previous commit which broke date parsing & palette creation
parent
1642ea48
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
src/common/Session.cpp
src/common/Session.cpp
+5
-2
src/common/Tools.cpp
src/common/Tools.cpp
+2
-2
No files found.
src/common/Session.cpp
View file @
328662f6
...
...
@@ -286,16 +286,18 @@ void Session::get_palettes_name(const std::string &type, QStringList &list) {
}
Palette
*
Session
::
get_palette
(
const
std
::
string
&
type
,
const
std
::
string
&
palette_name
)
{
Palette
*
p
=
NULL
;
Palette
*
p
,
**
where_from
;
if
(
type
==
"palette"
)
{
p
=
_palettes_state
;
where_from
=
&
_palettes_state
;
}
else
if
(
type
==
"link_types"
)
{
p
=
_palettes_link
;
where_from
=
&
_palettes_link
;
}
else
if
(
type
==
"event_types"
)
{
p
=
_palettes_event
;
where_from
=
&
_palettes_event
;
}
if
(
!
p
||
p
->
get_name
()
!=
palette_name
)
{
...
...
@@ -304,6 +306,7 @@ Palette *Session::get_palette(const std::string &type, const std::string &palett
QMap
<
QString
,
QVariant
>
qmap
=
S
->
value
(
QString
::
fromStdString
(
type
+
"/"
+
palette_name
+
"/map"
)).
toMap
();
p
=
new
Palette
(
string
(
type
+
"/"
+
palette_name
));
*
where_from
=
p
;
for
(
QMap
<
QString
,
QVariant
>::
const_iterator
it
=
qmap
.
constBegin
()
;
it
!=
qmap
.
constEnd
()
;
++
it
)
{
const
QColor
qc
=
it
.
value
().
value
<
QColor
>
();
...
...
src/common/Tools.cpp
View file @
328662f6
...
...
@@ -59,7 +59,7 @@ using namespace std;
bool
convert_to_double
(
const
std
::
string
&
arg
,
double
*
val
)
{
unsigned
int
nb_read
;
// Try to convert first in the current locale
sscanf
(
arg
.
c_str
(),
"%lf%
u
"
,
val
,
&
nb_read
);
sscanf
(
arg
.
c_str
(),
"%lf%
n
"
,
val
,
&
nb_read
);
if
(
nb_read
==
arg
.
size
())
{
return
true
;
// It is the good format
...
...
@@ -88,7 +88,7 @@ bool convert_to_double(const std::string &arg, double *val) {
}
// Reads the value in the new locale
sscanf
(
arg
.
c_str
(),
"%lf%
u
"
,
val
,
&
nb_read
);
sscanf
(
arg
.
c_str
(),
"%lf%
n
"
,
val
,
&
nb_read
);
return
nb_read
==
arg
.
size
();
}
}
...
...
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