Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
LEFEBVREJP email
radix
Commits
d347f7d4
Commit
d347f7d4
authored
Aug 14, 2019
by
LEFEBVREJP email
Browse files
Merge branch 'fortify' into 'master'
Fortify changes See merge request
!80
parents
1ef4f9ff
ad788bbc
Pipeline
#67178
passed with stages
in 18 minutes and 21 seconds
Changes
15
Pipelines
1
Show whitespace changes
Inline
Side-by-side
radixcore/stringfunctions.cc
View file @
d347f7d4
...
...
@@ -134,6 +134,7 @@ struct std::tm utc_to_time(const std::string &time, int &zone, int &daylight)
int
year
=
0
,
month
=
0
,
day
=
0
,
hour
=
0
,
minute
=
0
,
second
=
0
;
int
count
=
sscanf
(
time
.
c_str
(),
"%d-%d-%dT%d:%d:%d-%d:%d"
,
&
year
,
&
month
,
&
day
,
&
hour
,
&
minute
,
&
second
,
&
zone
,
&
daylight
);
(
void
)
sizeof
(
count
);
radix_line
(
"utc_to_time elements: "
<<
count
);
struct
std
::
tm
res
;
res
.
tm_year
=
year
;
...
...
radixcore/system.cc
View file @
d347f7d4
...
...
@@ -71,9 +71,10 @@ std::string computer_name()
char
*
hostname
;
#ifndef _WIN32
hostname
=
new
char
[
256
];
hostname
[
255
]
=
'\0'
;
if
(
gethostname
(
hostname
,
256
)
!=
0
)
{
strcpy
(
hostname
,
"Unknown"
);
str
n
cpy
(
hostname
,
"Unknown"
,
255
);
}
std
::
string
result
(
hostname
);
delete
[]
hostname
;
...
...
@@ -485,6 +486,7 @@ long get_process_memory()
char
buffer
[
128
];
strncpy
(
buffer
,
line
.
substr
(
6
).
c_str
(),
std
::
min
(
sizeof
(
buffer
),
line
.
size
()
-
6
));
buffer
[
127
]
=
'\0'
;
caddr_t
context
=
nullptr
,
token
=
strtok_r
(
buffer
,
"
\t
"
,
&
context
);
if
(
token
!=
nullptr
)
result
=
long
(
atoi
(
token
))
*
1024L
;
...
...
radixwidgets/navigationactionmanager.cc
View file @
d347f7d4
...
...
@@ -19,10 +19,13 @@ class NavigationActionManager::PImpl
NavigationActionManager
::
PImpl
::~
PImpl
()
{}
NavigationActionManager
::
NavigationActionManager
(
QObject
*
parent
)
:
p
(
new
PImpl
(),
[](
PImpl
*
impl
)
{
delete
impl
;
})
:
QObject
(
parent
)
,
p
(
new
PImpl
(),
[](
PImpl
*
impl
)
{
delete
impl
;
})
{
}
void
NavigationActionManager
::
deleter
(
PImpl
*
impl
)
{
delete
impl
;
}
void
NavigationActionManager
::
registerAction
(
NavigationItem
*
item
,
QString
text
,
std
::
function
<
void
()
>
functor
)
{
...
...
radixwidgets/navigationactionmanager.hh
View file @
d347f7d4
...
...
@@ -25,6 +25,7 @@ class RADIX_PUBLIC NavigationActionManager : public QObject
private:
class
PImpl
;
std
::
unique_ptr
<
PImpl
,
void
(
*
)(
PImpl
*
)
>
p
;
static
void
deleter
(
PImpl
*
impl
);
};
}
// namespace radix
...
...
radixwidgets/navigationitem.cc
View file @
d347f7d4
...
...
@@ -19,25 +19,27 @@ class NavigationItem::PImpl
NavigationItem
::
PImpl
::~
PImpl
()
{
qDeleteAll
(
children
);
}
NavigationItem
::
NavigationItem
(
QVariant
data
,
NavigationItem
*
parentItem
)
:
p
(
new
PImpl
(),
[](
PImpl
*
impl
)
{
delete
impl
;
}
)
:
p
(
new
PImpl
(),
deleter
)
{
p
->
parent
=
parentItem
;
p
->
data
.
append
(
data
);
}
NavigationItem
::
NavigationItem
(
QList
<
QVariant
>
data
,
NavigationItem
*
parentItem
)
:
p
(
new
PImpl
(),
[](
PImpl
*
impl
)
{
delete
impl
;
}
)
:
p
(
new
PImpl
(),
deleter
)
{
p
->
parent
=
parentItem
;
p
->
data
=
data
;
}
NavigationItem
::
NavigationItem
(
NavigationItem
*
parentItem
)
:
p
(
new
PImpl
(),
[](
PImpl
*
impl
)
{
delete
impl
;
}
)
:
p
(
new
PImpl
(),
deleter
)
{
p
->
parent
=
parentItem
;
}
void
NavigationItem
::
deleter
(
PImpl
*
impl
)
{
delete
impl
;
}
int
NavigationItem
::
type
()
const
{
return
p
->
type
;
}
void
NavigationItem
::
setType
(
int
type
)
{
p
->
type
=
type
;
}
...
...
radixwidgets/navigationitem.hh
View file @
d347f7d4
...
...
@@ -30,6 +30,7 @@ class RADIX_PUBLIC NavigationItem
private:
class
PImpl
;
std
::
unique_ptr
<
PImpl
,
void
(
*
)(
PImpl
*
)
>
p
;
static
void
deleter
(
PImpl
*
impl
);
};
}
// namespace radix
...
...
radixwidgets/navigationmodel.cc
View file @
d347f7d4
...
...
@@ -21,11 +21,13 @@ NavigationModel::PImpl::~PImpl()
}
NavigationModel
::
NavigationModel
(
QObject
*
parent
)
:
QAbstractItemModel
(
parent
)
,
p
(
new
PImpl
(),
[](
PImpl
*
impl
)
{
delete
impl
;
}
)
,
p
(
new
PImpl
(),
deleter
)
{
p
->
root
=
new
NavigationItem
();
}
void
NavigationModel
::
deleter
(
PImpl
*
impl
)
{
delete
impl
;
}
QVariant
NavigationModel
::
data
(
const
QModelIndex
&
index
,
int
role
)
const
{
if
(
!
index
.
isValid
())
return
QVariant
();
...
...
radixwidgets/navigationmodel.hh
View file @
d347f7d4
...
...
@@ -38,6 +38,7 @@ class RADIX_PUBLIC NavigationModel : public QAbstractItemModel
private:
class
PImpl
;
std
::
unique_ptr
<
PImpl
,
void
(
*
)(
PImpl
*
)
>
p
;
static
void
deleter
(
PImpl
*
impl
);
};
}
// namespace radix
...
...
radixwidgets/navigationwidget.cc
View file @
d347f7d4
...
...
@@ -34,10 +34,12 @@ class RADIX_PUBLIC NavigationItemSortFilterProxyModel::PImpl
NavigationItemSortFilterProxyModel
::
NavigationItemSortFilterProxyModel
(
QObject
*
parent
)
:
QSortFilterProxyModel
(
parent
)
,
p
(
new
PImpl
(),
[](
PImpl
*
impl
)
{
delete
impl
;
}
)
,
p
(
new
PImpl
(),
deleter
)
{
}
void
NavigationItemSortFilterProxyModel
::
deleter
(
PImpl
*
impl
)
{
delete
impl
;
}
bool
NavigationItemSortFilterProxyModel
::
accepts
(
const
QModelIndex
&
index
)
const
{
const
QString
&
text
=
index
.
data
().
toString
();
...
...
@@ -85,12 +87,14 @@ class RADIX_PUBLIC NavigationWidget::PImpl
NavigationWidget
::
NavigationWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
)
,
p
(
new
PImpl
(),
[](
PImpl
*
impl
)
{
delete
impl
;
}
)
,
p
(
new
PImpl
(),
deleter
)
{
initMembers
();
initLayout
();
}
void
NavigationWidget
::
deleter
(
PImpl
*
impl
)
{
delete
impl
;
}
NavigationModel
*
NavigationWidget
::
navigationModel
()
{
return
p
->
model
;
}
NavigationActionManager
*
NavigationWidget
::
navigationActionManager
()
...
...
radixwidgets/navigationwidget.hh
View file @
d347f7d4
...
...
@@ -22,7 +22,8 @@ class NavigationItem;
class
NavigationModel
;
class
NavigationActionManager
;
class
RADIX_PUBLIC
NavigationItemSortFilterProxyModel
:
public
QSortFilterProxyModel
class
RADIX_PUBLIC
NavigationItemSortFilterProxyModel
:
public
QSortFilterProxyModel
{
Q_OBJECT
...
...
@@ -39,6 +40,7 @@ class RADIX_PUBLIC NavigationItemSortFilterProxyModel : public QSortFilterProxyM
bool
accepts
(
const
QModelIndex
&
index
)
const
;
class
PImpl
;
std
::
unique_ptr
<
PImpl
,
void
(
*
)(
PImpl
*
)
>
p
;
static
void
deleter
(
PImpl
*
impl
);
};
class
RADIX_PUBLIC
NavigationWidget
:
public
QWidget
...
...
@@ -73,6 +75,7 @@ class RADIX_PUBLIC NavigationWidget : public QWidget
class
PImpl
;
std
::
unique_ptr
<
PImpl
,
void
(
*
)(
PImpl
*
)
>
p
;
static
void
deleter
(
PImpl
*
impl
);
};
}
// namespace radix
...
...
radixwidgets/tableview.cc
View file @
d347f7d4
...
...
@@ -29,10 +29,12 @@ TableView::PImpl::PImpl()
TableView
::
TableView
(
QWidget
*
parent
)
:
QTableView
(
parent
)
,
p
(
new
PImpl
(),
[](
PImpl
*
impl
)
{
delete
impl
;
}
)
,
p
(
new
PImpl
(),
deleter
)
{
}
void
TableView
::
deleter
(
PImpl
*
impl
)
{
delete
impl
;
}
char
TableView
::
separator
()
const
{
return
p
->
separator
;
}
void
TableView
::
setSeparator
(
char
value
)
{
p
->
separator
=
value
;
}
...
...
radixwidgets/tableview.hh
View file @
d347f7d4
...
...
@@ -21,9 +21,10 @@ class RADIX_PUBLIC TableView : public QTableView
class
PImpl
;
std
::
unique_ptr
<
PImpl
,
void
(
*
)(
PImpl
*
)
>
p
;
static
void
deleter
(
PImpl
*
impl
);
public:
TableView
(
QWidget
*
parent
=
0
);
TableView
(
QWidget
*
parent
=
nullptr
);
char
separator
()
const
;
void
setSeparator
(
char
value
);
...
...
radixwidgets/tabwidget.cc
View file @
d347f7d4
...
...
@@ -3,7 +3,6 @@
#include
<iostream>
#include
<QLabel>
#include
<QPushButton>
#include
<QTabBar>
#include
<QToolButton>
...
...
@@ -16,15 +15,15 @@ TabWidget::TabWidget(QWidget *parent)
setTabsClosable
(
true
);
//
// create a 'new tab' button
QPushButton
*
n
ewButton
=
new
QPushButton
(
"+"
,
this
);
n
ewButton
->
setObjectName
(
"tabs_new_tab_button"
);
n
ewButton
->
setToolTip
(
"Add new tab"
);
n
ewButton
->
setMaximumWidth
(
25
);
mN
ewButton
=
new
QPushButton
(
"+"
,
this
);
mN
ewButton
->
setObjectName
(
"tabs_new_tab_button"
);
mN
ewButton
->
setToolTip
(
"Add new tab"
);
mN
ewButton
->
setMaximumWidth
(
25
);
addTab
(
new
QLabel
(
""
),
QString
(
""
));
QWidget
*
newTabWidget
=
widget
(
0
);
newTabWidget
->
setObjectName
(
"tabwidget_new_tab"
);
tabBar
()
->
setTabButton
(
0
,
QTabBar
::
RightSide
,
n
ewButton
);
tabBar
()
->
setTabButton
(
0
,
QTabBar
::
RightSide
,
mN
ewButton
);
// this is require on mac to hide the close button on the first tab
QWidget
*
temp
=
tabBar
()
->
tabButton
(
0
,
QTabBar
::
LeftSide
);
if
(
temp
)
temp
->
hide
();
...
...
@@ -34,7 +33,7 @@ TabWidget::TabWidget(QWidget *parent)
setCurrentIndex
(
-
1
);
// forward pushbutton signal
connect
(
n
ewButton
,
SIGNAL
(
clicked
(
bool
)),
this
,
SIGNAL
(
addTabRequested
()));
connect
(
mN
ewButton
,
SIGNAL
(
clicked
(
bool
)),
this
,
SIGNAL
(
addTabRequested
()));
}
}
// namespace radix
radixwidgets/tabwidget.hh
View file @
d347f7d4
#ifndef RADIX_RADIXWIDGETS_TABWIDGET_HH_
#define RADIX_RADIXWIDGETS_TABWIDGET_HH_
#include
<QPushButton>
#include
<QTabWidget>
#include
"radixcore/visibility.hh"
...
...
@@ -15,7 +16,10 @@ class RADIX_PUBLIC TabWidget : public QTabWidget
Q_OBJECT
public:
TabWidget
(
QWidget
*
parent
=
0
);
TabWidget
(
QWidget
*
parent
=
nullptr
);
private:
QPushButton
*
mNewButton
;
signals:
void
addTabRequested
();
...
...
radixwidgets/vtkPlotPointsErrorBars.cc
View file @
d347f7d4
...
...
@@ -832,6 +832,7 @@ bool vtkPlotPointsErrorBars::UpdateTableCache(vtkTable *table)
}
vtkDataArray
*
x
=
array
[
0
];
vtkDataArray
*
y
=
array
[
1
];
if
(
x
==
nullptr
||
y
==
nullptr
)
return
false
;
// Now copy the components into their new columns
if
(
this
->
UseIndexForXSeries
)
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment