Changeset View
Changeset View
Standalone View
Standalone View
plugins/appwizard/projectselectionpage.cpp
Show First 20 Lines • Show All 132 Lines • ▼ Show 20 Line(s) | 122 | { | |||
---|---|---|---|---|---|
133 | ui->description->setText(current.data(KDevelop::TemplatesModel::CommentRole).toString()); | 133 | ui->description->setText(current.data(KDevelop::TemplatesModel::CommentRole).toString()); | ||
134 | validateData(); | 134 | validateData(); | ||
135 | 135 | | |||
136 | ui->propertiesBox->setEnabled(true); | 136 | ui->propertiesBox->setEnabled(true); | ||
137 | } | 137 | } | ||
138 | 138 | | |||
139 | QString ProjectSelectionPage::selectedTemplate() | 139 | QString ProjectSelectionPage::selectedTemplate() | ||
140 | { | 140 | { | ||
141 | QStandardItem *item = getCurrentItem(); | 141 | QStandardItem *item = currentItem(); | ||
142 | if (item) | 142 | if (item) | ||
143 | return item->data().toString(); | 143 | return item->data().toString(); | ||
144 | else | 144 | else | ||
145 | return QString(); | 145 | return QString(); | ||
146 | } | 146 | } | ||
147 | 147 | | |||
148 | QUrl ProjectSelectionPage::location() | 148 | QUrl ProjectSelectionPage::location() | ||
149 | { | 149 | { | ||
▲ Show 20 Lines • Show All 67 Lines • ▼ Show 20 Line(s) | 216 | { | |||
217 | ui->locationValidWidget->setText( i18n("Unable to create subdirectories, " | 217 | ui->locationValidWidget->setText( i18n("Unable to create subdirectories, " | ||
218 | "missing permissions on: %1", tDir.absolutePath()) ); | 218 | "missing permissions on: %1", tDir.absolutePath()) ); | ||
219 | ui->locationValidWidget->animatedShow(); | 219 | ui->locationValidWidget->animatedShow(); | ||
220 | emit invalid(); | 220 | emit invalid(); | ||
221 | return; | 221 | return; | ||
222 | } | 222 | } | ||
223 | } | 223 | } | ||
224 | 224 | | |||
225 | QStandardItem* item = getCurrentItem(); | 225 | QStandardItem* item = currentItem(); | ||
226 | if( item && !item->hasChildren() ) | 226 | if( item && !item->hasChildren() ) | ||
227 | { | 227 | { | ||
228 | ui->locationValidWidget->animatedHide(); | 228 | ui->locationValidWidget->animatedHide(); | ||
229 | emit valid(); | 229 | emit valid(); | ||
230 | } else | 230 | } else | ||
231 | { | 231 | { | ||
232 | ui->locationValidWidget->setText( i18n("Invalid project template, please choose a leaf item") ); | 232 | ui->locationValidWidget->setText( i18n("Invalid project template, please choose a leaf item") ); | ||
233 | ui->locationValidWidget->animatedShow(); | 233 | ui->locationValidWidget->animatedShow(); | ||
Show All 28 Lines | 258 | { | |||
262 | 262 | | |||
263 | QByteArray tReplace = QUrl::toPercentEncoding( tChar ); | 263 | QByteArray tReplace = QUrl::toPercentEncoding( tChar ); | ||
264 | tEncodedName.replace( tEncodedName.at( i ) ,tReplace ); | 264 | tEncodedName.replace( tEncodedName.at( i ) ,tReplace ); | ||
265 | i = i + tReplace.size() - 1; | 265 | i = i + tReplace.size() - 1; | ||
266 | } | 266 | } | ||
267 | return tEncodedName; | 267 | return tEncodedName; | ||
268 | } | 268 | } | ||
269 | 269 | | |||
270 | QStandardItem* ProjectSelectionPage::getCurrentItem() const | 270 | QStandardItem* ProjectSelectionPage::currentItem() const | ||
271 | { | 271 | { | ||
272 | QStandardItem* item = m_templatesModel->itemFromIndex( ui->listView->currentIndex() ); | 272 | QStandardItem* item = m_templatesModel->itemFromIndex( ui->listView->currentIndex() ); | ||
273 | if ( item && item->hasChildren() ) | 273 | if ( item && item->hasChildren() ) | ||
274 | { | 274 | { | ||
275 | const int currect = ui->templateType->currentIndex(); | 275 | const int currect = ui->templateType->currentIndex(); | ||
276 | const QModelIndex idx = m_templatesModel->index( currect, 0, ui->templateType->rootModelIndex() ); | 276 | const QModelIndex idx = m_templatesModel->index( currect, 0, ui->templateType->rootModelIndex() ); | ||
277 | item = m_templatesModel->itemFromIndex(idx); | 277 | item = m_templatesModel->itemFromIndex(idx); | ||
278 | } | 278 | } | ||
▲ Show 20 Lines • Show All 88 Lines • Show Last 20 Lines |