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
cfe5888f
Commit
cfe5888f
authored
Oct 09, 2021
by
Laurent Montel
😁
Browse files
Use std::unique_ptr
parent
449d14b9
Pipeline
#87396
passed with stage
in 4 minutes and 10 seconds
Changes
8
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/pimuniqueapplication.cpp
View file @
cfe5888f
...
...
@@ -32,15 +32,15 @@ const char kDisableInProcessStackTraces[] = "--disable-in-process-stack-traces";
}
//@cond PRIVATE
class
Q_DECL_HIDDEN
KontactInterface
::
PimUniqueApplication
::
Private
class
Q_DECL_HIDDEN
KontactInterface
::
PimUniqueApplication
::
PimUniqueApplication
Private
{
public:
Private
()
PimUniqueApplication
Private
()
:
cmdArgs
(
new
QCommandLineParser
())
{
}
~
Private
()
~
PimUniqueApplication
Private
()
{
delete
cmdArgs
;
}
...
...
@@ -60,14 +60,11 @@ public:
PimUniqueApplication
::
PimUniqueApplication
(
int
&
argc
,
char
**
argv
[])
:
QApplication
(
argc
,
*
argv
)
,
d
(
new
Private
())
,
d
(
new
PimUniqueApplication
Private
())
{
}
PimUniqueApplication
::~
PimUniqueApplication
()
{
delete
d
;
}
PimUniqueApplication
::~
PimUniqueApplication
()
=
default
;
QCommandLineParser
*
PimUniqueApplication
::
cmdArgs
()
const
{
...
...
@@ -139,7 +136,7 @@ bool PimUniqueApplication::start(const QStringList &arguments)
QDBusConnection
::
sessionBus
().
registerService
(
serviceName
);
// Make sure we have DrKonqi
Private
::
disableChromiumCrashHandler
();
PimUniqueApplication
Private
::
disableChromiumCrashHandler
();
static_cast
<
PimUniqueApplication
*>
(
qApp
)
->
activate
(
arguments
,
QDir
::
currentPath
());
return
true
;
...
...
src/pimuniqueapplication.h
View file @
cfe5888f
...
...
@@ -9,6 +9,7 @@
#include
"kontactinterface_export.h"
#include
<QApplication>
#include
<memory>
class
KAboutData
;
class
QCommandLineParser
;
...
...
@@ -56,8 +57,8 @@ protected:
private:
//@cond PRIVATE
class
Private
;
Private
*
const
d
;
class
PimUniqueApplication
Private
;
std
::
unique_ptr
<
PimUniqueApplication
Private
>
const
d
;
//@endcond
};
...
...
src/plugin.cpp
View file @
cfe5888f
...
...
@@ -27,11 +27,11 @@
using
namespace
KontactInterface
;
/**
Private class that helps to provide binary compatibility between releases.
Plugin
Private class that helps to provide binary compatibility between releases.
@internal
*/
//@cond PRIVATE
class
Q_DECL_HIDDEN
Plugin
::
Private
class
Q_DECL_HIDDEN
Plugin
::
Plugin
Private
{
public:
void
partDestroyed
();
...
...
@@ -57,7 +57,7 @@ public:
Plugin
::
Plugin
(
Core
*
core
,
QObject
*
parent
,
const
char
*
appName
,
const
char
*
pluginName
)
:
KXMLGUIClient
(
core
)
,
QObject
(
parent
)
,
d
(
new
Private
)
,
d
(
new
Plugin
Private
)
{
setObjectName
(
QLatin1String
(
appName
));
core
->
factory
()
->
addClient
(
this
);
...
...
@@ -72,7 +72,6 @@ Plugin::Plugin(Core *core, QObject *parent, const char *appName, const char *plu
Plugin
::~
Plugin
()
{
delete
d
->
part
;
delete
d
;
}
void
Plugin
::
setIdentifier
(
const
QString
&
identifier
)
...
...
@@ -234,12 +233,12 @@ void Plugin::configUpdated()
}
//@cond PRIVATE
void
Plugin
::
Private
::
partDestroyed
()
void
Plugin
::
Plugin
Private
::
partDestroyed
()
{
part
=
nullptr
;
}
void
Plugin
::
Private
::
removeInvisibleToolbarActions
(
Plugin
*
plugin
)
void
Plugin
::
Plugin
Private
::
removeInvisibleToolbarActions
(
Plugin
*
plugin
)
{
if
(
pluginName
.
isEmpty
())
{
return
;
...
...
@@ -294,7 +293,7 @@ void Plugin::Private::removeInvisibleToolbarActions(Plugin *plugin)
setXmlFiles
();
}
void
Plugin
::
Private
::
setXmlFiles
()
void
Plugin
::
Plugin
Private
::
setXmlFiles
()
{
if
(
pluginName
.
isEmpty
())
{
return
;
...
...
src/plugin.h
View file @
cfe5888f
...
...
@@ -321,8 +321,8 @@ protected:
private:
//@cond PRIVATE
class
Private
;
Private
*
const
d
;
class
Plugin
Private
;
std
::
unique_ptr
<
Plugin
Private
>
const
d
;
//@endcond
};
...
...
src/summary.cpp
View file @
cfe5888f
...
...
@@ -41,7 +41,7 @@ public:
//@endcond
//@cond PRIVATE
class
Q_DECL_HIDDEN
Summary
::
Private
class
Q_DECL_HIDDEN
Summary
::
Summary
Private
{
public:
QPoint
mDragStartPoint
;
...
...
@@ -50,16 +50,13 @@ public:
Summary
::
Summary
(
QWidget
*
parent
)
:
QWidget
(
parent
)
,
d
(
new
Private
)
,
d
(
new
Summary
Private
)
{
setFont
(
QFontDatabase
::
systemFont
(
QFontDatabase
::
GeneralFont
));
setAcceptDrops
(
true
);
}
Summary
::~
Summary
()
{
delete
d
;
}
Summary
::~
Summary
()
=
default
;
int
Summary
::
summaryHeight
()
const
{
...
...
src/summary.h
View file @
cfe5888f
...
...
@@ -100,8 +100,8 @@ protected:
private:
//@cond PRIVATE
class
Private
;
Private
*
const
d
;
class
Summary
Private
;
std
::
unique_ptr
<
Summary
Private
>
const
d
;
//@endcond
};
...
...
src/uniqueapphandler.cpp
View file @
cfe5888f
...
...
@@ -65,7 +65,7 @@
using
namespace
KontactInterface
;
//@cond PRIVATE
class
UniqueAppHandler
::
Private
class
UniqueAppHandler
::
UniqueAppHandler
Private
{
public:
Plugin
*
mPlugin
;
...
...
@@ -74,7 +74,7 @@ public:
UniqueAppHandler
::
UniqueAppHandler
(
Plugin
*
plugin
)
:
QObject
(
plugin
)
,
d
(
new
Private
)
,
d
(
new
UniqueAppHandler
Private
)
{
qCDebug
(
KONTACTINTERFACE_LOG
)
<<
"plugin->objectName():"
<<
plugin
->
objectName
();
...
...
@@ -91,7 +91,6 @@ UniqueAppHandler::~UniqueAppHandler()
QDBusConnection
session
=
QDBusConnection
::
sessionBus
();
const
QString
appName
=
parent
()
->
objectName
();
session
.
unregisterService
(
QLatin1String
(
"org.kde."
)
+
appName
);
delete
d
;
}
// DBUS call
...
...
@@ -141,7 +140,7 @@ bool KontactInterface::UniqueAppHandler::load()
}
//@cond PRIVATE
class
Q_DECL_HIDDEN
UniqueAppWatcher
::
Private
class
Q_DECL_HIDDEN
UniqueAppWatcher
::
UniqueAppWatcher
Private
{
public:
UniqueAppHandlerFactoryBase
*
mFactory
=
nullptr
;
...
...
@@ -152,7 +151,7 @@ public:
UniqueAppWatcher
::
UniqueAppWatcher
(
UniqueAppHandlerFactoryBase
*
factory
,
Plugin
*
plugin
)
:
QObject
(
plugin
)
,
d
(
new
Private
)
,
d
(
new
UniqueAppWatcher
Private
)
{
d
->
mFactory
=
factory
;
d
->
mPlugin
=
plugin
;
...
...
@@ -200,7 +199,6 @@ UniqueAppWatcher::UniqueAppWatcher(UniqueAppHandlerFactoryBase *factory, Plugin
UniqueAppWatcher
::~
UniqueAppWatcher
()
{
delete
d
->
mFactory
;
delete
d
;
}
bool
UniqueAppWatcher
::
isRunningStandalone
()
const
...
...
src/uniqueapphandler.h
View file @
cfe5888f
...
...
@@ -10,7 +10,7 @@
#include
"kontactinterface_export.h"
#include
"plugin.h"
#include
<memory>
class
QCommandLineParser
;
namespace
KontactInterface
...
...
@@ -57,8 +57,8 @@ protected:
virtual
int
activate
(
const
QStringList
&
args
,
const
QString
&
workingDirectory
);
private:
class
Private
;
Private
*
const
d
;
class
UniqueAppHandler
Private
;
std
::
unique_ptr
<
UniqueAppHandler
Private
>
const
d
;
};
/// Base class for UniqueAppHandler
...
...
@@ -118,8 +118,8 @@ private Q_SLOTS:
void
slotApplicationRemoved
(
const
QString
&
name
,
const
QString
&
oldOwner
,
const
QString
&
newOwner
);
private:
class
Private
;
Private
*
const
d
;
class
UniqueAppWatcher
Private
;
std
::
unique_ptr
<
UniqueAppWatcher
Private
>
const
d
;
};
}
// namespace
...
...
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