Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
LEFEBVREJP email
radix
Commits
c2d02242
Commit
c2d02242
authored
Sep 09, 2019
by
Huff, Israel
Browse files
- replaced all instances of unique_ptr with standard pointers to address Fortify issues
parent
0772a90d
Pipeline
#70551
passed with stages
in 16 minutes and 38 seconds
Changes
10
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
radixwidgets/navigationactionmanager.cc
View file @
c2d02242
...
...
@@ -16,15 +16,13 @@ class NavigationActionManager::PImpl
~
PImpl
();
};
NavigationActionManager
::
PImpl
::~
PImpl
()
{}
NavigationActionManager
::
NavigationActionManager
(
QObject
*
parent
)
:
QObject
(
parent
)
,
p
(
new
PImpl
(),
deleter
)
,
p
(
new
PImpl
)
{
}
void
NavigationActionManager
::
deleter
(
PImpl
*
impl
)
{
delete
impl
;
}
NavigationActionManager
::
~
NavigationActionManager
(
)
{
delete
p
;
}
void
NavigationActionManager
::
registerAction
(
NavigationItem
*
item
,
QString
text
,
std
::
function
<
void
()
>
functor
)
...
...
radixwidgets/navigationactionmanager.hh
View file @
c2d02242
...
...
@@ -17,6 +17,7 @@ class RADIX_PUBLIC NavigationActionManager : public QObject
Q_OBJECT
public:
NavigationActionManager
(
QObject
*
parent
=
nullptr
);
~
NavigationActionManager
();
void
registerAction
(
NavigationItem
*
item
,
QString
text
,
std
::
function
<
void
()
>
functor
);
...
...
@@ -24,8 +25,7 @@ class RADIX_PUBLIC NavigationActionManager : public QObject
private:
class
PImpl
;
std
::
unique_ptr
<
PImpl
,
void
(
*
)(
PImpl
*
)
>
p
;
static
void
deleter
(
PImpl
*
impl
);
PImpl
*
p
;
};
}
// namespace radix
...
...
radixwidgets/navigationitem.cc
View file @
c2d02242
...
...
@@ -19,26 +19,26 @@ class NavigationItem::PImpl
NavigationItem
::
PImpl
::~
PImpl
()
{
qDeleteAll
(
children
);
}
NavigationItem
::
NavigationItem
(
QVariant
data
,
NavigationItem
*
parentItem
)
:
p
(
new
PImpl
()
,
deleter
)
:
p
(
new
PImpl
())
{
p
->
parent
=
parentItem
;
p
->
data
.
append
(
data
);
}
NavigationItem
::
NavigationItem
(
QList
<
QVariant
>
data
,
NavigationItem
*
parentItem
)
:
p
(
new
PImpl
()
,
deleter
)
:
p
(
new
PImpl
())
{
p
->
parent
=
parentItem
;
p
->
data
=
data
;
}
NavigationItem
::
NavigationItem
(
NavigationItem
*
parentItem
)
:
p
(
new
PImpl
()
,
deleter
)
:
p
(
new
PImpl
())
{
p
->
parent
=
parentItem
;
}
void
NavigationItem
::
deleter
(
PImpl
*
impl
)
{
delete
impl
;
}
NavigationItem
::
~
NavigationItem
(
)
{
delete
p
;
}
int
NavigationItem
::
type
()
const
{
return
p
->
type
;
}
...
...
radixwidgets/navigationitem.hh
View file @
c2d02242
...
...
@@ -13,6 +13,7 @@ class RADIX_PUBLIC NavigationItem
NavigationItem
(
QVariant
data
,
NavigationItem
*
parentItem
=
nullptr
);
NavigationItem
(
QList
<
QVariant
>
data
,
NavigationItem
*
parentItem
=
nullptr
);
NavigationItem
(
NavigationItem
*
parentItem
=
nullptr
);
~
NavigationItem
();
int
type
()
const
;
void
setType
(
int
type
);
...
...
@@ -29,8 +30,7 @@ class RADIX_PUBLIC NavigationItem
private:
class
PImpl
;
std
::
unique_ptr
<
PImpl
,
void
(
*
)(
PImpl
*
)
>
p
;
static
void
deleter
(
PImpl
*
impl
);
PImpl
*
p
;
};
}
// namespace radix
...
...
radixwidgets/navigationmodel.cc
View file @
c2d02242
...
...
@@ -21,12 +21,12 @@ NavigationModel::PImpl::~PImpl()
}
NavigationModel
::
NavigationModel
(
QObject
*
parent
)
:
QAbstractItemModel
(
parent
)
,
p
(
new
PImpl
()
,
deleter
)
,
p
(
new
PImpl
())
{
p
->
root
=
new
NavigationItem
();
}
void
NavigationModel
::
deleter
(
PImpl
*
impl
)
{
delete
impl
;
}
NavigationModel
::
~
NavigationModel
(
)
{
delete
p
;
}
QVariant
NavigationModel
::
data
(
const
QModelIndex
&
index
,
int
role
)
const
{
...
...
radixwidgets/navigationmodel.hh
View file @
c2d02242
...
...
@@ -16,6 +16,7 @@ class RADIX_PUBLIC NavigationModel : public QAbstractItemModel
Q_OBJECT
public:
NavigationModel
(
QObject
*
parent
=
nullptr
);
~
NavigationModel
();
QVariant
data
(
const
QModelIndex
&
index
,
int
role
)
const
override
;
bool
setData
(
const
QModelIndex
&
index
,
const
QVariant
&
value
,
...
...
@@ -37,8 +38,7 @@ class RADIX_PUBLIC NavigationModel : public QAbstractItemModel
private:
class
PImpl
;
std
::
unique_ptr
<
PImpl
,
void
(
*
)(
PImpl
*
)
>
p
;
static
void
deleter
(
PImpl
*
impl
);
PImpl
*
p
;
};
}
// namespace radix
...
...
radixwidgets/navigationwidget.cc
View file @
c2d02242
...
...
@@ -32,11 +32,14 @@ class RADIX_PUBLIC NavigationItemSortFilterProxyModel::PImpl
NavigationItemSortFilterProxyModel
::
NavigationItemSortFilterProxyModel
(
QObject
*
parent
)
:
QSortFilterProxyModel
(
parent
)
,
p
(
new
PImpl
()
,
deleter
)
,
p
(
new
PImpl
())
{
}
void
NavigationItemSortFilterProxyModel
::
deleter
(
PImpl
*
impl
)
{
delete
impl
;
}
NavigationItemSortFilterProxyModel
::~
NavigationItemSortFilterProxyModel
()
{
delete
p
;
}
bool
NavigationItemSortFilterProxyModel
::
accepts
(
const
QModelIndex
&
index
)
const
{
...
...
@@ -85,13 +88,13 @@ class RADIX_PUBLIC NavigationWidget::PImpl
NavigationWidget
::
NavigationWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
)
,
p
(
new
PImpl
()
,
deleter
)
,
p
(
new
PImpl
())
{
initMembers
();
initLayout
();
}
void
NavigationWidget
::
deleter
(
PImpl
*
impl
)
{
delete
impl
;
}
NavigationWidget
::
~
NavigationWidget
(
)
{
delete
p
;
}
NavigationModel
*
NavigationWidget
::
navigationModel
()
{
return
p
->
model
;
}
...
...
radixwidgets/navigationwidget.hh
View file @
c2d02242
...
...
@@ -31,6 +31,7 @@ class RADIX_PUBLIC NavigationItemSortFilterProxyModel
public:
NavigationItemSortFilterProxyModel
(
QObject
*
parent
=
nullptr
);
~
NavigationItemSortFilterProxyModel
();
public
slots
:
void
clearCache
();
...
...
@@ -41,8 +42,7 @@ class RADIX_PUBLIC NavigationItemSortFilterProxyModel
private:
bool
accepts
(
const
QModelIndex
&
index
)
const
;
class
PImpl
;
std
::
unique_ptr
<
PImpl
,
void
(
*
)(
PImpl
*
)
>
p
;
static
void
deleter
(
PImpl
*
impl
);
PImpl
*
p
;
};
class
RADIX_PUBLIC
NavigationWidget
:
public
QWidget
...
...
@@ -51,6 +51,7 @@ class RADIX_PUBLIC NavigationWidget : public QWidget
public:
NavigationWidget
(
QWidget
*
parent
=
nullptr
);
~
NavigationWidget
();
void
collapse
(
QStandardItem
*
item
);
...
...
@@ -79,8 +80,7 @@ class RADIX_PUBLIC NavigationWidget : public QWidget
void
initMembers
();
class
PImpl
;
std
::
unique_ptr
<
PImpl
,
void
(
*
)(
PImpl
*
)
>
p
;
static
void
deleter
(
PImpl
*
impl
);
PImpl
*
p
;
};
}
// namespace radix
...
...
radixwidgets/tableview.cc
View file @
c2d02242
...
...
@@ -29,11 +29,11 @@ TableView::PImpl::PImpl()
TableView
::
TableView
(
QWidget
*
parent
)
:
QTableView
(
parent
)
,
p
(
new
PImpl
(),
deleter
)
,
p
(
new
PImpl
)
{
}
void
TableView
::
deleter
(
PImpl
*
impl
)
{
delete
impl
;
}
TableView
::
~
TableView
(
)
{
delete
p
;
}
char
TableView
::
separator
()
const
{
return
p
->
separator
;
}
...
...
radixwidgets/tableview.hh
View file @
c2d02242
...
...
@@ -20,11 +20,12 @@ class RADIX_PUBLIC TableView : public QTableView
Q_OBJECT
class
PImpl
;
std
::
unique_ptr
<
PImpl
,
void
(
*
)(
PImpl
*
)
>
p
;
PImpl
*
p
;
static
void
deleter
(
PImpl
*
impl
);
public:
TableView
(
QWidget
*
parent
=
nullptr
);
~
TableView
();
char
separator
()
const
;
void
setSeparator
(
char
value
);
...
...
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