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
PIM MailCommon
Commits
059ed5d1
Commit
059ed5d1
authored
Oct 08, 2021
by
Laurent Montel
😁
Browse files
Use std::unique_ptr
parent
94a636f5
Pipeline
#86959
passed with stage
in 31 minutes and 36 seconds
Changes
24
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/folder/accountconfigorderdialog.cpp
View file @
059ed5d1
...
...
@@ -116,7 +116,6 @@ AccountConfigOrderDialog::AccountConfigOrderDialog(MailCommon::MailCommonSetting
AccountConfigOrderDialog
::~
AccountConfigOrderDialog
()
{
writeConfig
();
delete
d
;
}
void
AccountConfigOrderDialog
::
slotEnableAccountOrder
(
bool
state
)
...
...
src/folder/accountconfigorderdialog.h
View file @
059ed5d1
...
...
@@ -35,7 +35,7 @@ private:
void
writeConfig
();
void
readConfig
();
void
init
();
AccountConfigOrderDialogPrivate
*
const
d
;
std
::
unique_ptr
<
AccountConfigOrderDialogPrivate
>
const
d
;
};
}
src/folder/entitycollectionorderproxymodel.cpp
View file @
059ed5d1
...
...
@@ -94,7 +94,6 @@ EntityCollectionOrderProxyModel::~EntityCollectionOrderProxyModel()
if
(
d
->
manualSortingActive
)
{
saveOrder
();
}
delete
d
;
}
void
EntityCollectionOrderProxyModel
::
slotSpecialCollectionsChanged
()
...
...
src/folder/entitycollectionorderproxymodel.h
View file @
059ed5d1
...
...
@@ -46,7 +46,7 @@ public Q_SLOTS:
private:
class
EntityCollectionOrderProxyModelPrivate
;
EntityCollectionOrderProxyModelPrivate
*
const
d
;
std
::
unique_ptr
<
EntityCollectionOrderProxyModelPrivate
>
const
d
;
};
}
src/folder/foldercollectionmonitor.cpp
View file @
059ed5d1
...
...
@@ -51,11 +51,7 @@ FolderCollectionMonitor::FolderCollectionMonitor(Akonadi::Session *session, QObj
d
->
mMonitor
->
itemFetchScope
().
fetchAttribute
<
Akonadi
::
EntityAnnotationsAttribute
>
(
true
);
}
FolderCollectionMonitor
::~
FolderCollectionMonitor
()
{
qDebug
()
<<
"FolderCollectionMonitor::~FolderCollectionMonitor() "
<<
this
;
delete
d
;
}
FolderCollectionMonitor
::~
FolderCollectionMonitor
()
=
default
;
Akonadi
::
ChangeRecorder
*
FolderCollectionMonitor
::
monitor
()
const
{
...
...
src/folder/foldercollectionmonitor.h
View file @
059ed5d1
...
...
@@ -47,7 +47,7 @@ protected:
private:
void
slotDeleteJob
(
KJob
*
job
);
FolderCollectionMonitorPrivate
*
const
d
;
std
::
unique_ptr
<
FolderCollectionMonitorPrivate
>
const
d
;
};
}
src/folder/folderrequester.cpp
View file @
059ed5d1
...
...
@@ -81,10 +81,7 @@ void FolderRequester::slotOpenDialog()
}
//-----------------------------------------------------------------------------
FolderRequester
::~
FolderRequester
()
{
delete
d
;
}
FolderRequester
::~
FolderRequester
()
=
default
;
Akonadi
::
Collection
FolderRequester
::
collection
()
const
{
...
...
src/folder/folderrequester.h
View file @
059ed5d1
...
...
@@ -97,7 +97,7 @@ protected:
void
setCollectionFullPath
(
const
Akonadi
::
Collection
&
col
);
protected:
FolderRequesterPrivate
*
const
d
;
std
::
unique_ptr
<
FolderRequesterPrivate
>
const
d
;
};
}
src/folder/folderselectiondialog.cpp
View file @
059ed5d1
...
...
@@ -118,7 +118,6 @@ FolderSelectionDialog::FolderSelectionDialog(QWidget *parent, SelectionFolderOpt
FolderSelectionDialog
::~
FolderSelectionDialog
()
{
writeConfig
();
delete
d
;
}
void
FolderSelectionDialog
::
slotFolderTreeWidgetContextMenuRequested
(
const
QPoint
&
pos
)
...
...
src/folder/folderselectiondialog.h
View file @
059ed5d1
...
...
@@ -70,7 +70,7 @@ protected:
private:
class
FolderSelectionDialogPrivate
;
FolderSelectionDialogPrivate
*
const
d
;
std
::
unique_ptr
<
FolderSelectionDialogPrivate
>
const
d
;
};
}
src/mdn/mdnstateattribute.cpp
View file @
059ed5d1
...
...
@@ -18,7 +18,7 @@ using namespace MailCommon;
/**
* @internal
*/
class
Q_DECL_HIDDEN
MDNStateAttribute
::
Private
class
Q_DECL_HIDDEN
MDNStateAttribute
::
MDNStateAttribute
Private
{
public:
MDNSentState
dataToState
(
const
QByteArray
&
data
)
...
...
@@ -100,21 +100,18 @@ public:
};
MDNStateAttribute
::
MDNStateAttribute
(
MDNSentState
state
)
:
d
(
new
Private
)
:
d
(
new
MDNStateAttribute
Private
)
{
d
->
mSentState
=
d
->
stateToData
(
state
);
}
MDNStateAttribute
::
MDNStateAttribute
(
const
QByteArray
&
stateData
)
:
d
(
new
Private
)
:
d
(
new
MDNStateAttribute
Private
)
{
d
->
mSentState
=
stateData
;
}
MDNStateAttribute
::~
MDNStateAttribute
()
{
delete
d
;
}
MDNStateAttribute
::~
MDNStateAttribute
()
=
default
;
MDNStateAttribute
*
MDNStateAttribute
::
clone
()
const
{
...
...
src/mdn/mdnstateattribute.h
View file @
059ed5d1
...
...
@@ -12,6 +12,7 @@
#include
"mailcommon_export.h"
#include
<Akonadi/Attribute>
#include
<memory>
namespace
MailCommon
{
...
...
@@ -96,8 +97,8 @@ public:
private:
//@cond PRIVATE
class
Private
;
Private
*
const
d
;
class
MDNStateAttribute
Private
;
std
::
unique_ptr
<
MDNStateAttribute
Private
>
const
d
;
//@endcond
};
}
...
...
src/snippets/snippetsmanager.cpp
View file @
059ed5d1
...
...
@@ -26,10 +26,10 @@
using
namespace
MailCommon
;
class
Q_DECL_HIDDEN
SnippetsManager
::
Private
class
Q_DECL_HIDDEN
SnippetsManager
::
SnippetsManager
Private
{
public:
Private
(
SnippetsManager
*
qq
,
QWidget
*
parentWidget
)
SnippetsManager
Private
(
SnippetsManager
*
qq
,
QWidget
*
parentWidget
)
:
q
(
qq
)
,
mParent
(
parentWidget
)
{
...
...
@@ -92,7 +92,7 @@ public:
bool
mDirty
=
false
;
};
QModelIndex
SnippetsManager
::
Private
::
currentGroupIndex
()
const
QModelIndex
SnippetsManager
::
SnippetsManager
Private
::
currentGroupIndex
()
const
{
if
(
mSelectionModel
->
selectedIndexes
().
isEmpty
())
{
return
QModelIndex
();
...
...
@@ -106,7 +106,7 @@ QModelIndex SnippetsManager::Private::currentGroupIndex() const
}
}
void
SnippetsManager
::
Private
::
selectionChanged
()
void
SnippetsManager
::
SnippetsManager
Private
::
selectionChanged
()
{
const
bool
itemSelected
=
!
mSelectionModel
->
selectedIndexes
().
isEmpty
();
...
...
@@ -135,12 +135,12 @@ void SnippetsManager::Private::selectionChanged()
}
}
void
SnippetsManager
::
Private
::
addSnippet
()
void
SnippetsManager
::
SnippetsManager
Private
::
addSnippet
()
{
createSnippet
();
}
void
SnippetsManager
::
Private
::
createSnippet
(
const
QString
&
text
)
void
SnippetsManager
::
SnippetsManager
Private
::
createSnippet
(
const
QString
&
text
)
{
const
bool
noGroupAvailable
=
(
mModel
->
rowCount
()
==
0
);
...
...
@@ -196,17 +196,17 @@ void SnippetsManager::Private::createSnippet(const QString &text)
delete
dlg
;
}
void
SnippetsManager
::
Private
::
slotAddNewDndSnippset
(
const
QString
&
text
)
void
SnippetsManager
::
SnippetsManager
Private
::
slotAddNewDndSnippset
(
const
QString
&
text
)
{
createSnippet
(
text
);
}
void
SnippetsManager
::
Private
::
dndDone
()
void
SnippetsManager
::
SnippetsManager
Private
::
dndDone
()
{
mDirty
=
true
;
}
void
SnippetsManager
::
Private
::
editSnippet
()
void
SnippetsManager
::
SnippetsManager
Private
::
editSnippet
()
{
QModelIndex
index
=
mSelectionModel
->
selectedIndexes
().
first
();
if
(
!
index
.
isValid
()
||
index
.
data
(
SnippetsModel
::
IsGroupRole
).
toBool
())
{
...
...
@@ -266,7 +266,7 @@ void SnippetsManager::Private::editSnippet()
delete
dlg
;
}
void
SnippetsManager
::
Private
::
deleteSnippet
()
void
SnippetsManager
::
SnippetsManager
Private
::
deleteSnippet
()
{
const
QModelIndex
index
=
mSelectionModel
->
selectedIndexes
().
first
();
...
...
@@ -290,7 +290,7 @@ void SnippetsManager::Private::deleteSnippet()
save
();
}
void
SnippetsManager
::
Private
::
addSnippetGroup
()
void
SnippetsManager
::
SnippetsManager
Private
::
addSnippetGroup
()
{
QPointer
<
SnippetDialog
>
dlg
=
new
SnippetDialog
(
mActionCollection
,
true
,
mParent
);
dlg
->
setWindowTitle
(
i18nc
(
"@title:window"
,
"Add Group"
));
...
...
@@ -310,7 +310,7 @@ void SnippetsManager::Private::addSnippetGroup()
delete
dlg
;
}
void
SnippetsManager
::
Private
::
editSnippetGroup
()
void
SnippetsManager
::
SnippetsManager
Private
::
editSnippetGroup
()
{
const
QModelIndex
groupIndex
=
currentGroupIndex
();
if
(
!
groupIndex
.
isValid
()
||
!
groupIndex
.
data
(
SnippetsModel
::
IsGroupRole
).
toBool
())
{
...
...
@@ -335,7 +335,7 @@ void SnippetsManager::Private::editSnippetGroup()
delete
dlg
;
}
void
SnippetsManager
::
Private
::
deleteSnippetGroup
()
void
SnippetsManager
::
SnippetsManager
Private
::
deleteSnippetGroup
()
{
const
QModelIndex
groupIndex
=
currentGroupIndex
();
if
(
!
groupIndex
.
isValid
())
{
...
...
@@ -370,7 +370,7 @@ void SnippetsManager::Private::deleteSnippetGroup()
save
();
}
void
SnippetsManager
::
Private
::
insertSelectedSnippet
()
void
SnippetsManager
::
SnippetsManager
Private
::
insertSelectedSnippet
()
{
if
(
!
mSelectionModel
->
hasSelection
())
{
return
;
...
...
@@ -390,7 +390,7 @@ void SnippetsManager::Private::insertSelectedSnippet()
Q_EMIT
q
->
insertSnippetInfo
({
subject
,
text
,
to
,
cc
,
bcc
,
attachment
});
}
void
SnippetsManager
::
Private
::
insertActionSnippet
()
void
SnippetsManager
::
SnippetsManager
Private
::
insertActionSnippet
()
{
auto
action
=
qobject_cast
<
QAction
*>
(
q
->
sender
());
if
(
!
action
)
{
...
...
@@ -406,7 +406,7 @@ void SnippetsManager::Private::insertActionSnippet()
Q_EMIT
q
->
insertSnippetInfo
({
subject
,
text
,
to
,
cc
,
bcc
,
attachment
});
}
void
SnippetsManager
::
Private
::
initializeActionCollection
()
void
SnippetsManager
::
SnippetsManager
Private
::
initializeActionCollection
()
{
if
(
mActionCollection
)
{
const
QVector
<
SnippetsInfo
>
infos
=
mModel
->
snippetsInfo
();
...
...
@@ -416,14 +416,14 @@ void SnippetsManager::Private::initializeActionCollection()
}
}
void
SnippetsManager
::
Private
::
initializeAction
(
const
QString
&
newName
,
const
QKeySequence
&
keySequence
,
const
QString
&
text
,
const
QString
&
subject
,
const
QString
&
to
,
const
QString
&
cc
,
const
QString
&
bcc
,
const
QString
&
attachment
)
void
SnippetsManager
::
SnippetsManager
Private
::
initializeAction
(
const
QString
&
newName
,
const
QKeySequence
&
keySequence
,
const
QString
&
text
,
const
QString
&
subject
,
const
QString
&
to
,
const
QString
&
cc
,
const
QString
&
bcc
,
const
QString
&
attachment
)
{
const
QString
actionName
=
i18nc
(
"@action"
,
"Snippet %1"
,
newName
);
const
QString
normalizedName
=
QString
(
actionName
).
replace
(
QLatin1Char
(
' '
),
QLatin1Char
(
'_'
));
...
...
@@ -442,15 +442,15 @@ void SnippetsManager::Private::initializeAction(const QString &newName,
mActionCollection
->
setDefaultShortcut
(
action
,
keySequence
);
}
void
SnippetsManager
::
Private
::
updateActionCollection
(
const
QString
&
oldName
,
const
QString
&
newName
,
const
QKeySequence
&
keySequence
,
const
QString
&
text
,
const
QString
&
subject
,
const
QString
&
to
,
const
QString
&
cc
,
const
QString
&
bcc
,
const
QString
&
attachment
)
void
SnippetsManager
::
SnippetsManager
Private
::
updateActionCollection
(
const
QString
&
oldName
,
const
QString
&
newName
,
const
QKeySequence
&
keySequence
,
const
QString
&
text
,
const
QString
&
subject
,
const
QString
&
to
,
const
QString
&
cc
,
const
QString
&
bcc
,
const
QString
&
attachment
)
{
// remove previous action in case that the name changed
if
(
!
oldName
.
isEmpty
()
&&
mActionCollection
)
{
...
...
@@ -468,7 +468,7 @@ void SnippetsManager::Private::updateActionCollection(const QString &oldName,
}
}
QString
SnippetsManager
::
Private
::
replaceVariables
(
const
QString
&
text
)
QString
SnippetsManager
::
SnippetsManager
Private
::
replaceVariables
(
const
QString
&
text
)
{
QString
result
=
text
;
QString
variableName
;
...
...
@@ -514,7 +514,7 @@ QString SnippetsManager::Private::replaceVariables(const QString &text)
return
result
;
}
void
SnippetsManager
::
Private
::
save
()
void
SnippetsManager
::
SnippetsManager
Private
::
save
()
{
if
(
!
mDirty
)
{
return
;
...
...
@@ -526,7 +526,7 @@ void SnippetsManager::Private::save()
SnippetsManager
::
SnippetsManager
(
KActionCollection
*
actionCollection
,
QObject
*
parent
,
QWidget
*
parentWidget
)
:
QObject
(
parent
)
,
d
(
new
Private
(
this
,
parentWidget
))
,
d
(
new
SnippetsManager
Private
(
this
,
parentWidget
))
{
d
->
mModel
=
SnippetsModel
::
instance
();
connect
(
d
->
mModel
,
...
...
@@ -607,7 +607,6 @@ SnippetsManager::SnippetsManager(KActionCollection *actionCollection, QObject *p
SnippetsManager
::~
SnippetsManager
()
{
d
->
save
();
delete
d
;
}
QAbstractItemModel
*
SnippetsManager
::
model
()
const
...
...
src/snippets/snippetsmanager.h
View file @
059ed5d1
...
...
@@ -12,7 +12,7 @@
#include
"mailcommon_export.h"
#include
<QObject>
#include
<memory>
class
KActionCollection
;
class
QAbstractItemModel
;
...
...
@@ -126,8 +126,8 @@ Q_SIGNALS:
private:
//@cond PRIVATE
class
Private
;
Private
*
const
d
;
class
SnippetsManager
Private
;
std
::
unique_ptr
<
SnippetsManager
Private
>
const
d
;
//@endcond
};
}
...
...
src/snippets/snippetwidget.cpp
View file @
059ed5d1
...
...
@@ -92,10 +92,7 @@ SnippetWidget::SnippetWidget(QWidget *parent)
});
}
SnippetWidget
::~
SnippetWidget
()
{
delete
d
;
}
SnippetWidget
::~
SnippetWidget
()
=
default
;
void
SnippetWidget
::
setName
(
const
QString
&
name
)
{
...
...
src/snippets/snippetwidget.h
View file @
059ed5d1
...
...
@@ -72,7 +72,7 @@ Q_SIGNALS:
void
groupChanged
(
int
index
);
private:
SnippetWidgetPrivate
*
const
d
;
std
::
unique_ptr
<
SnippetWidgetPrivate
>
const
d
;
};
}
src/tag/addtagdialog.cpp
View file @
059ed5d1
...
...
@@ -57,10 +57,7 @@ AddTagDialog::AddTagDialog(const QList<KActionCollection *> &actions, QWidget *p
mainLayout
->
addWidget
(
buttonBox
);
}
AddTagDialog
::~
AddTagDialog
()
{
delete
d
;
}
AddTagDialog
::~
AddTagDialog
()
=
default
;
void
AddTagDialog
::
setTags
(
const
QVector
<
MailCommon
::
Tag
::
Ptr
>
&
tags
)
{
...
...
src/tag/addtagdialog.h
View file @
059ed5d1
...
...
@@ -33,6 +33,6 @@ private:
void
slotSave
();
void
slotTagNameChanged
(
const
QString
&
text
);
void
onTagCreated
(
KJob
*
job
);
AddTagDialogPrivate
*
const
d
;
std
::
unique_ptr
<
AddTagDialogPrivate
>
const
d
;
};
}
src/util/resourcereadconfigfile.cpp
View file @
059ed5d1
...
...
@@ -31,10 +31,7 @@ ResourceReadConfigFile::ResourceReadConfigFile(const QString &resourceName)
d
->
mConfig
=
new
KConfig
(
resourceName
+
QStringLiteral
(
"rc"
));
}
ResourceReadConfigFile
::~
ResourceReadConfigFile
()
{
delete
d
;
}
ResourceReadConfigFile
::~
ResourceReadConfigFile
()
=
default
;
KConfigGroup
ResourceReadConfigFile
::
group
(
const
QString
&
name
)
const
{
...
...
src/util/resourcereadconfigfile.h
View file @
059ed5d1
...
...
@@ -9,6 +9,7 @@
#include
"mailcommon_export.h"
#include
<KConfigGroup>
#include
<QString>
#include
<memory>
namespace
MailCommon
{
...
...
@@ -22,7 +23,7 @@ public:
KConfigGroup
group
(
const
QString
&
name
)
const
;
private:
ResourceReadConfigFilePrivate
*
const
d
;
std
::
unique_ptr
<
ResourceReadConfigFilePrivate
>
const
d
;
};
}
Prev
1
2
Next
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