| 657 | } |
| 658 | |
| 659 | void ProjectController::initialize() |
| 660 | { |
| 661 | Q_D(ProjectController); |
| 662 | |
| 663 | d->buildset = new ProjectBuildSetModel( this ); |
| 664 | buildSetModel()->loadFromSession( Core::self()->activeSession() ); |
| 665 | connect( this, &ProjectController::projectOpened, |
| 666 | d->buildset, &ProjectBuildSetModel::loadFromProject ); |
| 667 | connect( this, &ProjectController::projectClosing, |
| 668 | d->buildset, &ProjectBuildSetModel::saveToProject ); |
| 669 | connect( this, &ProjectController::projectClosed, |
| 670 | d->buildset, &ProjectBuildSetModel::projectClosed ); |
| 671 | |
| 672 | loadSettings(false); |
| 673 | d->dialog = new ProjectDialogProvider(d); |
| 674 | |
| 675 | QDBusConnection::sessionBus().registerObject( QStringLiteral("/org/kdevelop/ProjectController"), |
| 676 | this, QDBusConnection::ExportScriptableSlots ); |
| 677 | |
| 678 | KSharedConfigPtr config = Core::self()->activeSession()->config(); |
| 679 | KConfigGroup group = config->group(QStringLiteral("General Options")); |
| 680 | const auto projects = group.readEntry( "Open Projects", QList<QUrl>() ); |
| 681 | |
| 682 | connect( Core::self()->selectionController(), &ISelectionController::selectionChanged, |
| 683 | this, [this]() { Q_D(ProjectController); d->updateActionStates(); } ); |
| 684 | connect(this, &ProjectController::projectOpened, |
| 685 | this, [this]() { Q_D(ProjectController); d->updateActionStates(); }); |
| 686 | connect(this, &ProjectController::projectClosing, |
| 687 | this, [this]() { Q_D(ProjectController); d->updateActionStates(); }); |
| 688 | |
| 689 | QTimer::singleShot(0, this, [this, projects](){ |
| 690 | openProjects(projects); |
| 691 | emit initialized(); |
| 692 | }); |
| 693 | } |
| 694 | |
| 695 | void ProjectController::openProjects(const QList<QUrl>& projects) |
| 696 | { |
nothing calls this directly
no test coverage detected