Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KontactInterface
Commits
449d14b9
Commit
449d14b9
authored
Oct 07, 2021
by
Laurent Montel
😁
Browse files
use unique_ptr
parent
f566e4fe
Pipeline
#86228
passed with stage
in 3 minutes and 21 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/core.cpp
View file @
449d14b9
...
...
@@ -20,12 +20,12 @@
using
namespace
KontactInterface
;
//@cond PRIVATE
class
Q_DECL_HIDDEN
KontactInterface
::
Core
::
Private
class
Q_DECL_HIDDEN
KontactInterface
::
CorePrivate
{
Core
*
const
q
;
public:
explicit
Private
(
Core
*
qq
);
explicit
Core
Private
(
Core
*
qq
);
void
slotPartDestroyed
(
QObject
*
);
void
checkNewDay
();
...
...
@@ -35,7 +35,7 @@ public:
QMap
<
QByteArray
,
KParts
::
Part
*>
mParts
;
};
Core
::
Private
::
Private
(
Core
*
qq
)
CorePrivate
::
Core
Private
(
Core
*
qq
)
:
q
(
qq
)
,
mLastDate
(
QDate
::
currentDate
())
{
...
...
@@ -44,7 +44,7 @@ Core::Private::Private(Core *qq)
Core
::
Core
(
QWidget
*
parent
,
Qt
::
WindowFlags
f
)
:
KParts
::
MainWindow
(
parent
,
f
)
,
d
(
new
Private
(
this
))
,
d
(
new
Core
Private
(
this
))
{
auto
timer
=
new
QTimer
(
this
);
connect
(
timer
,
&
QTimer
::
timeout
,
this
,
[
this
]()
{
...
...
@@ -53,10 +53,7 @@ Core::Core(QWidget *parent, Qt::WindowFlags f)
timer
->
start
(
1000
*
60
);
}
Core
::~
Core
()
{
delete
d
;
}
Core
::~
Core
()
=
default
;
KParts
::
Part
*
Core
::
createPart
(
const
char
*
libname
)
{
...
...
@@ -84,7 +81,7 @@ KParts::Part *Core::createPart(const char *libname)
}
//@cond PRIVATE
void
Core
::
Private
::
slotPartDestroyed
(
QObject
*
obj
)
void
CorePrivate
::
slotPartDestroyed
(
QObject
*
obj
)
{
// the part was deleted, we need to remove it from the part map to not return
// a dangling pointer in createPart
...
...
@@ -98,7 +95,7 @@ void Core::Private::slotPartDestroyed(QObject *obj)
}
}
void
Core
::
Private
::
checkNewDay
()
void
CorePrivate
::
checkNewDay
()
{
if
(
mLastDate
!=
QDate
::
currentDate
())
{
Q_EMIT
q
->
dayChanged
(
QDate
::
currentDate
());
...
...
src/core.h
View file @
449d14b9
...
...
@@ -17,7 +17,7 @@
namespace
KontactInterface
{
class
Plugin
;
class
CorePrivate
;
/**
* @short The abstract interface that represents the Kontact core.
*
...
...
@@ -94,8 +94,8 @@ protected:
private:
//@cond PRIVATE
class
Private
;
Private
*
const
d
;
friend
class
Core
Private
;
std
::
unique_ptr
<
Core
Private
>
const
d
;
//@endcond
};
...
...
Write
Preview
Supports
Markdown
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