StudioPlugin: Use custom openOpenProjectDialog() to only allow qmlproject

Task-number: QDS-2549
Change-Id: I7393877b5f0306eafc6dbd5b5919e6592e664c16
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
This commit is contained in:
Thomas Hartmann
2022-11-25 10:00:19 +01:00
parent caccbe8377
commit 21c659400a

View File

@@ -72,6 +72,16 @@ static bool useNewWelcomePage()
return settings->value(newWelcomePageEntry, false).toBool();
}
static void openOpenProjectDialog()
{
const FilePath path = Core::DocumentManager::useProjectsDirectory()
? Core::DocumentManager::projectsDirectory()
: FilePath();
const FilePaths files = Core::DocumentManager::getOpenFileNames("*.qmlproject", path);
if (!files.isEmpty())
Core::ICore::openFiles(files, Core::ICore::None);
}
const char DO_NOT_SHOW_SPLASHSCREEN_AGAIN_KEY[] = "StudioSplashScreen";
const char DETAILED_USAGE_STATISTICS[] = "DetailedUsageStatistics";
@@ -194,16 +204,14 @@ public:
Q_INVOKABLE void createProject()
{
QTimer::singleShot(0, []() {
QTimer::singleShot(0, this, []() {
ProjectExplorer::ProjectExplorerPlugin::openNewProjectDialog();
});
}
Q_INVOKABLE void openProject()
{
QTimer::singleShot(0, []() {
ProjectExplorer::ProjectExplorerPlugin::openOpenProjectDialog();
});
QTimer::singleShot(0, this, []() { openOpenProjectDialog(); });
}
Q_INVOKABLE void openProjectAt(int row)