| 200 | } |
| 201 | |
| 202 | void QtHelpConfig::modify(QTreeWidgetItem* item) |
| 203 | { |
| 204 | if (!item) |
| 205 | return; |
| 206 | |
| 207 | QPointer<QtHelpConfigEditDialog> dialog = new QtHelpConfigEditDialog(item, this); |
| 208 | if (item->text(GhnsColumn) != QLatin1String("0")) { |
| 209 | dialog->qchRequester->setText(i18n("Documentation provided by GHNS")); |
| 210 | dialog->qchRequester->setEnabled(false); |
| 211 | } else { |
| 212 | dialog->qchRequester->setText(item->text(PathColumn)); |
| 213 | dialog->qchRequester->setEnabled(true); |
| 214 | } |
| 215 | dialog->qchName->setText(item->text(NameColumn)); |
| 216 | dialog->qchIcon->setIcon(item->text(IconColumn)); |
| 217 | if (dialog->exec()) { |
| 218 | item->setIcon(NameColumn, QIcon(dialog->qchIcon->icon())); |
| 219 | item->setText(NameColumn, dialog->qchName->text()); |
| 220 | item->setText(IconColumn, dialog->qchIcon->icon()); |
| 221 | if(item->text(GhnsColumn) == QLatin1String("0")) { |
| 222 | item->setText(PathColumn, dialog->qchRequester->text()); |
| 223 | } |
| 224 | |
| 225 | emit changed(); |
| 226 | } |
| 227 | delete dialog; |
| 228 | } |
| 229 | |
| 230 | bool QtHelpConfig::checkNamespace(const QString& filename, QTreeWidgetItem* modifiedItem) |
| 231 | { |