104 CaIconDescription iconDesc; |
104 CaIconDescription iconDesc; |
105 if(pref.contains(hsItemId)) |
105 if(pref.contains(hsItemId)) |
106 { |
106 { |
107 QSharedPointer<CaEntry> update_entry = CaService::instance()->getEntry(pref.take(hsItemId).toInt()); |
107 QSharedPointer<CaEntry> update_entry = CaService::instance()->getEntry(pref.take(hsItemId).toInt()); |
108 |
108 |
109 update_entry->setText(pref.take(hsItemName).toString()); |
109 if(pref.contains(hsItemLocName)) |
110 |
110 { |
111 update_entry->setDescription(pref.take(hsItemDescription).toString()); |
111 update_entry->setText(pref.take(hsItemLocName).toString(),true); |
|
112 } |
|
113 else |
|
114 { |
|
115 update_entry->setText(pref.take(hsItemName).toString()); |
|
116 } |
|
117 |
|
118 if(pref.contains(hsItemLocDescription)) |
|
119 { |
|
120 update_entry->setDescription(pref.take(hsItemLocDescription).toString(), true); |
|
121 } |
|
122 else |
|
123 { |
|
124 update_entry->setDescription(pref.take(hsItemDescription).toString()); |
|
125 } |
112 |
126 |
113 iconDesc.setFilename(pref.take(hsIconFileName).toString()); |
127 iconDesc.setFilename(pref.take(hsIconFileName).toString()); |
114 iconDesc.setSkinId(pref.take(hsIconName).toString()); |
128 iconDesc.setSkinId(pref.take(hsIconName).toString()); |
115 iconDesc.setApplicationId(pref.take(hsIconApplicationId).toString()); |
129 iconDesc.setApplicationId(pref.take(hsIconApplicationId).toString()); |
116 update_entry->setIconDescription(iconDesc); |
130 update_entry->setIconDescription(iconDesc); |
120 update_entry->setAttribute(k.key(),k.value().toString()); |
134 update_entry->setAttribute(k.key(),k.value().toString()); |
121 } |
135 } |
122 |
136 |
123 result = CaService::instance()->updateEntry(*update_entry); |
137 result = CaService::instance()->updateEntry(*update_entry); |
124 } |
138 } |
125 else if (pref.contains(hsItemName) && pref.contains(hsitemLaunchUri) && pref.contains(hsitemPublisherId)) |
139 else if ((pref.contains(hsItemName) || pref.contains(hsItemLocName)) && pref.contains(hsitemLaunchUri) && pref.contains(hsitemPublisherId)) |
126 { |
140 { |
127 CaEntry add_entry(ItemEntryRole); |
141 CaEntry add_entry(ItemEntryRole); |
128 add_entry.setEntryTypeName(templatedApplicationTypeName()); |
142 add_entry.setEntryTypeName(templatedApplicationTypeName()); |
129 // mandatory values |
143 // mandatory values |
130 add_entry.setText(pref.take(hsItemName).toString()); |
144 if(pref.contains(hsItemLocName)) |
|
145 { |
|
146 add_entry.setText(pref.take(hsItemLocName).toString(),true); |
|
147 } |
|
148 else |
|
149 { |
|
150 add_entry.setText(pref.take(hsItemName).toString()); |
|
151 } |
131 |
152 |
132 iconDesc.setFilename(pref.take(hsIconFileName).toString()); |
153 iconDesc.setFilename(pref.take(hsIconFileName).toString()); |
133 iconDesc.setSkinId(pref.take(hsIconName).toString()); |
154 iconDesc.setSkinId(pref.take(hsIconName).toString()); |
134 iconDesc.setApplicationId(pref.take(hsIconApplicationId).toString()); |
155 iconDesc.setApplicationId(pref.take(hsIconApplicationId).toString()); |
135 add_entry.setIconDescription(iconDesc); |
156 add_entry.setIconDescription(iconDesc); |
136 |
157 |
137 add_entry.setDescription(pref.take(hsItemDescription).toString()); |
158 if(pref.contains(hsItemLocDescription)) |
|
159 { |
|
160 add_entry.setDescription(pref.take(hsItemLocDescription).toString(), true); |
|
161 } |
|
162 else |
|
163 { |
|
164 add_entry.setDescription(pref.take(hsItemDescription).toString()); |
|
165 } |
138 QMapIterator<QString, QVariant> k(pref); |
166 QMapIterator<QString, QVariant> k(pref); |
139 while (k.hasNext()) { |
167 while (k.hasNext()) { |
140 k.next(); |
168 k.next(); |
141 add_entry.setAttribute(k.key(),k.value().toString()); |
169 add_entry.setAttribute(k.key(),k.value().toString()); |
142 } |
170 } |