[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [akonadi-google] /: Use user-friendly name of resources in Resource
From:       Dan_Vrátil <dan () progdan ! cz>
Date:       2011-09-05 10:32:49
Message-ID: 20110905103249.A4260A607A () git ! kde ! org
[Download RAW message or body]

Git commit 0d7c964b76ecc6217437d1c3f55f9e58d661d778 by Dan Vrátil.
Committed on 05/09/2011 at 12:32.
Pushed by dvratil into branch 'master'.

Use user-friendly name of resources in Resource Configuration dialog

M  +3    -0    calendar/calendarresource.cpp
M  +8    -0    contacts/contactsresource.cpp
M  +5    -2    tasks/tasksresource.cpp

http://commits.kde.org/akonadi-google/0d7c964b76ecc6217437d1c3f55f9e58d661d778

diff --git a/calendar/calendarresource.cpp b/calendar/calendarresource.cpp
index 5559e24..3c0f48e 100644
--- a/calendar/calendarresource.cpp
+++ b/calendar/calendarresource.cpp
@@ -179,6 +179,9 @@ void CalendarResource::retrieveCollections()
 		     Collection::CanDeleteItem);
   calendar.addAttribute(attr);
 
+  /* Use user-friendly name in resource configuration dialog */
+  setAgentName(i18n("Google Calendar - %1", Settings::self()->calendarName()));  
+  
   collectionsRetrieved(Collection::List() << calendar);
 }
 
diff --git a/contacts/contactsresource.cpp b/contacts/contactsresource.cpp
index 0c5fc0e..33be8ba 100644
--- a/contacts/contactsresource.cpp
+++ b/contacts/contactsresource.cpp
@@ -154,6 +154,10 @@ bool ContactsResource::retrieveItem(const Akonadi::Item& item, const QSet< QByte
 
 void ContactsResource::retrieveCollections()
 {
+  
+  EntityDisplayAttribute* displayAttribute = new EntityDisplayAttribute();
+  displayAttribute->setDisplayName(i18n("Google Contacts"));
+
   Collection contacts;
   contacts.setRemoteId("googleContacts");
   contacts.setName(i18n("Google Contacts"));
@@ -162,8 +166,12 @@ void ContactsResource::retrieveCollections()
   contacts.setRights(Collection::CanDeleteItem |
 		     Collection::CanCreateItem |
 		     Collection::CanChangeItem);
+  contacts.addAttribute(displayAttribute);
 
   collectionsRetrieved(Collection::List() << contacts);
+  
+  /* Use user-friendly name in resource configuration dialog */
+  setAgentName(i18n("Google Contacts"));    
 }
 
 void ContactsResource::initialItemFetchJobFinished(KJob* job)
diff --git a/tasks/tasksresource.cpp b/tasks/tasksresource.cpp
index f7439ed..0356605 100644
--- a/tasks/tasksresource.cpp
+++ b/tasks/tasksresource.cpp
@@ -1,4 +1,4 @@
- /*
+/*
     Akonadi Google - Tasks Resource
     Copyright (C) 2011  Dan Vratil <dan@progdan.cz>
 
@@ -76,7 +76,7 @@ TasksResource::TasksResource(const QString &id):
   
   changeRecorder()->fetchCollection(true);
   changeRecorder()->itemFetchScope().fetchFullPayload(true);
-
+  
   synchronize();  
 }
 
@@ -179,6 +179,9 @@ void TasksResource::retrieveCollections()
   taskList.addAttribute(attr);
 
   collectionsRetrieved(Collection::List() << taskList);
+
+  /* Use user-friendly name in resource configuration dialog */  
+  setAgentName(i18n("Google Tasks - %1", Settings::self()->taskListName()));
 }
 
 void TasksResource::itemAdded(const Akonadi::Item& item, const Akonadi::Collection& collection)

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic