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 IncidenceEditor
Commits
04c2e4ef
Commit
04c2e4ef
authored
Nov 03, 2020
by
Laurent Montel
😁
Browse files
Modernize code (using auto)
parent
701db76d
Pipeline
#39368
passed with stage
in 13 minutes and 23 seconds
Changes
29
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
autotests/testfreebusyganttproxymodel.cpp
View file @
04c2e4ef
...
...
@@ -29,8 +29,8 @@ void FreeBusyGanttProxyModelTest::initTestCase()
void
FreeBusyGanttProxyModelTest
::
testModelValidity
()
{
CalendarSupport
::
FreeBusyItemModel
*
fbModel
=
new
CalendarSupport
::
FreeBusyItemModel
();
FreeBusyGanttProxyModel
*
ganttModel
=
new
FreeBusyGanttProxyModel
();
auto
*
fbModel
=
new
CalendarSupport
::
FreeBusyItemModel
();
auto
*
ganttModel
=
new
FreeBusyGanttProxyModel
();
ganttModel
->
setSourceModel
(
fbModel
);
auto
*
modelTest
=
new
QAbstractItemModelTester
(
ganttModel
);
...
...
src/alarmdialog.cpp
View file @
04c2e4ef
...
...
@@ -23,7 +23,7 @@ AlarmDialog::AlarmDialog(KCalendarCore::Incidence::IncidenceType incidenceType,
,
mIncidenceType
(
incidenceType
)
{
setWindowTitle
(
i18nc
(
"@title:window"
,
"Create a new reminder"
));
QVBoxLayo
ut
*
mainLayout
=
new
QVBoxLayout
(
this
);
a
ut
o
*
mainLayout
=
new
QVBoxLayout
(
this
);
QDialogButtonBox
*
buttonBox
=
new
QDialogButtonBox
(
QDialogButtonBox
::
Ok
|
QDialogButtonBox
::
Cancel
,
this
);
QPushButton
*
okButton
=
buttonBox
->
button
(
QDialogButtonBox
::
Ok
);
...
...
src/attachmenteditdialog.cpp
View file @
04c2e4ef
...
...
@@ -38,7 +38,7 @@ AttachmentEditDialog::AttachmentEditDialog(AttachmentIconItem *item, QWidget *pa
QMimeDatabase
db
;
mMimeType
=
db
.
mimeTypeForName
(
item
->
mimeType
());
QWidget
*
page
=
new
QWidget
(
this
);
QVBoxLayo
ut
*
mainLayout
=
new
QVBoxLayout
(
this
);
a
ut
o
*
mainLayout
=
new
QVBoxLayout
(
this
);
QDialogButtonBox
*
buttonBox
=
new
QDialogButtonBox
(
QDialogButtonBox
::
Ok
|
QDialogButtonBox
::
Cancel
,
this
);
mOkButton
=
buttonBox
->
button
(
QDialogButtonBox
::
Ok
);
...
...
src/attachmenticonview.cpp
View file @
04c2e4ef
...
...
@@ -200,7 +200,7 @@ QMimeData *AttachmentIconView::mimeData(const QList< QListWidgetItem *> items) c
QStringList
labels
;
for
(
QListWidgetItem
*
it
:
items
)
{
if
(
it
->
isSelected
())
{
AttachmentIconItem
*
item
=
static_cast
<
AttachmentIconItem
*>
(
it
);
auto
*
item
=
static_cast
<
AttachmentIconItem
*>
(
it
);
if
(
item
->
isBinary
())
{
urls
.
append
(
item
->
tempFileForAttachment
());
}
else
{
...
...
@@ -210,7 +210,7 @@ QMimeData *AttachmentIconView::mimeData(const QList< QListWidgetItem *> items) c
}
}
if
(
selectionMode
()
==
NoSelection
)
{
AttachmentIconItem
*
item
=
static_cast
<
AttachmentIconItem
*>
(
currentItem
());
auto
*
item
=
static_cast
<
AttachmentIconItem
*>
(
currentItem
());
if
(
item
)
{
urls
.
append
(
QUrl
(
item
->
uri
()));
labels
.
append
(
QString
::
fromLatin1
(
QUrl
::
toPercentEncoding
(
item
->
label
())));
...
...
@@ -220,7 +220,7 @@ QMimeData *AttachmentIconView::mimeData(const QList< QListWidgetItem *> items) c
QMap
<
QString
,
QString
>
metadata
;
metadata
[
QStringLiteral
(
"labels"
)]
=
labels
.
join
(
QLatin1Char
(
':'
));
QMimeData
*
mimeData
=
new
QMimeData
;
auto
*
mimeData
=
new
QMimeData
;
mimeData
->
setUrls
(
urls
);
KUrlMimeData
::
setMetaData
(
metadata
,
mimeData
);
return
mimeData
;
...
...
@@ -246,7 +246,7 @@ void AttachmentIconView::startDrag(Qt::DropActions supportedActions)
const
QPoint
hotspot
(
pixmap
.
width
()
/
2
,
pixmap
.
height
()
/
2
);
QDrag
*
drag
=
new
QDrag
(
this
);
auto
*
drag
=
new
QDrag
(
this
);
drag
->
setMimeData
(
mimeData
());
drag
->
setPixmap
(
pixmap
);
...
...
src/attendeecomboboxdelegate.cpp
View file @
04c2e4ef
...
...
@@ -54,7 +54,7 @@ void AttendeeComboBoxDelegate::setStandardIndex(int index)
QWidget
*
AttendeeComboBoxDelegate
::
createEditor
(
QWidget
*
parent
,
const
QStyleOptionViewItem
&
/* option */
,
const
QModelIndex
&
/* index */
)
const
{
AttendeeComboBox
*
editor
=
new
AttendeeComboBox
(
parent
);
auto
*
editor
=
new
AttendeeComboBox
(
parent
);
for
(
const
QPair
<
QIcon
,
QString
>
&
pair
:
qAsConst
(
mEntries
))
{
editor
->
addItem
(
pair
.
first
,
pair
.
second
);
...
...
@@ -71,7 +71,7 @@ QWidget *AttendeeComboBoxDelegate::createEditor(QWidget *parent, const QStyleOpt
void
AttendeeComboBoxDelegate
::
setEditorData
(
QWidget
*
editor
,
const
QModelIndex
&
index
)
const
{
AttendeeComboBox
*
comboBox
=
static_cast
<
AttendeeComboBox
*>
(
editor
);
auto
*
comboBox
=
static_cast
<
AttendeeComboBox
*>
(
editor
);
int
value
=
index
.
model
()
->
data
(
index
,
Qt
::
EditRole
).
toUInt
();
if
(
value
>=
mEntries
.
count
())
{
value
=
mStandardIndex
;
...
...
@@ -81,7 +81,7 @@ void AttendeeComboBoxDelegate::setEditorData(QWidget *editor, const QModelIndex
void
AttendeeComboBoxDelegate
::
setModelData
(
QWidget
*
editor
,
QAbstractItemModel
*
model
,
const
QModelIndex
&
index
)
const
{
AttendeeComboBox
*
comboBox
=
static_cast
<
AttendeeComboBox
*>
(
editor
);
auto
*
comboBox
=
static_cast
<
AttendeeComboBox
*>
(
editor
);
model
->
setData
(
index
,
comboBox
->
currentIndex
(),
Qt
::
EditRole
);
comboBox
->
menu
()
->
close
();
}
...
...
@@ -111,7 +111,7 @@ void AttendeeComboBoxDelegate::paint(QPainter *painter, const QStyleOptionViewIt
bool
AttendeeComboBoxDelegate
::
eventFilter
(
QObject
*
editor
,
QEvent
*
event
)
{
if
(
event
->
type
()
==
QEvent
::
Enter
)
{
AttendeeComboBox
*
comboBox
=
static_cast
<
AttendeeComboBox
*>
(
editor
);
auto
*
comboBox
=
static_cast
<
AttendeeComboBox
*>
(
editor
);
comboBox
->
showMenu
();
return
editor
->
eventFilter
(
editor
,
event
);
}
...
...
@@ -121,7 +121,7 @@ bool AttendeeComboBoxDelegate::eventFilter(QObject *editor, QEvent *event)
void
AttendeeComboBoxDelegate
::
doCloseEditor
(
QWidget
*
editor
)
{
AttendeeComboBox
*
comboBox
=
static_cast
<
AttendeeComboBox
*>
(
editor
);
auto
*
comboBox
=
static_cast
<
AttendeeComboBox
*>
(
editor
);
comboBox
->
menu
()
->
close
();
}
...
...
src/attendeeeditor.cpp
View file @
04c2e4ef
...
...
@@ -21,7 +21,7 @@ AttendeeEditor::AttendeeEditor(QWidget *parent)
void
AttendeeEditor
::
slotLineAdded
(
KPIM
::
MultiplyingLine
*
line
)
{
AttendeeLine
*
att
=
qobject_cast
<
AttendeeLine
*>
(
line
);
auto
*
att
=
qobject_cast
<
AttendeeLine
*>
(
line
);
if
(
!
att
)
{
return
;
}
...
...
@@ -38,7 +38,7 @@ void AttendeeEditor::slotCalculateTotal()
const
QList
<
KPIM
::
MultiplyingLine
*>
listLines
=
lines
();
for
(
KPIM
::
MultiplyingLine
*
line
:
listLines
)
{
AttendeeLine
*
att
=
qobject_cast
<
AttendeeLine
*>
(
line
);
auto
*
att
=
qobject_cast
<
AttendeeLine
*>
(
line
);
if
(
att
)
{
if
(
att
->
isEmpty
())
{
++
empty
;
...
...
@@ -83,7 +83,7 @@ void AttendeeEditor::setActions(AttendeeLine::AttendeeActions actions)
{
const
QList
<
KPIM
::
MultiplyingLine
*>
listLines
=
lines
();
for
(
KPIM
::
MultiplyingLine
*
line
:
listLines
)
{
AttendeeLine
*
att
=
qobject_cast
<
AttendeeLine
*>
(
line
);
auto
*
att
=
qobject_cast
<
AttendeeLine
*>
(
line
);
att
->
setActions
(
actions
);
}
}
src/attendeelineeditdelegate.cpp
View file @
04c2e4ef
...
...
@@ -31,7 +31,7 @@ QWidget *AttendeeLineEditDelegate::createEditor(QWidget *parent, const QStyleOpt
{
Q_UNUSED
(
option
);
Q_UNUSED
(
index
);
AttendeeLineEdit
*
editor
=
new
AttendeeLineEdit
(
parent
);
auto
*
editor
=
new
AttendeeLineEdit
(
parent
);
connect
(
editor
,
&
AttendeeLineEdit
::
leftPressed
,
this
,
&
AttendeeLineEditDelegate
::
leftPressed
);
connect
(
editor
,
&
AttendeeLineEdit
::
rightPressed
,
this
,
&
AttendeeLineEditDelegate
::
rightPressed
);
editor
->
setToolTip
(
mToolTip
);
...
...
@@ -44,13 +44,13 @@ QWidget *AttendeeLineEditDelegate::createEditor(QWidget *parent, const QStyleOpt
void
AttendeeLineEditDelegate
::
setEditorData
(
QWidget
*
editor
,
const
QModelIndex
&
index
)
const
{
AttendeeLineEdit
*
lineedit
=
static_cast
<
AttendeeLineEdit
*>
(
editor
);
auto
*
lineedit
=
static_cast
<
AttendeeLineEdit
*>
(
editor
);
lineedit
->
setText
(
index
.
model
()
->
data
(
index
,
Qt
::
EditRole
).
toString
());
}
void
AttendeeLineEditDelegate
::
setModelData
(
QWidget
*
editor
,
QAbstractItemModel
*
model
,
const
QModelIndex
&
index
)
const
{
AttendeeLineEdit
*
lineedit
=
static_cast
<
AttendeeLineEdit
*>
(
editor
);
auto
*
lineedit
=
static_cast
<
AttendeeLineEdit
*>
(
editor
);
model
->
setData
(
index
,
lineedit
->
text
(),
Qt
::
EditRole
);
}
...
...
@@ -86,7 +86,7 @@ bool AttendeeLineEditDelegate::helpEvent(QHelpEvent *event, QAbstractItemView *v
#ifndef QT_NO_TOOLTIP
case
QEvent
::
ToolTip
:
{
QHelpEvent
*
he
=
static_cast
<
QHelpEvent
*>
(
event
);
auto
*
he
=
static_cast
<
QHelpEvent
*>
(
event
);
QToolTip
::
showText
(
he
->
globalPos
(),
mToolTip
,
view
);
return
true
;
}
...
...
@@ -96,7 +96,7 @@ bool AttendeeLineEditDelegate::helpEvent(QHelpEvent *event, QAbstractItemView *v
return
true
;
case
QEvent
::
WhatsThis
:
{
QHelpEvent
*
he
=
static_cast
<
QHelpEvent
*>
(
event
);
auto
*
he
=
static_cast
<
QHelpEvent
*>
(
event
);
QWhatsThis
::
showText
(
he
->
globalPos
(),
mWhatsThis
,
view
);
return
true
;
}
...
...
src/categorydialog.cpp
View file @
04c2e4ef
...
...
@@ -36,7 +36,7 @@ CategoryWidget::CategoryWidget(CategoryConfig *cc, QWidget *parent)
:
QWidget
(
parent
)
,
mCategoryConfig
(
cc
)
{
QHBoxLayo
ut
*
topL
=
new
QHBoxLayout
(
this
);
a
ut
o
*
topL
=
new
QHBoxLayout
(
this
);
topL
->
setContentsMargins
(
0
,
0
,
0
,
0
);
mWidgets
=
new
CategoryWidgetBase
(
this
);
topL
->
addWidget
(
mWidgets
);
...
...
@@ -220,7 +220,7 @@ CategoryDialog::CategoryDialog(CategoryConfig *cc, QWidget *parent)
,
d
(
nullptr
)
{
setWindowTitle
(
i18nc
(
"@title:window"
,
"Select Categories"
));
QVBoxLayo
ut
*
mainLayout
=
new
QVBoxLayout
(
this
);
a
ut
o
*
mainLayout
=
new
QVBoxLayout
(
this
);
QDialogButtonBox
*
buttonBox
=
new
QDialogButtonBox
(
QDialogButtonBox
::
Ok
|
QDialogButtonBox
::
Cancel
/*| QDialogButtonBox::Help*/
|
QDialogButtonBox
::
Apply
,
this
);
...
...
@@ -233,7 +233,7 @@ CategoryDialog::CategoryDialog(CategoryConfig *cc, QWidget *parent)
QWidget
*
page
=
new
QWidget
;
mainLayout
->
addWidget
(
page
);
mainLayout
->
addWidget
(
buttonBox
);
QVBoxLayo
ut
*
lay
=
new
QVBoxLayout
(
page
);
a
ut
o
*
lay
=
new
QVBoxLayout
(
page
);
lay
->
setContentsMargins
(
0
,
0
,
0
,
0
);
mWidgets
=
new
CategoryWidget
(
cc
,
this
);
...
...
src/categoryeditdialog.cpp
View file @
04c2e4ef
...
...
@@ -32,7 +32,7 @@ CategoryEditDialog::CategoryEditDialog(CategoryConfig *categoryConfig, QWidget *
,
mCategoryConfig
(
categoryConfig
)
{
setWindowTitle
(
i18nc
(
"@title:window"
,
"Edit Categories"
));
QVBoxLayo
ut
*
mainLayout
=
new
QVBoxLayout
(
this
);
a
ut
o
*
mainLayout
=
new
QVBoxLayout
(
this
);
QDialogButtonBox
*
buttonBox
=
new
QDialogButtonBox
(
QDialogButtonBox
::
Ok
|
QDialogButtonBox
::
Cancel
|
QDialogButtonBox
::
Help
,
this
);
QPushButton
*
okButton
=
buttonBox
->
button
(
QDialogButtonBox
::
Ok
);
...
...
src/categoryselectdialog.cpp
View file @
04c2e4ef
...
...
@@ -36,7 +36,7 @@ CategorySelectWidget::CategorySelectWidget(CategoryConfig *cc, QWidget *parent)
:
QWidget
(
parent
)
,
mCategoryConfig
(
cc
)
{
QHBoxLayo
ut
*
topL
=
new
QHBoxLayout
(
this
);
a
ut
o
*
topL
=
new
QHBoxLayout
(
this
);
topL
->
setContentsMargins
(
0
,
0
,
0
,
0
);
mWidgets
=
new
CategorySelectWidgetBase
(
this
);
topL
->
addWidget
(
mWidgets
);
...
...
@@ -154,7 +154,7 @@ CategorySelectDialog::CategorySelectDialog(CategoryConfig *cc, QWidget *parent)
,
d
(
nullptr
)
{
setWindowTitle
(
i18nc
(
"@title:window"
,
"Select Categories"
));
QVBoxLayo
ut
*
mainLayout
=
new
QVBoxLayout
(
this
);
a
ut
o
*
mainLayout
=
new
QVBoxLayout
(
this
);
QDialogButtonBox
*
buttonBox
=
new
QDialogButtonBox
(
QDialogButtonBox
::
Ok
|
QDialogButtonBox
::
Cancel
/*| QDialogButtonBox::Help*/
|
QDialogButtonBox
::
Apply
,
this
);
...
...
@@ -164,7 +164,7 @@ CategorySelectDialog::CategorySelectDialog(CategoryConfig *cc, QWidget *parent)
connect
(
buttonBox
,
&
QDialogButtonBox
::
rejected
,
this
,
&
CategorySelectDialog
::
reject
);
QWidget
*
page
=
new
QWidget
;
QVBoxLayo
ut
*
lay
=
new
QVBoxLayout
(
page
);
a
ut
o
*
lay
=
new
QVBoxLayout
(
page
);
lay
->
setContentsMargins
(
0
,
0
,
0
,
0
);
mWidgets
=
new
CategorySelectWidget
(
cc
,
this
);
...
...
src/editoritemmanager.cpp
View file @
04c2e4ef
...
...
@@ -111,7 +111,7 @@ void ItemEditorPrivate::itemFetchResult(KJob *job)
return
;
}
Akonadi
::
ItemFetchJob
*
fetchJob
=
qobject_cast
<
Akonadi
::
ItemFetchJob
*>
(
job
);
auto
*
fetchJob
=
qobject_cast
<
Akonadi
::
ItemFetchJob
*>
(
job
);
if
(
fetchJob
->
items
().
isEmpty
())
{
mItemUi
->
reject
(
ItemEditorUi
::
ItemFetchFailed
);
return
;
...
...
@@ -144,7 +144,7 @@ void ItemEditorPrivate::itemMoveResult(KJob *job)
Q_Q
(
EditorItemManager
);
if
(
job
->
error
())
{
Akonadi
::
ItemMoveJob
*
moveJob
=
qobject_cast
<
Akonadi
::
ItemMoveJob
*>
(
job
);
auto
*
moveJob
=
qobject_cast
<
Akonadi
::
ItemMoveJob
*>
(
job
);
Q_ASSERT
(
moveJob
);
Q_UNUSED
(
moveJob
);
//Q_ASSERT(!moveJob->items().isEmpty());
...
...
@@ -227,7 +227,7 @@ void ItemEditorPrivate::itemChanged(const Akonadi::Item &item, const QSet<QByteA
dlg
->
addButton
(
i18n
(
"Ignore and Overwrite changes"
),
QMessageBox
::
RejectRole
);
if
(
dlg
->
exec
()
==
QMessageBox
::
AcceptRole
)
{
Akonadi
::
ItemFetchJob
*
job
=
new
Akonadi
::
ItemFetchJob
(
mItem
);
auto
*
job
=
new
Akonadi
::
ItemFetchJob
(
mItem
);
job
->
setFetchScope
(
mFetchScope
);
mItem
=
item
;
...
...
@@ -294,7 +294,7 @@ void EditorItemManager::load(const Akonadi::Item &item)
Q_D
(
ItemEditor
);
//We fetch anyways to make sure we have everything required including tags
Akonadi
::
ItemFetchJob
*
job
=
new
Akonadi
::
ItemFetchJob
(
item
,
this
);
auto
*
job
=
new
Akonadi
::
ItemFetchJob
(
item
,
this
);
job
->
setFetchScope
(
d
->
mFetchScope
);
connect
(
job
,
SIGNAL
(
result
(
KJob
*
)),
SLOT
(
itemFetchResult
(
KJob
*
)));
}
...
...
src/freebusyurldialog.cpp
View file @
04c2e4ef
...
...
@@ -27,7 +27,7 @@ FreeBusyUrlDialog::FreeBusyUrlDialog(const AttendeeData::Ptr &attendee, QWidget
{
setModal
(
true
);
setWindowTitle
(
i18nc
(
"@title:window"
,
"Edit Free/Busy Location"
));
QVBoxLayo
ut
*
mainLayout
=
new
QVBoxLayout
(
this
);
a
ut
o
*
mainLayout
=
new
QVBoxLayout
(
this
);
QFrame
*
topFrame
=
new
QFrame
(
this
);
QDialogButtonBox
*
buttonBox
=
new
QDialogButtonBox
(
...
...
src/incidenceattachment.cpp
View file @
04c2e4ef
...
...
@@ -78,7 +78,7 @@ void IncidenceAttachment::save(const KCalendarCore::Incidence::Ptr &incidence)
for
(
int
itemIndex
=
0
;
itemIndex
<
mAttachmentView
->
count
();
++
itemIndex
)
{
QListWidgetItem
*
item
=
mAttachmentView
->
item
(
itemIndex
);
AttachmentIconItem
*
attitem
=
dynamic_cast
<
AttachmentIconItem
*>
(
item
);
auto
*
attitem
=
dynamic_cast
<
AttachmentIconItem
*>
(
item
);
Q_ASSERT
(
item
);
incidence
->
addAttachment
(
attitem
->
attachment
());
}
...
...
@@ -173,7 +173,7 @@ void IncidenceAttachment::removeSelectedAttachments()
for
(
int
itemIndex
=
0
;
itemIndex
<
mAttachmentView
->
count
();
++
itemIndex
)
{
QListWidgetItem
*
it
=
mAttachmentView
->
item
(
itemIndex
);
if
(
it
->
isSelected
())
{
AttachmentIconItem
*
attitem
=
static_cast
<
AttachmentIconItem
*>
(
it
);
auto
*
attitem
=
static_cast
<
AttachmentIconItem
*>
(
it
);
if
(
attitem
)
{
const
KCalendarCore
::
Attachment
att
=
attitem
->
attachment
();
labels
<<
att
.
label
();
...
...
@@ -221,7 +221,7 @@ void IncidenceAttachment::saveAttachment(QListWidgetItem *item)
Q_ASSERT
(
item
);
Q_ASSERT
(
dynamic_cast
<
AttachmentIconItem
*>
(
item
));
AttachmentIconItem
*
attitem
=
static_cast
<
AttachmentIconItem
*>
(
item
);
auto
*
attitem
=
static_cast
<
AttachmentIconItem
*>
(
item
);
if
(
attitem
->
attachment
().
isEmpty
())
{
return
;
}
...
...
@@ -263,7 +263,7 @@ void IncidenceAttachment::showAttachment(QListWidgetItem *item)
{
Q_ASSERT
(
item
);
Q_ASSERT
(
dynamic_cast
<
AttachmentIconItem
*>
(
item
));
AttachmentIconItem
*
attitem
=
static_cast
<
AttachmentIconItem
*>
(
item
);
auto
*
attitem
=
static_cast
<
AttachmentIconItem
*>
(
item
);
if
(
attitem
->
attachment
().
isEmpty
())
{
return
;
}
...
...
@@ -329,7 +329,7 @@ void IncidenceAttachment::editSelectedAttachments()
if
(
item
->
isSelected
())
{
Q_ASSERT
(
dynamic_cast
<
AttachmentIconItem
*>
(
item
));
AttachmentIconItem
*
attitem
=
static_cast
<
AttachmentIconItem
*>
(
item
);
auto
*
attitem
=
static_cast
<
AttachmentIconItem
*>
(
item
);
if
(
attitem
->
attachment
().
isEmpty
())
{
return
;
}
...
...
@@ -551,7 +551,7 @@ void IncidenceAttachment::setupAttachmentIconView()
connect
(
mAttachmentView
,
&
AttachmentIconView
::
customContextMenuRequested
,
this
,
&
IncidenceAttachment
::
showContextMenu
);
QGridLayo
ut
*
layout
=
new
QGridLayout
(
mUi
->
mAttachmentViewPlaceHolder
);
a
ut
o
*
layout
=
new
QGridLayout
(
mUi
->
mAttachmentViewPlaceHolder
);
layout
->
setContentsMargins
(
0
,
0
,
0
,
0
);
layout
->
addWidget
(
mAttachmentView
);
}
...
...
src/incidenceattendee.cpp
View file @
04c2e4ef
...
...
@@ -80,7 +80,7 @@ IncidenceAttendee::IncidenceAttendee(QWidget *parent, IncidenceDateTime *dateTim
setObjectName
(
QStringLiteral
(
"IncidenceAttendee"
));
AttendeeFilterProxyModel
*
filterProxyModel
=
new
AttendeeFilterProxyModel
(
this
);
auto
*
filterProxyModel
=
new
AttendeeFilterProxyModel
(
this
);
filterProxyModel
->
setDynamicSortFilter
(
true
);
filterProxyModel
->
setSourceModel
(
mDataModel
);
...
...
@@ -368,7 +368,7 @@ void IncidenceAttendee::checkIfExpansionIsNeeded(const KCalendarCore::Attendee &
mGroupList
.
remove
(
attendee
.
uid
());
if
(
!
fullname
.
isEmpty
())
{
Akonadi
::
ContactGroupSearchJob
*
job
=
new
Akonadi
::
ContactGroupSearchJob
();
auto
*
job
=
new
Akonadi
::
ContactGroupSearchJob
();
job
->
setQuery
(
Akonadi
::
ContactGroupSearchJob
::
Name
,
fullname
);
connect
(
job
,
&
Akonadi
::
ContactGroupSearchJob
::
result
,
this
,
&
IncidenceAttendee
::
groupSearchResult
);
...
...
@@ -379,7 +379,7 @@ void IncidenceAttendee::checkIfExpansionIsNeeded(const KCalendarCore::Attendee &
void
IncidenceAttendee
::
groupSearchResult
(
KJob
*
job
)
{
Akonadi
::
ContactGroupSearchJob
*
searchJob
=
qobject_cast
<
Akonadi
::
ContactGroupSearchJob
*>
(
job
);
auto
*
searchJob
=
qobject_cast
<
Akonadi
::
ContactGroupSearchJob
*>
(
job
);
Q_ASSERT
(
searchJob
);
Q_ASSERT
(
mMightBeGroupJobs
.
contains
(
job
));
...
...
@@ -410,7 +410,7 @@ void IncidenceAttendee::updateGroupExpand()
void
IncidenceAttendee
::
slotGroupSubstitutionPressed
()
{
for
(
auto
it
=
mGroupList
.
cbegin
(),
end
=
mGroupList
.
cend
();
it
!=
end
;
++
it
)
{
Akonadi
::
ContactGroupExpandJob
*
expandJob
=
new
Akonadi
::
ContactGroupExpandJob
(
it
.
value
(),
this
);
auto
*
expandJob
=
new
Akonadi
::
ContactGroupExpandJob
(
it
.
value
(),
this
);
connect
(
expandJob
,
&
Akonadi
::
ContactGroupExpandJob
::
result
,
this
,
&
IncidenceAttendee
::
expandResult
);
mExpandGroupJobs
.
insert
(
expandJob
,
it
.
key
());
...
...
@@ -420,7 +420,7 @@ void IncidenceAttendee::slotGroupSubstitutionPressed()
void
IncidenceAttendee
::
expandResult
(
KJob
*
job
)
{
Akonadi
::
ContactGroupExpandJob
*
expandJob
=
qobject_cast
<
Akonadi
::
ContactGroupExpandJob
*>
(
job
);
auto
*
expandJob
=
qobject_cast
<
Akonadi
::
ContactGroupExpandJob
*>
(
job
);
Q_ASSERT
(
expandJob
);
Q_ASSERT
(
mExpandGroupJobs
.
contains
(
job
));
const
auto
uid
=
mExpandGroupJobs
.
take
(
job
);
...
...
src/incidencecategories.cpp
View file @
04c2e4ef
...
...
@@ -43,7 +43,7 @@ void IncidenceCategories::load(const KCalendarCore::Incidence::Ptr &incidence)
mMissingCategories
.
clear
();
if
(
mLoadedIncidence
)
{
Akonadi
::
TagFetchJob
*
fetchJob
=
new
Akonadi
::
TagFetchJob
(
this
);
auto
*
fetchJob
=
new
Akonadi
::
TagFetchJob
(
this
);
fetchJob
->
fetchScope
().
fetchAttribute
<
Akonadi
::
TagAttribute
>
();
connect
(
fetchJob
,
&
Akonadi
::
TagFetchJob
::
result
,
this
,
&
IncidenceCategories
::
onTagsFetched
);
}
...
...
@@ -81,7 +81,7 @@ void IncidenceCategories::createMissingCategories()
{
for
(
const
QString
&
category
:
qAsConst
(
mMissingCategories
))
{
Akonadi
::
Tag
missingTag
=
Akonadi
::
Tag
::
genericTag
(
category
);
Akonadi
::
TagCreateJob
*
createJob
=
new
Akonadi
::
TagCreateJob
(
missingTag
,
this
);
auto
*
createJob
=
new
Akonadi
::
TagCreateJob
(
missingTag
,
this
);
connect
(
createJob
,
&
Akonadi
::
TagCreateJob
::
result
,
this
,
&
IncidenceCategories
::
onMissingTagCreated
);
}
...
...
@@ -106,7 +106,7 @@ void IncidenceCategories::onTagsFetched(KJob *job)
qCWarning
(
INCIDENCEEDITOR_LOG
)
<<
"Failed to load tags "
<<
job
->
errorString
();
return
;
}
Akonadi
::
TagFetchJob
*
fetchJob
=
static_cast
<
Akonadi
::
TagFetchJob
*>
(
job
);
auto
*
fetchJob
=
static_cast
<
Akonadi
::
TagFetchJob
*>
(
job
);
const
Akonadi
::
Tag
::
List
jobTags
=
fetchJob
->
tags
();
Q_ASSERT
(
mLoadedIncidence
);
...
...
@@ -130,7 +130,7 @@ void IncidenceCategories::onMissingTagCreated(KJob *job)
qCWarning
(
INCIDENCEEDITOR_LOG
)
<<
"Failed to create tag "
<<
job
->
errorString
();
return
;
}
Akonadi
::
TagCreateJob
*
createJob
=
static_cast
<
Akonadi
::
TagCreateJob
*>
(
job
);
auto
*
createJob
=
static_cast
<
Akonadi
::
TagCreateJob
*>
(
job
);
int
count
=
mMissingCategories
.
removeAll
(
createJob
->
tag
().
name
());
Q_ASSERT
(
count
>
0
);
...
...
src/incidencedescription.cpp
View file @
04c2e4ef
...
...
@@ -142,7 +142,7 @@ void IncidenceDescription::setupToolBar()
KActionCollection
*
collection
=
new
KActionCollection
(
this
);
mUi
->
mDescriptionEdit
->
richTextComposer
()
->
createActions
(
collection
);
KToolBar
*
mEditToolBar
=
new
KToolBar
(
mUi
->
mEditToolBarPlaceHolder
);
auto
*
mEditToolBar
=
new
KToolBar
(
mUi
->
mEditToolBarPlaceHolder
);
mEditToolBar
->
setToolButtonStyle
(
Qt
::
ToolButtonIconOnly
);
mEditToolBar
->
addAction
(
collection
->
action
(
QStringLiteral
(
"format_text_bold"
)));
mEditToolBar
->
addAction
(
collection
->
action
(
QStringLiteral
(
"format_text_italic"
)));
...
...
@@ -172,7 +172,7 @@ void IncidenceDescription::setupToolBar()
mEditToolBar
->
addAction
(
collection
->
action
(
QStringLiteral
(
"manage_link"
)));
mUi
->
mDescriptionEdit
->
richTextComposer
()
->
setEnableActions
(
false
);
QGridLayo
ut
*
layout
=
new
QGridLayout
(
mUi
->
mEditToolBarPlaceHolder
);
a
ut
o
*
layout
=
new
QGridLayout
(
mUi
->
mEditToolBarPlaceHolder
);
layout
->
addWidget
(
mEditToolBar
);
#endif
...
...
src/incidencedialog.cpp
View file @
04c2e4ef
...
...
@@ -123,7 +123,7 @@ IncidenceDialogPrivate::IncidenceDialogPrivate(Akonadi::IncidenceChanger *change
Q_Q
(
IncidenceDialog
);
mUi
->
setupUi
(
q
);
mUi
->
mMessageWidget
->
hide
();
QGridLayo
ut
*
layout
=
new
QGridLayout
(
mUi
->
mCalSelectorPlaceHolder
);
a
ut
o
*
layout
=
new
QGridLayout
(
mUi
->
mCalSelectorPlaceHolder
);
layout
->
setSpacing
(
0
);
layout
->
setContentsMargins
(
0
,
0
,
0
,
0
);
layout
->
addWidget
(
mCalSelector
);
...
...
@@ -134,31 +134,31 @@ IncidenceDialogPrivate::IncidenceDialogPrivate(Akonadi::IncidenceChanger *change
// Now instantiate the logic of the dialog. These editors update the ui, validate
// fields and load/store incidences in the ui.
IncidenceWhatWhere
*
ieGeneral
=
new
IncidenceWhatWhere
(
mUi
);
auto
*
ieGeneral
=
new
IncidenceWhatWhere
(
mUi
);
mEditor
->
combine
(
ieGeneral
);
IncidenceCategories
*
ieCategories
=
new
IncidenceCategories
(
mUi
);
auto
*
ieCategories
=
new
IncidenceCategories
(
mUi
);
mEditor
->
combine
(
ieCategories
);
mIeDateTime
=
new
IncidenceDateTime
(
mUi
);
mEditor
->
combine
(
mIeDateTime
);
IncidenceCompletionPriority
*
ieCompletionPriority
=
new
IncidenceCompletionPriority
(
mUi
);
auto
*
ieCompletionPriority
=
new
IncidenceCompletionPriority
(
mUi
);
mEditor
->
combine
(
ieCompletionPriority
);
IncidenceDescription
*
ieDescription
=
new
IncidenceDescription
(
mUi
);
auto
*
ieDescription
=
new
IncidenceDescription
(
mUi
);
mEditor
->
combine
(
ieDescription
);
IncidenceAlarm
*
ieAlarm
=
new
IncidenceAlarm
(
mIeDateTime
,
mUi
);
auto
*
ieAlarm
=
new
IncidenceAlarm
(
mIeDateTime
,
mUi
);
mEditor
->
combine
(
ieAlarm
);
IncidenceAttachment
*
ieAttachments
=
new
IncidenceAttachment
(
mUi
);
auto
*
ieAttachments
=
new
IncidenceAttachment
(
mUi
);
mEditor
->
combine
(
ieAttachments
);
mIeRecurrence
=
new
IncidenceRecurrence
(
mIeDateTime
,
mUi
);
mEditor
->
combine
(
mIeRecurrence
);
IncidenceSecrecy
*
ieSecrecy
=
new
IncidenceSecrecy
(
mUi
);
auto
*
ieSecrecy
=
new
IncidenceSecrecy
(
mUi
);
mEditor
->
combine
(
ieSecrecy
);
mIeAttendee
=
new
IncidenceAttendee
(
qq
,
mIeDateTime
,
mUi
);
...
...
src/incidencedialogfactory.cpp
View file @
04c2e4ef
...
...
@@ -24,7 +24,7 @@ IncidenceDialog *IncidenceDialogFactory::create(bool needsSaving, KCalendarCore:
case
KCalendarCore
::
IncidenceBase
::
TypeTodo
:
case
KCalendarCore
::
IncidenceBase
::
TypeJournal
:
{
IncidenceDialog
*
dialog
=
new
IncidenceDialog
(
changer
,
parent
,
flags
);
auto
*
dialog
=
new
IncidenceDialog
(
changer
,
parent
,
flags
);
// needs to be save to akonadi?, apply button should be turned on if so.
dialog
->
setInitiallyDirty
(
needsSaving
/* mInitiallyDirty */
);
...
...
src/incidencerecurrence.cpp
View file @
04c2e4ef
...
...
@@ -175,9 +175,9 @@ void IncidenceRecurrence::load(const KCalendarCore::Incidence::Ptr &incidence)
{
mUi
->
mRecurrenceTypeCombo
->
setCurrentIndex
(
RecurrenceTypeWeekly
);
handleRecurrenceTypeChange
(
RecurrenceTypeWeekly
);
QBitArray
disableDays
(
7
/*size*/
,
0
/*default value*/
);
QBitArray
disableDays
(
7
/*size*/
,
false
/*default value*/
);
// dayOfWeek returns between 1 and 7
disableDays
.
setBit
(
currentDate
().
dayOfWeek
()
-
1
,
1
);
disableDays
.
setBit
(
currentDate
().
dayOfWeek
()
-
1
,
true
);
mUi
->
mWeekDayCombo
->
setDays
(
r
->
days
(),
disableDays
);
setFrequency
(
f
);
break
;
...
...
@@ -845,10 +845,10 @@ void IncidenceRecurrence::setDefaults()
// -1 because we want between 0 and 6
const
int
day
=
currentDate
().
dayOfWeek
()
-
1
;
QBitArray
checkDays
(
7
,
0
);
QBitArray
checkDays
(
7
,
false
);
checkDays
.
setBit
(
day
);
QBitArray
disableDays
(
7
,
0
);
QBitArray
disableDays
(
7
,
false
);
disableDays
.
setBit
(
day
);
mUi
->
mWeekDayCombo
->
setDays
(
checkDays
,
disableDays
);
...
...
src/incidenceresource.cpp
View file @
04c2e4ef
...
...
@@ -59,11 +59,11 @@ IncidenceResource::IncidenceResource(IncidenceAttendee *ieAttendee, IncidenceDat
attrs
<<
QStringLiteral
(
"cn"
)
<<
QStringLiteral
(
"mail"
);
completer
=
new
QCompleter
(
this
);
ResourceModel
*
model
=
new
ResourceModel
(
attrs
,
this
);
auto
*
model
=
new
ResourceModel
(
attrs
,
this
);
KDescendantsProxyModel
*
proxyModel
=
new
KDescendantsProxyModel
(
this
);
auto
*
proxyModel
=
new
KDescendantsProxyModel
(
this
);
proxyModel
->
setSourceModel
(
model
);
SwitchRoleProxy
*
proxyModel2
=
new
SwitchRoleProxy
(
this
);
auto
*
proxyModel2
=
new
SwitchRoleProxy
(
this
);
proxyModel2
->
setSourceModel
(
proxyModel
);
completer
->
setModel
(
proxyModel2
);
...
...
@@ -71,9 +71,9 @@ IncidenceResource::IncidenceResource(IncidenceAttendee *ieAttendee, IncidenceDat
completer
->
setWrapAround
(
false
);
mUi
->
mNewResource
->
setCompleter
(
completer
);
AttendeeLineEditDelegate
*
attendeeDelegate
=
new
AttendeeLineEditDelegate
(
this
);
auto
*
attendeeDelegate
=
new
AttendeeLineEditDelegate
(
this
);
ResourceFilterProxyModel
*
filterProxyModel
=
new
ResourceFilterProxyModel
(
this
);
auto
*
filterProxyModel
=
new
ResourceFilterProxyModel
(
this
);
filterProxyModel
->
setDynamicSortFilter
(
true
);
filterProxyModel
->
setSourceModel
(
dataModel
);
...
...
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