Changeset View
Changeset View
Standalone View
Standalone View
shell/projectcontroller.cpp
Show First 20 Lines • Show All 407 Lines • ▼ Show 20 Line(s) | |||||
408 | { | 408 | { | ||
409 | KSharedConfigPtr cfg = KSharedConfig::openConfig( configPath, KConfig::SimpleConfig ); | 409 | KSharedConfigPtr cfg = KSharedConfig::openConfig( configPath, KConfig::SimpleConfig ); | ||
410 | KConfigGroup grp = cfg->group( "Project" ); | 410 | KConfigGroup grp = cfg->group( "Project" ); | ||
411 | QString defaultName = dlg->projectFileUrl().adjusted(QUrl::RemoveFilename | QUrl::StripTrailingSlash).fileName(); | 411 | QString defaultName = dlg->projectFileUrl().adjusted(QUrl::RemoveFilename | QUrl::StripTrailingSlash).fileName(); | ||
412 | return (grp.readEntry( "Name", QString() ) == dlg->projectName() || dlg->projectName() == defaultName) && | 412 | return (grp.readEntry( "Name", QString() ) == dlg->projectName() || dlg->projectName() == defaultName) && | ||
413 | grp.readEntry( "Manager", QString() ) == dlg->projectManager(); | 413 | grp.readEntry( "Manager", QString() ) == dlg->projectManager(); | ||
414 | } | 414 | } | ||
415 | 415 | | |||
416 | QUrl ProjectDialogProvider::askProjectConfigLocation(bool fetch, const QUrl& startUrl) | 416 | QUrl ProjectDialogProvider::askProjectConfigLocation(bool fetch, const QUrl& startUrl, | ||
417 | const QUrl& repoUrl, IPlugin* vcsOrProviderPlugin) | ||||
mwolff: & placement | |||||
417 | { | 418 | { | ||
418 | Q_ASSERT(d); | 419 | Q_ASSERT(d); | ||
419 | OpenProjectDialog dlg( fetch, startUrl, Core::self()->uiController()->activeMainWindow() ); | 420 | OpenProjectDialog dlg(fetch, startUrl, repoUrl, vcsOrProviderPlugin, Core::self()->uiController()->activeMainWindow()); | ||
420 | if(dlg.exec() == QDialog::Rejected) | 421 | if(dlg.exec() == QDialog::Rejected) | ||
421 | return QUrl(); | 422 | return QUrl(); | ||
422 | 423 | | |||
423 | QUrl projectFileUrl = dlg.projectFileUrl(); | 424 | QUrl projectFileUrl = dlg.projectFileUrl(); | ||
424 | qCDebug(SHELL) << "selected project:" << projectFileUrl << dlg.projectName() << dlg.projectManager(); | 425 | qCDebug(SHELL) << "selected project:" << projectFileUrl << dlg.projectName() << dlg.projectManager(); | ||
425 | if ( dlg.projectManager() == "<built-in>" ) { | 426 | if ( dlg.projectManager() == "<built-in>" ) { | ||
426 | return projectFileUrl; | 427 | return projectFileUrl; | ||
427 | } | 428 | } | ||
▲ Show 20 Lines • Show All 399 Lines • ▼ Show 20 Line(s) | 777 | #endif | |||
827 | } | 828 | } | ||
828 | 829 | | |||
829 | if ( !url.isEmpty() ) | 830 | if ( !url.isEmpty() ) | ||
830 | { | 831 | { | ||
831 | d->importProject(url); | 832 | d->importProject(url); | ||
832 | } | 833 | } | ||
833 | } | 834 | } | ||
834 | 835 | | |||
836 | void ProjectController::fetchProjectFromUrl(const QUrl& repoUrl, IPlugin* vcsOrProviderPlugin) | ||||
mwolff: style: & next to typename | |||||
837 | { | ||||
838 | const QUrl url = d->dialog->askProjectConfigLocation(true, QUrl(), repoUrl, vcsOrProviderPlugin); | ||||
mwolff: const | |||||
839 | | ||||
840 | if (!url.isEmpty()) { | ||||
841 | d->importProject(url); | ||||
842 | } | ||||
843 | } | ||||
844 | | ||||
835 | void ProjectController::fetchProject() | 845 | void ProjectController::fetchProject() | ||
836 | { | 846 | { | ||
837 | QUrl url = d->dialog->askProjectConfigLocation(true); | 847 | QUrl url = d->dialog->askProjectConfigLocation(true); | ||
838 | 848 | | |||
839 | if ( !url.isEmpty() ) | 849 | if ( !url.isEmpty() ) | ||
840 | { | 850 | { | ||
841 | d->importProject(url); | 851 | d->importProject(url); | ||
842 | } | 852 | } | ||
▲ Show 20 Lines • Show All 380 Lines • Show Last 20 Lines |
& placement