Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
KDE Pim
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Unmaintained
KDE Pim
Commits
e7450616
Commit
e7450616
authored
Jun 14, 2015
by
Sergio Martins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use QList::reserve(), reduces reallocations.
parent
623808b3
Changes
26
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
78 additions
and
25 deletions
+78
-25
calendarsupport/collectionselection.cpp
calendarsupport/collectionselection.cpp
+6
-2
calendarsupport/eventarchiver.cpp
calendarsupport/eventarchiver.cpp
+2
-0
calendarsupport/kcalprefs.cpp
calendarsupport/kcalprefs.cpp
+6
-3
calendarsupport/printing/calprintdefaultplugins.cpp
calendarsupport/printing/calprintdefaultplugins.cpp
+1
-0
calendarsupport/printing/calprintpluginbase.cpp
calendarsupport/printing/calprintpluginbase.cpp
+2
-0
calendarsupport/utils.cpp
calendarsupport/utils.cpp
+7
-2
calendarviews/agenda/agendaview.cpp
calendarviews/agenda/agendaview.cpp
+1
-0
calendarviews/agenda/timescaleconfigdialog.cpp
calendarviews/agenda/timescaleconfigdialog.cpp
+3
-1
calendarviews/journal/journalframe.cpp
calendarviews/journal/journalframe.cpp
+1
-0
calendarviews/month/monthview.cpp
calendarviews/month/monthview.cpp
+3
-1
calendarviews/todo/todoview.cpp
calendarviews/todo/todoview.cpp
+6
-1
incidenceeditor-ng/alarmdialog.cpp
incidenceeditor-ng/alarmdialog.cpp
+2
-0
incidenceeditor-ng/incidenceattachment.cpp
incidenceeditor-ng/incidenceattachment.cpp
+3
-0
incidenceeditor-ng/incidenceattendee.cpp
incidenceeditor-ng/incidenceattendee.cpp
+3
-1
incidenceeditor-ng/incidencecategories.cpp
incidenceeditor-ng/incidencecategories.cpp
+1
-0
incidenceeditor-ng/resourcemanagement.cpp
incidenceeditor-ng/resourcemanagement.cpp
+8
-3
korgac/alarmdialog.cpp
korgac/alarmdialog.cpp
+3
-1
korgac/koalarmclient.cpp
korgac/koalarmclient.cpp
+3
-2
korgac/mailclient.cpp
korgac/mailclient.cpp
+1
-0
korganizer/actionmanager.cpp
korganizer/actionmanager.cpp
+2
-1
korganizer/calendarview.cpp
korganizer/calendarview.cpp
+1
-0
korganizer/datenavigator.cpp
korganizer/datenavigator.cpp
+2
-2
korganizer/dialog/filtereditdialog.cpp
korganizer/dialog/filtereditdialog.cpp
+3
-1
korganizer/kodaymatrix.cpp
korganizer/kodaymatrix.cpp
+1
-0
korganizer/kontactplugin/korganizer/summaryeventinfo.cpp
korganizer/kontactplugin/korganizer/summaryeventinfo.cpp
+3
-2
korganizer/widgets/navigatorbar.cpp
korganizer/widgets/navigatorbar.cpp
+4
-2
No files found.
calendarsupport/collectionselection.cpp
View file @
e7450616
...
...
@@ -72,7 +72,9 @@ bool CollectionSelection::contains(const Akonadi::Collection::Id &id) const
Akonadi
::
Collection
::
List
CollectionSelection
::
selectedCollections
()
const
{
Akonadi
::
Collection
::
List
selected
;
Q_FOREACH
(
const
QModelIndex
&
idx
,
d
->
model
->
selectedIndexes
())
{
const
QModelIndexList
selectedIndexes
=
d
->
model
->
selectedIndexes
();
selected
.
reserve
(
selectedIndexes
.
count
());
Q_FOREACH
(
const
QModelIndex
&
idx
,
selectedIndexes
)
{
selected
.
append
(
collectionFromIndex
(
idx
));
}
return
selected
;
...
...
@@ -81,7 +83,9 @@ Akonadi::Collection::List CollectionSelection::selectedCollections() const
QList
<
Akonadi
::
Collection
::
Id
>
CollectionSelection
::
selectedCollectionIds
()
const
{
QList
<
Akonadi
::
Collection
::
Id
>
selected
;
Q_FOREACH
(
const
QModelIndex
&
idx
,
d
->
model
->
selectedIndexes
())
{
const
QModelIndexList
selectedIndexes
=
d
->
model
->
selectedIndexes
();
selected
.
reserve
(
selectedIndexes
.
count
());
Q_FOREACH
(
const
QModelIndex
&
idx
,
selectedIndexes
)
{
selected
.
append
(
collectionIdFromIndex
(
idx
));
}
return
selected
;
...
...
calendarsupport/eventarchiver.cpp
View file @
e7450616
...
...
@@ -164,6 +164,7 @@ void EventArchiver::deleteIncidences(Akonadi::IncidenceChanger *changer,
QStringList
incidenceStrs
;
Akonadi
::
Item
::
List
::
ConstIterator
it
;
Akonadi
::
Item
::
List
::
ConstIterator
end
(
items
.
constEnd
());
incidenceStrs
.
reserve
(
items
.
count
());
for
(
it
=
items
.
constBegin
();
it
!=
end
;
++
it
)
{
incidenceStrs
.
append
(
CalendarSupport
::
incidence
(
*
it
)
->
summary
());
}
...
...
@@ -232,6 +233,7 @@ void EventArchiver::archiveIncidences(const Akonadi::ETMCalendar::Ptr &calendar,
// remain. This is not really efficient, but there is no other easy way.
QStringList
uids
;
Incidence
::
List
allIncidences
=
archiveCalendar
->
rawIncidences
();
uids
.
reserve
(
incidences
.
count
());
foreach
(
const
KCalCore
::
Incidence
::
Ptr
&
incidence
,
incidences
)
{
uids
.
append
(
incidence
->
uid
());
}
...
...
calendarsupport/kcalprefs.cpp
View file @
e7450616
...
...
@@ -241,13 +241,16 @@ QStringList KCalPrefs::allEmails()
QStringList
KCalPrefs
::
fullEmails
()
{
QStringList
fullEmails
;
// The user name and email from the config dialog:
fullEmails
<<
QString
::
fromUtf8
(
"%1 <%2>"
).
arg
(
fullName
()).
arg
(
email
());
QStringList
::
Iterator
it
;
// Grab emails from the email identities
KIdentityManagement
::
IdentityManager
*
idmanager
=
CalendarSupport
::
identityManager
();
QStringList
lst
=
idmanager
->
identities
();
fullEmails
.
reserve
(
1
+
mAdditionalMails
.
count
()
+
lst
.
count
());
// The user name and email from the config dialog:
fullEmails
<<
QString
::
fromUtf8
(
"%1 <%2>"
).
arg
(
fullName
()).
arg
(
email
());
QStringList
::
Iterator
it
;
KIdentityManagement
::
IdentityManager
::
ConstIterator
it1
;
for
(
it1
=
idmanager
->
begin
();
it1
!=
idmanager
->
end
();
++
it1
)
{
fullEmails
<<
(
*
it1
).
fullEmailAddr
();
...
...
calendarsupport/printing/calprintdefaultplugins.cpp
View file @
e7450616
...
...
@@ -344,6 +344,7 @@ void CalPrintIncidence::print(QPainter &p, int width, int height)
QStringList
alarmStrings
;
KCalCore
::
Alarm
::
List
::
ConstIterator
it
;
alarmStrings
.
reserve
(
alarms
.
count
());
for
(
it
=
alarms
.
constBegin
();
it
!=
alarms
.
constEnd
();
++
it
)
{
KCalCore
::
Alarm
::
Ptr
alarm
=
*
it
;
...
...
calendarsupport/printing/calprintpluginbase.cpp
View file @
e7450616
...
...
@@ -979,6 +979,7 @@ void CalPrintPluginBase::drawAgendaDayBox(QPainter &p, const KCalCore::Event::Li
continue
;
}
QList
<
KDateTime
>
times
=
event
->
startDateTimesForDate
(
qd
);
cells
.
reserve
(
times
.
count
());
for
(
QList
<
KDateTime
>::
ConstIterator
it
=
times
.
constBegin
();
it
!=
times
.
constEnd
();
++
it
)
{
cells
.
append
(
new
PrintCellItem
(
event
,
(
*
it
),
event
->
endDateForStart
(
*
it
)));
...
...
@@ -2080,6 +2081,7 @@ void CalPrintPluginBase::drawTodo(int &count, const KCalCore::Todo::Ptr &todo, Q
KCalCore
::
Todo
::
List
sl
=
mCalendar
->
sortTodos
(
&
t
,
sortField
,
sortDir
);
#else
KCalCore
::
Todo
::
List
tl
;
tl
.
reserve
(
t
.
count
());
foreach
(
const
KCalCore
::
Todo
::
Ptr
&
todo
,
t
)
{
tl
.
append
(
todo
);
}
...
...
calendarsupport/utils.cpp
View file @
e7450616
...
...
@@ -401,7 +401,9 @@ KCalCore::Todo::List CalendarSupport::todos(const QMimeData *mimeData,
#ifndef QT_NO_DRAGANDDROP
KCalCore
::
Calendar
::
Ptr
cal
(
KCalUtils
::
DndFactory
::
createDropCalendar
(
mimeData
,
spec
));
if
(
cal
)
{
Q_FOREACH
(
const
KCalCore
::
Todo
::
Ptr
&
i
,
cal
->
todos
())
{
const
KCalCore
::
Todo
::
List
calTodos
=
cal
->
todos
();
todos
.
reserve
(
calTodos
.
count
());
Q_FOREACH
(
const
KCalCore
::
Todo
::
Ptr
&
i
,
calTodos
)
{
todos
.
push_back
(
KCalCore
::
Todo
::
Ptr
(
i
->
clone
()));
}
}
...
...
@@ -419,6 +421,7 @@ KCalCore::Incidence::List CalendarSupport::incidences(const QMimeData *mimeData,
KCalCore
::
Calendar
::
Ptr
cal
(
KCalUtils
::
DndFactory
::
createDropCalendar
(
mimeData
,
spec
));
if
(
cal
)
{
KCalCore
::
Incidence
::
List
calIncidences
=
cal
->
incidences
();
incidences
.
reserve
(
calIncidences
.
count
());
Q_FOREACH
(
const
KCalCore
::
Incidence
::
Ptr
&
i
,
calIncidences
)
{
incidences
.
push_back
(
KCalCore
::
Incidence
::
Ptr
(
i
->
clone
()));
}
...
...
@@ -527,6 +530,7 @@ Akonadi::Collection::Id CalendarSupport::collectionIdFromIndex(const QModelIndex
Akonadi
::
Collection
::
List
CalendarSupport
::
collectionsFromIndexes
(
const
QModelIndexList
&
indexes
)
{
Akonadi
::
Collection
::
List
l
;
l
.
reserve
(
indexes
.
count
());
Q_FOREACH
(
const
QModelIndex
&
idx
,
indexes
)
{
l
.
push_back
(
collectionFromIndex
(
idx
));
}
...
...
@@ -714,7 +718,8 @@ QStringList CalendarSupport::holiday(const QDate &date)
const
HolidayRegion
holidays
(
KCalPrefs
::
instance
()
->
mHolidays
);
const
Holiday
::
List
list
=
holidays
.
holidays
(
date
);
const
int
listCount
(
list
.
count
());
const
int
listCount
=
list
.
count
();
hdays
.
reserve
(
listCount
);
for
(
int
i
=
0
;
i
<
listCount
;
++
i
)
{
hdays
.
append
(
list
.
at
(
i
).
text
());
}
...
...
calendarviews/agenda/agendaview.cpp
View file @
e7450616
...
...
@@ -389,6 +389,7 @@ QList<QDate> AgendaView::Private::generateDateList(const QDate &start, const QDa
if
(
start
.
isValid
()
&&
end
.
isValid
()
&&
end
>=
start
&&
start
.
daysTo
(
end
)
<
AgendaView
::
MAX_DAY_COUNT
)
{
QDate
date
=
start
;
list
.
reserve
(
start
.
daysTo
(
end
)
+
1
);
while
(
date
<=
end
)
{
list
.
append
(
date
);
date
=
date
.
addDays
(
1
);
...
...
calendarviews/agenda/timescaleconfigdialog.cpp
View file @
e7450616
...
...
@@ -202,7 +202,9 @@ void TimeScaleConfigDialog::down()
QStringList
TimeScaleConfigDialog
::
zones
()
{
QStringList
list
;
for
(
int
i
=
0
;
i
<
listWidget
->
count
();
++
i
)
{
const
int
count
=
listWidget
->
count
();
list
.
reserve
(
count
);
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
list
<<
listWidget
->
item
(
i
)
->
data
(
TimeZoneNameRole
).
toString
();
}
return
list
;
...
...
calendarviews/journal/journalframe.cpp
View file @
e7450616
...
...
@@ -105,6 +105,7 @@ void JournalDateView::addJournal(const Akonadi::Item &j)
Akonadi
::
Item
::
List
JournalDateView
::
journals
()
const
{
Akonadi
::
Item
::
List
l
;
l
.
reserve
(
mEntries
.
count
());
Q_FOREACH
(
const
JournalFrame
*
const
i
,
mEntries
)
{
l
.
push_back
(
i
->
journal
());
}
...
...
calendarviews/month/monthview.cpp
View file @
e7450616
...
...
@@ -112,7 +112,9 @@ void MonthViewPrivate::moveStartDate(int weeks, int months)
#ifndef KDEPIM_MOBILE_UI
KCalCore
::
DateList
dateList
;
QDate
d
=
start
.
date
();
while
(
d
<=
end
.
date
())
{
const
QDate
e
=
end
.
date
();
dateList
.
reserve
(
d
.
daysTo
(
e
)
+
1
);
while
(
d
<=
e
)
{
dateList
.
append
(
d
);
d
=
d
.
addDays
(
1
);
}
...
...
calendarviews/todo/todoview.cpp
View file @
e7450616
...
...
@@ -512,6 +512,7 @@ Akonadi::Item::List TodoView::selectedIncidences() const
{
Akonadi
::
Item
::
List
ret
;
const
QModelIndexList
selection
=
mView
->
selectionModel
()
->
selectedRows
();
ret
.
reserve
(
selection
.
count
());
Q_FOREACH
(
const
QModelIndex
&
mi
,
selection
)
{
ret
<<
mi
.
data
(
TodoModel
::
TodoRole
).
value
<
Akonadi
::
Item
>
();
}
...
...
@@ -535,7 +536,11 @@ void TodoView::saveLayout(KConfig *config, const QString &group) const
QVariantList
columnVisibility
;
QVariantList
columnOrder
;
QVariantList
columnWidths
;
for
(
int
i
=
0
;
i
<
header
->
count
();
++
i
)
{
const
int
headerCount
=
header
->
count
();
columnVisibility
.
reserve
(
headerCount
);
columnWidths
.
reserve
(
headerCount
);
columnOrder
.
reserve
(
headerCount
);
for
(
int
i
=
0
;
i
<
headerCount
;
++
i
)
{
columnVisibility
<<
QVariant
(
!
mView
->
isColumnHidden
(
i
));
columnWidths
<<
QVariant
(
header
->
sectionSize
(
i
));
columnOrder
<<
QVariant
(
header
->
visualIndex
(
i
));
...
...
incidenceeditor-ng/alarmdialog.cpp
View file @
e7450616
...
...
@@ -138,6 +138,7 @@ void AlarmDialog::load(const KCalCore::Alarm::Ptr &alarm)
mUi
->
mTypeCombo
->
setCurrentIndex
(
3
);
KCalCore
::
Person
::
List
addresses
=
alarm
->
mailAddresses
();
QStringList
add
;
add
.
reserve
(
addresses
.
count
());
for
(
KCalCore
::
Person
::
List
::
ConstIterator
it
=
addresses
.
constBegin
();
it
!=
addresses
.
constEnd
();
++
it
)
{
add
<<
(
*
it
)
->
fullName
();
...
...
@@ -214,6 +215,7 @@ void AlarmDialog::save(const KCalCore::Alarm::Ptr &alarm) const
}
else
if
(
mUi
->
mTypeCombo
->
currentIndex
()
==
3
)
{
// Email
QStringList
addresses
=
KEmailAddress
::
splitAddressList
(
mUi
->
mEmailAddress
->
text
());
KCalCore
::
Person
::
List
add
;
add
.
reserve
(
addresses
.
count
());
for
(
QStringList
::
Iterator
it
=
addresses
.
begin
();
it
!=
addresses
.
end
();
++
it
)
{
add
<<
KCalCore
::
Person
::
fromFullName
(
*
it
);
}
...
...
incidenceeditor-ng/incidenceattachment.cpp
View file @
e7450616
...
...
@@ -405,6 +405,8 @@ void IncidenceAttachment::handlePasteOrDrop(const QMimeData *mimeData)
if
(
KContacts
::
VCardDrag
::
canDecode
(
mimeData
))
{
KContacts
::
Addressee
::
List
addressees
;
KContacts
::
VCardDrag
::
fromMimeData
(
mimeData
,
addressees
);
urls
.
reserve
(
addressees
.
count
());
labels
.
reserve
(
addressees
.
count
());
for
(
KContacts
::
Addressee
::
List
::
ConstIterator
it
=
addressees
.
constBegin
();
it
!=
addressees
.
constEnd
();
++
it
)
{
urls
.
append
(
QString
(
QLatin1String
(
"uid:"
)
+
(
*
it
).
uid
()));
...
...
@@ -425,6 +427,7 @@ void IncidenceAttachment::handlePasteOrDrop(const QMimeData *mimeData)
}
else
if
(
mimeData
->
hasText
())
{
QString
text
=
mimeData
->
text
();
QStringList
lst
=
text
.
split
(
'\n'
,
QString
::
SkipEmptyParts
);
urls
.
reserve
(
lst
.
count
());
for
(
QStringList
::
ConstIterator
it
=
lst
.
constBegin
();
it
!=
lst
.
constEnd
();
++
it
)
{
urls
.
append
(
*
it
);
}
...
...
incidenceeditor-ng/incidenceattendee.cpp
View file @
e7450616
...
...
@@ -229,7 +229,9 @@ void IncidenceAttendee::load(const KCalCore::Incidence::Ptr &incidence)
}
KCalCore
::
Attendee
::
List
attendees
;
foreach
(
const
KCalCore
::
Attendee
::
Ptr
&
a
,
incidence
->
attendees
())
{
const
KCalCore
::
Attendee
::
List
incidenceAttendees
=
incidence
->
attendees
();
attendees
.
reserve
(
incidenceAttendees
.
count
());
foreach
(
const
KCalCore
::
Attendee
::
Ptr
&
a
,
incidenceAttendees
)
{
attendees
<<
KCalCore
::
Attendee
::
Ptr
(
new
KCalCore
::
Attendee
(
*
a
));
}
...
...
incidenceeditor-ng/incidencecategories.cpp
View file @
e7450616
...
...
@@ -97,6 +97,7 @@ void IncidenceCategories::save(Akonadi::Item &item)
QStringList
IncidenceCategories
::
categories
()
const
{
QStringList
list
;
list
.
reserve
(
mSelectedTags
.
count
());
Q_FOREACH
(
const
Akonadi
::
Tag
&
tag
,
mSelectedTags
)
{
list
<<
tag
.
name
();
}
...
...
incidenceeditor-ng/resourcemanagement.cpp
View file @
e7450616
...
...
@@ -215,7 +215,9 @@ void ResourceManagement::showDetails(const KLDAP::LdapObject &obj, const KLDAP::
continue
;
}
QStringList
list
;
foreach
(
const
QByteArray
&
value
,
obj
.
attributes
().
value
(
key
))
{
const
QList
<
QByteArray
>
values
=
obj
.
attributes
().
value
(
key
);
list
.
reserve
(
values
.
count
());
foreach
(
const
QByteArray
&
value
,
values
)
{
list
<<
QString
::
fromUtf8
(
value
);
}
mUi
->
formDetails
->
addRow
(
translateLDAPAttributeForDisplay
(
key
),
new
QLabel
(
list
.
join
(
"
\n
"
)));
...
...
@@ -231,7 +233,8 @@ void ResourceManagement::showDetails(const KLDAP::LdapObject &obj, const KLDAP::
void
ResourceManagement
::
slotLayoutChanged
()
{
for
(
int
i
=
1
;
i
<
mUi
->
treeResults
->
model
()
->
columnCount
(
QModelIndex
());
++
i
)
{
const
int
columnCount
=
mUi
->
treeResults
->
model
()
->
columnCount
(
QModelIndex
());
for
(
int
i
=
1
;
i
<
columnCount
;
++
i
)
{
mUi
->
treeResults
->
setColumnHidden
(
i
,
true
);
}
}
...
...
@@ -255,7 +258,9 @@ void ResourceManagement::slotOwnerSearchFinished()
continue
;
}
QStringList
list
;
foreach
(
const
QByteArray
&
value
,
obj
.
attributes
().
value
(
key
))
{
const
QList
<
QByteArray
>
values
=
obj
.
attributes
().
value
(
key
);
list
.
reserve
(
values
.
count
());
foreach
(
const
QByteArray
&
value
,
values
)
{
list
<<
QString
::
fromUtf8
(
value
);
}
mUi
->
formOwner
->
addRow
(
translateLDAPAttributeForDisplay
(
key
),
new
QLabel
(
list
.
join
(
QStringLiteral
(
"
\n
"
))));
...
...
korgac/alarmdialog.cpp
View file @
e7450616
...
...
@@ -428,6 +428,7 @@ void AlarmDialog::dismissAll()
void
AlarmDialog
::
dismiss
(
ReminderList
selections
)
{
QList
<
Akonadi
::
Item
::
Id
>
ids
;
ids
.
reserve
(
selections
.
count
());
for
(
ReminderList
::
Iterator
it
=
selections
.
begin
();
it
!=
selections
.
end
();
++
it
)
{
qCDebug
(
KOALARMCLIENT_LOG
)
<<
"removing "
<<
CalendarSupport
::
incidence
((
*
it
)
->
mIncidence
)
->
summary
();
if
(
mIncidenceTree
->
itemBelow
(
*
it
))
{
...
...
@@ -651,6 +652,7 @@ void AlarmDialog::eventNotification()
}
else
{
const
Person
::
List
addresses
=
alarm
->
mailAddresses
();
QStringList
add
;
add
.
reserve
(
addresses
.
count
());
for
(
Person
::
List
::
ConstIterator
it
=
addresses
.
constBegin
();
it
!=
addresses
.
constEnd
();
++
it
)
{
add
<<
(
*
it
)
->
fullName
();
...
...
@@ -873,7 +875,7 @@ KDateTime AlarmDialog::triggerDateForIncidence(const Incidence::Ptr &incidence,
return
result
;
}
Alarm
::
Ptr
alarm
=
incidence
->
alarms
().
first
(
);
Alarm
::
Ptr
alarm
=
incidence
->
alarms
().
at
(
0
);
if
(
incidence
->
recurs
())
{
result
=
incidence
->
recurrence
()
->
getNextDateTime
(
...
...
korgac/koalarmclient.cpp
View file @
e7450616
...
...
@@ -282,16 +282,17 @@ QStringList KOAlarmClient::dumpAlarms()
const
KDateTime
end
=
start
.
addDays
(
1
).
addSecs
(
-
1
);
QStringList
lst
;
const
Alarm
::
List
alarms
=
mCalendar
->
alarms
(
start
,
end
);
lst
.
reserve
(
1
+
(
alarms
.
isEmpty
()
?
1
:
alarms
.
count
()));
// Don't translate, this is for debugging purposes.
lst
<<
QLatin1String
(
"AlarmDeamon::dumpAlarms() from "
)
+
start
.
toString
()
+
QLatin1String
(
" to "
)
+
end
.
toString
();
Alarm
::
List
alarms
=
mCalendar
->
alarms
(
start
,
end
);
if
(
alarms
.
isEmpty
())
{
lst
<<
QLatin1String
(
"No alarm found."
);
}
else
{
foreach
(
Alarm
::
Ptr
a
,
alarms
)
{
foreach
(
const
Alarm
::
Ptr
&
a
,
alarms
)
{
const
Incidence
::
Ptr
parentIncidence
=
mCalendar
->
incidence
(
a
->
parentUid
());
lst
<<
QLatin1String
(
" "
)
+
parentIncidence
->
summary
()
+
QLatin1String
(
" ("
)
+
a
->
time
().
toString
()
+
QLatin1Char
(
')'
);
}
...
...
korgac/mailclient.cpp
View file @
e7450616
...
...
@@ -186,6 +186,7 @@ QStringList extractEmailAndNormalize(const QString &email)
{
const
QStringList
splittedEmail
=
KEmailAddress
::
splitAddressList
(
email
);
QStringList
normalizedEmail
;
normalizedEmail
.
reserve
(
splittedEmail
.
count
());
Q_FOREACH
(
const
QString
&
email
,
splittedEmail
)
{
const
QString
str
=
KEmailAddress
::
extractEmailAddress
(
KEmailAddress
::
normalizeAddressesAndEncodeIdn
(
email
));
normalizedEmail
<<
str
;
...
...
korganizer/actionmanager.cpp
View file @
e7450616
...
...
@@ -1436,7 +1436,8 @@ void ActionManager::downloadNewStuff()
}
else
{
QStringList
eventSummaries
;
KCalCore
::
Event
::
List
events
=
calendar
()
->
events
();
foreach
(
KCalCore
::
Event
::
Ptr
event
,
events
)
{
eventSummaries
.
reserve
(
events
.
count
());
foreach
(
const
KCalCore
::
Event
::
Ptr
&
event
,
events
)
{
eventSummaries
.
append
(
event
->
summary
());
}
...
...
korganizer/calendarview.cpp
View file @
e7450616
...
...
@@ -520,6 +520,7 @@ void CalendarView::writeFilterSettings(KConfig *config)
group
.
deleteGroup
();
}
filterList
.
reserve
(
mFilters
.
count
());
foreach
(
KCalCore
::
CalFilter
*
filter
,
mFilters
)
{
filterList
<<
filter
->
name
();
KConfigGroup
filterConfig
(
config
,
QLatin1String
(
"Filter_"
)
+
filter
->
name
());
...
...
korganizer/datenavigator.cpp
View file @
e7450616
...
...
@@ -86,9 +86,9 @@ void DateNavigator::selectDates(const QDate &d, int count,
const
QDate
&
preferredMonth
)
{
KCalCore
::
DateList
dates
;
dates
.
reserve
(
count
);
int
i
;
for
(
i
=
0
;
i
<
count
;
++
i
)
{
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
dates
.
append
(
d
.
addDays
(
i
));
}
...
...
korganizer/dialog/filtereditdialog.cpp
View file @
e7450616
...
...
@@ -231,7 +231,9 @@ void FilterEdit::bNewPressed()
mDetailsFrame
->
setEnabled
(
true
);
saveChanges
();
QStringList
filterNames
;
for
(
int
i
=
0
;
i
<
mRulesList
->
count
();
++
i
)
{
const
int
numRules
=
mRulesList
->
count
();
filterNames
.
reserve
(
numRules
);
for
(
int
i
=
0
;
i
<
numRules
;
++
i
)
{
filterNames
<<
mRulesList
->
item
(
i
)
->
text
();
}
QString
newFilterName
;
...
...
korganizer/kodaymatrix.cpp
View file @
e7450616
...
...
@@ -566,6 +566,7 @@ void KODayMatrix::mouseReleaseEvent(QMouseEvent *e)
if
(
mSelStart
<
0
)
{
mSelStart
=
0
;
}
daylist
.
reserve
(
mSelEnd
-
mSelStart
+
1
);
for
(
int
i
=
mSelStart
;
i
<=
mSelEnd
;
++
i
)
{
daylist
.
append
(
mDays
[
i
]);
}
...
...
korganizer/kontactplugin/korganizer/summaryeventinfo.cpp
View file @
e7450616
...
...
@@ -172,8 +172,9 @@ SummaryEventInfo::List SummaryEventInfo::eventsForRange(const QDate &start, cons
SummaryEventInfo
::
List
eventInfoList
;
KCalCore
::
Event
::
Ptr
ev
;
KCalCore
::
Event
::
List
::
ConstIterator
itEnd
=
events
.
constEnd
();
for
(
KCalCore
::
Event
::
List
::
ConstIterator
it
=
events
.
constBegin
();
it
!=
itEnd
;
++
it
)
{
eventInfoList
.
reserve
(
events
.
count
());
auto
itEnd
=
events
.
constEnd
();
for
(
auto
it
=
events
.
constBegin
();
it
!=
itEnd
;
++
it
)
{
ev
=
*
it
;
// Count number of days remaining in multiday event
int
span
=
1
;
...
...
korganizer/widgets/navigatorbar.cpp
View file @
e7450616
...
...
@@ -145,9 +145,10 @@ void NavigatorBar::selectMonthFromMenu()
int
months
=
calSys
->
monthsInYear
(
mDate
);
QMenu
*
menu
=
new
QMenu
(
mMonth
);
QList
<
QAction
*>
act
;
QList
<
QAction
*>
act
;
QAction
*
activateAction
=
Q_NULLPTR
;
act
.
reserve
(
months
);
for
(
int
i
=
1
;
i
<=
months
;
++
i
)
{
QAction
*
monthAction
=
menu
->
addAction
(
calSys
->
monthName
(
i
,
year
));
act
.
append
(
monthAction
);
...
...
@@ -185,7 +186,8 @@ void NavigatorBar::selectYearFromMenu()
int
minYear
=
year
-
(
years
/
3
);
QMenu
*
menu
=
new
QMenu
(
mYear
);
QList
<
QAction
*>
act
;
QList
<
QAction
*>
act
;
act
.
reserve
(
years
);
QString
yearStr
;
QAction
*
activateAction
=
Q_NULLPTR
;
...
...
Write
Preview
Markdown
is supported
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