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
4a8c1770
Commit
4a8c1770
authored
Dec 19, 2014
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use collectiontypeutil
parent
335c3bdb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
119 additions
and
225 deletions
+119
-225
mailcommon/collectionpage/collectiongeneralpage.cpp
mailcommon/collectionpage/collectiongeneralpage.cpp
+39
-206
mailcommon/collectionpage/collectiongeneralpage.h
mailcommon/collectionpage/collectiongeneralpage.h
+0
-19
mailcommon/collectionpage/collectiontypeutil.cpp
mailcommon/collectionpage/collectiontypeutil.cpp
+77
-0
mailcommon/collectionpage/collectiontypeutil.h
mailcommon/collectionpage/collectiontypeutil.h
+3
-0
No files found.
mailcommon/collectionpage/collectiongeneralpage.cpp
View file @
4a8c1770
...
...
@@ -16,6 +16,7 @@
*/
#include "collectiongeneralpage.h"
#include "collectiontypeutil.h"
#include "contentstypecombobox.h"
#include "collectionannotationsattribute.h"
...
...
@@ -74,178 +75,6 @@ static void addLine( QWidget *parent, QVBoxLayout *layout )
layout
->
addWidget
(
line
);
}
static
QString
incidencesForToString
(
CollectionGeneralPage
::
IncidencesFor
type
)
{
switch
(
type
)
{
case
CollectionGeneralPage
::
IncForNobody
:
return
QLatin1String
(
"nobody"
);
case
CollectionGeneralPage
::
IncForAdmins
:
return
QLatin1String
(
"admins"
);
case
CollectionGeneralPage
::
IncForReaders
:
return
QLatin1String
(
"readers"
);
}
return
QString
();
// can't happen
}
static
CollectionGeneralPage
::
IncidencesFor
incidencesForFromString
(
const
QString
&
string
)
{
if
(
string
==
QLatin1String
(
"nobody"
)
)
{
return
CollectionGeneralPage
::
IncForNobody
;
}
else
if
(
string
==
QLatin1String
(
"admins"
)
)
{
return
CollectionGeneralPage
::
IncForAdmins
;
}
else
if
(
string
==
QLatin1String
(
"readers"
)
)
{
return
CollectionGeneralPage
::
IncForReaders
;
}
return
CollectionGeneralPage
::
IncForAdmins
;
// by default
}
static
QString
folderContentDescription
(
CollectionGeneralPage
::
FolderContentsType
type
)
{
switch
(
type
)
{
case
CollectionGeneralPage
::
ContentsTypeMail
:
return
(
i18nc
(
"type of folder content"
,
"Mail"
)
);
case
CollectionGeneralPage
::
ContentsTypeCalendar
:
return
(
i18nc
(
"type of folder content"
,
"Calendar"
)
);
case
CollectionGeneralPage
::
ContentsTypeContact
:
return
(
i18nc
(
"type of folder content"
,
"Contacts"
)
);
case
CollectionGeneralPage
::
ContentsTypeNote
:
return
(
i18nc
(
"type of folder content"
,
"Notes"
)
);
case
CollectionGeneralPage
::
ContentsTypeTask
:
return
(
i18nc
(
"type of folder content"
,
"Tasks"
)
);
case
CollectionGeneralPage
::
ContentsTypeJournal
:
return
(
i18nc
(
"type of folder content"
,
"Journal"
)
);
case
CollectionGeneralPage
::
ContentsTypeConfiguration
:
return
(
i18nc
(
"type of folder content"
,
"Configuration"
)
);
case
CollectionGeneralPage
::
ContentsTypeFreebusy
:
return
(
i18nc
(
"type of folder content"
,
"Freebusy"
)
);
case
CollectionGeneralPage
::
ContentsTypeFile
:
return
(
i18nc
(
"type of folder content"
,
"Files"
)
);
default:
return
(
i18nc
(
"type of folder content"
,
"Unknown"
)
);
}
}
static
CollectionGeneralPage
::
FolderContentsType
contentsTypeFromString
(
const
QString
&
type
)
{
if
(
type
==
i18nc
(
"type of folder content"
,
"Mail"
)
)
{
return
CollectionGeneralPage
::
ContentsTypeMail
;
}
if
(
type
==
i18nc
(
"type of folder content"
,
"Calendar"
)
)
{
return
CollectionGeneralPage
::
ContentsTypeCalendar
;
}
if
(
type
==
i18nc
(
"type of folder content"
,
"Contacts"
)
)
{
return
CollectionGeneralPage
::
ContentsTypeContact
;
}
if
(
type
==
i18nc
(
"type of folder content"
,
"Notes"
)
)
{
return
CollectionGeneralPage
::
ContentsTypeNote
;
}
if
(
type
==
i18nc
(
"type of folder content"
,
"Tasks"
)
)
{
return
CollectionGeneralPage
::
ContentsTypeTask
;
}
if
(
type
==
i18nc
(
"type of folder content"
,
"Journal"
)
)
{
return
CollectionGeneralPage
::
ContentsTypeJournal
;
}
if
(
type
==
i18nc
(
"type of folder content"
,
"Configuration"
)
)
{
return
CollectionGeneralPage
::
ContentsTypeConfiguration
;
}
if
(
type
==
i18nc
(
"type of folder content"
,
"Freebusy"
)
)
{
return
CollectionGeneralPage
::
ContentsTypeFreebusy
;
}
if
(
type
==
i18nc
(
"type of folder content"
,
"Files"
)
)
{
return
CollectionGeneralPage
::
ContentsTypeFile
;
}
return
CollectionGeneralPage
::
ContentsTypeMail
;
//safety return value
}
static
QString
typeNameFromKolabType
(
const
QByteArray
&
type
)
{
if
(
type
==
"task"
||
type
==
"task.default"
)
{
return
i18nc
(
"type of folder content"
,
"Tasks"
);
}
if
(
type
==
"event"
||
type
==
"event.default"
)
{
return
i18nc
(
"type of folder content"
,
"Calendar"
);
}
if
(
type
==
"contact"
||
type
==
"contact.default"
)
{
return
i18nc
(
"type of folder content"
,
"Contacts"
);
}
if
(
type
==
"note"
||
type
==
"note.default"
)
{
return
i18nc
(
"type of folder content"
,
"Notes"
);
}
if
(
type
==
"journal"
||
type
==
"journal.default"
)
{
return
i18nc
(
"type of folder content"
,
"Journal"
);
}
if
(
type
==
"configuration"
||
type
==
"configuration.default"
)
{
return
i18nc
(
"type of folder content"
,
"Configuration"
);
}
if
(
type
==
"freebusy"
||
type
==
"freebusy.default"
)
{
return
i18nc
(
"type of folder content"
,
"Freebusy"
);
}
if
(
type
==
"file"
||
type
==
"file.default"
)
{
return
i18nc
(
"type of folder content"
,
"Files"
);
}
return
i18nc
(
"type of folder content"
,
"Mail"
);
}
static
QByteArray
kolabNameFromType
(
CollectionGeneralPage
::
FolderContentsType
type
)
{
switch
(
type
)
{
case
CollectionGeneralPage
::
ContentsTypeCalendar
:
return
"event"
;
case
CollectionGeneralPage
::
ContentsTypeContact
:
return
"contact"
;
case
CollectionGeneralPage
::
ContentsTypeNote
:
return
"note"
;
case
CollectionGeneralPage
::
ContentsTypeTask
:
return
"task"
;
case
CollectionGeneralPage
::
ContentsTypeJournal
:
return
"journal"
;
case
CollectionGeneralPage
::
ContentsTypeConfiguration
:
return
"configuration"
;
case
CollectionGeneralPage
::
ContentsTypeFreebusy
:
return
"freebusy"
;
case
CollectionGeneralPage
::
ContentsTypeFile
:
return
"file"
;
default:
return
QByteArray
();
}
}
static
CollectionGeneralPage
::
FolderContentsType
typeFromKolabName
(
const
QByteArray
&
name
)
{
if
(
name
==
"task"
||
name
==
"task.default"
)
{
return
CollectionGeneralPage
::
ContentsTypeTask
;
}
if
(
name
==
"event"
||
name
==
"event.default"
)
{
return
CollectionGeneralPage
::
ContentsTypeCalendar
;
}
if
(
name
==
"contact"
||
name
==
"contact.default"
)
{
return
CollectionGeneralPage
::
ContentsTypeContact
;
}
if
(
name
==
"note"
||
name
==
"note.default"
)
{
return
CollectionGeneralPage
::
ContentsTypeNote
;
}
if
(
name
==
"journal"
||
name
==
"journal.default"
)
{
return
CollectionGeneralPage
::
ContentsTypeJournal
;
}
if
(
name
==
"configuration"
||
name
==
"configuration.default"
)
{
return
CollectionGeneralPage
::
ContentsTypeConfiguration
;
}
if
(
name
==
"freebusy"
||
name
==
"freebusy.default"
)
{
return
CollectionGeneralPage
::
ContentsTypeFreebusy
;
}
if
(
name
==
"file"
||
name
==
"file.default"
)
{
return
CollectionGeneralPage
::
ContentsTypeFile
;
}
return
CollectionGeneralPage
::
ContentsTypeMail
;
}
void
CollectionGeneralPage
::
init
(
const
Akonadi
::
Collection
&
collection
)
{
mIsLocalSystemFolder
=
CommonKernel
->
isSystemFolderCollection
(
collection
)
||
...
...
@@ -350,7 +179,7 @@ void CollectionGeneralPage::init( const Akonadi::Collection &collection )
"automatically. Identities can be set up in the main configuration "
"dialog. (Settings -> Configure KMail)"
)
);
Collection
GeneralPage
::
FolderContentsType
contentsType
=
CollectionGeneralPage
::
ContentsTypeMail
;
Collection
TypeUtil
::
FolderContentsType
contentsType
=
CollectionTypeUtil
::
ContentsTypeMail
;
const
CollectionAnnotationsAttribute
*
annotationAttribute
=
collection
.
attribute
<
CollectionAnnotationsAttribute
>
();
...
...
@@ -362,10 +191,11 @@ void CollectionGeneralPage::init( const Akonadi::Collection &collection )
const
bool
sharedSeen
=
(
annotations
.
value
(
KOLAB_SHAREDSEEN
)
==
"true"
);
const
IncidencesFor
incidencesFor
=
incidencesForFromString
(
QLatin1String
(
annotations
.
value
(
KOLAB_INCIDENCESFOR
))
);
CollectionTypeUtil
collectionUtil
;
const
CollectionTypeUtil
::
IncidencesFor
incidencesFor
=
collectionUtil
.
incidencesForFromString
(
QLatin1String
(
annotations
.
value
(
KOLAB_INCIDENCESFOR
))
);
const
FolderContentsType
folderType
=
typeFromKolabName
(
annotations
.
value
(
KOLAB_FOLDERTYPE
)
);
const
CollectionTypeUtil
::
FolderContentsType
folderType
=
collectionUtil
.
typeFromKolabName
(
annotations
.
value
(
KOLAB_FOLDERTYPE
)
);
// Only do make this settable, if the IMAP resource is enabled
// and it's not the personal folders (those must not be changed)
...
...
@@ -376,15 +206,15 @@ void CollectionGeneralPage::init( const Akonadi::Collection &collection )
mContentsComboBox
=
new
KComboBox
(
this
);
label
->
setBuddy
(
mContentsComboBox
);
gl
->
addWidget
(
mContentsComboBox
,
row
,
1
);
mContentsComboBox
->
addItem
(
folderContentDescription
(
ContentsTypeMail
)
);
mContentsComboBox
->
addItem
(
folderContentDescription
(
ContentsTypeCalendar
)
);
mContentsComboBox
->
addItem
(
folderContentDescription
(
ContentsTypeContact
)
);
mContentsComboBox
->
addItem
(
folderContentDescription
(
ContentsTypeNote
)
);
mContentsComboBox
->
addItem
(
folderContentDescription
(
ContentsTypeTask
)
);
mContentsComboBox
->
addItem
(
folderContentDescription
(
ContentsTypeJournal
)
);
mContentsComboBox
->
addItem
(
folderContentDescription
(
ContentsTypeConfiguration
)
);
mContentsComboBox
->
addItem
(
folderContentDescription
(
ContentsTypeFreebusy
)
);
mContentsComboBox
->
addItem
(
folderContentDescription
(
ContentsTypeFile
)
);
mContentsComboBox
->
addItem
(
collectionUtil
.
folderContentDescription
(
CollectionTypeUtil
::
ContentsTypeMail
)
);
mContentsComboBox
->
addItem
(
collectionUtil
.
folderContentDescription
(
CollectionTypeUtil
::
ContentsTypeCalendar
)
);
mContentsComboBox
->
addItem
(
collectionUtil
.
folderContentDescription
(
CollectionTypeUtil
::
ContentsTypeContact
)
);
mContentsComboBox
->
addItem
(
collectionUtil
.
folderContentDescription
(
CollectionTypeUtil
::
ContentsTypeNote
)
);
mContentsComboBox
->
addItem
(
collectionUtil
.
folderContentDescription
(
CollectionTypeUtil
::
ContentsTypeTask
)
);
mContentsComboBox
->
addItem
(
collectionUtil
.
folderContentDescription
(
CollectionTypeUtil
::
ContentsTypeJournal
)
);
mContentsComboBox
->
addItem
(
collectionUtil
.
folderContentDescription
(
CollectionTypeUtil
::
ContentsTypeConfiguration
)
);
mContentsComboBox
->
addItem
(
collectionUtil
.
folderContentDescription
(
CollectionTypeUtil
::
ContentsTypeFreebusy
)
);
mContentsComboBox
->
addItem
(
collectionUtil
.
folderContentDescription
(
CollectionTypeUtil
::
ContentsTypeFile
)
);
mContentsComboBox
->
setCurrentIndex
(
contentsType
);
...
...
@@ -402,7 +232,7 @@ void CollectionGeneralPage::init( const Akonadi::Collection &collection )
// Kolab incidences-for annotation.
// Show incidences-for combobox if the contents type can be changed (new folder),
// or if it's set to calendar or task (existing folder)
if
(
folderType
==
Co
ntentsTypeCalendar
||
folderType
==
ContentsTypeTask
)
{
if
(
folderType
==
Co
llectionTypeUtil
::
ContentsTypeCalendar
||
folderType
==
CollectionTypeUtil
::
ContentsTypeTask
)
{
++
row
;
mIncidencesForComboBox
=
new
ContentsTypeComboBox
(
this
);
gl
->
addWidget
(
mIncidencesForComboBox
,
row
,
0
,
1
,
1
);
...
...
@@ -464,8 +294,9 @@ void CollectionGeneralPage::load( const Akonadi::Collection &collection )
if
(
annotationsAttribute
)
{
const
QMap
<
QByteArray
,
QByteArray
>
annotations
=
annotationsAttribute
->
annotations
();
if
(
annotations
.
contains
(
KOLAB_FOLDERTYPE
)
)
{
CollectionTypeUtil
collectionUtil
;
mContentsComboBox
->
setCurrentItem
(
typeNameFromKolabType
(
annotations
[
KOLAB_FOLDERTYPE
]
)
);
collectionUtil
.
typeNameFromKolabType
(
annotations
[
KOLAB_FOLDERTYPE
]
)
);
}
}
}
...
...
@@ -513,45 +344,46 @@ void CollectionGeneralPage::save( Collection &collection )
annotations
[
KOLAB_SHAREDSEEN
]
=
mSharedSeenFlagsCheckBox
->
isChecked
()
?
"true"
:
"false"
;
}
CollectionTypeUtil
collectionUtil
;
if
(
mIncidencesForComboBox
&&
mIncidencesForComboBox
->
isEnabled
()
)
{
annotations
[
KOLAB_INCIDENCESFOR
]
=
incidencesForToString
(
static_cast
<
IncidencesFor
>
(
mIncidencesForComboBox
->
currentIndex
()
)
).
toLatin1
();
collectionUtil
.
incidencesForToString
(
static_cast
<
CollectionTypeUtil
::
IncidencesFor
>
(
mIncidencesForComboBox
->
currentIndex
()
)
).
toLatin1
();
}
if
(
mContentsComboBox
)
{
const
Collection
GeneralPage
::
FolderContentsType
type
=
contentsTypeFromString
(
mContentsComboBox
->
currentText
()
);
const
Collection
TypeUtil
::
FolderContentsType
type
=
co
llectionUtil
.
co
ntentsTypeFromString
(
mContentsComboBox
->
currentText
()
);
const
QByteArray
kolabName
=
kolabNameFromType
(
type
)
;
const
QByteArray
kolabName
=
collectionUtil
.
kolabNameFromType
(
type
)
;
if
(
!
kolabName
.
isEmpty
()
)
{
QString
iconName
;
switch
(
type
)
{
case
ContentsTypeCalendar
:
case
Co
llectionTypeUtil
::
Co
ntentsTypeCalendar
:
iconName
=
QString
::
fromLatin1
(
"view-calendar"
);
break
;
case
ContentsTypeContact
:
case
Co
llectionTypeUtil
::
Co
ntentsTypeContact
:
iconName
=
QString
::
fromLatin1
(
"view-pim-contacts"
);
break
;
case
ContentsTypeNote
:
case
Co
llectionTypeUtil
::
Co
ntentsTypeNote
:
iconName
=
QString
::
fromLatin1
(
"view-pim-notes"
);
break
;
case
ContentsTypeTask
:
case
Co
llectionTypeUtil
::
Co
ntentsTypeTask
:
iconName
=
QString
::
fromLatin1
(
"view-pim-tasks"
);
break
;
case
ContentsTypeJournal
:
case
Co
llectionTypeUtil
::
Co
ntentsTypeJournal
:
iconName
=
QString
::
fromLatin1
(
"view-pim-journal"
);
break
;
case
ContentsTypeConfiguration
:
case
Co
llectionTypeUtil
::
Co
ntentsTypeConfiguration
:
iconName
=
QString
::
fromLatin1
(
"configure"
);
break
;
case
ContentsTypeFreebusy
:
case
Co
llectionTypeUtil
::
Co
ntentsTypeFreebusy
:
iconName
=
QString
::
fromLatin1
(
"view-calendar-agenda"
);
break
;
case
ContentsTypeFile
:
case
Co
llectionTypeUtil
::
Co
ntentsTypeFile
:
iconName
=
QString
::
fromLatin1
(
"document-open"
);
break
;
case
ContentsTypeMail
:
case
Co
llectionTypeUtil
::
Co
ntentsTypeMail
:
default:
break
;
}
...
...
@@ -586,10 +418,11 @@ void CollectionGeneralPage::slotIdentityCheckboxChanged()
void
CollectionGeneralPage
::
slotFolderContentsSelectionChanged
(
int
)
{
const
CollectionGeneralPage
::
FolderContentsType
type
=
contentsTypeFromString
(
mContentsComboBox
->
currentText
()
);
CollectionTypeUtil
collectionUtil
;
const
CollectionTypeUtil
::
FolderContentsType
type
=
collectionUtil
.
contentsTypeFromString
(
mContentsComboBox
->
currentText
()
);
if
(
type
!=
Collection
GeneralPage
::
ContentsTypeMail
)
{
if
(
type
!=
Collection
TypeUtil
::
ContentsTypeMail
)
{
const
QString
message
=
i18n
(
"You have configured this folder to contain groupware information. "
"That means that this folder will disappear once the configuration "
...
...
@@ -598,8 +431,8 @@ void CollectionGeneralPage::slotFolderContentsSelectionChanged( int )
KMessageBox
::
information
(
this
,
message
);
}
const
bool
enable
=
(
type
==
Collection
GeneralPage
::
ContentsTypeCalendar
||
type
==
Collection
GeneralPage
::
ContentsTypeTask
);
const
bool
enable
=
(
type
==
Collection
TypeUtil
::
ContentsTypeCalendar
||
type
==
Collection
TypeUtil
::
ContentsTypeTask
);
if
(
mIncidencesForComboBox
)
{
mIncidencesForComboBox
->
setEnabled
(
enable
);
...
...
mailcommon/collectionpage/collectiongeneralpage.h
View file @
4a8c1770
...
...
@@ -48,25 +48,6 @@ public:
void
load
(
const
Akonadi
::
Collection
&
collection
);
void
save
(
Akonadi
::
Collection
&
collection
);
enum
FolderContentsType
{
ContentsTypeMail
=
0
,
ContentsTypeCalendar
,
ContentsTypeContact
,
ContentsTypeNote
,
ContentsTypeTask
,
ContentsTypeJournal
,
ContentsTypeConfiguration
,
ContentsTypeFreebusy
,
ContentsTypeFile
,
ContentsTypeLast
=
ContentsTypeFile
};
enum
IncidencesFor
{
IncForNobody
,
IncForAdmins
,
IncForReaders
};
protected:
void
init
(
const
Akonadi
::
Collection
&
);
...
...
mailcommon/collectionpage/collectiontypeutil.cpp
View file @
4a8c1770
...
...
@@ -59,6 +59,20 @@ QString CollectionTypeUtil::folderContentDescription( CollectionTypeUtil::Folder
}
QString
CollectionTypeUtil
::
incidencesForToString
(
CollectionTypeUtil
::
IncidencesFor
type
)
{
switch
(
type
)
{
case
CollectionTypeUtil
::
IncForNobody
:
return
QLatin1String
(
"nobody"
);
case
CollectionTypeUtil
::
IncForAdmins
:
return
QLatin1String
(
"admins"
);
case
CollectionTypeUtil
::
IncForReaders
:
return
QLatin1String
(
"readers"
);
}
return
QString
();
// can't happen
}
CollectionTypeUtil
::
IncidencesFor
CollectionTypeUtil
::
incidencesForFromString
(
const
QString
&
string
)
{
if
(
string
==
QLatin1String
(
"nobody"
)
)
{
...
...
@@ -127,3 +141,66 @@ QByteArray CollectionTypeUtil::kolabNameFromType( CollectionTypeUtil::FolderCont
return
QByteArray
();
}
}
CollectionTypeUtil
::
FolderContentsType
CollectionTypeUtil
::
contentsTypeFromString
(
const
QString
&
type
)
{
if
(
type
==
i18nc
(
"type of folder content"
,
"Mail"
)
)
{
return
CollectionTypeUtil
::
ContentsTypeMail
;
}
if
(
type
==
i18nc
(
"type of folder content"
,
"Calendar"
)
)
{
return
CollectionTypeUtil
::
ContentsTypeCalendar
;
}
if
(
type
==
i18nc
(
"type of folder content"
,
"Contacts"
)
)
{
return
CollectionTypeUtil
::
ContentsTypeContact
;
}
if
(
type
==
i18nc
(
"type of folder content"
,
"Notes"
)
)
{
return
CollectionTypeUtil
::
ContentsTypeNote
;
}
if
(
type
==
i18nc
(
"type of folder content"
,
"Tasks"
)
)
{
return
CollectionTypeUtil
::
ContentsTypeTask
;
}
if
(
type
==
i18nc
(
"type of folder content"
,
"Journal"
)
)
{
return
CollectionTypeUtil
::
ContentsTypeJournal
;
}
if
(
type
==
i18nc
(
"type of folder content"
,
"Configuration"
)
)
{
return
CollectionTypeUtil
::
ContentsTypeConfiguration
;
}
if
(
type
==
i18nc
(
"type of folder content"
,
"Freebusy"
)
)
{
return
CollectionTypeUtil
::
ContentsTypeFreebusy
;
}
if
(
type
==
i18nc
(
"type of folder content"
,
"Files"
)
)
{
return
CollectionTypeUtil
::
ContentsTypeFile
;
}
return
CollectionTypeUtil
::
ContentsTypeMail
;
//safety return value
}
QString
CollectionTypeUtil
::
typeNameFromKolabType
(
const
QByteArray
&
type
)
{
if
(
type
==
"task"
||
type
==
"task.default"
)
{
return
i18nc
(
"type of folder content"
,
"Tasks"
);
}
if
(
type
==
"event"
||
type
==
"event.default"
)
{
return
i18nc
(
"type of folder content"
,
"Calendar"
);
}
if
(
type
==
"contact"
||
type
==
"contact.default"
)
{
return
i18nc
(
"type of folder content"
,
"Contacts"
);
}
if
(
type
==
"note"
||
type
==
"note.default"
)
{
return
i18nc
(
"type of folder content"
,
"Notes"
);
}
if
(
type
==
"journal"
||
type
==
"journal.default"
)
{
return
i18nc
(
"type of folder content"
,
"Journal"
);
}
if
(
type
==
"configuration"
||
type
==
"configuration.default"
)
{
return
i18nc
(
"type of folder content"
,
"Configuration"
);
}
if
(
type
==
"freebusy"
||
type
==
"freebusy.default"
)
{
return
i18nc
(
"type of folder content"
,
"Freebusy"
);
}
if
(
type
==
"file"
||
type
==
"file.default"
)
{
return
i18nc
(
"type of folder content"
,
"Files"
);
}
return
i18nc
(
"type of folder content"
,
"Mail"
);
}
mailcommon/collectionpage/collectiontypeutil.h
View file @
4a8c1770
...
...
@@ -55,6 +55,9 @@ public:
CollectionTypeUtil
::
FolderContentsType
typeFromKolabName
(
const
QByteArray
&
name
);
QString
folderContentDescription
(
CollectionTypeUtil
::
FolderContentsType
type
);
QByteArray
kolabNameFromType
(
CollectionTypeUtil
::
FolderContentsType
type
);
QString
incidencesForToString
(
CollectionTypeUtil
::
IncidencesFor
type
);
CollectionTypeUtil
::
FolderContentsType
contentsTypeFromString
(
const
QString
&
type
);
QString
typeNameFromKolabType
(
const
QByteArray
&
type
);
};
}
#endif // COLLECTIONTYPEUTIL_H
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