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
P
PIM Calendar Support
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
1
Merge Requests
1
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
PIM
PIM Calendar Support
Commits
7c90fd64
Commit
7c90fd64
authored
Dec 18, 2016
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Port to for(... : ..)
parent
825adea9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
15 deletions
+16
-15
src/categoryconfig.cpp
src/categoryconfig.cpp
+1
-1
src/categoryhierarchyreader.cpp
src/categoryhierarchyreader.cpp
+1
-1
src/collectionselection.cpp
src/collectionselection.cpp
+4
-4
src/utils.cpp
src/utils.cpp
+10
-9
No files found.
src/categoryconfig.cpp
View file @
7c90fd64
...
...
@@ -72,7 +72,7 @@ QHash<QString, QColor> CategoryConfig::readColors() const
QHash
<
QString
,
QColor
>
categoryColors
;
KConfigGroup
colorsConfig
(
d
->
config
->
config
(),
"Category Colors2"
);
const
QStringList
cats
=
customCategories
();
Q_FOREACH
(
const
QString
&
category
,
cats
)
{
for
(
const
QString
&
category
:
cats
)
{
const
QColor
color
=
colorsConfig
.
readEntry
(
category
,
d
->
mDefaultCategoryColor
);
if
(
color
!=
d
->
mDefaultCategoryColor
)
{
categoryColors
.
insert
(
category
,
color
);
...
...
src/categoryhierarchyreader.cpp
View file @
7c90fd64
...
...
@@ -54,7 +54,7 @@ void CategoryHierarchyReader::read(const QStringList &categories)
// case insensitive sort
QMap
<
QString
,
QString
>
sortedCategories
;
for
each
(
const
QString
&
str
,
categories
)
{
for
(
const
QString
&
str
:
categories
)
{
sortedCategories
.
insert
(
str
.
toLower
(),
str
);
}
...
...
src/collectionselection.cpp
View file @
7c90fd64
...
...
@@ -74,7 +74,7 @@ Akonadi::Collection::List CollectionSelection::selectedCollections() const
Akonadi
::
Collection
::
List
selected
;
const
QModelIndexList
selectedIndexes
=
d
->
model
->
selectedIndexes
();
selected
.
reserve
(
selectedIndexes
.
count
());
Q_FOREACH
(
const
QModelIndex
&
idx
,
selectedIndexes
)
{
for
(
const
QModelIndex
&
idx
:
selectedIndexes
)
{
selected
.
append
(
collectionFromIndex
(
idx
));
}
return
selected
;
...
...
@@ -85,7 +85,7 @@ QList<Akonadi::Collection::Id> CollectionSelection::selectedCollectionIds() cons
QList
<
Akonadi
::
Collection
::
Id
>
selected
;
const
QModelIndexList
selectedIndexes
=
d
->
model
->
selectedIndexes
();
selected
.
reserve
(
selectedIndexes
.
count
());
Q_FOREACH
(
const
QModelIndex
&
idx
,
selectedIndexes
)
{
for
(
const
QModelIndex
&
idx
:
selectedIndexes
)
{
selected
.
append
(
collectionIdFromIndex
(
idx
));
}
return
selected
;
...
...
@@ -98,10 +98,10 @@ void CollectionSelection::slotSelectionChanged(const QItemSelection &selectedInd
const
Akonadi
::
Collection
::
List
deselected
=
collectionsFromIndexes
(
deselIndexes
.
indexes
());
Q_EMIT
selectionChanged
(
selected
,
deselected
);
Q_FOREACH
(
const
Akonadi
::
Collection
&
c
,
deselected
)
{
for
(
const
Akonadi
::
Collection
&
c
:
deselected
)
{
Q_EMIT
collectionDeselected
(
c
);
}
Q_FOREACH
(
const
Akonadi
::
Collection
&
c
,
selected
)
{
for
(
const
Akonadi
::
Collection
&
c
:
selected
)
{
Q_EMIT
collectionSelected
(
c
);
}
}
src/utils.cpp
View file @
7c90fd64
...
...
@@ -107,7 +107,7 @@ KCalCore::Event::Ptr CalendarSupport::event(const KCalCore::Incidence::Ptr &inci
KCalCore
::
Incidence
::
List
CalendarSupport
::
incidencesFromItems
(
const
Akonadi
::
Item
::
List
&
items
)
{
KCalCore
::
Incidence
::
List
incidences
;
Q_FOREACH
(
const
Akonadi
::
Item
&
item
,
items
)
{
for
(
const
Akonadi
::
Item
&
item
:
items
)
{
if
(
const
KCalCore
::
Incidence
::
Ptr
e
=
CalendarSupport
::
incidence
(
item
))
{
incidences
.
push_back
(
e
);
}
...
...
@@ -203,7 +203,7 @@ QMimeData *CalendarSupport::createMimeData(const Akonadi::Item::List &items,
QList
<
QUrl
>
urls
;
int
incidencesFound
=
0
;
Q_FOREACH
(
const
Akonadi
::
Item
&
item
,
items
)
{
for
(
const
Akonadi
::
Item
&
item
:
items
)
{
const
KCalCore
::
Incidence
::
Ptr
incidence
(
CalendarSupport
::
incidence
(
item
));
if
(
!
incidence
)
{
continue
;
...
...
@@ -249,7 +249,7 @@ static QByteArray findMostCommonType(const Akonadi::Item::List &items)
return
"Incidence"
;
}
Q_FOREACH
(
const
Akonadi
::
Item
&
item
,
items
)
{
for
(
const
Akonadi
::
Item
&
item
:
items
)
{
if
(
!
CalendarSupport
::
hasIncidence
(
item
))
{
continue
;
}
...
...
@@ -378,7 +378,7 @@ KCalCore::Todo::List CalendarSupport::todos(const QMimeData *mimeData,
if
(
cal
)
{
const
KCalCore
::
Todo
::
List
calTodos
=
cal
->
todos
();
todos
.
reserve
(
calTodos
.
count
());
Q_FOREACH
(
const
KCalCore
::
Todo
::
Ptr
&
i
,
calTodos
)
{
for
(
const
KCalCore
::
Todo
::
Ptr
&
i
:
calTodos
)
{
todos
.
push_back
(
KCalCore
::
Todo
::
Ptr
(
i
->
clone
()));
}
}
...
...
@@ -395,9 +395,9 @@ KCalCore::Incidence::List CalendarSupport::incidences(const QMimeData *mimeData,
#ifndef QT_NO_DRAGANDDROP
KCalCore
::
Calendar
::
Ptr
cal
(
KCalUtils
::
DndFactory
::
createDropCalendar
(
mimeData
,
spec
));
if
(
cal
)
{
KCalCore
::
Incidence
::
List
calIncidences
=
cal
->
incidences
();
const
KCalCore
::
Incidence
::
List
calIncidences
=
cal
->
incidences
();
incidences
.
reserve
(
calIncidences
.
count
());
Q_FOREACH
(
const
KCalCore
::
Incidence
::
Ptr
&
i
,
calIncidences
)
{
for
(
const
KCalCore
::
Incidence
::
Ptr
&
i
:
calIncidences
)
{
incidences
.
push_back
(
KCalCore
::
Incidence
::
Ptr
(
i
->
clone
()));
}
}
...
...
@@ -506,7 +506,7 @@ Akonadi::Collection::List CalendarSupport::collectionsFromIndexes(const QModelIn
{
Akonadi
::
Collection
::
List
l
;
l
.
reserve
(
indexes
.
count
());
Q_FOREACH
(
const
QModelIndex
&
idx
,
indexes
)
{
for
(
const
QModelIndex
&
idx
:
indexes
)
{
l
.
push_back
(
collectionFromIndex
(
idx
));
}
return
l
;
...
...
@@ -767,10 +767,11 @@ QStringList CalendarSupport::categories(const KCalCore::Incidence::List &inciden
QStringList
cats
,
thisCats
;
// @TODO: For now just iterate over all incidences. In the future,
// the list of categories should be built when reading the file.
Q_FOREACH
(
const
KCalCore
::
Incidence
::
Ptr
&
incidence
,
incidences
)
{
for
(
const
KCalCore
::
Incidence
::
Ptr
&
incidence
:
incidences
)
{
thisCats
=
incidence
->
categories
();
const
QStringList
::
ConstIterator
send
(
thisCats
.
constEnd
());
for
(
QStringList
::
ConstIterator
si
=
thisCats
.
constBegin
();
si
!=
thisCats
.
constEnd
()
;
++
si
)
{
si
!=
send
;
++
si
)
{
if
(
!
cats
.
contains
(
*
si
))
{
cats
.
append
(
*
si
);
}
...
...
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