forked from qt-creator/qt-creator
ModelEditor: Avoid a use of PathChooser::pathChanged
Change-Id: I3fa563d46c7dcd4d02b2452e0b233586b431282c Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -67,7 +67,7 @@ void ExtPropertiesMView::visitMPackage(const qmt::MPackage *package)
|
|||||||
m_configPath->setInitialBrowsePathBackup(
|
m_configPath->setInitialBrowsePathBackup(
|
||||||
Utils::FilePath::fromString(project->fileName()).absolutePath());
|
Utils::FilePath::fromString(project->fileName()).absolutePath());
|
||||||
addRow(tr("Config path:"), m_configPath, "configpath");
|
addRow(tr("Config path:"), m_configPath, "configpath");
|
||||||
connect(m_configPath, &Utils::PathChooser::pathChanged,
|
connect(m_configPath, &Utils::PathChooser::filePathChanged,
|
||||||
this, &ExtPropertiesMView::onConfigPathChanged);
|
this, &ExtPropertiesMView::onConfigPathChanged);
|
||||||
}
|
}
|
||||||
if (!m_configPath->hasFocus()) {
|
if (!m_configPath->hasFocus()) {
|
||||||
@@ -86,7 +86,7 @@ void ExtPropertiesMView::visitMPackage(const qmt::MPackage *package)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExtPropertiesMView::onConfigPathChanged(const QString &path)
|
void ExtPropertiesMView::onConfigPathChanged(const Utils::FilePath &path)
|
||||||
{
|
{
|
||||||
bool modified = false;
|
bool modified = false;
|
||||||
qmt::Project *project = m_projectController->project();
|
qmt::Project *project = m_projectController->project();
|
||||||
@@ -98,7 +98,7 @@ void ExtPropertiesMView::onConfigPathChanged(const QString &path)
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// make path relative to current project's directory
|
// make path relative to current project's directory
|
||||||
QFileInfo absConfigPath(path);
|
QFileInfo absConfigPath = path.toFileInfo();
|
||||||
absConfigPath.makeAbsolute();
|
absConfigPath.makeAbsolute();
|
||||||
QDir projectDir = QFileInfo(project->fileName()).dir();
|
QDir projectDir = QFileInfo(project->fileName()).dir();
|
||||||
QString configPath = projectDir.relativeFilePath(absConfigPath.filePath());
|
QString configPath = projectDir.relativeFilePath(absConfigPath.filePath());
|
||||||
|
|||||||
@@ -28,7 +28,11 @@
|
|||||||
#include "qmt/model_widgets_ui/propertiesviewmview.h"
|
#include "qmt/model_widgets_ui/propertiesviewmview.h"
|
||||||
|
|
||||||
namespace qmt { class ProjectController; }
|
namespace qmt { class ProjectController; }
|
||||||
namespace Utils { class PathChooser; }
|
|
||||||
|
namespace Utils {
|
||||||
|
class FilePath;
|
||||||
|
class PathChooser;
|
||||||
|
} // Utils
|
||||||
|
|
||||||
namespace ModelEditor {
|
namespace ModelEditor {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -46,7 +50,7 @@ public:
|
|||||||
void visitMPackage(const qmt::MPackage *package) override;
|
void visitMPackage(const qmt::MPackage *package) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void onConfigPathChanged(const QString &path);
|
void onConfigPathChanged(const Utils::FilePath &path);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
qmt::ProjectController *m_projectController = nullptr;
|
qmt::ProjectController *m_projectController = nullptr;
|
||||||
|
|||||||
Reference in New Issue
Block a user