Vcpkg: Use Utils::FilePathAspect

Change-Id: I7532536186d500748e3ad30794801436c0a997e2
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Alessandro Portale
2023-05-19 11:30:57 +02:00
parent 5acecd4ef9
commit b0f68a916f
3 changed files with 3 additions and 4 deletions

View File

@@ -94,7 +94,7 @@ VcpkgPackageSearchDialog::VcpkgPackageSearchDialog(QWidget *parent)
m_buttonBox, m_buttonBox,
}.attachTo(this); }.attachTo(this);
m_allPackages = vcpkgManifests(VcpkgSettings::instance()->vcpkgRoot.filePath()); m_allPackages = vcpkgManifests(VcpkgSettings::instance()->vcpkgRoot());
listPackages({}); listPackages({});

View File

@@ -61,7 +61,6 @@ VcpkgSettings::VcpkgSettings()
registerAspect(&vcpkgRoot); registerAspect(&vcpkgRoot);
vcpkgRoot.setSettingsKey("VcpkgRoot"); vcpkgRoot.setSettingsKey("VcpkgRoot");
vcpkgRoot.setDisplayStyle(Utils::StringAspect::PathChooserDisplay);
vcpkgRoot.setExpectedKind(Utils::PathChooser::ExistingDirectory); vcpkgRoot.setExpectedKind(Utils::PathChooser::ExistingDirectory);
vcpkgRoot.setDefaultValue(Utils::qtcEnvironmentVariable(Constants::ENVVAR_VCPKG_ROOT)); vcpkgRoot.setDefaultValue(Utils::qtcEnvironmentVariable(Constants::ENVVAR_VCPKG_ROOT));
@@ -70,7 +69,7 @@ VcpkgSettings::VcpkgSettings()
bool VcpkgSettings::vcpkgRootValid() const bool VcpkgSettings::vcpkgRootValid() const
{ {
return (vcpkgRoot.filePath() / "vcpkg").withExecutableSuffix().isExecutableFile(); return (vcpkgRoot() / "vcpkg").withExecutableSuffix().isExecutableFile();
} }
} // namespace Vcpkg::Internal } // namespace Vcpkg::Internal

View File

@@ -15,7 +15,7 @@ public:
static VcpkgSettings *instance(); static VcpkgSettings *instance();
bool vcpkgRootValid() const; bool vcpkgRootValid() const;
Utils::StringAspect vcpkgRoot; Utils::FilePathAspect vcpkgRoot;
}; };
} // namespace Vcpkg::Internal } // namespace Vcpkg::Internal