forked from qt-creator/qt-creator
Utils: Replace FileChooser::path() by filePath().toString()
Keep the old method for now to ease downstream porting. The change is kept mechanical, there's a lot of cleanup possible now on the user code side. Change-Id: I936baedd45b7ba057f1c789a1bec896886f48eff Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -162,7 +162,7 @@ void PathChooserDelegate::setModelData(QWidget *editor, QAbstractItemModel *mode
|
||||
if (!pathChooser)
|
||||
return;
|
||||
|
||||
model->setData(index, pathChooser->path(), Qt::EditRole);
|
||||
model->setData(index, pathChooser->filePath().toString(), Qt::EditRole);
|
||||
}
|
||||
|
||||
void PathChooserDelegate::updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const
|
||||
|
@@ -82,7 +82,7 @@ QString FileWizardPage::fileName() const
|
||||
|
||||
QString FileWizardPage::path() const
|
||||
{
|
||||
return d->m_ui.pathChooser->path();
|
||||
return d->m_ui.pathChooser->filePath().toString();
|
||||
}
|
||||
|
||||
void FileWizardPage::setPath(const QString &path)
|
||||
|
@@ -295,9 +295,9 @@ FilePath PathChooser::baseDirectory() const
|
||||
|
||||
void PathChooser::setEnvironment(const Environment &env)
|
||||
{
|
||||
QString oldExpand = path();
|
||||
QString oldExpand = filePath().toString();
|
||||
d->m_environment = env;
|
||||
if (path() != oldExpand) {
|
||||
if (filePath().toString() != oldExpand) {
|
||||
triggerChanged();
|
||||
emit rawPathChanged(rawPath());
|
||||
}
|
||||
@@ -308,11 +308,6 @@ QString PathChooser::rawPath() const
|
||||
return rawFileName().toString();
|
||||
}
|
||||
|
||||
QString PathChooser::path() const
|
||||
{
|
||||
return filePath().toString();
|
||||
}
|
||||
|
||||
FilePath PathChooser::rawFileName() const
|
||||
{
|
||||
return FilePath::fromString(QDir::fromNativeSeparators(d->m_lineEdit->text()));
|
||||
@@ -364,7 +359,7 @@ void PathChooser::slotBrowse()
|
||||
{
|
||||
emit beforeBrowsing();
|
||||
|
||||
QString predefined = path();
|
||||
QString predefined = filePath().toString();
|
||||
QFileInfo fi(predefined);
|
||||
|
||||
if (!predefined.isEmpty() && !fi.isDir()) {
|
||||
|
@@ -90,11 +90,6 @@ public:
|
||||
|
||||
FilePath filePath() const;
|
||||
|
||||
// Deprecated. Use filePath().toString()
|
||||
QString path() const;
|
||||
// Deprecated. Use filePath()
|
||||
FilePath fileName() const { return filePath(); }
|
||||
|
||||
QString rawPath() const; // The raw unexpanded input.
|
||||
FilePath rawFileName() const; // The raw unexpanded input.
|
||||
|
||||
@@ -150,6 +145,11 @@ public:
|
||||
using AboutToShowContextMenuHandler = std::function<void (PathChooser *, QMenu *)>;
|
||||
static void setAboutToShowContextMenuHandler(AboutToShowContextMenuHandler handler);
|
||||
|
||||
// Deprecated. Use filePath().toString() or better suitable conversions.
|
||||
QString path() const { return filePath().toString(); }
|
||||
// Deprecated. Use filePath()
|
||||
FilePath fileName() const { return filePath(); }
|
||||
|
||||
private:
|
||||
bool validatePath(FancyLineEdit *edit, QString *errorMessage) const;
|
||||
// Returns overridden title or the one from <title>
|
||||
|
@@ -116,7 +116,7 @@ QString ProjectIntroPage::projectName() const
|
||||
|
||||
QString ProjectIntroPage::path() const
|
||||
{
|
||||
return d->m_ui.pathChooser->path();
|
||||
return d->m_ui.pathChooser->filePath().toString();
|
||||
}
|
||||
|
||||
void ProjectIntroPage::setPath(const QString &path)
|
||||
|
@@ -990,7 +990,7 @@ void AndroidSettingsWidget::downloadSdk()
|
||||
if (javaSummaryWidget->allRowsOk()) {
|
||||
auto javaPath = Utils::FilePath::fromUserInput(m_ui->OpenJDKLocationPathChooser->rawPath());
|
||||
m_sdkDownloader->downloadAndExtractSdk(javaPath.toString(),
|
||||
m_ui->SDKLocationPathChooser->path());
|
||||
m_ui->SDKLocationPathChooser->filePath().toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -196,7 +196,7 @@ void ChooseDirectoryPage::checkPackageSourceDir()
|
||||
const BuildTargetInfo bti = m_wizard->buildSystem()->buildTarget(buildKey);
|
||||
const QString projectDir = bti.projectFilePath.toFileInfo().absolutePath();
|
||||
|
||||
const QString newDir = m_androidPackageSourceDir->path();
|
||||
const QString newDir = m_androidPackageSourceDir->filePath().toString();
|
||||
bool isComplete = QFileInfo(projectDir) != QFileInfo(newDir);
|
||||
|
||||
m_sourceDirectoryWarning->setVisible(!isComplete);
|
||||
@@ -238,7 +238,7 @@ void ChooseDirectoryPage::initializePage()
|
||||
}
|
||||
|
||||
|
||||
m_wizard->setDirectory(m_androidPackageSourceDir->path());
|
||||
m_wizard->setDirectory(m_androidPackageSourceDir->filePath().toString());
|
||||
}
|
||||
|
||||
//
|
||||
|
@@ -95,5 +95,5 @@ BuildPathPage::BuildPathPage(AutotoolsOpenProjectWizard *w) : QWizardPage(w),
|
||||
|
||||
void BuildPathPage::buildDirectoryChanged()
|
||||
{
|
||||
static_cast<AutotoolsOpenProjectWizard *>(wizard())->setBuildDirectory(m_pc->path());
|
||||
static_cast<AutotoolsOpenProjectWizard *>(wizard())->setBuildDirectory(m_pc->filePath().toString());
|
||||
}
|
||||
|
@@ -57,7 +57,7 @@ QString PullOrPushDialog::branchLocation() const
|
||||
if (m_ui->defaultButton->isChecked())
|
||||
return QString();
|
||||
if (m_ui->localButton->isChecked())
|
||||
return m_ui->localPathChooser->path();
|
||||
return m_ui->localPathChooser->filePath().toString();
|
||||
return m_ui->urlLineEdit->text();
|
||||
}
|
||||
|
||||
|
@@ -66,11 +66,11 @@ ArtisticStyleOptionsPageWidget::ArtisticStyleOptionsPageWidget(ArtisticStyleSett
|
||||
connect(ui.command, &Utils::PathChooser::validChanged, ui.options, &QWidget::setEnabled);
|
||||
ui.configurations->setSettings(m_settings);
|
||||
|
||||
ui.command->setFileName(m_settings->command());
|
||||
ui.command->setFilePath(m_settings->command());
|
||||
ui.mime->setText(m_settings->supportedMimeTypesAsString());
|
||||
ui.useOtherFiles->setChecked(m_settings->useOtherFiles());
|
||||
ui.useSpecificConfigFile->setChecked(m_settings->useSpecificConfigFile());
|
||||
ui.specificConfigFile->setFileName(m_settings->specificConfigFile());
|
||||
ui.specificConfigFile->setFilePath(m_settings->specificConfigFile());
|
||||
ui.useHomeFile->setChecked(m_settings->useHomeFile());
|
||||
ui.useCustomStyle->setChecked(m_settings->useCustomStyle());
|
||||
ui.configurations->setCurrentConfiguration(m_settings->customStyle());
|
||||
@@ -78,7 +78,7 @@ ArtisticStyleOptionsPageWidget::ArtisticStyleOptionsPageWidget(ArtisticStyleSett
|
||||
|
||||
void ArtisticStyleOptionsPageWidget::apply()
|
||||
{
|
||||
m_settings->setCommand(ui.command->path());
|
||||
m_settings->setCommand(ui.command->filePath().toString());
|
||||
m_settings->setSupportedMimeTypes(ui.mime->text());
|
||||
m_settings->setUseOtherFiles(ui.useOtherFiles->isChecked());
|
||||
m_settings->setUseSpecificConfigFile(ui.useSpecificConfigFile->isChecked());
|
||||
|
@@ -90,7 +90,7 @@ ClangFormatOptionsPageWidget::ClangFormatOptionsPageWidget(ClangFormatSettings *
|
||||
|
||||
void ClangFormatOptionsPageWidget::apply()
|
||||
{
|
||||
m_settings->setCommand(ui.command->path());
|
||||
m_settings->setCommand(ui.command->filePath().toString());
|
||||
m_settings->setSupportedMimeTypes(ui.mime->text());
|
||||
m_settings->setUsePredefinedStyle(ui.usePredefinedStyle->isChecked());
|
||||
m_settings->setPredefinedStyle(ui.predefinedStyle->currentText());
|
||||
|
@@ -80,7 +80,7 @@ UncrustifyOptionsPageWidget::UncrustifyOptionsPageWidget(UncrustifySettings *set
|
||||
|
||||
void UncrustifyOptionsPageWidget::apply()
|
||||
{
|
||||
m_settings->setCommand(ui.command->path());
|
||||
m_settings->setCommand(ui.command->filePath().toString());
|
||||
m_settings->setSupportedMimeTypes(ui.mime->text());
|
||||
m_settings->setUseOtherFiles(ui.useOtherFiles->isChecked());
|
||||
m_settings->setUseHomeFile(ui.useHomeFile->isChecked());
|
||||
|
@@ -274,23 +274,23 @@ void CorePlugin::addToPathChooserContextMenu(Utils::PathChooser *pathChooser, QM
|
||||
QList<QAction*> actions = menu->actions();
|
||||
QAction *firstAction = actions.isEmpty() ? nullptr : actions.first();
|
||||
|
||||
if (QDir().exists(pathChooser->path())) {
|
||||
if (QDir().exists(pathChooser->filePath().toString())) {
|
||||
auto *showInGraphicalShell = new QAction(Core::FileUtils::msgGraphicalShellAction(), menu);
|
||||
connect(showInGraphicalShell, &QAction::triggered, pathChooser, [pathChooser]() {
|
||||
Core::FileUtils::showInGraphicalShell(pathChooser, pathChooser->path());
|
||||
Core::FileUtils::showInGraphicalShell(pathChooser, pathChooser->filePath().toString());
|
||||
});
|
||||
menu->insertAction(firstAction, showInGraphicalShell);
|
||||
|
||||
auto *showInTerminal = new QAction(Core::FileUtils::msgTerminalHereAction(), menu);
|
||||
connect(showInTerminal, &QAction::triggered, pathChooser, [pathChooser]() {
|
||||
Core::FileUtils::openTerminal(pathChooser->path());
|
||||
Core::FileUtils::openTerminal(pathChooser->filePath().toString());
|
||||
});
|
||||
menu->insertAction(firstAction, showInTerminal);
|
||||
|
||||
} else {
|
||||
auto *mkPathAct = new QAction(tr("Create Folder"), menu);
|
||||
connect(mkPathAct, &QAction::triggered, pathChooser, [pathChooser]() {
|
||||
QDir().mkpath(pathChooser->path());
|
||||
QDir().mkpath(pathChooser->filePath().toString());
|
||||
pathChooser->triggerChanged();
|
||||
});
|
||||
menu->insertAction(firstAction, mkPathAct);
|
||||
|
@@ -182,7 +182,7 @@ void SystemSettingsWidget::apply()
|
||||
m_ui.externalFileBrowserEdit->text());
|
||||
}
|
||||
}
|
||||
PatchTool::setPatchCommand(m_ui.patchChooser->path());
|
||||
PatchTool::setPatchCommand(m_ui.patchChooser->filePath().toString());
|
||||
EditorManagerPrivate::setAutoSaveEnabled(m_ui.autoSaveCheckBox->isChecked());
|
||||
EditorManagerPrivate::setAutoSaveInterval(m_ui.autoSaveInterval->value());
|
||||
EditorManagerPrivate::setAutoSuspendEnabled(m_ui.autoSuspendCheckBox->isChecked());
|
||||
|
@@ -84,7 +84,7 @@ void FileShareProtocolSettingsWidget::setSettings(const FileShareProtocolSetting
|
||||
FileShareProtocolSettings FileShareProtocolSettingsWidget::settings() const
|
||||
{
|
||||
FileShareProtocolSettings rc;
|
||||
rc.path = m_ui.pathChooser->path();
|
||||
rc.path = m_ui.pathChooser->filePath().toString();
|
||||
rc.displayCount = m_ui.displayCountSpinBox->value();
|
||||
return rc;
|
||||
}
|
||||
|
@@ -121,7 +121,7 @@ void OptionsWidget::load(const CppcheckOptions &options)
|
||||
|
||||
void OptionsWidget::save(CppcheckOptions &options) const
|
||||
{
|
||||
options.binary = m_binary->path();
|
||||
options.binary = m_binary->filePath().toString();
|
||||
options.customArguments = m_customArguments->text();
|
||||
options.ignoredPatterns = m_ignorePatterns->text();
|
||||
options.warning = m_warning->isChecked();
|
||||
|
@@ -297,7 +297,7 @@ CppFileSettingsWidget::CppFileSettingsWidget(CppFileSettings *settings)
|
||||
|
||||
QString CppFileSettingsWidget::licenseTemplatePath() const
|
||||
{
|
||||
return m_ui.licenseTemplatePathChooser->path();
|
||||
return m_ui.licenseTemplatePathChooser->filePath().toString();
|
||||
}
|
||||
|
||||
void CppFileSettingsWidget::setLicenseTemplatePath(const QString &lp)
|
||||
|
@@ -665,7 +665,7 @@ void BreakpointDialog::getParts(unsigned partsMask, BreakpointParameters *data)
|
||||
if (partsMask & FileAndLinePart) {
|
||||
data->lineNumber = m_lineEditLineNumber->text().toInt();
|
||||
data->pathUsage = static_cast<BreakpointPathUsage>(m_comboBoxPathUsage->currentIndex());
|
||||
data->fileName = FilePath::fromUserInput(m_pathChooserFileName->path());
|
||||
data->fileName = FilePath::fromUserInput(m_pathChooserFileName->filePath().toString());
|
||||
}
|
||||
if (partsMask & FunctionPart)
|
||||
data->functionName = m_lineEditFunction->text();
|
||||
|
@@ -484,9 +484,9 @@ StartApplicationParameters StartApplicationDialog::parameters() const
|
||||
result.serverInitCommands = d->serverInitCommandsTextEdit->toPlainText();
|
||||
result.serverResetCommands = d->serverResetCommandsTextEdit->toPlainText();
|
||||
result.kitId = d->kitChooser->currentKitId();
|
||||
result.debugInfoLocation = d->debuginfoPathChooser->path();
|
||||
result.debugInfoLocation = d->debuginfoPathChooser->filePath().toString();
|
||||
result.runnable.commandLineArguments = d->arguments->text();
|
||||
result.runnable.workingDirectory = d->workingDirectory->path();
|
||||
result.runnable.workingDirectory = d->workingDirectory->filePath().toString();
|
||||
result.breakAtMain = d->breakAtMainCheckBox->isChecked();
|
||||
result.runInTerminal = d->runInTerminalCheckBox->isChecked();
|
||||
return result;
|
||||
|
@@ -427,7 +427,7 @@ void DebuggerItemConfigWidget::binaryPathHasChanged()
|
||||
return;
|
||||
|
||||
DebuggerItem tmp;
|
||||
QFileInfo fi = QFileInfo(m_binaryChooser->path());
|
||||
QFileInfo fi = QFileInfo(m_binaryChooser->filePath().toString());
|
||||
if (fi.isExecutable()) {
|
||||
tmp = item();
|
||||
tmp.reinitializeFromFile();
|
||||
|
@@ -412,7 +412,7 @@ void AttachCoreDialog::selectRemoteCoreFile()
|
||||
|
||||
QString AttachCoreDialog::localCoreFile() const
|
||||
{
|
||||
return d->localCoreFileName->path();
|
||||
return d->localCoreFileName->filePath().toString();
|
||||
}
|
||||
|
||||
FilePath AttachCoreDialog::symbolFile() const
|
||||
@@ -462,7 +462,7 @@ Kit *AttachCoreDialog::kit() const
|
||||
|
||||
QString AttachCoreDialog::overrideStartScript() const
|
||||
{
|
||||
return d->overrideStartScriptFileName->path();
|
||||
return d->overrideStartScriptFileName->filePath().toString();
|
||||
}
|
||||
|
||||
void AttachCoreDialog::setOverrideStartScript(const QString &scriptName)
|
||||
|
@@ -75,7 +75,7 @@ void CacheDirectoryDialog::setPath(const QString &p)
|
||||
|
||||
QString CacheDirectoryDialog::path() const
|
||||
{
|
||||
return m_chooser->path();
|
||||
return m_chooser->filePath().toString();
|
||||
}
|
||||
|
||||
void CacheDirectoryDialog::accept()
|
||||
|
@@ -56,7 +56,7 @@ bool SymbolPathsDialog::useSymbolServer() const
|
||||
|
||||
QString SymbolPathsDialog::path() const
|
||||
{
|
||||
return ui->pathChooser->path();
|
||||
return ui->pathChooser->filePath().toString();
|
||||
}
|
||||
|
||||
void SymbolPathsDialog::setUseSymbolCache(bool useSymbolCache)
|
||||
|
@@ -256,7 +256,7 @@ void UnstartedAppWatcherDialog::startStopTimer(bool start)
|
||||
|
||||
void UnstartedAppWatcherDialog::findProcess()
|
||||
{
|
||||
const QString &appName = Utils::FileUtils::normalizePathName(m_pathChooser->path());
|
||||
const QString &appName = Utils::FileUtils::normalizePathName(m_pathChooser->filePath().toString());
|
||||
DeviceProcessItem fallback;
|
||||
foreach (const DeviceProcessItem &p, DeviceProcessList::localProcesses()) {
|
||||
if (Utils::FileUtils::normalizePathName(p.exe) == appName) {
|
||||
@@ -291,8 +291,8 @@ void UnstartedAppWatcherDialog::kitChanged()
|
||||
|
||||
bool UnstartedAppWatcherDialog::checkExecutableString() const
|
||||
{
|
||||
if (!m_pathChooser->path().isEmpty()) {
|
||||
QFileInfo fileInfo(m_pathChooser->path());
|
||||
if (!m_pathChooser->filePath().toString().isEmpty()) {
|
||||
QFileInfo fileInfo(m_pathChooser->filePath().toString());
|
||||
return (fileInfo.exists() && fileInfo.isFile());
|
||||
}
|
||||
return false;
|
||||
|
@@ -174,7 +174,7 @@ QString NewClassWidget::formFileName() const
|
||||
|
||||
QString NewClassWidget::path() const
|
||||
{
|
||||
return d->m_ui.pathChooser->path();
|
||||
return d->m_ui.pathChooser->filePath().toString();
|
||||
}
|
||||
|
||||
void NewClassWidget::setPath(const QString &path)
|
||||
|
@@ -137,7 +137,7 @@ void ChangeSelectionDialog::selectCommitFromRecentHistory()
|
||||
|
||||
QString ChangeSelectionDialog::workingDirectory() const
|
||||
{
|
||||
const QString workingDir = m_ui->workingDirectoryChooser->path();
|
||||
const QString workingDir = m_ui->workingDirectoryChooser->filePath().toString();
|
||||
if (workingDir.isEmpty() || !QDir(workingDir).exists())
|
||||
return QString();
|
||||
|
||||
|
@@ -124,8 +124,8 @@ GerritParameters GerritOptionsWidget::parameters() const
|
||||
static_cast<unsigned short>(m_portSpinBox->value()),
|
||||
m_userLineEdit->text().trimmed(),
|
||||
GerritServer::Ssh);
|
||||
result.ssh = m_sshChooser->path();
|
||||
result.curl = m_curlChooser->path();
|
||||
result.ssh = m_sshChooser->filePath().toString();
|
||||
result.curl = m_curlChooser->filePath().toString();
|
||||
result.https = m_httpsCheckBox->isChecked();
|
||||
return result;
|
||||
}
|
||||
|
@@ -890,7 +890,7 @@ StdIOSettingsWidget::StdIOSettingsWidget(const StdIOSettings *settings, QWidget
|
||||
|
||||
QString StdIOSettingsWidget::executable() const
|
||||
{
|
||||
return m_executable->path();
|
||||
return m_executable->filePath().toString();
|
||||
}
|
||||
|
||||
QString StdIOSettingsWidget::arguments() const
|
||||
|
@@ -80,7 +80,7 @@ McuPackage::McuPackage(const QString &label, const QString &defaultPath,
|
||||
|
||||
QString McuPackage::path() const
|
||||
{
|
||||
return QFileInfo(m_fileChooser->path() + m_relativePathModifier).absoluteFilePath();
|
||||
return QFileInfo(m_fileChooser->filePath().toString() + m_relativePathModifier).absoluteFilePath();
|
||||
}
|
||||
|
||||
QString McuPackage::label() const
|
||||
@@ -180,7 +180,7 @@ void McuPackage::updateStatus()
|
||||
m_path = m_fileChooser->rawPath();
|
||||
const bool validPath = m_fileChooser->isValid();
|
||||
const Utils::FilePath detectionPath = Utils::FilePath::fromString(
|
||||
m_fileChooser->path() + "/" + m_detectionPath);
|
||||
m_fileChooser->filePath().toString() + "/" + m_detectionPath);
|
||||
const QString displayDetectionPath = Utils::FilePath::fromString(m_detectionPath).toUserOutput();
|
||||
const bool validPackage = detectionPath.exists();
|
||||
|
||||
|
@@ -86,7 +86,7 @@ QString SrcDestDialog::getRepositoryString() const
|
||||
return repoUrl.toString();
|
||||
}
|
||||
if (m_ui->localButton->isChecked())
|
||||
return m_ui->localPathChooser->path();
|
||||
return m_ui->localPathChooser->filePath().toString();
|
||||
return m_ui->urlLineEdit->text();
|
||||
}
|
||||
|
||||
|
@@ -123,7 +123,7 @@ bool NimToolChainConfigWidget::isDirtyImpl() const
|
||||
{
|
||||
auto tc = static_cast<NimToolChain *>(toolChain());
|
||||
Q_ASSERT(tc);
|
||||
return tc->compilerCommand().toString() != m_compilerCommand->path();
|
||||
return tc->compilerCommand().toString() != m_compilerCommand->filePath().toString();
|
||||
}
|
||||
|
||||
void NimToolChainConfigWidget::makeReadOnlyImpl()
|
||||
|
@@ -47,7 +47,7 @@ NimToolsSettingsWidget::~NimToolsSettingsWidget()
|
||||
|
||||
QString NimToolsSettingsWidget::command() const
|
||||
{
|
||||
return ui->pathWidget->path();
|
||||
return ui->pathWidget->filePath().toString();
|
||||
}
|
||||
|
||||
void NimToolsSettingsWidget::setCommand(const QString &filename)
|
||||
|
@@ -608,7 +608,7 @@ bool CustomToolChainConfigWidget::isDirtyImpl() const
|
||||
auto tc = static_cast<CustomToolChain *>(toolChain());
|
||||
Q_ASSERT(tc);
|
||||
return m_compilerCommand->filePath() != tc->compilerCommand()
|
||||
|| m_makeCommand->path() != tc->makeCommand(Environment()).toString()
|
||||
|| m_makeCommand->filePath().toString() != tc->makeCommand(Environment()).toString()
|
||||
|| m_abiWidget->currentAbi() != tc->targetAbi()
|
||||
|| Macro::toMacros(m_predefinedDetails->text().toUtf8()) != tc->rawPredefinedMacros()
|
||||
|| m_headerDetails->entries() != tc->headerPathsList()
|
||||
|
@@ -360,8 +360,8 @@ void CustomWizardFieldPage::cleanupPage()
|
||||
PathChooserData &ped = m_pathChoosers[i];
|
||||
QString defaultText = ped.defaultText;
|
||||
CustomWizardContext::replaceFields(m_context->baseReplacements, &defaultText);
|
||||
if (ped.pathChooser->path() != ped.defaultText)
|
||||
ped.userChange = ped.pathChooser->path();
|
||||
if (ped.pathChooser->filePath().toString() != ped.defaultText)
|
||||
ped.userChange = ped.pathChooser->filePath().toString();
|
||||
else
|
||||
ped.userChange.clear();
|
||||
}
|
||||
@@ -435,7 +435,7 @@ CustomWizardPage::CustomWizardPage(const QSharedPointer<CustomWizardContext> &ct
|
||||
|
||||
QString CustomWizardPage::path() const
|
||||
{
|
||||
return m_pathChooser->path();
|
||||
return m_pathChooser->filePath().toString();
|
||||
}
|
||||
|
||||
void CustomWizardPage::setPath(const QString &path)
|
||||
|
@@ -1305,7 +1305,7 @@ void GccToolChainConfigWidget::setFromToolchain()
|
||||
m_platformLinkerFlagsLineEdit->setText(QtcProcess::joinArgs(tc->platformLinkerFlags()));
|
||||
if (m_abiWidget) {
|
||||
m_abiWidget->setAbis(tc->supportedAbis(), tc->targetAbi());
|
||||
if (!m_isReadOnly && !m_compilerCommand->path().isEmpty())
|
||||
if (!m_isReadOnly && !m_compilerCommand->filePath().toString().isEmpty())
|
||||
m_abiWidget->setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
@@ -746,7 +746,7 @@ QWidget *PathChooserField::createWidget(const QString &displayName, JsonFieldPag
|
||||
if (!m_historyId.isEmpty())
|
||||
w->setHistoryCompleter(m_historyId);
|
||||
QObject::connect(w, &PathChooser::pathChanged, [this, w] {
|
||||
if (w->path() != m_path)
|
||||
if (w->filePath().toString() != m_path)
|
||||
setHasUserChanges();
|
||||
});
|
||||
return w;
|
||||
@@ -798,7 +798,7 @@ void PathChooserField::fromSettings(const QVariant &value)
|
||||
|
||||
QVariant PathChooserField::toSettings() const
|
||||
{
|
||||
return qobject_cast<PathChooser *>(widget())->path();
|
||||
return qobject_cast<PathChooser *>(widget())->filePath().toString();
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
@@ -137,7 +137,7 @@ void ProjectExplorerSettingsWidget::setSettings(const ProjectExplorerSettings &
|
||||
|
||||
QString ProjectExplorerSettingsWidget::projectsDirectory() const
|
||||
{
|
||||
return m_ui.projectsDirectoryPathChooser->path();
|
||||
return m_ui.projectsDirectoryPathChooser->filePath().toString();
|
||||
}
|
||||
|
||||
void ProjectExplorerSettingsWidget::setProjectsDirectory(const QString &pd)
|
||||
|
@@ -148,7 +148,7 @@ void WorkingDirectoryAspect::addToLayout(LayoutBuilder &builder)
|
||||
m_chooser->setExpectedKind(Utils::PathChooser::Directory);
|
||||
m_chooser->setPromptDialogTitle(tr("Select Working Directory"));
|
||||
m_chooser->setBaseDirectory(m_defaultWorkingDirectory);
|
||||
m_chooser->setFileName(m_workingDirectory.isEmpty() ? m_defaultWorkingDirectory : m_workingDirectory);
|
||||
m_chooser->setFilePath(m_workingDirectory.isEmpty() ? m_defaultWorkingDirectory : m_workingDirectory);
|
||||
connect(m_chooser.data(), &PathChooser::pathChanged, this,
|
||||
[this]() {
|
||||
m_workingDirectory = m_chooser->rawFileName();
|
||||
@@ -183,7 +183,7 @@ QString WorkingDirectoryAspect::keyForDefaultWd() const
|
||||
|
||||
void WorkingDirectoryAspect::resetPath()
|
||||
{
|
||||
m_chooser->setFileName(m_defaultWorkingDirectory);
|
||||
m_chooser->setFilePath(m_defaultWorkingDirectory);
|
||||
}
|
||||
|
||||
void WorkingDirectoryAspect::fromMap(const QVariantMap &map)
|
||||
@@ -195,7 +195,7 @@ void WorkingDirectoryAspect::fromMap(const QVariantMap &map)
|
||||
m_workingDirectory = m_defaultWorkingDirectory;
|
||||
|
||||
if (m_chooser)
|
||||
m_chooser->setFileName(m_workingDirectory.isEmpty() ? m_defaultWorkingDirectory : m_workingDirectory);
|
||||
m_chooser->setFilePath(m_workingDirectory.isEmpty() ? m_defaultWorkingDirectory : m_workingDirectory);
|
||||
}
|
||||
|
||||
void WorkingDirectoryAspect::toMap(QVariantMap &data) const
|
||||
@@ -238,7 +238,7 @@ void WorkingDirectoryAspect::setDefaultWorkingDirectory(const FilePath &defaultW
|
||||
|
||||
if (m_workingDirectory.isEmpty() || m_workingDirectory == oldDefaultDir) {
|
||||
if (m_chooser)
|
||||
m_chooser->setFileName(m_defaultWorkingDirectory);
|
||||
m_chooser->setFilePath(m_defaultWorkingDirectory);
|
||||
m_workingDirectory = defaultWorkingDir;
|
||||
}
|
||||
}
|
||||
|
@@ -79,7 +79,7 @@ public:
|
||||
|
||||
Interpreter toInterpreter()
|
||||
{
|
||||
return {m_currentId, m_name->text(), FilePath::fromUserInput(m_executable->path())};
|
||||
return {m_currentId, m_name->text(), FilePath::fromUserInput(m_executable->filePath().toString())};
|
||||
}
|
||||
QLineEdit *m_name = nullptr;
|
||||
PathChooser *m_executable = nullptr;
|
||||
|
@@ -140,7 +140,7 @@ PluginOptions::WidgetOptions ClassDefinition::widgetOptions(const QString &class
|
||||
wo.pluginClassName = m_ui.pluginClassEdit->text();
|
||||
wo.pluginHeaderFile = m_ui.pluginHeaderEdit->text();
|
||||
wo.pluginSourceFile = m_ui.pluginSourceEdit->text();
|
||||
wo.iconFile = m_ui.iconPathChooser->path();
|
||||
wo.iconFile = m_ui.iconPathChooser->filePath().toString();
|
||||
wo.group = m_ui.groupEdit->text();
|
||||
wo.toolTip = m_ui.tooltipEdit->text();
|
||||
wo.whatsThis = m_ui.whatsthisEdit->toPlainText();
|
||||
|
@@ -622,7 +622,7 @@ AddLibraryWizard::LinkageType NonInternalLibraryDetailsController::suggestedLink
|
||||
AddLibraryWizard::LinkageType type = AddLibraryWizard::NoLinkage;
|
||||
if (libraryPlatformType() != Utils::OsTypeWindows) {
|
||||
if (libraryDetailsWidget()->libraryPathChooser->isValid()) {
|
||||
QFileInfo fi(libraryDetailsWidget()->libraryPathChooser->path());
|
||||
QFileInfo fi(libraryDetailsWidget()->libraryPathChooser->filePath().toString());
|
||||
if (fi.suffix() == QLatin1String("a"))
|
||||
type = AddLibraryWizard::StaticLinkage;
|
||||
else
|
||||
@@ -637,7 +637,7 @@ AddLibraryWizard::MacLibraryType NonInternalLibraryDetailsController::suggestedM
|
||||
AddLibraryWizard::MacLibraryType type = AddLibraryWizard::NoLibraryType;
|
||||
if (libraryPlatformType() == Utils::OsTypeMac) {
|
||||
if (libraryDetailsWidget()->libraryPathChooser->isValid()) {
|
||||
QFileInfo fi(libraryDetailsWidget()->libraryPathChooser->path());
|
||||
QFileInfo fi(libraryDetailsWidget()->libraryPathChooser->filePath().toString());
|
||||
if (fi.suffix() == QLatin1String("framework"))
|
||||
type = AddLibraryWizard::FrameworkType;
|
||||
else
|
||||
@@ -651,7 +651,7 @@ QString NonInternalLibraryDetailsController::suggestedIncludePath() const
|
||||
{
|
||||
QString includePath;
|
||||
if (libraryDetailsWidget()->libraryPathChooser->isValid()) {
|
||||
QFileInfo fi(libraryDetailsWidget()->libraryPathChooser->path());
|
||||
QFileInfo fi(libraryDetailsWidget()->libraryPathChooser->filePath().toString());
|
||||
includePath = fi.absolutePath();
|
||||
QFileInfo dfi(includePath);
|
||||
// TODO: Win: remove debug or release folder first if appropriate
|
||||
@@ -722,7 +722,7 @@ void NonInternalLibraryDetailsController::slotLibraryPathChanged()
|
||||
bool subfoldersEnabled = true;
|
||||
bool removeSuffixEnabled = true;
|
||||
if (libraryDetailsWidget()->libraryPathChooser->isValid()) {
|
||||
QFileInfo fi(libraryDetailsWidget()->libraryPathChooser->path());
|
||||
QFileInfo fi(libraryDetailsWidget()->libraryPathChooser->filePath().toString());
|
||||
QFileInfo dfi(fi.absolutePath());
|
||||
const QString parentFolderName = dfi.fileName().toLower();
|
||||
if (parentFolderName != QLatin1String("debug") &&
|
||||
@@ -755,7 +755,7 @@ bool NonInternalLibraryDetailsController::isComplete() const
|
||||
|
||||
QString NonInternalLibraryDetailsController::snippet() const
|
||||
{
|
||||
QString libPath = libraryDetailsWidget()->libraryPathChooser->path();
|
||||
QString libPath = libraryDetailsWidget()->libraryPathChooser->filePath().toString();
|
||||
QFileInfo fi(libPath);
|
||||
QString libName;
|
||||
const bool removeSuffix = isWindowsGroupVisible()
|
||||
@@ -801,7 +801,7 @@ QString NonInternalLibraryDetailsController::snippet() const
|
||||
}
|
||||
targetRelativePath = appendSeparator(pdir.relativeFilePath(absoluteLibraryPath));
|
||||
|
||||
const QString includePath = libraryDetailsWidget()->includePathChooser->path();
|
||||
const QString includePath = libraryDetailsWidget()->includePathChooser->filePath().toString();
|
||||
if (!includePath.isEmpty())
|
||||
includeRelativePath = pdir.relativeFilePath(includePath);
|
||||
}
|
||||
@@ -914,7 +914,7 @@ void ExternalLibraryDetailsController::updateWindowsOptionsEnablement()
|
||||
bool removeSuffixEnabled = true;
|
||||
if (libraryPlatformType() == Utils::OsTypeWindows
|
||||
&& libraryDetailsWidget()->libraryPathChooser->isValid()) {
|
||||
QFileInfo fi(libraryDetailsWidget()->libraryPathChooser->path());
|
||||
QFileInfo fi(libraryDetailsWidget()->libraryPathChooser->filePath().toString());
|
||||
QFileInfo dfi(fi.absolutePath());
|
||||
const QString parentFolderName = dfi.fileName().toLower();
|
||||
if (parentFolderName != QLatin1String("debug") &&
|
||||
@@ -1117,7 +1117,7 @@ QString InternalLibraryDetailsController::snippet() const
|
||||
TargetInformation targetInfo = m_proFiles.at(currentIndex)->targetInformation();
|
||||
|
||||
const QString targetRelativePath = appendSeparator(projectBuildDir.relativeFilePath(targetInfo.buildDir.toString()));
|
||||
const QString includeRelativePath = projectSrcDir.relativeFilePath(libraryDetailsWidget()->includePathChooser->path());
|
||||
const QString includeRelativePath = projectSrcDir.relativeFilePath(libraryDetailsWidget()->includePathChooser->filePath().toString());
|
||||
|
||||
const bool useSubfolders = libraryDetailsWidget()->useSubfoldersCheckBox->isChecked();
|
||||
const bool addSuffix = libraryDetailsWidget()->addSuffixCheckBox->isChecked();
|
||||
|
@@ -87,7 +87,7 @@ bool ComponentNameDialog::go(QString *proposedName,
|
||||
|
||||
if (QDialog::Accepted == d.exec()) {
|
||||
*proposedName = d.ui->componentNameEdit->text();
|
||||
*proposedPath = d.ui->pathEdit->path();
|
||||
*proposedPath = d.ui->pathEdit->filePath().toString();
|
||||
|
||||
if (d.ui->checkBox->isChecked())
|
||||
*proposedSuffix = "ui.qml";
|
||||
|
@@ -177,7 +177,7 @@ public:
|
||||
mainLayout->insertLayout(mainLayout->count() - 2, formLayout);
|
||||
}
|
||||
|
||||
QString projectSource() const { return m_projectSource->path(); }
|
||||
QString projectSource() const { return m_projectSource->filePath().toString(); }
|
||||
FilePath localExecutable() const { return m_localExecutable->filePath(); }
|
||||
|
||||
private:
|
||||
|
@@ -280,7 +280,7 @@ void QnxToolChainConfigWidget::discardImpl()
|
||||
m_compilerCommand->setFilePath(tc->compilerCommand());
|
||||
m_sdpPath->setPath(tc->sdpPath());
|
||||
m_abiWidget->setAbis(tc->supportedAbis(), tc->targetAbi());
|
||||
if (!m_compilerCommand->path().isEmpty())
|
||||
if (!m_compilerCommand->filePath().toString().isEmpty())
|
||||
m_abiWidget->setEnabled(true);
|
||||
}
|
||||
|
||||
@@ -289,7 +289,7 @@ bool QnxToolChainConfigWidget::isDirtyImpl() const
|
||||
auto tc = static_cast<const QnxToolChain *>(toolChain());
|
||||
Q_ASSERT(tc);
|
||||
return m_compilerCommand->filePath() != tc->compilerCommand()
|
||||
|| m_sdpPath->path() != tc->sdpPath()
|
||||
|| m_sdpPath->filePath().toString() != tc->sdpPath()
|
||||
|| m_abiWidget->currentAbi() != tc->targetAbi();
|
||||
}
|
||||
|
||||
|
@@ -125,7 +125,7 @@ QString ExamplesWelcomePage::copyToAlternativeLocation(const QFileInfo& proFileI
|
||||
int code = d.exec();
|
||||
if (code == Copy) {
|
||||
QString exampleDirName = proFileInfo.dir().dirName();
|
||||
QString destBaseDir = chooser->path();
|
||||
QString destBaseDir = chooser->filePath().toString();
|
||||
settings->setValue(QString::fromLatin1(C_FALLBACK_ROOT), destBaseDir);
|
||||
QDir toDirWithExamplesDir(destBaseDir);
|
||||
if (toDirWithExamplesDir.cd(exampleDirName)) {
|
||||
|
@@ -123,7 +123,7 @@ void GenericLinuxDeviceConfigurationWidget::userNameEditingFinished()
|
||||
void GenericLinuxDeviceConfigurationWidget::keyFileEditingFinished()
|
||||
{
|
||||
SshConnectionParameters sshParams = device()->sshParameters();
|
||||
sshParams.privateKeyFile = m_ui->keyFileLineEdit->path();
|
||||
sshParams.privateKeyFile = m_ui->keyFileLineEdit->filePath().toString();
|
||||
device()->setSshParameters(sshParams);
|
||||
}
|
||||
|
||||
|
@@ -227,15 +227,15 @@ void GenericLinuxDeviceConfigurationWizardKeyDeploymentPage::initializePage()
|
||||
|
||||
bool GenericLinuxDeviceConfigurationWizardKeyDeploymentPage::isComplete() const
|
||||
{
|
||||
return d->keyFileChooser.path().isEmpty() || d->keyFileChooser.filePath().exists();
|
||||
return d->keyFileChooser.filePath().toString().isEmpty() || d->keyFileChooser.filePath().exists();
|
||||
}
|
||||
|
||||
bool GenericLinuxDeviceConfigurationWizardKeyDeploymentPage::validatePage()
|
||||
{
|
||||
if (!d->defaultKeys().contains(d->keyFileChooser.path())) {
|
||||
if (!d->defaultKeys().contains(d->keyFileChooser.filePath().toString())) {
|
||||
SshConnectionParameters sshParams = d->device->sshParameters();
|
||||
sshParams.authenticationType = SshConnectionParameters::AuthenticationTypeSpecificKey;
|
||||
sshParams.privateKeyFile = d->keyFileChooser.path();
|
||||
sshParams.privateKeyFile = d->keyFileChooser.filePath().toString();
|
||||
d->device->setSshParameters(sshParams);
|
||||
}
|
||||
return true;
|
||||
@@ -243,7 +243,7 @@ bool GenericLinuxDeviceConfigurationWizardKeyDeploymentPage::validatePage()
|
||||
|
||||
QString GenericLinuxDeviceConfigurationWizardKeyDeploymentPage::privateKeyFilePath() const
|
||||
{
|
||||
return d->keyFileChooser.path();
|
||||
return d->keyFileChooser.filePath().toString();
|
||||
}
|
||||
|
||||
void GenericLinuxDeviceConfigurationWizardKeyDeploymentPage::createKey()
|
||||
|
@@ -150,7 +150,7 @@ const HighlighterSettings &HighlighterSettingsPage::highlighterSettings() const
|
||||
void HighlighterSettingsPage::settingsFromUI()
|
||||
{
|
||||
m_d->ensureInitialized();
|
||||
m_d->m_settings.setDefinitionFilesPath(m_d->m_page->definitionFilesPath->path());
|
||||
m_d->m_settings.setDefinitionFilesPath(m_d->m_page->definitionFilesPath->filePath().toString());
|
||||
m_d->m_settings.setIgnoredFilesPatterns(m_d->m_page->ignoreEdit->text());
|
||||
m_d->m_settings.toSettings(m_d->m_settingsPrefix, Core::ICore::settings());
|
||||
}
|
||||
@@ -165,6 +165,6 @@ void HighlighterSettingsPage::settingsToUI()
|
||||
bool HighlighterSettingsPage::settingsChanged() const
|
||||
{
|
||||
m_d->ensureInitialized();
|
||||
return (m_d->m_settings.definitionFilesPath() != m_d->m_page->definitionFilesPath->path())
|
||||
return (m_d->m_settings.definitionFilesPath() != m_d->m_page->definitionFilesPath->filePath().toString())
|
||||
|| (m_d->m_settings.ignoredFilesPatterns() != m_d->m_page->ignoreEdit->text());
|
||||
}
|
||||
|
@@ -1390,7 +1390,7 @@ bool HeobDialog::attach() const
|
||||
|
||||
QString HeobDialog::path() const
|
||||
{
|
||||
return m_pathChooser->path();
|
||||
return m_pathChooser->filePath().toString();
|
||||
}
|
||||
|
||||
void HeobDialog::keyPressEvent(QKeyEvent *e)
|
||||
@@ -1475,7 +1475,7 @@ void HeobDialog::saveOptions()
|
||||
settings->setValue(heobLeakRecordingC, m_leakRecordingCombo->currentIndex());
|
||||
settings->setValue(heobAttachC, m_attachCheck->isChecked());
|
||||
settings->setValue(heobExtraArgsC, m_extraArgsEdit->text());
|
||||
settings->setValue(heobPathC, m_pathChooser->path());
|
||||
settings->setValue(heobPathC, m_pathChooser->filePath().toString());
|
||||
settings->endGroup();
|
||||
}
|
||||
|
||||
|
@@ -194,7 +194,7 @@ void SuppressionDialog::maybeShow(MemcheckErrorView *view)
|
||||
|
||||
void SuppressionDialog::accept()
|
||||
{
|
||||
const QString path = m_fileChooser->path();
|
||||
const QString path = m_fileChooser->filePath().toString();
|
||||
QTC_ASSERT(!path.isEmpty(), return);
|
||||
QTC_ASSERT(!m_suppressionEdit->toPlainText().trimmed().isEmpty(), return);
|
||||
|
||||
|
@@ -74,12 +74,12 @@ CommonSettingsWidget::~CommonSettingsWidget()
|
||||
CommonVcsSettings CommonSettingsWidget::settings() const
|
||||
{
|
||||
CommonVcsSettings rc;
|
||||
rc.nickNameMailMap = m_ui->nickNameMailMapChooser->path();
|
||||
rc.nickNameFieldListFile = m_ui->nickNameFieldsFileChooser->path();
|
||||
rc.submitMessageCheckScript = m_ui->submitMessageCheckScriptChooser->path();
|
||||
rc.nickNameMailMap = m_ui->nickNameMailMapChooser->filePath().toString();
|
||||
rc.nickNameFieldListFile = m_ui->nickNameFieldsFileChooser->filePath().toString();
|
||||
rc.submitMessageCheckScript = m_ui->submitMessageCheckScriptChooser->filePath().toString();
|
||||
rc.lineWrap= m_ui->lineWrapCheckBox->isChecked();
|
||||
rc.lineWrapWidth = m_ui->lineWrapSpinBox->value();
|
||||
rc.sshPasswordPrompt = m_ui->sshPromptChooser->path();
|
||||
rc.sshPasswordPrompt = m_ui->sshPromptChooser->filePath().toString();
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user