forked from qt-creator/qt-creator
McuSupport: Allow PackageOptions to return different path than selected one
... by adding a relativePathModifier property Change-Id: I5e4a13ffb43566f7ed221dfc926731abc0460853 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -80,6 +80,7 @@ public:
|
|||||||
void setAddToPath(bool addToPath);
|
void setAddToPath(bool addToPath);
|
||||||
bool addToPath() const;
|
bool addToPath() const;
|
||||||
void writeToSettings() const;
|
void writeToSettings() const;
|
||||||
|
void setRelativePathModifier(const QString &path);
|
||||||
|
|
||||||
QWidget *widget();
|
QWidget *widget();
|
||||||
|
|
||||||
@@ -103,6 +104,7 @@ private:
|
|||||||
const QString m_settingsKey;
|
const QString m_settingsKey;
|
||||||
|
|
||||||
QString m_path;
|
QString m_path;
|
||||||
|
QString m_relativePathModifier; // relative path to m_path to be returned by path()
|
||||||
QUrl m_downloadUrl;
|
QUrl m_downloadUrl;
|
||||||
QString m_environmentVariableName;
|
QString m_environmentVariableName;
|
||||||
bool m_addToPath = false;
|
bool m_addToPath = false;
|
||||||
@@ -126,7 +128,7 @@ PackageOptions::PackageOptions(const QString &label, const QString &defaultPath,
|
|||||||
|
|
||||||
QString PackageOptions::path() const
|
QString PackageOptions::path() const
|
||||||
{
|
{
|
||||||
return m_fileChooser->path();
|
return QFileInfo(m_fileChooser->path() + m_relativePathModifier).absoluteFilePath();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString PackageOptions::label() const
|
QString PackageOptions::label() const
|
||||||
@@ -220,6 +222,11 @@ void PackageOptions::writeToSettings() const
|
|||||||
s->endGroup();
|
s->endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PackageOptions::setRelativePathModifier(const QString &path)
|
||||||
|
{
|
||||||
|
m_relativePathModifier = path;
|
||||||
|
}
|
||||||
|
|
||||||
void PackageOptions::updateStatus()
|
void PackageOptions::updateStatus()
|
||||||
{
|
{
|
||||||
m_path = m_fileChooser->rawPath();
|
m_path = m_fileChooser->rawPath();
|
||||||
|
Reference in New Issue
Block a user