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
8a857804
Commit
8a857804
authored
Nov 02, 2020
by
Laurent Montel
😁
Browse files
Modernize code
parent
994a8112
Pipeline
#39277
passed with stage
in 33 minutes and 16 seconds
Changes
127
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
autotests/favoritestest.cpp
View file @
8a857804
...
...
@@ -64,9 +64,9 @@ static bool waitForPopulation(const QModelIndex &idx, EntityTreeModel *model, in
EntityTreeModel
*
FavoriteProxyTest
::
createETM
()
{
ChangeRecorder
*
changeRecorder
=
new
ChangeRecorder
(
this
);
auto
*
changeRecorder
=
new
ChangeRecorder
(
this
);
changeRecorder
->
setCollectionMonitored
(
Collection
::
root
());
EntityTreeModel
*
model
=
new
EntityTreeModel
(
changeRecorder
,
this
);
auto
*
model
=
new
EntityTreeModel
(
changeRecorder
,
this
);
model
->
setItemPopulationStrategy
(
Akonadi
::
EntityTreeModel
::
LazyPopulation
);
return
model
;
}
...
...
@@ -97,10 +97,10 @@ void FavoriteProxyTest::testReordering()
configGroup
.
writeEntry
(
"FavoriteCollectionLabels"
,
labels
);
configGroup
.
writeEntry
(
"0"
,
order
);
FavoriteCollectionsModel
*
favoriteModel
=
new
FavoriteCollectionsModel
(
model
,
configGroup
,
this
);
auto
*
favoriteModel
=
new
FavoriteCollectionsModel
(
model
,
configGroup
,
this
);
QTRY_COMPARE
(
favoriteModel
->
rowCount
(),
2
);
FavoriteCollectionOrderProxyModel
*
orderProxy
=
new
FavoriteCollectionOrderProxyModel
(
this
);
auto
*
orderProxy
=
new
FavoriteCollectionOrderProxyModel
(
this
);
orderProxy
->
setOrderConfig
(
configGroup
);
orderProxy
->
setSourceModel
(
favoriteModel
);
orderProxy
->
sort
(
0
,
Qt
::
AscendingOrder
);
...
...
autotests/foldertreewidgettest.cpp
View file @
8a857804
...
...
@@ -49,7 +49,7 @@ private Q_SLOTS:
{
AkonadiTest
::
checkTestIsIsolated
();
DummyKernel
*
kernel
=
new
DummyKernel
(
nullptr
);
auto
*
kernel
=
new
DummyKernel
(
nullptr
);
CommonKernel
->
registerKernelIf
(
kernel
);
CommonKernel
->
registerSettingsIf
(
kernel
);
...
...
@@ -106,7 +106,7 @@ private Q_SLOTS:
QSignalSpy
rATBRSpy_TopModel
(
mTopModel
,
&
QAbstractItemModel
::
rowsAboutToBeRemoved
);
// Now delete it
Akonadi
::
CollectionDeleteJob
*
delJob
=
new
Akonadi
::
CollectionDeleteJob
(
searchCol
);
auto
*
delJob
=
new
Akonadi
::
CollectionDeleteJob
(
searchCol
);
AKVERIFYEXEC
(
delJob
);
// Check it disappeared from the tree, as well as the toplevel item
...
...
@@ -142,7 +142,7 @@ private Q_SLOTS:
// Create resources
const
int
numResources
=
numFolders
.
count
();
for
(
int
i
=
1
/*first one already created*/
;
i
<
numResources
;
++
i
)
{
AgentInstanceCreateJob
*
agentCreateJob
=
new
AgentInstanceCreateJob
(
agentType
);
auto
*
agentCreateJob
=
new
AgentInstanceCreateJob
(
agentType
);
AKVERIFYEXEC
(
agentCreateJob
);
const
QString
identifier
=
agentCreateJob
->
instance
().
identifier
();
...
...
@@ -158,7 +158,7 @@ private Q_SLOTS:
Collection
mailCollection
;
mailCollection
.
setParentCollection
(
topLevelCollection
);
mailCollection
.
setName
(
QStringLiteral
(
"mailCollection_%1_%2"
).
arg
(
i
).
arg
(
number
));
CollectionCreateJob
*
collCreateJob
=
new
CollectionCreateJob
(
mailCollection
);
auto
*
collCreateJob
=
new
CollectionCreateJob
(
mailCollection
);
AKVERIFYEXEC
(
collCreateJob
);
}
const
int
resourceRow
=
collectNames
(
mTopModel
).
indexOf
(
"res"
+
QString
::
number
(
i
+
1
));
...
...
@@ -183,7 +183,7 @@ private Q_SLOTS:
Collection
mailCollection
;
mailCollection
.
setParentCollection
(
currentColl
);
mailCollection
.
setName
(
QStringLiteral
(
"sub%1"
).
arg
(
number
+
1
));
CollectionCreateJob
*
collCreateJob
=
new
CollectionCreateJob
(
mailCollection
);
auto
*
collCreateJob
=
new
CollectionCreateJob
(
mailCollection
);
AKVERIFYEXEC
(
collCreateJob
);
currentColl
=
collCreateJob
->
collection
();
}
...
...
@@ -198,7 +198,7 @@ private Q_SLOTS:
QTest
::
qWait
(
100
);
// #### akonadi bug? Without this, a warning "Only resources can modify remote identifiers" appears
// When moving the source folder (sub2) to the dest folder
CollectionMoveJob
*
collMoveJob
=
new
CollectionMoveJob
(
currentColl
,
newParentCollection
);
auto
*
collMoveJob
=
new
CollectionMoveJob
(
currentColl
,
newParentCollection
);
AKVERIFYEXEC
(
collMoveJob
);
// wait for Akonadi::Monitor::collectionMoved
...
...
src/collectionpage/attributes/expirecollectionattribute.cpp
View file @
8a857804
...
...
@@ -25,7 +25,7 @@ QByteArray ExpireCollectionAttribute::type() const
ExpireCollectionAttribute
*
ExpireCollectionAttribute
::
clone
()
const
{
ExpireCollectionAttribute
*
expireAttr
=
new
ExpireCollectionAttribute
();
auto
*
expireAttr
=
new
ExpireCollectionAttribute
();
expireAttr
->
setAutoExpire
(
mExpireMessages
);
expireAttr
->
setUnreadExpireAge
(
mUnreadExpireAge
);
expireAttr
->
setUnreadExpireUnits
(
mUnreadExpireUnits
);
...
...
src/collectionpage/collectionexpiryjob.cpp
View file @
8a857804
...
...
@@ -24,7 +24,7 @@ CollectionExpiryJob::~CollectionExpiryJob()
void
CollectionExpiryJob
::
start
()
{
if
(
mCollection
.
isValid
())
{
Akonadi
::
CollectionModifyJob
*
job
=
new
Akonadi
::
CollectionModifyJob
(
mCollection
,
this
);
auto
*
job
=
new
Akonadi
::
CollectionModifyJob
(
mCollection
,
this
);
connect
(
job
,
&
Akonadi
::
CollectionModifyJob
::
result
,
this
,
&
CollectionExpiryJob
::
slotCollectionModified
);
}
else
{
qCWarning
(
MAILCOMMON_LOG
)
<<
"Collection is not valid"
;
...
...
@@ -52,7 +52,7 @@ void CollectionExpiryJob::slotCollectionModified(KJob *job)
// trigger immediate expiry if there is something to do
if
(
mExpireNow
)
{
Akonadi
::
CollectionModifyJob
*
modifiedJob
=
qobject_cast
<
Akonadi
::
CollectionModifyJob
*>
(
job
);
auto
*
modifiedJob
=
qobject_cast
<
Akonadi
::
CollectionModifyJob
*>
(
job
);
if
(
modifiedJob
)
{
MailCommon
::
Util
::
expireOldMessages
(
modifiedJob
->
collection
(),
true
/*immediate*/
);
}
else
{
...
...
src/collectionpage/collectionexpirypage.cpp
View file @
8a857804
...
...
@@ -38,7 +38,7 @@ bool CollectionExpiryPage::canHandle(const Akonadi::Collection &col) const
void
CollectionExpiryPage
::
init
()
{
QVBoxLayo
ut
*
globalVBox
=
new
QVBoxLayout
(
this
);
a
ut
o
*
globalVBox
=
new
QVBoxLayout
(
this
);
mCollectionExpiryWidget
=
new
CollectionExpiryWidget
(
this
);
connect
(
mCollectionExpiryWidget
,
&
CollectionExpiryWidget
::
saveAndExpireRequested
,
this
,
&
CollectionExpiryPage
::
slotSaveAndExpire
);
connect
(
mCollectionExpiryWidget
,
&
CollectionExpiryWidget
::
configChanged
,
this
,
&
CollectionExpiryPage
::
slotConfigChanged
);
...
...
@@ -56,7 +56,7 @@ void CollectionExpiryPage::load(const Akonadi::Collection &collection)
{
mCollection
=
collection
;
init
();
const
MailCommon
::
ExpireCollectionAttribute
*
attr
=
collection
.
attribute
<
MailCommon
::
ExpireCollectionAttribute
>
();
const
auto
*
attr
=
collection
.
attribute
<
MailCommon
::
ExpireCollectionAttribute
>
();
if
(
attr
)
{
int
daysToExpireRead
,
daysToExpireUnread
;
attr
->
daysToExpire
(
daysToExpireUnread
,
daysToExpireRead
);
...
...
src/collectionpage/collectionexpirywidget.cpp
View file @
8a857804
...
...
@@ -28,10 +28,10 @@ using namespace MailCommon;
CollectionExpiryWidget
::
CollectionExpiryWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
)
{
QVBoxLayo
ut
*
globalVBox
=
new
QVBoxLayout
(
this
);
a
ut
o
*
globalVBox
=
new
QVBoxLayout
(
this
);
globalVBox
->
setContentsMargins
({});
QGridLayo
ut
*
daysBox
=
new
QGridLayout
;
a
ut
o
*
daysBox
=
new
QGridLayout
;
mExpireReadMailCB
=
new
QCheckBox
(
i18n
(
"Expire read messages after"
),
this
);
connect
(
mExpireReadMailCB
,
&
QCheckBox
::
toggled
,
this
,
&
CollectionExpiryWidget
::
slotUpdateControls
);
...
...
@@ -64,11 +64,11 @@ CollectionExpiryWidget::CollectionExpiryWidget(QWidget *parent)
globalVBox
->
addSpacing
(
30
);
QGroupBox
*
actionsGroup
=
new
QGroupBox
(
this
);
auto
*
actionsGroup
=
new
QGroupBox
(
this
);
actionsGroup
->
setFlat
(
true
);
// for mutual exclusion of the radio buttons
globalVBox
->
addWidget
(
actionsGroup
);
QHBoxLayo
ut
*
moveToHBox
=
new
QHBoxLayout
();
a
ut
o
*
moveToHBox
=
new
QHBoxLayout
();
moveToHBox
->
setContentsMargins
(
0
,
0
,
0
,
0
);
moveToHBox
->
setSpacing
(
6
);
...
...
@@ -233,7 +233,7 @@ void CollectionExpiryWidget::save(const CollectionExpirySettings &collectionExpi
attribute
->
setExpireAction
(
collectionExpirySettings
.
mExpireAction
);
if
(
saveSettings
)
{
CollectionExpiryJob
*
job
=
new
CollectionExpiryJob
;
auto
*
job
=
new
CollectionExpiryJob
;
job
->
setExpireNow
(
expireNow
);
job
->
setCollection
(
collection
);
job
->
start
();
...
...
src/collectionpage/collectiongeneralpage.cpp
View file @
8a857804
...
...
@@ -58,12 +58,12 @@ void CollectionGeneralPage::init(const Akonadi::Collection &collection)
mIsResourceFolder
=
(
collection
.
parentCollection
()
==
Akonadi
::
Collection
::
root
());
QLabel
*
label
=
nullptr
;
QVBoxLayo
ut
*
topLayout
=
new
QVBoxLayout
(
this
);
a
ut
o
*
topLayout
=
new
QVBoxLayout
(
this
);
// Musn't be able to edit details for a non-resource, system folder.
if
((
!
mIsLocalSystemFolder
||
mIsResourceFolder
)
&&
!
mFolderCollection
->
isReadOnly
())
{
QHBoxLayo
ut
*
hl
=
new
QHBoxLayout
();
a
ut
o
*
hl
=
new
QHBoxLayout
();
topLayout
->
addItem
(
hl
);
label
=
new
QLabel
(
i18nc
(
"@label:textbox Name of the folder."
,
"&Name:"
),
this
);
hl
->
addWidget
(
label
);
...
...
@@ -84,7 +84,7 @@ void CollectionGeneralPage::init(const Akonadi::Collection &collection)
if
(
CommonKernel
->
imapResourceManager
()
->
hasAnnotationSupport
(
collectionResource
))
{
PimCommon
::
CollectionTypeUtil
::
FolderContentsType
contentsType
=
PimCommon
::
CollectionTypeUtil
::
ContentsTypeMail
;
const
PimCommon
::
CollectionAnnotationsAttribute
*
annotationAttribute
const
auto
*
annotationAttribute
=
collection
.
attribute
<
PimCommon
::
CollectionAnnotationsAttribute
>
();
const
QMap
<
QByteArray
,
QByteArray
>
annotations
...
...
@@ -101,7 +101,7 @@ void CollectionGeneralPage::init(const Akonadi::Collection &collection)
const
PimCommon
::
CollectionTypeUtil
::
FolderContentsType
folderType
=
collectionUtil
.
typeFromKolabName
(
annotations
.
value
(
PimCommon
::
CollectionTypeUtil
::
kolabFolderType
()));
int
row
=
0
;
QGridLayo
ut
*
gl
=
new
QGridLayout
();
a
ut
o
*
gl
=
new
QGridLayout
();
topLayout
->
addItem
(
gl
);
mContentsComboBox
=
new
PimCommon
::
ContentTypeWidget
(
this
);
gl
->
addWidget
(
mContentsComboBox
,
row
,
0
,
1
,
2
);
...
...
@@ -154,7 +154,7 @@ void CollectionGeneralPage::load(const Akonadi::Collection &collection)
}
if
(
mContentsComboBox
)
{
const
PimCommon
::
CollectionAnnotationsAttribute
*
annotationsAttribute
const
auto
*
annotationsAttribute
=
collection
.
attribute
<
PimCommon
::
CollectionAnnotationsAttribute
>
();
if
(
annotationsAttribute
)
{
...
...
@@ -196,7 +196,7 @@ void CollectionGeneralPage::save(Collection &collection)
}
mCollectionGeneralWidget
->
save
(
collection
);
PimCommon
::
CollectionAnnotationsAttribute
*
annotationsAttribute
auto
*
annotationsAttribute
=
collection
.
attribute
<
PimCommon
::
CollectionAnnotationsAttribute
>
(
Collection
::
AddIfMissing
);
QMap
<
QByteArray
,
QByteArray
>
annotations
=
annotationsAttribute
->
annotations
();
...
...
@@ -218,7 +218,7 @@ void CollectionGeneralPage::save(Collection &collection)
const
QByteArray
kolabName
=
collectionUtil
.
kolabNameFromType
(
type
);
if
(
!
kolabName
.
isEmpty
())
{
const
QString
iconName
=
collectionUtil
.
iconNameFromContentsType
(
type
);
Akonadi
::
EntityDisplayAttrib
ut
e
*
attribute
a
ut
o
*
attribute
=
collection
.
attribute
<
Akonadi
::
EntityDisplayAttribute
>
(
Akonadi
::
Collection
::
AddIfMissing
);
attribute
->
setIconName
(
iconName
);
new
Akonadi
::
CollectionModifyJob
(
collection
);
...
...
src/collectionpage/collectiongeneralwidget.cpp
View file @
8a857804
...
...
@@ -20,11 +20,11 @@ using namespace MailCommon;
CollectionGeneralWidget
::
CollectionGeneralWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
)
{
QVBoxLayo
ut
*
topLayout
=
new
QVBoxLayout
(
this
);
a
ut
o
*
topLayout
=
new
QVBoxLayout
(
this
);
topLayout
->
setObjectName
(
QStringLiteral
(
"topLayout"
));
topLayout
->
setContentsMargins
({});
// should new mail in this folder be ignored?
QHBoxLayo
ut
*
hbl
=
new
QHBoxLayout
();
a
ut
o
*
hbl
=
new
QHBoxLayout
();
topLayout
->
addItem
(
hbl
);
mNotifyOnNewMailCheckBox
=
new
QCheckBox
(
i18n
(
"Act on new/unread mail in this folder"
),
this
);
...
...
@@ -65,7 +65,7 @@ CollectionGeneralWidget::CollectionGeneralWidget(QWidget *parent)
addLine
(
this
,
topLayout
);
// use grid layout for the following combobox settings
QGridLayo
ut
*
gl
=
new
QGridLayout
();
a
ut
o
*
gl
=
new
QGridLayout
();
topLayout
->
addItem
(
gl
);
gl
->
setColumnStretch
(
1
,
100
);
// make the second column use all available space
int
row
=
-
1
;
...
...
@@ -118,7 +118,7 @@ void CollectionGeneralWidget::save(Akonadi::Collection &collection)
mFolderCollection
=
FolderSettings
::
forCollection
(
collection
);
}
if
(
!
mNotifyOnNewMailCheckBox
->
isChecked
())
{
Akonadi
::
NewMailNotifierAttrib
ut
e
*
newMailNotifierAttr
=
collection
.
attribute
<
Akonadi
::
NewMailNotifierAttribute
>
(
Akonadi
::
Collection
::
AddIfMissing
);
a
ut
o
*
newMailNotifierAttr
=
collection
.
attribute
<
Akonadi
::
NewMailNotifierAttribute
>
(
Akonadi
::
Collection
::
AddIfMissing
);
newMailNotifierAttr
->
setIgnoreNewMail
(
true
);
}
else
{
collection
.
removeAttribute
<
Akonadi
::
NewMailNotifierAttribute
>
();
...
...
src/collectionpage/collectiontemplateswidget.cpp
View file @
8a857804
...
...
@@ -18,8 +18,8 @@ using namespace MailCommon;
CollectionTemplatesWidget
::
CollectionTemplatesWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
)
{
QVBoxLayo
ut
*
topLayout
=
new
QVBoxLayout
(
this
);
QHBoxLayo
ut
*
topItems
=
new
QHBoxLayout
;
a
ut
o
*
topLayout
=
new
QVBoxLayout
(
this
);
a
ut
o
*
topItems
=
new
QHBoxLayout
;
topItems
->
setContentsMargins
(
0
,
0
,
0
,
0
);
topLayout
->
addLayout
(
topItems
);
...
...
@@ -38,7 +38,7 @@ CollectionTemplatesWidget::CollectionTemplatesWidget(QWidget *parent)
topLayout
->
addWidget
(
mWidget
);
QHBoxLayo
ut
*
btns
=
new
QHBoxLayout
();
a
ut
o
*
btns
=
new
QHBoxLayout
();
QPushButton
*
copyGlobal
=
new
QPushButton
(
i18n
(
"&Copy Global Templates"
),
this
);
copyGlobal
->
setEnabled
(
false
);
btns
->
addWidget
(
copyGlobal
);
...
...
src/collectionpage/collectionviewwidget.cpp
View file @
8a857804
...
...
@@ -26,7 +26,7 @@ using namespace MailCommon;
CollectionViewWidget
::
CollectionViewWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
)
{
QVBoxLayo
ut
*
topLayout
=
new
QVBoxLayout
(
this
);
a
ut
o
*
topLayout
=
new
QVBoxLayout
(
this
);
topLayout
->
setObjectName
(
QStringLiteral
(
"topLayout"
));
topLayout
->
setContentsMargins
({});
...
...
@@ -41,14 +41,14 @@ CollectionViewWidget::CollectionViewWidget(QWidget *parent)
mShowSenderReceiverComboBox
->
insertItem
(
1
,
i18nc
(
"@item:inlistbox Show sender."
,
"Sender"
));
mShowSenderReceiverComboBox
->
insertItem
(
2
,
i18nc
(
"@item:inlistbox Show receiver."
,
"Receiver"
));
QHBoxLayo
ut
*
senderReceiverColumnHLayout
=
new
QHBoxLayout
();
a
ut
o
*
senderReceiverColumnHLayout
=
new
QHBoxLayout
();
senderReceiverColumnHLayout
->
addWidget
(
senderReceiverColumnLabel
);
senderReceiverColumnHLayout
->
addWidget
(
mShowSenderReceiverComboBox
);
topLayout
->
addLayout
(
senderReceiverColumnHLayout
);
// message list
QGroupBox
*
messageListGroup
=
new
QGroupBox
(
i18n
(
"Message List"
),
this
);
QVBoxLayo
ut
*
messageListGroupLayout
=
new
QVBoxLayout
(
messageListGroup
);
a
ut
o
*
messageListGroupLayout
=
new
QVBoxLayout
(
messageListGroup
);
topLayout
->
addWidget
(
messageListGroup
);
// message list aggregation
...
...
@@ -62,11 +62,11 @@ CollectionViewWidget::CollectionViewWidget(QWidget *parent)
aggregationLabel
->
setBuddy
(
mAggregationComboBox
);
using
MessageList
::
Utils
::
AggregationConfigButton
;
AggregationConfigButton
*
aggregationConfigButton
=
new
AggregationConfigButton
(
messageListGroup
,
mAggregationComboBox
);
auto
*
aggregationConfigButton
=
new
AggregationConfigButton
(
messageListGroup
,
mAggregationComboBox
);
// Make sure any changes made in the aggregations configure dialog are reflected in the combo.
connect
(
aggregationConfigButton
,
&
AggregationConfigButton
::
configureDialogCompleted
,
this
,
&
CollectionViewWidget
::
slotSelectFolderAggregation
);
QHBoxLayo
ut
*
aggregationLayout
=
new
QHBoxLayout
();
a
ut
o
*
aggregationLayout
=
new
QHBoxLayout
();
aggregationLayout
->
addWidget
(
aggregationLabel
,
1
);
aggregationLayout
->
addWidget
(
mAggregationComboBox
,
1
);
aggregationLayout
->
addWidget
(
aggregationConfigButton
,
0
);
...
...
@@ -83,11 +83,11 @@ CollectionViewWidget::CollectionViewWidget(QWidget *parent)
themeLabel
->
setBuddy
(
mThemeComboBox
);
using
MessageList
::
Utils
::
ThemeConfigButton
;
ThemeConfigBut
to
n
*
themeConfigButton
=
new
ThemeConfigButton
(
messageListGroup
,
mThemeComboBox
);
au
to
*
themeConfigButton
=
new
ThemeConfigButton
(
messageListGroup
,
mThemeComboBox
);
// Make sure any changes made in the themes configure dialog are reflected in the combo.
connect
(
themeConfigButton
,
&
ThemeConfigButton
::
configureDialogCompleted
,
this
,
&
CollectionViewWidget
::
slotSelectFolderTheme
);
QHBoxLayo
ut
*
themeLayout
=
new
QHBoxLayout
();
a
ut
o
*
themeLayout
=
new
QHBoxLayout
();
themeLayout
->
addWidget
(
themeLabel
,
1
);
themeLayout
->
addWidget
(
mThemeComboBox
,
1
);
themeLayout
->
addWidget
(
themeConfigButton
,
0
);
...
...
@@ -95,7 +95,7 @@ CollectionViewWidget::CollectionViewWidget(QWidget *parent)
// Message Default Format
QGroupBox
*
messageFormatGroup
=
new
QGroupBox
(
i18n
(
"Message Default Format"
),
this
);
QVBoxLayo
ut
*
messageFormatGroupLayout
=
new
QVBoxLayout
(
messageFormatGroup
);
a
ut
o
*
messageFormatGroupLayout
=
new
QVBoxLayout
(
messageFormatGroup
);
mPreferHtmlToText
=
new
QRadioButton
(
i18n
(
"Prefer HTML to text"
),
this
);
messageFormatGroupLayout
->
addWidget
(
mPreferHtmlToText
);
mPreferTextToHtml
=
new
QRadioButton
(
i18n
(
"Prefer text to HTML"
),
this
);
...
...
@@ -158,10 +158,10 @@ void CollectionViewWidget::save(Akonadi::Collection &col)
const
int
currentIndex
=
mShowSenderReceiverComboBox
->
currentIndex
();
if
(
mShowSenderReceiverValue
!=
currentIndex
)
{
if
(
currentIndex
==
1
)
{
Akonadi
::
MessageFolderAttrib
ut
e
*
messageFolder
=
col
.
attribute
<
Akonadi
::
MessageFolderAttribute
>
(
Akonadi
::
Collection
::
AddIfMissing
);
a
ut
o
*
messageFolder
=
col
.
attribute
<
Akonadi
::
MessageFolderAttribute
>
(
Akonadi
::
Collection
::
AddIfMissing
);
messageFolder
->
setOutboundFolder
(
false
);
}
else
if
(
currentIndex
==
2
)
{
Akonadi
::
MessageFolderAttrib
ut
e
*
messageFolder
=
col
.
attribute
<
Akonadi
::
MessageFolderAttribute
>
(
Akonadi
::
Collection
::
AddIfMissing
);
a
ut
o
*
messageFolder
=
col
.
attribute
<
Akonadi
::
MessageFolderAttribute
>
(
Akonadi
::
Collection
::
AddIfMissing
);
messageFolder
->
setOutboundFolder
(
true
);
}
else
{
col
.
removeAttribute
<
Akonadi
::
MessageFolderAttribute
>
();
...
...
src/filter/autotests/filteractionaddheadertest.cpp
View file @
8a857804
...
...
@@ -30,9 +30,9 @@ void FilterActionAddHeaderTest::shouldCreateWidget()
auto
comboBox
=
widget
->
findChild
<
QComboBox
*>
(
QStringLiteral
(
"combo"
));
QVERIFY
(
comboBox
);
QVERIFY
(
comboBox
->
isEditable
());
QLabel
*
label
=
widget
->
findChild
<
QLabel
*>
(
QStringLiteral
(
"label_value"
));
auto
*
label
=
widget
->
findChild
<
QLabel
*>
(
QStringLiteral
(
"label_value"
));
QVERIFY
(
label
);
KLineEdit
*
lineEdit
=
widget
->
findChild
<
KLineEdit
*>
(
QStringLiteral
(
"ledit"
));
auto
*
lineEdit
=
widget
->
findChild
<
KLineEdit
*>
(
QStringLiteral
(
"ledit"
));
QVERIFY
(
lineEdit
);
QVERIFY
(
lineEdit
->
text
().
isEmpty
());
}
...
...
@@ -52,7 +52,7 @@ void FilterActionAddHeaderTest::shouldClearWidget()
MailCommon
::
FilterActionAddHeader
filter
;
QWidget
*
widget
=
filter
.
createParamWidget
(
nullptr
);
auto
comboBox
=
widget
->
findChild
<
QComboBox
*>
(
QStringLiteral
(
"combo"
));
KLineEdit
*
lineEdit
=
widget
->
findChild
<
KLineEdit
*>
(
QStringLiteral
(
"ledit"
));
auto
*
lineEdit
=
widget
->
findChild
<
KLineEdit
*>
(
QStringLiteral
(
"ledit"
));
comboBox
->
lineEdit
()
->
setText
(
QStringLiteral
(
"test"
));
lineEdit
->
setText
(
QStringLiteral
(
"blo"
));
filter
.
clearParamWidget
(
widget
);
...
...
@@ -188,7 +188,7 @@ void FilterActionAddHeaderTest::shouldAddValue()
filter
.
argsFromString
(
argsinput
);
filter
.
setParamWidgetValue
(
widget
);
auto
comboBox
=
widget
->
findChild
<
QComboBox
*>
(
QStringLiteral
(
"combo"
));
KLineEdit
*
lineEdit
=
widget
->
findChild
<
KLineEdit
*>
(
QStringLiteral
(
"ledit"
));
auto
*
lineEdit
=
widget
->
findChild
<
KLineEdit
*>
(
QStringLiteral
(
"ledit"
));
QCOMPARE
(
comboBox
->
lineEdit
()
->
text
(),
resultheader
);
QCOMPARE
(
lineEdit
->
text
(),
resultvalue
);
}
...
...
src/filter/autotests/filteractionaddtoaddressbooktest.cpp
View file @
8a857804
...
...
@@ -31,7 +31,7 @@ void FilterActionAddToAddressBookTest::shouldHaveDefaultValue()
auto
headerCombo
=
w
->
findChild
<
QComboBox
*>
(
QStringLiteral
(
"HeaderComboBox"
));
QVERIFY
(
headerCombo
);
QLabel
*
label
=
w
->
findChild
<
QLabel
*>
(
QStringLiteral
(
"label_with_category"
));
auto
*
label
=
w
->
findChild
<
QLabel
*>
(
QStringLiteral
(
"label_with_category"
));
QVERIFY
(
label
);
auto
categoryEdit
=
w
->
findChild
<
Akonadi
::
TagWidget
*>
(
QStringLiteral
(
"CategoryEdit"
));
...
...
@@ -40,7 +40,7 @@ void FilterActionAddToAddressBookTest::shouldHaveDefaultValue()
label
=
w
->
findChild
<
QLabel
*>
(
QStringLiteral
(
"label_in_addressbook"
));
QVERIFY
(
label
);
Akonadi
::
CollectionComboBox
*
collectionComboBox
=
w
->
findChild
<
Akonadi
::
CollectionComboBox
*>
(
QStringLiteral
(
"AddressBookComboBox"
));
auto
*
collectionComboBox
=
w
->
findChild
<
Akonadi
::
CollectionComboBox
*>
(
QStringLiteral
(
"AddressBookComboBox"
));
QVERIFY
(
collectionComboBox
);
}
...
...
src/filter/autotests/filteractiondeletetest.cpp
View file @
8a857804
...
...
@@ -23,7 +23,7 @@ void FilterActionDeleteTest::shouldHaveDefaultValue()
QWidget
*
w
=
filter
.
createParamWidget
(
nullptr
);
QVERIFY
(
w
);
QLabel
*
lab
=
dynamic_cast
<
QLabel
*>
(
w
);
auto
*
lab
=
dynamic_cast
<
QLabel
*>
(
w
);
QVERIFY
(
lab
);
QCOMPARE
(
lab
->
objectName
(),
QStringLiteral
(
"label_delete"
));
}
...
...
src/filter/autotests/filteractionexectest.cpp
View file @
8a857804
...
...
@@ -24,10 +24,10 @@ void FilterActionExecTest::shouldHaveDefaultValue()
{
MailCommon
::
FilterActionExec
filter
;
QWidget
*
w
=
filter
.
createParamWidget
(
nullptr
);
KUrlRequester
*
requester
=
w
->
findChild
<
KUrlRequester
*>
(
QStringLiteral
(
"requester"
));
auto
*
requester
=
w
->
findChild
<
KUrlRequester
*>
(
QStringLiteral
(
"requester"
));
QVERIFY
(
requester
);
MailCommon
::
FilterActionWithUrlHelpButton
*
helpButton
=
w
->
findChild
<
MailCommon
::
FilterActionWithUrlHelpButton
*>
(
QStringLiteral
(
"helpbutton"
));
auto
*
helpButton
=
w
->
findChild
<
MailCommon
::
FilterActionWithUrlHelpButton
*>
(
QStringLiteral
(
"helpbutton"
));
QVERIFY
(
helpButton
);
}
...
...
src/filter/autotests/filteractionmissingaccountdialogtest.cpp
View file @
8a857804
...
...
@@ -28,14 +28,14 @@ void FilterActionMissingAccountDialogTest::shouldHaveDefaultValue()
QVERIFY
(
!
dlg
.
windowTitle
().
isEmpty
());
QVERIFY
(
dlg
.
isModal
());
QDialogButtonBox
*
buttonBox
=
dlg
.
findChild
<
QDialogButtonBox
*>
(
QStringLiteral
(
"buttonbox"
));
auto
*
buttonBox
=
dlg
.
findChild
<
QDialogButtonBox
*>
(
QStringLiteral
(
"buttonbox"
));
QVERIFY
(
buttonBox
);
QLabel
*
label
=
dlg
.
findChild
<
QLabel
*>
(
QStringLiteral
(
"label"
));
auto
*
label
=
dlg
.
findChild
<
QLabel
*>
(
QStringLiteral
(
"label"
));
QVERIFY
(
label
);
QVERIFY
(
!
label
->
text
().
isEmpty
());
MailCommon
::
KMFilterAccountList
*
mAccountList
=
dlg
.
findChild
<
MailCommon
::
KMFilterAccountList
*>
(
QStringLiteral
(
"accountlist"
));
auto
*
mAccountList
=
dlg
.
findChild
<
MailCommon
::
KMFilterAccountList
*>
(
QStringLiteral
(
"accountlist"
));
QVERIFY
(
mAccountList
);
}
...
...
src/filter/autotests/filteractionmissingidentitydialogtest.cpp
View file @
8a857804
...
...
@@ -26,7 +26,7 @@ FilterActionMissingIdentityDialogTest::~FilterActionMissingIdentityDialogTest()
void
FilterActionMissingIdentityDialogTest
::
initTestCase
()
{
DummyKernel
*
kernel
=
new
DummyKernel
(
nullptr
);
auto
*
kernel
=
new
DummyKernel
(
nullptr
);
CommonKernel
->
registerKernelIf
(
kernel
);
//register KernelIf early, it is used by the Filter classes
CommonKernel
->
registerSettingsIf
(
kernel
);
//SettingsIf is used in FolderTreeWidget
}
...
...
@@ -37,14 +37,14 @@ void FilterActionMissingIdentityDialogTest::shouldHaveDefaultValue()
QVERIFY
(
dlg
.
isModal
());
QVERIFY
(
!
dlg
.
windowTitle
().
isEmpty
());
QLabel
*
label
=
dlg
.
findChild
<
QLabel
*>
(
QStringLiteral
(
"label"
));
auto
*
label
=
dlg
.
findChild
<
QLabel
*>
(
QStringLiteral
(
"label"
));
QVERIFY
(
label
);
QVERIFY
(
!
label
->
text
().
isEmpty
());
KIdentityManagement
::
IdentityComb
o
*
mComboBoxIdentity
=
dlg
.
findChild
<
KIdentityManagement
::
IdentityCombo
*>
(
QStringLiteral
(
"comboboxidentity"
));
aut
o
*
mComboBoxIdentity
=
dlg
.
findChild
<
KIdentityManagement
::
IdentityCombo
*>
(
QStringLiteral
(
"comboboxidentity"
));
QVERIFY
(
mComboBoxIdentity
);
QDialogButtonBox
*
buttonBox
=
dlg
.
findChild
<
QDialogButtonBox
*>
(
QStringLiteral
(
"buttonbox"
));
auto
*
buttonBox
=
dlg
.
findChild
<
QDialogButtonBox
*>
(
QStringLiteral
(
"buttonbox"
));
QVERIFY
(
buttonBox
);
}
...
...
src/filter/autotests/filteractionmissingsoundurldialogtest.cpp
View file @
8a857804
...
...
@@ -27,10 +27,10 @@ void FilterActionMissingSoundUrlDialogTest::shouldHaveDefaultValue()
MailCommon
::
FilterActionMissingSoundUrlDialog
dlg
(
QStringLiteral
(
"filename"
),
QStringLiteral
(
"arg"
));
QVERIFY
(
!
dlg
.
windowTitle
().
isEmpty
());
QDialogButtonBox
*
buttonBox
=
dlg
.
findChild
<
QDialogButtonBox
*>
(
QStringLiteral
(
"buttonbox"
));
auto
*
buttonBox
=
dlg
.
findChild
<
QDialogButtonBox
*>
(
QStringLiteral
(
"buttonbox"
));
QVERIFY
(
buttonBox
);
QLabel
*
label
=
dlg
.
findChild
<
QLabel
*>
(
QStringLiteral
(
"oldlabel"
));
auto
*
label
=
dlg
.
findChild
<
QLabel
*>
(
QStringLiteral
(
"oldlabel"
));
QVERIFY
(
label
);
QVERIFY
(
!
label
->
text
().
isEmpty
());
...
...
@@ -38,7 +38,7 @@ void FilterActionMissingSoundUrlDialogTest::shouldHaveDefaultValue()
QVERIFY
(
label
);
QVERIFY
(
!
label
->
text
().
isEmpty
());
KUrlRequester
*
mUrlWidget
=
dlg
.
findChild
<
KUrlRequester
*>
(
QStringLiteral
(
"urlwidget"
));
auto
*
mUrlWidget
=
dlg
.
findChild
<
KUrlRequester
*>
(
QStringLiteral
(
"urlwidget"
));
QVERIFY
(
mUrlWidget
);
}
...
...
src/filter/autotests/filteractionmissingtagdialogtest.cpp
View file @
8a857804
...
...
@@ -30,7 +30,7 @@ void FilterActionMissingTagDialogTest::shouldHaveDefaultValue()
QVERIFY
(
dlg
.
isModal
());
QVERIFY
(
!
dlg
.
windowTitle
().
isEmpty
());
QLabel
*
label
=
dlg
.
findChild
<
QLabel
*>
(
QStringLiteral
(
"tagnamelabel"
));
auto
*
label
=
dlg
.
findChild
<
QLabel
*>
(
QStringLiteral
(
"tagnamelabel"
));
QVERIFY
(
label
);
QVERIFY
(
!
label
->
text
().
isEmpty
());
...
...
@@ -38,13 +38,13 @@ void FilterActionMissingTagDialogTest::shouldHaveDefaultValue()
QVERIFY
(
label
);
QVERIFY
(
!
label
->
text
().
isEmpty
());
QListWidget
*
mTagList
=
dlg
.
findChild
<
QListWidget
*>
(
QStringLiteral
(
"taglist"
));
auto
*
mTagList
=
dlg
.
findChild
<
QListWidget
*>
(
QStringLiteral
(
"taglist"
));
QVERIFY
(
mTagList
);
QDialogButtonBox
*
buttonBox
=
dlg
.
findChild
<
QDialogButtonBox
*>
(
QStringLiteral
(
"buttonbox"
));
auto
*
buttonBox
=
dlg
.
findChild
<
QDialogButtonBox
*>
(
QStringLiteral
(
"buttonbox"
));
QVERIFY
(
buttonBox
);
QPushBut
to
n
*
user1Button
=
dlg
.
findChild
<
QPushButton
*>
(
QStringLiteral
(
"addtag"
));
au
to
*
user1Button
=
dlg
.
findChild
<
QPushButton
*>
(
QStringLiteral
(
"addtag"
));
QVERIFY
(
user1Button
);
QVERIFY
(
!
user1Button
->
text
().
isEmpty
());
}
...
...
src/filter/autotests/filteractionmissingtemplatedialogtest.cpp
View file @
8a857804
...
...
@@ -27,14 +27,14 @@ void FilterActionMissingTemplateDialogTest::shouldHaveDefaultValue()
MailCommon
::
FilterActionMissingTemplateDialog
dlg
(
QStringList
(),
QStringLiteral
(
"filename"
));
QVERIFY
(
!
dlg
.
windowTitle
().
isEmpty
());
QDialogButtonBox
*
buttonBox
=
dlg
.
findChild
<
QDialogButtonBox
*>
(
QStringLiteral
(
"buttonbox"
));
auto
*
buttonBox
=
dlg
.
findChild
<
QDialogButtonBox
*>
(
QStringLiteral
(
"buttonbox"
));
QVERIFY
(
buttonBox
);
QLabel
*
label
=
dlg
.
findChild
<
QLabel
*>
(
QStringLiteral
(
"label"
));
auto
*
label
=
dlg
.
findChild
<
QLabel
*>
(
QStringLiteral
(
"label"
));
QVERIFY
(
label
);
QVERIFY
(
!
label
->
text
().
isEmpty
());
QComboBox
*
mComboBoxTemplate
=
dlg
.
findChild
<
QComboBox
*>
(
QStringLiteral
(
"comboboxtemplate"
));
auto
*
mComboBoxTemplate
=
dlg
.
findChild
<
QComboBox
*>
(
QStringLiteral
(
"comboboxtemplate"
));
QVERIFY
(
mComboBoxTemplate
);
}
...
...
src/filter/autotests/filteractionmissingtransportdialogtest.cpp
View file @
8a857804
...
...
@@ -29,13 +29,13 @@ void FilterActionMissingTransportDialogTest::shouldHaveDefaultValue()
MailCommon
::
FilterActionMissingTransportDialog
dlg
(
QStringLiteral
(
"filename"
));
QVERIFY
(
!
dlg
.
windowTitle
().
isEmpty
());
QVERIFY
(
dlg
.
isModal
());
QDialogButtonBox
*
buttonBox
=
dlg
.
findChild
<
QDialogButtonBox
*>
(
QStringLiteral
(
"buttonbox"
));
auto
*
buttonBox
=
dlg
.
findChild
<
QDialogButtonBox
*>
(
QStringLiteral
(
"buttonbox"
));
QVERIFY
(
buttonBox
);
QLabel
*
label
=
dlg
.
findChild
<
QLabel
*>
(
QStringLiteral
(
"label"
));
auto
*
label
=
dlg
.
findChild
<
QLabel
*>
(
QStringLiteral
(
"label"
));
QVERIFY
(
label
);
QVERIFY
(
!
label
->
text
().
isEmpty
());
MailTransport
::
TransportComboBox
*
mComboBoxTransport
=
dlg
.
findChild
<
MailTransport
::
TransportComboBox
*>
(
QStringLiteral
(
"comboboxtransport"
));
auto
*
mComboBoxTransport
=
dlg
.
findChild
<
MailTransport
::
TransportComboBox
*>
(
QStringLiteral
(
"comboboxtransport"
));
QVERIFY
(
mComboBoxTransport
);
}
...
...
Prev
1
2
3
4
5
…
7
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