From 9fc0a05c3b12d6a23101db8b7d6814b6f94c9872 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eberhard=20Gr=C3=A4ther?= Date: Mon, 10 Feb 2020 23:45:31 +0100 Subject: [PATCH] ui: Fixes in Source Group UI (issue #723) (#915) * fixed Source Group setup from Visual Studio Extension * fixed crashes in project setup due to use of std::shared_ptr * fixed source file count not updated on 'show files' click * fixed passing wheel events to parents when list boxes can't handle them --- src/lib/CMakeLists.txt | 1 - .../type/SourceGroupSettingsCxxCdbVs.h | 11 ---- src/lib_gui/qt/element/dialog/QtListBox.cpp | 46 ++++++------- src/lib_gui/qt/element/dialog/QtListBox.h | 9 +-- .../qt/project_wizard/QtProjectWizard.cpp | 65 ++++++++----------- .../qt/project_wizard/QtProjectWizard.h | 1 + .../project_wizard/QtProjectWizardWindow.cpp | 5 ++ .../qt/project_wizard/QtProjectWizardWindow.h | 1 + .../content/QtProjectWizardContent.cpp | 14 ++-- .../content/QtProjectWizardContent.h | 3 +- .../content/QtProjectWizardContentGroup.cpp | 11 ++++ .../content/QtProjectWizardContentGroup.h | 1 + .../content/QtProjectWizardContentVS.cpp | 18 +++-- .../path/QtProjectWizardContentPathCDB.cpp | 15 +++-- .../path/QtProjectWizardContentPathCDB.h | 1 + ...tProjectWizardContentPathsHeaderSearch.cpp | 16 ++--- ...rojectWizardContentPathsIndexedHeaders.cpp | 22 +++---- 17 files changed, 124 insertions(+), 116 deletions(-) delete mode 100644 src/lib/settings/source_group/type/SourceGroupSettingsCxxCdbVs.h diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt index c9624c28..2e2bbbf4 100644 --- a/src/lib/CMakeLists.txt +++ b/src/lib/CMakeLists.txt @@ -645,7 +645,6 @@ if (BUILD_CXX_LANGUAGE_PACKAGE) settings/source_group/type/SourceGroupSettingsCppEmpty.h settings/source_group/type/SourceGroupSettingsCustomCommand.h settings/source_group/type/SourceGroupSettingsCxxCdb.h - settings/source_group/type/SourceGroupSettingsCxxCdbVs.h settings/source_group/type/SourceGroupSettingsCxxCodeblocks.h ) endif() diff --git a/src/lib/settings/source_group/type/SourceGroupSettingsCxxCdbVs.h b/src/lib/settings/source_group/type/SourceGroupSettingsCxxCdbVs.h deleted file mode 100644 index 0a507e69..00000000 --- a/src/lib/settings/source_group/type/SourceGroupSettingsCxxCdbVs.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef SOURCE_GROUP_SETTINGS_CXX_CDB_VS_H -#define SOURCE_GROUP_SETTINGS_CXX_CDB_VS_H - -#include "SourceGroupSettingsCxxCdb.h" - -class SourceGroupSettingsCxxCdbVs: public SourceGroupSettingsCxxCdb -{ - using SourceGroupSettingsCxxCdb::SourceGroupSettingsCxxCdb; -}; - -#endif // SOURCE_GROUP_SETTINGS_CXX_CDB_VS_H diff --git a/src/lib_gui/qt/element/dialog/QtListBox.cpp b/src/lib_gui/qt/element/dialog/QtListBox.cpp index a13d6c8c..4ecb6014 100644 --- a/src/lib_gui/qt/element/dialog/QtListBox.cpp +++ b/src/lib_gui/qt/element/dialog/QtListBox.cpp @@ -11,6 +11,29 @@ #include "utilityQt.h" #include "utilityString.h" +void QtListWidget::mouseDoubleClickEvent(QMouseEvent* event) +{ + QModelIndex index; + emit doubleClicked(index); +} + +void QtListWidget::wheelEvent(QWheelEvent* event) +{ + QScrollBar* bar = verticalScrollBar(); + bool down = event->angleDelta().y() < 0; + + if (bar->minimum() == bar->maximum() || + (down && bar->value() == bar->maximum()) || + (!down && bar->value() == bar->minimum())) + { + event->ignore(); + } + else + { + QListWidget::wheelEvent(event); + } +} + QtListBox::QtListBox(QWidget* parent, const QString& listName): QFrame(parent), m_listName(listName) { QBoxLayout* layout = new QVBoxLayout(); @@ -87,29 +110,6 @@ void QtListBox::addWidgetToBar(QWidget* widget) } } -bool QtListBox::event(QEvent* event) -{ - // Prevent nested ScrollAreas from scrolling at the same time; - if (event->type() == QEvent::Wheel) - { - QRect rect = m_list->viewport()->rect(); - QPoint pos = m_list->mapFromGlobal(dynamic_cast(event)->globalPos()); - QScrollBar* bar = m_list->verticalScrollBar(); - - if (bar->minimum() != bar->maximum() && rect.contains(pos)) - { - bool down = dynamic_cast(event)->angleDelta().y() < 0; - - if ((down && bar->value() != bar->maximum()) || (!down && bar->value() != bar->minimum())) - { - return true; - } - } - } - - return QFrame::event(event); -} - QtListBoxItem* QtListBox::addListBoxItemWithText(const QString& text) { QtListBoxItem* item = addListBoxItem(); diff --git a/src/lib_gui/qt/element/dialog/QtListBox.h b/src/lib_gui/qt/element/dialog/QtListBox.h index 2c259327..88b49fce 100644 --- a/src/lib_gui/qt/element/dialog/QtListBox.h +++ b/src/lib_gui/qt/element/dialog/QtListBox.h @@ -6,7 +6,6 @@ #include "FilePath.h" -class QEvent; class QHBoxLayout; class QListWidgetItem; class QPushButton; @@ -22,11 +21,8 @@ public: QtListWidget(QWidget* parent = nullptr): QListWidget(parent) {} protected: - void mouseDoubleClickEvent(QMouseEvent* event) override - { - QModelIndex index; - emit doubleClicked(index); - } + void mouseDoubleClickEvent(QMouseEvent* event) override; + void wheelEvent(QWheelEvent* event) override; }; class QtListBox: public QFrame @@ -45,7 +41,6 @@ public: protected: void addWidgetToBar(QWidget* widget); - bool event(QEvent* event) override; QtListWidget* m_list; diff --git a/src/lib_gui/qt/project_wizard/QtProjectWizard.cpp b/src/lib_gui/qt/project_wizard/QtProjectWizard.cpp index 7d105d92..d3a7b24a 100644 --- a/src/lib_gui/qt/project_wizard/QtProjectWizard.cpp +++ b/src/lib_gui/qt/project_wizard/QtProjectWizard.cpp @@ -52,7 +52,6 @@ # include "SourceGroupSettingsCEmpty.h" # include "SourceGroupSettingsCppEmpty.h" # include "SourceGroupSettingsCxxCdb.h" -# include "SourceGroupSettingsCxxCdbVs.h" # include "SourceGroupSettingsCxxCodeblocks.h" #endif // BUILD_CXX_LANGUAGE_PACKAGE @@ -237,32 +236,6 @@ void addSourceGroupContents( group->addContent(new QtProjectWizardContentFlags(settings, window, true)); } -template <> -void addSourceGroupContents( - QtProjectWizardContentGroup* group, std::shared_ptr settings, QtProjectWizardWindow* window) -{ - group->addContent(new QtProjectWizardContentVS(window)); // TODO make separate window - group->addSpace(); - - group->addContent(new QtProjectWizardContentPathCDB(settings, window)); - group->addContent(new QtProjectWizardContentPathsIndexedHeaders(settings, window, "Compilation Database")); - group->addContent(new QtProjectWizardContentPathsExclude(settings, window)); - group->addSpace(); - - group->addContent(new QtProjectWizardContentPathsHeaderSearch(settings, window, true)); - group->addContent(new QtProjectWizardContentPathsHeaderSearchGlobal(window)); - group->addSpace(); - - if (utility::getOsType() == OS_MAC) - { - group->addContent(new QtProjectWizardContentPathsFrameworkSearch(settings, window, true)); - group->addContent(new QtProjectWizardContentPathsFrameworkSearchGlobal(window)); - group->addSpace(); - } - - group->addContent(new QtProjectWizardContentFlags(settings, window, true)); -} - #endif // BUILD_CXX_LANGUAGE_PACKAGE #if BUILD_JAVA_LANGUAGE_PACKAGE @@ -391,8 +364,8 @@ void QtProjectWizard::newProjectFromCDB(const FilePath& filePath) cancelSourceGroup(); - std::shared_ptr sourceGroupSettings = - std::make_shared( + std::shared_ptr sourceGroupSettings = + std::make_shared( utility::getUuidString(), m_projectSettings.get()); sourceGroupSettings->setCompilationDatabasePath(filePath); @@ -718,12 +691,6 @@ void QtProjectWizard::selectedSourceGroupChanged(int index) { addSourceGroupContents(summary, settings, this); } - else if ( - std::shared_ptr settings = - std::dynamic_pointer_cast(group)) - { - addSourceGroupContents(summary, settings, this); - } #endif // BUILD_CXX_LANGUAGE_PACKAGE #if BUILD_JAVA_LANGUAGE_PACKAGE else if ( @@ -928,6 +895,28 @@ void QtProjectWizard::newSourceGroup() window->updateSubTitle(QStringLiteral("Type Selection")); } +void QtProjectWizard::newSourceGroupFromVS() +{ +#if BUILD_CXX_LANGUAGE_PACKAGE + QtProjectWizardWindow* window = createWindowWithContent([](QtProjectWizardWindow* window) { + window->setPreferredSize(QSize(560, 320)); + return new QtProjectWizardContentVS(window); + }); + window->resize(QSize(560, 320)); + + connect(window, &QtProjectWizardWindow::next, + [this](){ + selectedProjectType(SOURCE_GROUP_CXX_CDB); + } + ); + + window->show(); + window->setNextEnabled(true); + window->setPreviousEnabled(true); + window->updateSubTitle(QStringLiteral("C/C++ from Visual Studio")); +#endif // BUILD_CXX_LANGUAGE_PACKAGE +} + void QtProjectWizard::selectedProjectType(SourceGroupType sourceGroupType) { const std::string sourceGroupId = utility::getUuidString(); @@ -964,8 +953,8 @@ void QtProjectWizard::selectedProjectType(SourceGroupType sourceGroupType) } break; case SOURCE_GROUP_CXX_VS: - settings = std::make_shared(sourceGroupId, m_projectSettings.get()); - break; + newSourceGroupFromVS(); + return; #endif // BUILD_CXX_LANGUAGE_PACKAGE #if BUILD_JAVA_LANGUAGE_PACKAGE @@ -1010,7 +999,7 @@ void QtProjectWizard::createSourceGroup(std::shared_ptr set m_previouslySelectedIndex = -1; - m_sourceGroupList->setCurrentRow(m_allSourceGroupSettings.size() - 1); + m_sourceGroupList->setCurrentRow(int(m_allSourceGroupSettings.size()) - 1); } void QtProjectWizard::createProject() diff --git a/src/lib_gui/qt/project_wizard/QtProjectWizard.h b/src/lib_gui/qt/project_wizard/QtProjectWizard.h index 386ca2db..289c4f72 100644 --- a/src/lib_gui/qt/project_wizard/QtProjectWizard.h +++ b/src/lib_gui/qt/project_wizard/QtProjectWizard.h @@ -75,6 +75,7 @@ private slots: void windowStackChanged(); void newSourceGroup(); + void newSourceGroupFromVS(); void selectedProjectType(SourceGroupType sourceGroupType); void createSourceGroup(std::shared_ptr settings); diff --git a/src/lib_gui/qt/project_wizard/QtProjectWizardWindow.cpp b/src/lib_gui/qt/project_wizard/QtProjectWizardWindow.cpp index 482f9507..2c0f0b5d 100644 --- a/src/lib_gui/qt/project_wizard/QtProjectWizardWindow.cpp +++ b/src/lib_gui/qt/project_wizard/QtProjectWizardWindow.cpp @@ -47,6 +47,11 @@ void QtProjectWizardWindow::loadContent() m_content->load(); } +void QtProjectWizardWindow::refreshContent() +{ + m_content->refresh(); +} + void QtProjectWizardWindow::populateWindow(QWidget* widget) { QGridLayout* layout = new QGridLayout(); diff --git a/src/lib_gui/qt/project_wizard/QtProjectWizardWindow.h b/src/lib_gui/qt/project_wizard/QtProjectWizardWindow.h index 9b4b1f65..dc29a199 100644 --- a/src/lib_gui/qt/project_wizard/QtProjectWizardWindow.h +++ b/src/lib_gui/qt/project_wizard/QtProjectWizardWindow.h @@ -20,6 +20,7 @@ public: void saveContent(); void loadContent(); + void refreshContent(); static const int FRONT_COL = 0; static const int HELP_COL = 1; diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContent.cpp b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContent.cpp index 6039155d..7e484de2 100644 --- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContent.cpp +++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContent.cpp @@ -22,6 +22,8 @@ void QtProjectWizardContent::load() {} void QtProjectWizardContent::save() {} +void QtProjectWizardContent::refresh() {} + bool QtProjectWizardContent::check() { return true; @@ -131,6 +133,7 @@ QFrame* QtProjectWizardContent::addSeparator(QGridLayout* layout, int row) const void QtProjectWizardContent::filesButtonClicked() { m_window->saveContent(); + m_window->refreshContent(); std::thread([&]() { const std::vector filePaths = getFilePaths(); @@ -142,8 +145,8 @@ void QtProjectWizardContent::showFilesDialog(const std::vector& filePa { if (!m_filesDialog) { - m_filesDialog = std::make_shared( - getFileNamesTitle(), QString::number(filePaths.size()) + " " + getFileNamesDescription()); + m_filesDialog = new QtTextEditDialog( + getFileNamesTitle(), QString::number(filePaths.size()) + " " + getFileNamesDescription(), m_window); m_filesDialog->setup(); m_filesDialog->setText(utility::join(utility::toWStrings(filePaths), L"\n")); @@ -151,12 +154,12 @@ void QtProjectWizardContent::showFilesDialog(const std::vector& filePa m_filesDialog->setReadOnly(true); connect( - m_filesDialog.get(), + m_filesDialog, &QtTextEditDialog::finished, this, &QtProjectWizardContent::closedFilesDialog); connect( - m_filesDialog.get(), + m_filesDialog, &QtTextEditDialog::canceled, this, &QtProjectWizardContent::closedFilesDialog); @@ -169,7 +172,8 @@ void QtProjectWizardContent::showFilesDialog(const std::vector& filePa void QtProjectWizardContent::closedFilesDialog() { m_filesDialog->hide(); - m_filesDialog.reset(); + m_filesDialog->deleteLater(); + m_filesDialog = nullptr; window()->raise(); } diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContent.h b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContent.h index d5d8b429..cbbf3aee 100644 --- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContent.h +++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContent.h @@ -25,6 +25,7 @@ public: virtual void load(); virtual void save(); + virtual void refresh(); virtual bool check(); virtual std::vector getFilePaths() const; @@ -47,7 +48,7 @@ protected: QtProjectWizardWindow* m_window; - std::shared_ptr m_filesDialog; + QtTextEditDialog* m_filesDialog = nullptr; protected slots: void filesButtonClicked(); diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentGroup.cpp b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentGroup.cpp index 4362e694..2fa5eebf 100644 --- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentGroup.cpp +++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentGroup.cpp @@ -70,6 +70,17 @@ void QtProjectWizardContentGroup::save() } } +void QtProjectWizardContentGroup::refresh() +{ + for (QtProjectWizardContent* content: m_contents) + { + if (content) + { + content->refresh(); + } + } +} + bool QtProjectWizardContentGroup::check() { for (QtProjectWizardContent* content: m_contents) diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentGroup.h b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentGroup.h index 7a65f1dd..ab4122b1 100644 --- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentGroup.h +++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentGroup.h @@ -23,6 +23,7 @@ protected: virtual void load() override; virtual void save() override; + virtual void refresh() override; virtual bool check() override; private: diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentVS.cpp b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentVS.cpp index 5f619eae..21fc5c1a 100644 --- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentVS.cpp +++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentVS.cpp @@ -9,21 +9,26 @@ QtProjectWizardContentVS::QtProjectWizardContentVS(QtProjectWizardWindow* window void QtProjectWizardContentVS::populate(QGridLayout* layout, int& row) { + layout->setRowMinimumHeight(row++, 10); + QLabel* nameLabel = createFormLabel("Create Compilation Database"); layout->addWidget(nameLabel, row, QtProjectWizardWindow::FRONT_COL); addHelpButton( "Create Compilation Database", - "To create a new Compilation Database from a Visual Studio Solution, this Solution has to be open in Visual Studio.\n\ -Sourcetrail will call Visual Studio to open the 'Create Compilation Database' dialog.\ - Please follow the instructions in Visual Studio to complete the process.\n\ -Note: Sourcetrail's Visual Studio plugin has to be installed. Visual Studio has to be running with an eligible Solution, containing C/C++ projects, loaded.", + "To create a new Compilation Database from a Visual Studio Solution, a Solution has to be open in Visual " + "Studio.\n Sourcetrail will call Visual Studio to open the 'Create Compilation Database' dialog. Please follow " + "the instructions in Visual Studio to complete the process.\n Note: Sourcetrail's Visual Studio plugin has to " + "be installed. Visual Studio has to be running with an eligible Solution, containing C/C++ projects, loaded.", layout, row); QLabel* descriptionLabel = createFormSubLabel( - "Call Visual Studio to create a Compilation Database from the loaded Solution."); + "Call Visual Studio to create a Compilation Database from the loaded Solution (requires installed " + "Sourcetrail Visual Studio " + "Extension)."); descriptionLabel->setObjectName("description"); + descriptionLabel->setOpenExternalLinks(true); descriptionLabel->setAlignment(Qt::AlignmentFlag::AlignLeft); layout->addWidget(descriptionLabel, row, QtProjectWizardWindow::BACK_COL); row++; @@ -40,7 +45,8 @@ Note: Sourcetrail's Visual Studio plugin has to be installed. Visual Studio has layout->addWidget(skipLabel, row, QtProjectWizardWindow::BACK_COL); row++; - addSeparator(layout, row++); + layout->setRowMinimumHeight(row, 10); + layout->setRowStretch(row, 1); connect(button, &QPushButton::clicked, this, &QtProjectWizardContentVS::handleVSCDBClicked); } diff --git a/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCDB.cpp b/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCDB.cpp index fa6e4d09..93644e75 100644 --- a/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCDB.cpp +++ b/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCDB.cpp @@ -68,6 +68,16 @@ void QtProjectWizardContentPathCDB::load() { m_picker->setText(QString::fromStdWString(m_settings->getCompilationDatabasePath().wstr())); + refresh(); +} + +void QtProjectWizardContentPathCDB::save() +{ + m_settings->setCompilationDatabasePath(FilePath(m_picker->getText().toStdWString())); +} + +void QtProjectWizardContentPathCDB::refresh() +{ m_filePaths.clear(); if (m_fileCountLabel) @@ -78,11 +88,6 @@ void QtProjectWizardContentPathCDB::load() } } -void QtProjectWizardContentPathCDB::save() -{ - m_settings->setCompilationDatabasePath(FilePath(m_picker->getText().toStdWString())); -} - std::vector QtProjectWizardContentPathCDB::getFilePaths() const { return m_filePaths.getValue(); diff --git a/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCDB.h b/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCDB.h index 753b1a41..63c0a748 100644 --- a/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCDB.h +++ b/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCDB.h @@ -19,6 +19,7 @@ public: void load() override; void save() override; + void refresh() override; std::vector getFilePaths() const override; QString getFileNamesTitle() const override; diff --git a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsHeaderSearch.cpp b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsHeaderSearch.cpp index d90408db..72ce9704 100644 --- a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsHeaderSearch.cpp +++ b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsHeaderSearch.cpp @@ -357,12 +357,12 @@ void QtProjectWizardContentPathsHeaderSearch::showDetectedIncludesResult( detailedText += path.wstr() + L"\n"; } - m_filesDialog = std::make_shared( + m_filesDialog = new QtTextEditDialog( "Detected Include Paths", ("

The following " + std::to_string(additionalHeaderSearchPaths.size()) + " include paths have been " "detected and will be added to the include paths of this Source Group.") - .c_str()); + .c_str(), m_window); m_filesDialog->setup(); m_filesDialog->setReadOnly(true); @@ -373,12 +373,12 @@ void QtProjectWizardContentPathsHeaderSearch::showDetectedIncludesResult( m_filesDialog->showWindow(); connect( - m_filesDialog.get(), + m_filesDialog, &QtTextEditDialog::finished, this, &QtProjectWizardContentPathsHeaderSearch::finishedAcceptDetectedIncludePathsDialog); connect( - m_filesDialog.get(), + m_filesDialog, &QtTextEditDialog::canceled, this, &QtProjectWizardContentPathsHeaderSearch::closedFilesDialog); @@ -417,7 +417,7 @@ void QtProjectWizardContentPathsHeaderSearch::showValidationResult( detailedText += L"\n"; } - m_filesDialog = std::make_shared( + m_filesDialog = new QtTextEditDialog( "Unresolved Include Directives", ("

The indexed files contain " + std::to_string(unresolvedIncludes.size()) + " include directive" + (unresolvedIncludes.size() == 1 ? "" : "s") + @@ -427,7 +427,7 @@ void QtProjectWizardContentPathsHeaderSearch::showValidationResult( "conditional preprocessor " "directives. This means that some of the unresolved includes may actually not be " "required by the indexer.

") - .c_str()); + .c_str(), m_window); m_filesDialog->setup(); m_filesDialog->setCloseVisible(false); @@ -437,12 +437,12 @@ void QtProjectWizardContentPathsHeaderSearch::showValidationResult( m_filesDialog->showWindow(); connect( - m_filesDialog.get(), + m_filesDialog, &QtTextEditDialog::finished, this, &QtProjectWizardContentPathsHeaderSearch::closedFilesDialog); connect( - m_filesDialog.get(), + m_filesDialog, &QtTextEditDialog::canceled, this, &QtProjectWizardContentPathsHeaderSearch::closedFilesDialog); diff --git a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsIndexedHeaders.cpp b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsIndexedHeaders.cpp index 1960a63e..53846841 100644 --- a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsIndexedHeaders.cpp +++ b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsIndexedHeaders.cpp @@ -203,27 +203,27 @@ void QtProjectWizardContentPathsIndexedHeaders::buttonClicked() return; } - m_filesDialog = std::make_shared( + m_filesDialog = new QtSelectPathsDialog( "Select from Include Paths", "The list contains all Include Paths found in the Code::Blocks project. Red paths " "do not exist. Select the " - "paths containing the header files you want to index with Sourcetrail."); + "paths containing the header files you want to index with Sourcetrail.", m_window); m_filesDialog->setup(); connect( - m_filesDialog.get(), + m_filesDialog, &QtSelectPathsDialog::finished, this, &QtProjectWizardContentPathsIndexedHeaders::savedFilesDialog); connect( - m_filesDialog.get(), + m_filesDialog, &QtSelectPathsDialog::canceled, this, &QtProjectWizardContentPathsIndexedHeaders::closedFilesDialog); const FilePath projectPath = codeblocksSettings->getProjectDirectoryPath(); - dynamic_cast(m_filesDialog.get()) + dynamic_cast(m_filesDialog) ->setPathsList( utility::convert( getIndexedPathsDerivedFromCodeblocksProject(codeblocksSettings), @@ -247,27 +247,27 @@ void QtProjectWizardContentPathsIndexedHeaders::buttonClicked() return; } - m_filesDialog = std::make_shared( + m_filesDialog = new QtSelectPathsDialog( "Select from Include Paths", "The list contains all Include Paths found in the Compilation Database. Red paths " "do not exist. Select the " - "paths containing the header files you want to index with Sourcetrail."); + "paths containing the header files you want to index with Sourcetrail.", m_window); m_filesDialog->setup(); connect( - m_filesDialog.get(), + m_filesDialog, &QtSelectPathsDialog::finished, this, &QtProjectWizardContentPathsIndexedHeaders::savedFilesDialog); connect( - m_filesDialog.get(), + m_filesDialog, &QtSelectPathsDialog::canceled, this, &QtProjectWizardContentPathsIndexedHeaders::closedFilesDialog); const FilePath projectPath = cdbSettings->getProjectDirectoryPath(); - dynamic_cast(m_filesDialog.get()) + dynamic_cast(m_filesDialog) ->setPathsList( utility::convert( getIndexedPathsDerivedFromCDB(cdbSettings), @@ -288,6 +288,6 @@ void QtProjectWizardContentPathsIndexedHeaders::buttonClicked() void QtProjectWizardContentPathsIndexedHeaders::savedFilesDialog() { - m_list->setPaths(dynamic_cast(m_filesDialog.get())->getPathsList()); + m_list->setPaths(dynamic_cast(m_filesDialog)->getPathsList()); closedFilesDialog(); }