forked from qt-creator/qt-creator
Pathchooser: Add method to get/set base dir using a FileName
Change-Id: I29f09197f98ad12f3508ff2357dc294b2f820050 Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
This commit is contained in:
committed by
Daniel Teske
parent
f1f567bf2d
commit
a3d244e970
@@ -291,6 +291,16 @@ void PathChooser::setBaseDirectory(const QString &directory)
|
||||
d->m_baseDirectory = directory;
|
||||
}
|
||||
|
||||
FileName PathChooser::baseFileName() const
|
||||
{
|
||||
return Utils::FileName::fromString(d->m_baseDirectory);
|
||||
}
|
||||
|
||||
void PathChooser::setBaseFileName(const FileName &base)
|
||||
{
|
||||
d->m_baseDirectory = base.toString();
|
||||
}
|
||||
|
||||
void PathChooser::setEnvironment(const Utils::Environment &env)
|
||||
{
|
||||
QString oldExpand = path();
|
||||
|
@@ -62,6 +62,7 @@ class QTCREATOR_UTILS_EXPORT PathChooser : public QWidget
|
||||
Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly DESIGNABLE true)
|
||||
// Designer does not know this type, so force designable to false:
|
||||
Q_PROPERTY(Utils::FileName fileName READ fileName WRITE setFileName DESIGNABLE false)
|
||||
Q_PROPERTY(Utils::FileName baseFileName READ baseFileName WRITE setBaseFileName DESIGNABLE false)
|
||||
|
||||
public:
|
||||
static const char * const browseButtonLabel;
|
||||
@@ -99,6 +100,8 @@ public:
|
||||
|
||||
QString baseDirectory() const;
|
||||
void setBaseDirectory(const QString &directory);
|
||||
Utils::FileName baseFileName() const;
|
||||
void setBaseFileName(const Utils::FileName &base);
|
||||
|
||||
void setEnvironment(const Utils::Environment &env);
|
||||
|
||||
|
Reference in New Issue
Block a user