diff --git a/dist/changes-6.0.0.md b/dist/changes-6.0.0.md index a188d81663b..c16f46c3cf8 100644 --- a/dist/changes-6.0.0.md +++ b/dist/changes-6.0.0.md @@ -13,55 +13,122 @@ the public Git repository. For example: General ------- -* ... +* Moved launching of tools to external process +* Merged `CppTools` plugin into `CppEditor` plugin Editing ------- +* Added support for multiple cursor editing (QTCREATORBUG-16013) +* Added import and export for font settings (QTCREATORBUG-6833) + ### C++ +* Added completion and function hint to `clangd` support +* Added option for saving open files automatically after refactoring + (QTCREATORBUG-25924) +* Fixed `Insert Definition` for templates with value parameters + (QTCREATORBUG-26113) +* Fixed canceling of C++ parsing on configuration change (QTCREATORBUG-24890) + ### QML -### Language Client - -### Beautifier - -### Designer +* Improved wizards for Qt 6.2 (QTCREATORBUG-26170) +* Simplified wizards Projects -------- -Debugging ---------- +* Added option to close all projects except one to Projects' view context menu +* Added option to cancel file renaming (QTCREATORBUG-26268) +* Added `Show in File System View` to project context menu +* Added `Advanced Find` scope for `Files in All Project Directories` +* Fixed stale directories in `Files in All Project Directories` locator filter +* Fixed redundant output on process crash (QTCREATORBUG-26049) +* Fixed duplicates in file rename dialog (QTCREATORBUG-26268) +* Fixed variable expansion for working directory (QTCREATORBUG-26274) -### GDB +### CMake -* Dropped support for GDB versions using Python version 2.x. - Python 3.6+ is required now. +* Removed separate `` node from project tree (QTCREATORBUG-18206, + QTCREATORBUG-24609, QTCREATORBUG-25407) +* Fixed that CMake warnings and project loading errors were not added to + `Issues` pane (QTCREATORBUG-26231) +* Fixed header file handling when mentioned in target sources + (QTCREATORBUG-23783, QTCREATORBUG-23843, QTCREATORBUG-26201, + QTCREATORBUG-26238) -### QML +Version Control Systems +----------------------- -Analyzer --------- +### Git -FakeVim -------- +* Added option to `Show HEAD` when amending commit (QTCREATORBUG-25004) +* Fixed wrong modified state of log viewer + +Test Integration +---------------- + +* Added option to run tests without deployment + +## CTest + +* Added options page (QTCREATORBUG-26029) Platforms --------- -### Windows - ### macOS +* Changed prebuilt binaries to universal Intel + ARM + ### Android -### Remote Linux +* Removed device selection dialog in favor of device selection in target + selector (QTCREATORBUG-23991) +* Added details to device settings (QTCREATORBUG-23991) -### QNX - -### MCU +### Docker +* Various improvements Credits for these changes go to: -------------------------------- +Aleksei German +Alessandro Portale +Alex Richardson +Alp Öz +Andre Hartmann +André Pönitz +Artem Sokolovskii +Artur Shepilko +Assam Boudjelthia +Christian Kandeler +Christian Stenger +Cristian Adam +David Schulz +Eike Ziller +Fawzi Mohamed +Henning Gruendl +Ihor Dutchak +Jaroslaw Kobus +Jonas Karlsson +Kai Köhne +Kama Wójcik +Li Xi +Loren Burkholder +Mahmoud Badri +Marco Bubke +Martin Kampas +Miina Puuronen +Orgad Shaneh +Petar Perisin +Piotr Mikolajczyk +Samuel Ghinet +Shantanu Tushar +Tasuku Suzuki +Thiago Macieira +Thomas Hartmann +Tony Leinonen +Tor Arne Vestbø +Vladimir Serdyuk diff --git a/src/libs/ssh/sshconnection.cpp b/src/libs/ssh/sshconnection.cpp index df548099917..5b1dc86d7d3 100644 --- a/src/libs/ssh/sshconnection.cpp +++ b/src/libs/ssh/sshconnection.cpp @@ -130,7 +130,7 @@ struct SshConnection::SshConnectionPrivate SshConnectionParameters::AuthenticationTypeSpecificKey; if (keyOnly) { args << "-o" << "IdentitiesOnly=yes"; - args << "-i" << connParams.privateKeyFile; + args << "-i" << connParams.privateKeyFile.path(); } if (keyOnly || SshSettings::askpassFilePath().isEmpty()) args << "-o" << "BatchMode=yes"; diff --git a/src/libs/ssh/sshconnection.h b/src/libs/ssh/sshconnection.h index 2778be02e08..cecd9999753 100644 --- a/src/libs/ssh/sshconnection.h +++ b/src/libs/ssh/sshconnection.h @@ -28,20 +28,19 @@ #include "sftpdefs.h" #include "ssh_global.h" +#include #include #include #include +#include #include #include #include -#include #include #include -namespace Utils { class FilePath; } - namespace QSsh { class SshRemoteProcess; @@ -69,7 +68,7 @@ public: void setUserName(const QString &name) { url.setUserName(name); } QUrl url; - QString privateKeyFile; + Utils::FilePath privateKeyFile; QString x11DisplayName; int timeout = 0; // In seconds. AuthenticationType authenticationType = AuthenticationTypeAll; diff --git a/src/libs/ssh/sshkeycreationdialog.cpp b/src/libs/ssh/sshkeycreationdialog.cpp index ed4a4547a4b..89488b2c27f 100644 --- a/src/libs/ssh/sshkeycreationdialog.cpp +++ b/src/libs/ssh/sshkeycreationdialog.cpp @@ -32,9 +32,6 @@ #include #include -#include -#include -#include #include #include #include @@ -50,7 +47,7 @@ SshKeyCreationDialog::SshKeyCreationDialog(QWidget *parent) m_ui->privateKeyFileButton->setText(Utils::PathChooser::browseButtonLabel()); const QString defaultPath = QStandardPaths::writableLocation(QStandardPaths::HomeLocation) + QLatin1String("/.ssh/qtc_id"); - setPrivateKeyFile(defaultPath); + setPrivateKeyFile(FilePath::fromString(defaultPath)); connect(m_ui->rsa, &QRadioButton::toggled, this, &SshKeyCreationDialog::keyTypeChanged); @@ -86,16 +83,16 @@ void SshKeyCreationDialog::generateKeys() showError(tr("The ssh-keygen tool was not found.")); return; } - if (QFileInfo::exists(privateKeyFilePath())) { + if (privateKeyFilePath().exists()) { showError(tr("Refusing to overwrite existing private key file \"%1\".") - .arg(QDir::toNativeSeparators(privateKeyFilePath()))); + .arg(privateKeyFilePath().toUserOutput())); return; } const QString keyTypeString = QLatin1String(m_ui->rsa->isChecked() ? "rsa": "ecdsa"); QApplication::setOverrideCursor(Qt::BusyCursor); QProcess keygen; const QStringList args{"-t", keyTypeString, "-b", m_ui->comboBox->currentText(), - "-N", QString(), "-f", privateKeyFilePath()}; + "-N", QString(), "-f", privateKeyFilePath().path()}; QString errorMsg; keygen.start(SshSettings::keygenFilePath().toString(), args); keygen.closeWriteChannel(); @@ -115,14 +112,14 @@ void SshKeyCreationDialog::handleBrowseButtonClicked() { const FilePath filePath = FileUtils::getSaveFilePath(this, tr("Choose Private Key File Name")); if (!filePath.isEmpty()) - setPrivateKeyFile(filePath.toString()); + setPrivateKeyFile(filePath); } -void SshKeyCreationDialog::setPrivateKeyFile(const QString &filePath) +void SshKeyCreationDialog::setPrivateKeyFile(const FilePath &filePath) { - m_ui->privateKeyFileValueLabel->setText(filePath); + m_ui->privateKeyFileValueLabel->setText(filePath.toUserOutput()); m_ui->generateButton->setEnabled(!privateKeyFilePath().isEmpty()); - m_ui->publicKeyFileLabel->setText(filePath + QLatin1String(".pub")); + m_ui->publicKeyFileLabel->setText(filePath.toUserOutput() + ".pub"); } void SshKeyCreationDialog::showError(const QString &details) @@ -130,14 +127,14 @@ void SshKeyCreationDialog::showError(const QString &details) QMessageBox::critical(this, tr("Key Generation Failed"), details); } -QString SshKeyCreationDialog::privateKeyFilePath() const +FilePath SshKeyCreationDialog::privateKeyFilePath() const { - return m_ui->privateKeyFileValueLabel->text(); + return FilePath::fromUserInput(m_ui->privateKeyFileValueLabel->text()); } -QString SshKeyCreationDialog::publicKeyFilePath() const +FilePath SshKeyCreationDialog::publicKeyFilePath() const { - return m_ui->publicKeyFileLabel->text(); + return FilePath::fromUserInput(m_ui->publicKeyFileLabel->text()); } } // namespace QSsh diff --git a/src/libs/ssh/sshkeycreationdialog.h b/src/libs/ssh/sshkeycreationdialog.h index dca0bdef821..3999cf93f76 100644 --- a/src/libs/ssh/sshkeycreationdialog.h +++ b/src/libs/ssh/sshkeycreationdialog.h @@ -27,6 +27,8 @@ #include "ssh_global.h" +#include + #include namespace QSsh { @@ -40,14 +42,14 @@ public: SshKeyCreationDialog(QWidget *parent = nullptr); ~SshKeyCreationDialog(); - QString privateKeyFilePath() const; - QString publicKeyFilePath() const; + Utils::FilePath privateKeyFilePath() const; + Utils::FilePath publicKeyFilePath() const; private: void keyTypeChanged(); void generateKeys(); void handleBrowseButtonClicked(); - void setPrivateKeyFile(const QString &filePath); + void setPrivateKeyFile(const Utils::FilePath &filePath); void showError(const QString &details); private: diff --git a/src/libs/utils/delegates.cpp b/src/libs/utils/delegates.cpp index 240b20fe0c9..c5e1985b288 100644 --- a/src/libs/utils/delegates.cpp +++ b/src/libs/utils/delegates.cpp @@ -30,7 +30,7 @@ #include #include -using namespace Utils; +namespace Utils { AnnotatedItemDelegate::AnnotatedItemDelegate(QObject *parent) : QStyledItemDelegate(parent) {} @@ -119,7 +119,7 @@ PathChooserDelegate::PathChooserDelegate(QObject *parent) { } -void PathChooserDelegate::setExpectedKind(Utils::PathChooser::Kind kind) +void PathChooserDelegate::setExpectedKind(PathChooser::Kind kind) { m_kind = kind; } @@ -134,13 +134,13 @@ QWidget *PathChooserDelegate::createEditor(QWidget *parent, const QStyleOptionVi Q_UNUSED(option) Q_UNUSED(index) - auto editor = new Utils::PathChooser(parent); + auto editor = new PathChooser(parent); editor->setHistoryCompleter(m_historyKey); editor->setAutoFillBackground(true); // To hide the text beneath the editor widget editor->lineEdit()->setMinimumWidth(0); - connect(editor, &Utils::PathChooser::browsingFinished, this, [this, editor]() { + connect(editor, &PathChooser::browsingFinished, this, [this, editor]() { emit const_cast(this)->commitData(editor); }); @@ -149,20 +149,20 @@ QWidget *PathChooserDelegate::createEditor(QWidget *parent, const QStyleOptionVi void PathChooserDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const { - if (auto *pathChooser = qobject_cast(editor)) { + if (auto *pathChooser = qobject_cast(editor)) { pathChooser->setExpectedKind(m_kind); pathChooser->setPromptDialogFilter(m_filter); - pathChooser->setPath(index.model()->data(index, Qt::EditRole).toString()); + pathChooser->setFilePath(FilePath::fromVariant(index.model()->data(index, Qt::EditRole))); } } void PathChooserDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const { - auto pathChooser = qobject_cast(editor); + auto pathChooser = qobject_cast(editor); if (!pathChooser) return; - model->setData(index, pathChooser->filePath().toString(), Qt::EditRole); + model->setData(index, pathChooser->filePath().toVariant(), Qt::EditRole); } void PathChooserDelegate::updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const @@ -233,3 +233,5 @@ void CompleterDelegate::updateEditorGeometry(QWidget *editor, editor->setGeometry(option.rect); } + +} // Utils diff --git a/src/libs/utils/filepath.cpp b/src/libs/utils/filepath.cpp index f39d7c90b3c..3b099e422e4 100644 --- a/src/libs/utils/filepath.cpp +++ b/src/libs/utils/filepath.cpp @@ -477,12 +477,14 @@ void FileUtils::setDeviceFileHooks(const DeviceFileHooks &hooks) } /// \returns a QString to display to the user -/// Converts the separators to the native format +/// Converts the separators to the native format of the system +/// this path belongs to. QString FilePath::toUserOutput() const { - if (m_scheme.isEmpty()) - return QDir::toNativeSeparators(m_data); - return toString(); + FilePath tmp = *this; + if (osType() == OsTypeWindows) + tmp.m_data.replace('/', '\\'); + return tmp.toString(); } QString FilePath::fileName() const diff --git a/src/libs/utils/projectintropage.cpp b/src/libs/utils/projectintropage.cpp index 07470ab6d2b..1a318df0d4c 100644 --- a/src/libs/utils/projectintropage.cpp +++ b/src/libs/utils/projectintropage.cpp @@ -62,7 +62,7 @@ public: bool m_complete = false; QRegularExpressionValidator m_projectNameValidator; bool m_forceSubProject = false; - QStringList m_projectDirectories; + FilePaths m_projectDirectories; }; ProjectIntroPage::ProjectIntroPage(QWidget *parent) : @@ -157,7 +157,7 @@ bool ProjectIntroPage::validate() int index = d->m_ui.projectComboBox->currentIndex(); if (index == 0) return false; - d->m_ui.pathChooser->setPath(d->m_projectDirectories.at(index)); + d->m_ui.pathChooser->setFilePath(d->m_projectDirectories.at(index)); } // Validate and display status if (!d->m_ui.pathChooser->isValid()) { @@ -230,7 +230,7 @@ void ProjectIntroPage::setProjectList(const QStringList &projectList) d->m_ui.projectComboBox->addItems(projectList); } -void ProjectIntroPage::setProjectDirectories(const QStringList &directoryList) +void ProjectIntroPage::setProjectDirectories(const FilePaths &directoryList) { d->m_projectDirectories = directoryList; } diff --git a/src/libs/utils/projectintropage.h b/src/libs/utils/projectintropage.h index 63e2f656713..5de165efe11 100644 --- a/src/libs/utils/projectintropage.h +++ b/src/libs/utils/projectintropage.h @@ -61,7 +61,7 @@ public: bool forceSubProject() const; void setForceSubProject(bool force); void setProjectList(const QStringList &projectList); - void setProjectDirectories(const QStringList &directoryList); + void setProjectDirectories(const Utils::FilePaths &directoryList); int projectIndex() const; bool validateProjectName(const QString &name, QString *errorMessage); diff --git a/src/plugins/coreplugin/locator/filesystemfilter.cpp b/src/plugins/coreplugin/locator/filesystemfilter.cpp index f7f6f906773..95c9bf16ea2 100644 --- a/src/plugins/coreplugin/locator/filesystemfilter.cpp +++ b/src/plugins/coreplugin/locator/filesystemfilter.cpp @@ -44,10 +44,11 @@ #include #include -using namespace Core; -using namespace Core::Internal; using namespace Utils; +namespace Core { +namespace Internal { + ILocatorFilter::MatchLevel FileSystemFilter::matchLevelFor(const QRegularExpressionMatch &match, const QString &matchText) { @@ -159,8 +160,7 @@ QList FileSystemFilter::matchesFor(QFutureInterfacem_cachedAdditionalToolsPaths; } -void VcsManager::promptToAdd(const QString &directory, const QStringList &fileNames) +void VcsManager::promptToAdd(const FilePath &directory, const FilePaths &filePaths) { - IVersionControl *vc = findVersionControlForDirectory(FilePath::fromString(directory)); + IVersionControl *vc = findVersionControlForDirectory(directory); if (!vc || !vc->supportsOperation(IVersionControl::AddOperation)) return; - const FilePaths unmanagedFiles = vc->unmanagedFiles(Utils::transform(fileNames, &FilePath::fromString)); + const FilePaths unmanagedFiles = vc->unmanagedFiles(filePaths); if (unmanagedFiles.isEmpty()) return; @@ -446,7 +446,7 @@ void VcsManager::promptToAdd(const QString &directory, const QStringList &fileNa if (dlg.exec() == QDialog::Accepted) { QStringList notAddedToVc; for (const FilePath &file : unmanagedFiles) { - if (!vc->vcsAdd(FilePath::fromString(QDir(directory).filePath(file.path())))) + if (!vc->vcsAdd(directory.resolvePath(file))) notAddedToVc << file.toUserOutput(); } diff --git a/src/plugins/coreplugin/vcsmanager.h b/src/plugins/coreplugin/vcsmanager.h index 7cb15f2f58f..f0ce9b30cab 100644 --- a/src/plugins/coreplugin/vcsmanager.h +++ b/src/plugins/coreplugin/vcsmanager.h @@ -80,7 +80,7 @@ public: // Shows a confirmation dialog, whether the files in the list should be // added to revision control. Calls vcsAdd for each file. - static void promptToAdd(const QString &directory, const QStringList &fileNames); + static void promptToAdd(const Utils::FilePath &directory, const Utils::FilePaths &filePaths); static void emitRepositoryChanged(const Utils::FilePath &repository); diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp index 885e60d7031..23e0e2208ea 100644 --- a/src/plugins/debugger/cdb/cdbengine.cpp +++ b/src/plugins/debugger/cdb/cdbengine.cpp @@ -419,7 +419,7 @@ void CdbEngine::setupEngine() } break; case AttachToCore: - debugger.addArgs({"-z", sp.coreFile}); + debugger.addArgs({"-z", sp.coreFile.path()}); break; default: handleSetupFailure(QString("Internal error: Unsupported start mode %1.").arg(sp.startMode)); diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index c55deb55393..debdcaafdd4 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -2632,7 +2632,7 @@ QString DebuggerEngine::formatStartParameters() const if (!sp.debugger.command.isEmpty()) str << "Debugger: " << sp.debugger.command.toUserOutput() << '\n'; if (!sp.coreFile.isEmpty()) - str << "Core: " << QDir::toNativeSeparators(sp.coreFile) << '\n'; + str << "Core: " << sp.coreFile.toUserOutput() << '\n'; if (sp.attachPID.isValid()) str << "PID: " << sp.attachPID.pid() << ' ' << sp.crashParameter << '\n'; if (!sp.projectSourceDirectory.isEmpty()) { diff --git a/src/plugins/debugger/debuggerengine.h b/src/plugins/debugger/debuggerengine.h index 68d66fba500..8611e4668d6 100644 --- a/src/plugins/debugger/debuggerengine.h +++ b/src/plugins/debugger/debuggerengine.h @@ -158,7 +158,7 @@ public: Utils::FilePath sysRoot; // Used by general core file debugging. Public access requested in QTCREATORBUG-17158. - QString coreFile; + Utils::FilePath coreFile; // Macro-expanded and passed to debugger startup. QString additionalStartupCommands; @@ -172,7 +172,7 @@ public: bool runAsRoot = false; ProjectExplorer::Runnable debugger; - QString overrideStartScript; // Used in attach to core and remote debugging + Utils::FilePath overrideStartScript; // Used in attach to core and remote debugging QString startMessage; // First status message shown. Utils::FilePath debugInfoLocation; // Gdb "set-debug-file-directory". QStringList debugSourceLocation; // Gdb "directory" diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 36a521cbdd2..6481ee3b6ca 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -1255,7 +1255,7 @@ bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it, DebuggerStartMode startMode = StartExternal; FilePath executable; QString remoteChannel; - QString coreFile; + FilePath coreFile; QString sysRoot; bool useTerminal = false; @@ -1281,7 +1281,7 @@ bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it, remoteChannel = val; } else if (key == "core") { startMode = AttachToCore; - coreFile = val; + coreFile = FilePath::fromUserInput(val); } else if (key == "terminal") { useTerminal = true; } else if (key == "sysroot") { @@ -1312,9 +1312,9 @@ bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it, } else if (startMode == AttachToCore) { debugger->setStartMode(AttachToCore); debugger->setCloseMode(DetachAtClose); - debugger->setCoreFileName(coreFile); - debugger->setRunControlName(tr("Core file \"%1\"").arg(coreFile)); - debugger->setStartMessage(tr("Attaching to core file %1.").arg(coreFile)); + debugger->setCoreFilePath(coreFile); + debugger->setRunControlName(tr("Core file \"%1\"").arg(coreFile.toUserOutput())); + debugger->setStartMessage(tr("Attaching to core file %1.").arg(coreFile.toUserOutput())); } else { debugger->setStartMode(StartExternal); debugger->setRunControlName(tr("Executable file \"%1\"").arg(executable.toUserOutput())); @@ -1521,31 +1521,32 @@ void DebuggerPluginPrivate::attachCore() const QString lastExternalKit = configValue("LastExternalKit").toString(); if (!lastExternalKit.isEmpty()) dlg.setKitId(Id::fromString(lastExternalKit)); - dlg.setSymbolFile(configValue("LastExternalExecutableFile").toString()); - dlg.setLocalCoreFile(configValue("LastLocalCoreFile").toString()); - dlg.setRemoteCoreFile(configValue("LastRemoteCoreFile").toString()); - dlg.setOverrideStartScript(configValue("LastExternalStartScript").toString()); - dlg.setSysRoot(configValue("LastSysRoot").toString()); + dlg.setSymbolFile(FilePath::fromVariant(configValue("LastExternalExecutableFile"))); + dlg.setLocalCoreFile(FilePath::fromVariant(configValue("LastLocalCoreFile"))); + dlg.setRemoteCoreFile(FilePath::fromVariant(configValue("LastRemoteCoreFile"))); + dlg.setOverrideStartScript(FilePath::fromVariant(configValue("LastExternalStartScript"))); + dlg.setSysRoot(FilePath::fromVariant(configValue("LastSysRoot"))); dlg.setForceLocalCoreFile(configValue("LastForceLocalCoreFile").toBool()); if (dlg.exec() != QDialog::Accepted) return; setConfigValue("LastExternalExecutableFile", dlg.symbolFile().toVariant()); - setConfigValue("LastLocalCoreFile", dlg.localCoreFile()); - setConfigValue("LastRemoteCoreFile", dlg.remoteCoreFile()); + setConfigValue("LastLocalCoreFile", dlg.localCoreFile().toVariant()); + setConfigValue("LastRemoteCoreFile", dlg.remoteCoreFile().toVariant()); setConfigValue("LastExternalKit", dlg.kit()->id().toSetting()); - setConfigValue("LastExternalStartScript", dlg.overrideStartScript()); - setConfigValue("LastSysRoot", dlg.sysRoot().toString()); + setConfigValue("LastExternalStartScript", dlg.overrideStartScript().toVariant()); + setConfigValue("LastSysRoot", dlg.sysRoot().toVariant()); setConfigValue("LastForceLocalCoreFile", dlg.forcesLocalCoreFile()); auto runControl = new RunControl(ProjectExplorer::Constants::DEBUG_RUN_MODE); runControl->setKit(dlg.kit()); runControl->setDisplayName(tr("Core file \"%1\"") - .arg(dlg.useLocalCoreFile() ? dlg.localCoreFile() : dlg.remoteCoreFile())); + .arg(dlg.useLocalCoreFile() ? dlg.localCoreFile().toUserOutput() + : dlg.remoteCoreFile().toUserOutput())); auto debugger = new DebuggerRunTool(runControl); debugger->setInferiorExecutable(dlg.symbolFile()); - debugger->setCoreFileName(dlg.localCoreFile()); + debugger->setCoreFilePath(dlg.localCoreFile()); debugger->setStartMode(AttachToCore); debugger->setCloseMode(DetachAtClose); debugger->setOverrideStartScript(dlg.overrideStartScript()); diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index 0b23be17c21..ffece207088 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -108,11 +108,11 @@ static QString noDebuggerInKitMessage() class CoreUnpacker final : public RunWorker { public: - CoreUnpacker(RunControl *runControl, const QString &coreFileName) - : RunWorker(runControl), m_coreFileName(coreFileName) + CoreUnpacker(RunControl *runControl, const FilePath &coreFilePath) + : RunWorker(runControl), m_coreFilePath(coreFilePath) {} - QString coreFileName() const { return m_tempCoreFileName; } + FilePath coreFileName() const { return m_tempCoreFilePath; } private: ~CoreUnpacker() final @@ -123,7 +123,7 @@ private: if (m_tempCoreFile.isOpen()) m_tempCoreFile.close(); - QFile::remove(m_tempCoreFileName); + m_tempCoreFilePath.removeFile(); } void start() final @@ -131,40 +131,41 @@ private: { Utils::TemporaryFile tmp("tmpcore-XXXXXX"); tmp.open(); - m_tempCoreFileName = tmp.fileName(); + m_tempCoreFilePath = FilePath::fromString(tmp.fileName()); } m_coreUnpackProcess.setWorkingDirectory(FilePath::fromString(TemporaryDirectory::masterDirectoryPath())); connect(&m_coreUnpackProcess, &QtcProcess::finished, this, &CoreUnpacker::reportStarted); const QString msg = DebuggerRunTool::tr("Unpacking core file to %1"); - appendMessage(msg.arg(m_tempCoreFileName), LogMessageFormat); + appendMessage(msg.arg(m_tempCoreFilePath.toUserOutput()), LogMessageFormat); - if (m_coreFileName.endsWith(".lzo")) { - m_coreUnpackProcess.setCommand({"lzop", {"-o", m_tempCoreFileName, "-x", m_coreFileName}}); + if (m_coreFilePath.endsWith(".lzo")) { + m_coreUnpackProcess.setCommand({"lzop", {"-o", m_tempCoreFilePath.path(), + "-x", m_coreFilePath.path()}}); m_coreUnpackProcess.start(); return; } - if (m_coreFileName.endsWith(".gz")) { - appendMessage(msg.arg(m_tempCoreFileName), LogMessageFormat); - m_tempCoreFile.setFileName(m_tempCoreFileName); + if (m_coreFilePath.endsWith(".gz")) { + appendMessage(msg.arg(m_tempCoreFilePath.toUserOutput()), LogMessageFormat); + m_tempCoreFile.setFileName(m_tempCoreFilePath.path()); m_tempCoreFile.open(QFile::WriteOnly); connect(&m_coreUnpackProcess, &QtcProcess::readyReadStandardOutput, this, [this] { m_tempCoreFile.write(m_coreUnpackProcess.readAllStandardOutput()); }); - m_coreUnpackProcess.setCommand({"gzip", {"-c", "-d", m_coreFileName}}); + m_coreUnpackProcess.setCommand({"gzip", {"-c", "-d", m_coreFilePath.path()}}); m_coreUnpackProcess.start(); return; } QTC_CHECK(false); - reportFailure("Unknown file extension in " + m_coreFileName); + reportFailure("Unknown file extension in " + m_coreFilePath.toUserOutput()); } QFile m_tempCoreFile; - QString m_coreFileName; - QString m_tempCoreFileName; + FilePath m_coreFilePath; + FilePath m_tempCoreFilePath; QtcProcess m_coreUnpackProcess; }; @@ -369,7 +370,7 @@ void DebuggerRunTool::setTestCase(int testCase) m_runParameters.testCase = testCase; } -void DebuggerRunTool::setOverrideStartScript(const QString &script) +void DebuggerRunTool::setOverrideStartScript(const FilePath &script) { m_runParameters.overrideStartScript = script; } @@ -409,7 +410,7 @@ void DebuggerRunTool::setStartMessage(const QString &msg) m_runParameters.startMessage = msg; } -void DebuggerRunTool::setCoreFileName(const QString &coreFile, bool isSnapshot) +void DebuggerRunTool::setCoreFilePath(const FilePath &coreFile, bool isSnapshot) { if (coreFile.endsWith(".gz") || coreFile.endsWith(".lzo")) { d->coreUnpacker = new CoreUnpacker(runControl(), coreFile); @@ -588,7 +589,7 @@ void DebuggerRunTool::start() auto debugger = new DebuggerRunTool(rc); debugger->setStartMode(AttachToCore); debugger->setRunControlName(name); - debugger->setCoreFileName(coreFile, true); + debugger->setCoreFilePath(FilePath::fromString(coreFile), true); debugger->startRunControl(); }); @@ -962,7 +963,7 @@ void DebuggerRunTool::addSolibSearchDir(const QString &str) DebuggerRunTool::~DebuggerRunTool() { if (m_runParameters.isSnapshot && !m_runParameters.coreFile.isEmpty()) - QFile::remove(m_runParameters.coreFile); + m_runParameters.coreFile.removeFile(); delete m_engine2; m_engine2 = nullptr; diff --git a/src/plugins/debugger/debuggerruncontrol.h b/src/plugins/debugger/debuggerruncontrol.h index 11abe9874f0..a11cc098e90 100644 --- a/src/plugins/debugger/debuggerruncontrol.h +++ b/src/plugins/debugger/debuggerruncontrol.h @@ -119,13 +119,13 @@ public: void setQmlServer(const QUrl &qmlServer); QUrl qmlServer() const; // Used in GammaRay integration. - void setCoreFileName(const QString &core, bool isSnapshot = false); + void setCoreFilePath(const Utils::FilePath &core, bool isSnapshot = false); void setIosPlatform(const QString &platform); void setDeviceSymbolsRoot(const QString &deviceSymbolsRoot); void setTestCase(int testCase); - void setOverrideStartScript(const QString &script); + void setOverrideStartScript(const Utils::FilePath &script); void setAbi(const ProjectExplorer::Abi &abi); diff --git a/src/plugins/debugger/enginemanager.cpp b/src/plugins/debugger/enginemanager.cpp index f816ac97254..0c5ef1dd68e 100644 --- a/src/plugins/debugger/enginemanager.cpp +++ b/src/plugins/debugger/enginemanager.cpp @@ -245,7 +245,7 @@ QVariant EngineItem::data(int column, int role) const return myName; } case 1: - return rp.coreFile.isEmpty() ? rp.inferior.command.executable().toUserOutput() : rp.coreFile; + return (rp.coreFile.isEmpty() ? rp.inferior.command.executable() : rp.coreFile).toUserOutput(); } return QVariant(); diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index e09c1cce661..e53ddd7cf97 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -4018,17 +4018,17 @@ void GdbEngine::handleGdbStartFailed() void GdbEngine::loadInitScript() { - const QString script = runParameters().overrideStartScript; + const FilePath script = runParameters().overrideStartScript; if (!script.isEmpty()) { - if (QFileInfo(script).isReadable()) { - runCommand({"source " + script}); + if (script.isReadableFile()) { + runCommand({"source " + script.path()}); } else { AsynchronousMessageBox::warning( tr("Cannot Find Debugger Initialization Script"), tr("The debugger settings point to a script file at \"%1\", " "which is not accessible. If a script file is not needed, " "consider clearing that entry to avoid this warning." - ).arg(script)); + ).arg(script.toUserOutput())); } } else { const QString commands = nativeStartupCommands().trimmed(); @@ -4537,7 +4537,7 @@ void GdbEngine::runEngine() } else if (isCoreEngine()) { claimInitialBreakpoints(); - runCommand({"target core " + runParameters().coreFile, CB(handleTargetCore)}); + runCommand({"target core " + runParameters().coreFile.path(), CB(handleTargetCore)}); } else if (isTermEngine()) { @@ -4714,12 +4714,12 @@ void GdbEngine::handleFileExecAndSymbols(const DebuggerResponse &response) } else if (isCoreEngine()) { - QString core = runParameters().coreFile; + const FilePath core = runParameters().coreFile; if (response.resultClass == ResultDone) { showMessage(tr("Symbols found."), StatusBar); handleInferiorPrepared(); } else { - QString msg = tr("No symbols found in the core file \"%1\".").arg(core) + QString msg = tr("No symbols found in the core file \"%1\".").arg(core.toUserOutput()) + ' ' + tr("This can be caused by a path length limitation " "in the core file.") + ' ' + tr("Try to specify the binary in " @@ -4956,41 +4956,35 @@ void GdbEngine::handleStubAttached(const DebuggerResponse &response, qint64 main } } -static QString findExecutableFromName(const QString &fileNameFromCore, const QString &coreFile) +static FilePath findExecutableFromName(const QString &fileNameFromCore, const FilePath &coreFile) { if (fileNameFromCore.isEmpty()) - return fileNameFromCore; - QFileInfo fi(fileNameFromCore); - if (fi.isFile()) - return fileNameFromCore; + return {}; + + FilePath filePathFromCore = FilePath::fromUserInput(fileNameFromCore); + if (filePathFromCore.isFile()) + return filePathFromCore; // turn the filename into an absolute path, using the location of the core as a hint - QString absPath; - if (fi.isAbsolute()) { - absPath = fileNameFromCore; - } else { - QFileInfo coreInfo(coreFile); - FilePath coreDir = FilePath::fromString(coreInfo.dir().absolutePath()); - absPath = coreDir.resolvePath(fileNameFromCore).toString(); - } - if (QFileInfo(absPath).isFile() || absPath.isEmpty()) + const FilePath coreDir = coreFile.absoluteFilePath().parentDir(); + const FilePath absPath = coreDir.resolvePath(fileNameFromCore); + + if (absPath.isFile() || absPath.isEmpty()) return absPath; // remove possible trailing arguments - QChar sep(' '); - QStringList pathFragments = absPath.split(sep); + QStringList pathFragments = absPath.path().split(' '); while (pathFragments.size() > 0) { - QString joined_path = pathFragments.join(sep); - if (QFileInfo(joined_path).isFile()) { + const FilePath joined_path = FilePath::fromString(pathFragments.join(' ')); + if (joined_path.isFile()) return joined_path; - } pathFragments.pop_back(); } - return QString(); + return {}; } -CoreInfo CoreInfo::readExecutableNameFromCore(const Runnable &debugger, const QString &coreFile) +CoreInfo CoreInfo::readExecutableNameFromCore(const Runnable &debugger, const FilePath &coreFile) { CoreInfo cinfo; #if 0 @@ -5002,7 +4996,7 @@ CoreInfo CoreInfo::readExecutableNameFromCore(const Runnable &debugger, const QS // Multiarch GDB on Windows crashes if osabi is cygwin (the default) when opening a core dump. if (HostOsInfo::isWindowsHost()) args += {"-ex", "set osabi GNU/Linux"}; - args += {"-ex", "core " + coreFile}; + args += {"-ex", "core " + coreFile.toUserOutput()}; QtcProcess proc; Environment envLang(Environment::systemEnvironment()); @@ -5022,8 +5016,7 @@ CoreInfo CoreInfo::readExecutableNameFromCore(const Runnable &debugger, const QS if (pos2 != -1) { cinfo.isCore = true; cinfo.rawStringFromCore = output.mid(pos1, pos2 - pos1); - cinfo.foundExecutableName = - FilePath::fromString(findExecutableFromName(cinfo.rawStringFromCore, coreFile)); + cinfo.foundExecutableName = findExecutableFromName(cinfo.rawStringFromCore, coreFile); } } } @@ -5040,7 +5033,7 @@ void GdbEngine::handleTargetCore(const DebuggerResponse &response) // We'll accept any kind of error e.g. &"Cannot access memory at address 0x2abc2a24\n" // Even without the stack, the user can find interesting stuff by exploring // the memory, globals etc. - showStatusMessage(tr("Attach to core \"%1\" failed:").arg(runParameters().coreFile) + showStatusMessage(tr("Attach to core \"%1\" failed:").arg(runParameters().coreFile.toUserOutput()) + '\n' + response.data["msg"].data() + '\n' + tr("Continuing nevertheless.")); } diff --git a/src/plugins/debugger/gdb/gdbengine.h b/src/plugins/debugger/gdb/gdbengine.h index 491098a7bff..54ee843ed23 100644 --- a/src/plugins/debugger/gdb/gdbengine.h +++ b/src/plugins/debugger/gdb/gdbengine.h @@ -61,7 +61,7 @@ struct CoreInfo bool isCore = false; static CoreInfo readExecutableNameFromCore(const ProjectExplorer::Runnable &debugger, - const QString &coreFile); + const Utils::FilePath &coreFile); }; class GdbEngine final : public CppDebuggerEngine diff --git a/src/plugins/debugger/loadcoredialog.cpp b/src/plugins/debugger/loadcoredialog.cpp index 8ad011fae67..b5d04ead15c 100644 --- a/src/plugins/debugger/loadcoredialog.cpp +++ b/src/plugins/debugger/loadcoredialog.cpp @@ -73,8 +73,8 @@ public: explicit SelectRemoteFileDialog(QWidget *parent); void attachToDevice(Kit *k); - QString localFile() const { return m_localFile; } - QString remoteFile() const { return m_remoteFile; } + FilePath localFile() const { return m_localFile; } + FilePath remoteFile() const { return m_remoteFile; } private: void handleSftpOperationFinished(SftpJobId, const QString &error); @@ -88,8 +88,8 @@ private: QTreeView *m_fileSystemView; QTextBrowser *m_textBrowser; QDialogButtonBox *m_buttonBox; - QString m_localFile; - QString m_remoteFile; + FilePath m_localFile; + FilePath m_remoteFile; SftpJobId m_sftpJobId; }; @@ -185,12 +185,12 @@ void SelectRemoteFileDialog::selectFile() { Utils::TemporaryFile localFile("remotecore-XXXXXX"); localFile.open(); - m_localFile = localFile.fileName(); + m_localFile = FilePath::fromString(localFile.fileName()); } idx = idx.sibling(idx.row(), 1); - m_remoteFile = m_fileSystemModel.data(idx, SftpFileSystemModel::PathRole).toString(); - m_sftpJobId = m_fileSystemModel.downloadFile(idx, m_localFile); + m_remoteFile = FilePath::fromVariant(m_fileSystemModel.data(idx, SftpFileSystemModel::PathRole)); + m_sftpJobId = m_fileSystemModel.downloadFile(idx, m_localFile.toString()); } /////////////////////////////////////////////////////////////////////// @@ -372,11 +372,12 @@ bool AttachCoreDialog::useLocalCoreFile() const void AttachCoreDialog::coreFileChanged(const QString &core) { - if (!HostOsInfo::isWindowsHost() && QFile::exists(core)) { + const FilePath coreFile = FilePath::fromUserInput(core); + if (coreFile.osType() != OsType::OsTypeWindows && coreFile.exists()) { Kit *k = d->kitChooser->currentKit(); QTC_ASSERT(k, return); Runnable debugger = DebuggerKitAspect::runnable(k); - CoreInfo cinfo = CoreInfo::readExecutableNameFromCore(debugger, core); + CoreInfo cinfo = CoreInfo::readExecutableNameFromCore(debugger, coreFile); if (!cinfo.foundExecutableName.isEmpty()) d->symbolFileName->setFilePath(cinfo.foundExecutableName); else if (!d->symbolFileName->isValid() && !cinfo.rawStringFromCore.isEmpty()) @@ -413,14 +414,14 @@ void AttachCoreDialog::selectRemoteCoreFile() dlg.attachToDevice(d->kitChooser->currentKit()); if (dlg.exec() == QDialog::Rejected) return; - d->localCoreFileName->setPath(dlg.localFile()); - d->remoteCoreFileName->setText(dlg.remoteFile()); + d->localCoreFileName->setFilePath(dlg.localFile()); + d->remoteCoreFileName->setText(dlg.remoteFile().toUserOutput()); changed(); } -QString AttachCoreDialog::localCoreFile() const +FilePath AttachCoreDialog::localCoreFile() const { - return d->localCoreFileName->filePath().toString(); + return d->localCoreFileName->filePath(); } FilePath AttachCoreDialog::symbolFile() const @@ -428,24 +429,24 @@ FilePath AttachCoreDialog::symbolFile() const return d->symbolFileName->filePath(); } -void AttachCoreDialog::setSymbolFile(const QString &symbolFileName) +void AttachCoreDialog::setSymbolFile(const FilePath &symbolFilePath) { - d->symbolFileName->setPath(symbolFileName); + d->symbolFileName->setFilePath(symbolFilePath); } -void AttachCoreDialog::setLocalCoreFile(const QString &fileName) +void AttachCoreDialog::setLocalCoreFile(const FilePath &coreFilePath) { - d->localCoreFileName->setPath(fileName); + d->localCoreFileName->setFilePath(coreFilePath); } -void AttachCoreDialog::setRemoteCoreFile(const QString &fileName) +void AttachCoreDialog::setRemoteCoreFile(const FilePath &coreFilePath) { - d->remoteCoreFileName->setText(fileName); + d->remoteCoreFileName->setText(coreFilePath.toUserOutput()); } -QString AttachCoreDialog::remoteCoreFile() const +FilePath AttachCoreDialog::remoteCoreFile() const { - return d->remoteCoreFileName->text(); + return FilePath::fromUserInput(d->remoteCoreFileName->text()); } void AttachCoreDialog::setKitId(Id id) @@ -468,14 +469,14 @@ Kit *AttachCoreDialog::kit() const return d->kitChooser->currentKit(); } -QString AttachCoreDialog::overrideStartScript() const +FilePath AttachCoreDialog::overrideStartScript() const { - return d->overrideStartScriptFileName->filePath().toString(); + return d->overrideStartScriptFileName->filePath(); } -void AttachCoreDialog::setOverrideStartScript(const QString &scriptName) +void AttachCoreDialog::setOverrideStartScript(const FilePath &scriptName) { - d->overrideStartScriptFileName->setPath(scriptName); + d->overrideStartScriptFileName->setFilePath(scriptName); } FilePath AttachCoreDialog::sysRoot() const @@ -483,9 +484,9 @@ FilePath AttachCoreDialog::sysRoot() const return d->sysRootDirectory->filePath(); } -void AttachCoreDialog::setSysRoot(const QString &sysRoot) +void AttachCoreDialog::setSysRoot(const FilePath &sysRoot) { - d->sysRootDirectory->setPath(sysRoot); + d->sysRootDirectory->setFilePath(sysRoot); } } // namespace Internal diff --git a/src/plugins/debugger/loadcoredialog.h b/src/plugins/debugger/loadcoredialog.h index 39b1c1a8274..de181c9844e 100644 --- a/src/plugins/debugger/loadcoredialog.h +++ b/src/plugins/debugger/loadcoredialog.h @@ -48,9 +48,9 @@ public: int exec() override; Utils::FilePath symbolFile() const; - QString localCoreFile() const; - QString remoteCoreFile() const; - QString overrideStartScript() const; + Utils::FilePath localCoreFile() const; + Utils::FilePath remoteCoreFile() const; + Utils::FilePath overrideStartScript() const; Utils::FilePath sysRoot() const; bool useLocalCoreFile() const; bool forcesLocalCoreFile() const; @@ -58,11 +58,11 @@ public: // For persistance. ProjectExplorer::Kit *kit() const; - void setSymbolFile(const QString &symbolFileName); - void setLocalCoreFile(const QString &core); - void setRemoteCoreFile(const QString &core); - void setOverrideStartScript(const QString &scriptName); - void setSysRoot(const QString &sysRoot); + void setSymbolFile(const Utils::FilePath &symbolFilePath); + void setLocalCoreFile(const Utils::FilePath &coreFilePath); + void setRemoteCoreFile(const Utils::FilePath &coreFilePath); + void setOverrideStartScript(const Utils::FilePath &scriptName); + void setSysRoot(const Utils::FilePath &sysRoot); void setKitId(Utils::Id id); void setForceLocalCoreFile(bool on); diff --git a/src/plugins/debugger/shared/cdbsymbolpathlisteditor.cpp b/src/plugins/debugger/shared/cdbsymbolpathlisteditor.cpp index ae5e38366c7..2e67bf675ed 100644 --- a/src/plugins/debugger/shared/cdbsymbolpathlisteditor.cpp +++ b/src/plugins/debugger/shared/cdbsymbolpathlisteditor.cpp @@ -42,18 +42,44 @@ #include #include +using namespace Utils; + namespace Debugger { namespace Internal { +// Internal helper dialog prompting for a cache directory using a PathChooser. +// +// Note that QFileDialog does not offer a way of suggesting +// a non-existent folder, which is in turn automatically +// created. This is done here (suggest $TEMP\symbolcache +// regardless of its existence). + +class CacheDirectoryDialog : public QDialog +{ + Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::CaheDirectoryDialog) + +public: + explicit CacheDirectoryDialog(QWidget *parent); + + void setPath(const FilePath &p) { m_chooser->setFilePath(p); } + FilePath path() const { return m_chooser->filePath(); } + + void accept() override; + +private: + PathChooser *m_chooser; + QDialogButtonBox *m_buttonBox; +}; + CacheDirectoryDialog::CacheDirectoryDialog(QWidget *parent) : - QDialog(parent), m_chooser(new Utils::PathChooser), + QDialog(parent), m_chooser(new PathChooser), m_buttonBox(new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel)) { setWindowTitle(tr("Select Local Cache Folder")); setModal(true); auto formLayout = new QFormLayout; - m_chooser->setExpectedKind(Utils::PathChooser::ExistingDirectory); + m_chooser->setExpectedKind(PathChooser::ExistingDirectory); m_chooser->setHistoryCompleter("Debugger.CdbCacheDir.History"); m_chooser->setMinimumWidth(400); formLayout->addRow(tr("Path:"), m_chooser); @@ -68,42 +94,30 @@ CacheDirectoryDialog::CacheDirectoryDialog(QWidget *parent) : connect(m_buttonBox, &QDialogButtonBox::rejected, this, &CacheDirectoryDialog::reject); } -void CacheDirectoryDialog::setPath(const QString &p) -{ - m_chooser->setPath(p); -} - -QString CacheDirectoryDialog::path() const -{ - return m_chooser->filePath().toString(); -} - void CacheDirectoryDialog::accept() { - QString cache = path(); + FilePath cache = path(); // if cache is empty a default is used by the cdb if (cache.isEmpty()) { QDialog::accept(); return; } // Ensure path exists - QFileInfo fi(cache); // Folder exists - all happy. - if (fi.isDir()) { + if (cache.isDir()) { QDialog::accept(); return; } // Does a file of the same name exist? - if (fi.exists()) { + if (cache.exists()) { Core::AsynchronousMessageBox::warning(tr("Already Exists"), - tr("A file named \"%1\" already exists.").arg(cache)); + tr("A file named \"%1\" already exists.").arg(cache.toUserOutput())); return; } // Create - QDir root(QDir::root()); - if (!root.mkpath(cache)) { + if (!cache.ensureWritableDir()) { Core::AsynchronousMessageBox::warning(tr("Cannot Create"), - tr("The folder \"%1\" could not be created.").arg(cache)); + tr("The folder \"%1\" could not be created.").arg(cache.toUserOutput())); return; } QDialog::accept(); @@ -111,12 +125,13 @@ void CacheDirectoryDialog::accept() // ---------------- CdbSymbolPathListEditor -const char *CdbSymbolPathListEditor::symbolServerPrefixC = "srv*"; -const char *CdbSymbolPathListEditor::symbolServerPostfixC = "http://msdl.microsoft.com/download/symbols"; -const char *CdbSymbolPathListEditor::symbolCachePrefixC = "cache*"; +// Pre- and Postfix used to build a symbol server path specification +const char symbolServerPrefixC[] = "srv*"; +const char symbolServerPostfixC[] = "http://msdl.microsoft.com/download/symbols"; +const char symbolCachePrefixC[] = "cache*"; CdbSymbolPathListEditor::CdbSymbolPathListEditor(QWidget *parent) : - Utils::PathListEditor(parent) + PathListEditor(parent) { QPushButton *button = insertButton(lastInsertButtonIndex + 1, tr("Insert Symbol Server..."), this, [this](){ @@ -136,10 +151,10 @@ CdbSymbolPathListEditor::CdbSymbolPathListEditor(QWidget *parent) : button->setToolTip(tr("Configure Symbol paths that are used to locate debug symbol files.")); } -bool CdbSymbolPathListEditor::promptCacheDirectory(QWidget *parent, QString *cacheDirectory) +bool CdbSymbolPathListEditor::promptCacheDirectory(QWidget *parent, FilePath *cacheDirectory) { CacheDirectoryDialog dialog(parent); - dialog.setPath(Utils::TemporaryDirectory::masterDirectoryPath() + "/symbolcache"); + dialog.setPath(FilePath::fromString(TemporaryDirectory::masterDirectoryPath()) + "/symbolcache"); if (dialog.exec() != QDialog::Accepted) return false; *cacheDirectory = dialog.path(); @@ -148,9 +163,9 @@ bool CdbSymbolPathListEditor::promptCacheDirectory(QWidget *parent, QString *cac void CdbSymbolPathListEditor::addSymbolPath(CdbSymbolPathListEditor::SymbolPathMode mode) { - QString cacheDir; + FilePath cacheDir; if (promptCacheDirectory(this, &cacheDir)) - insertPathAtCursor(CdbSymbolPathListEditor::symbolPath(cacheDir, mode)); + insertPathAtCursor(CdbSymbolPathListEditor::symbolPath(cacheDir.path(), mode)); } void CdbSymbolPathListEditor::setupSymbolPaths() @@ -165,7 +180,7 @@ void CdbSymbolPathListEditor::setupSymbolPaths() if (path.isEmpty() && indexOfSymbolCache != -1) path = currentPaths.at(indexOfSymbolCache); if (path.isEmpty()) - path = Utils::TemporaryDirectory::masterDirectoryPath() + "/symbolcache"; + path = TemporaryDirectory::masterDirectoryPath() + "/symbolcache"; bool useSymbolServer = true; bool useSymbolCache = true; diff --git a/src/plugins/debugger/shared/cdbsymbolpathlisteditor.h b/src/plugins/debugger/shared/cdbsymbolpathlisteditor.h index 99098368894..df64b35bfed 100644 --- a/src/plugins/debugger/shared/cdbsymbolpathlisteditor.h +++ b/src/plugins/debugger/shared/cdbsymbolpathlisteditor.h @@ -27,13 +27,7 @@ #include -#include - -namespace Utils { class PathChooser; } - -QT_BEGIN_NAMESPACE -class QDialogButtonBox; -QT_END_NAMESPACE +namespace Utils { class FilePath; } namespace Debugger { namespace Internal { @@ -45,21 +39,6 @@ namespace Internal { // created. This is done here (suggest $TEMP\symbolcache // regardless of its existence). -class CacheDirectoryDialog : public QDialog { - Q_OBJECT -public: - explicit CacheDirectoryDialog(QWidget *parent = nullptr); - - void setPath(const QString &p); - QString path() const; - - void accept() override; - -private: - Utils::PathChooser *m_chooser; - QDialogButtonBox *m_buttonBox; -}; - class CdbSymbolPathListEditor : public Utils::PathListEditor { Q_OBJECT @@ -71,12 +50,7 @@ public: explicit CdbSymbolPathListEditor(QWidget *parent = nullptr); - static bool promptCacheDirectory(QWidget *parent, QString *cacheDirectory); - - // Pre- and Postfix used to build a symbol server path specification - static const char *symbolServerPrefixC; - static const char *symbolServerPostfixC; - static const char *symbolCachePrefixC; + static bool promptCacheDirectory(QWidget *parent, Utils::FilePath *cacheDirectory); // Format a symbol path specification static QString symbolPath(const QString &cacheDir, SymbolPathMode mode); diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index 40efac7f541..cbf27544079 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -1654,10 +1654,12 @@ bool DockerDevicePrivate::runInShell(const CommandLine &cmd) const QMutexLocker l(&m_shellMutex); m_shell->readAllStandardOutput(); // clean possible left-overs m_shell->write(cmd.toUserOutput().toUtf8() + "\necho $?\n"); - m_shell->waitForReadyRead(); + QTC_ASSERT(m_shell->waitForReadyRead(), return false); QByteArray output = m_shell->readAllStandardOutput(); - int result = output.toInt(); + bool ok; + int result = output.toInt(&ok); LOG("Run command in shell:" << cmd.toUserOutput() << "result: " << output << " ==>" << result); + QTC_ASSERT(ok, return false); return result == 0; } diff --git a/src/plugins/projectexplorer/baseprojectwizarddialog.cpp b/src/plugins/projectexplorer/baseprojectwizarddialog.cpp index 789366b9302..969ff39b187 100644 --- a/src/plugins/projectexplorer/baseprojectwizarddialog.cpp +++ b/src/plugins/projectexplorer/baseprojectwizarddialog.cpp @@ -26,7 +26,6 @@ #include "baseprojectwizarddialog.h" #include -#include #include #include @@ -45,28 +44,25 @@ using namespace Utils; namespace ProjectExplorer { -struct BaseProjectWizardDialogPrivate { - explicit BaseProjectWizardDialogPrivate(Utils::ProjectIntroPage *page, int id = -1); +struct BaseProjectWizardDialogPrivate +{ + explicit BaseProjectWizardDialogPrivate(ProjectIntroPage *page, int id = -1) + : desiredIntroPageId(id), introPage(page) + {} const int desiredIntroPageId; - Utils::ProjectIntroPage *introPage; - int introPageId; - Utils::Id selectedPlatform; - QSet requiredFeatureSet; + ProjectIntroPage *introPage; + int introPageId = -1; + Id selectedPlatform; + QSet requiredFeatureSet; }; -BaseProjectWizardDialogPrivate::BaseProjectWizardDialogPrivate(Utils::ProjectIntroPage *page, int id) : - desiredIntroPageId(id), - introPage(page), - introPageId(-1) -{ -} BaseProjectWizardDialog::BaseProjectWizardDialog(const Core::BaseFileWizardFactory *factory, QWidget *parent, const Core::WizardDialogParameters ¶meters) : Core::BaseFileWizard(factory, parameters.extraValues(), parent), - d(std::make_unique(new Utils::ProjectIntroPage)) + d(std::make_unique(new ProjectIntroPage)) { setFilePath(parameters.defaultPath()); setSelectedPlatform(parameters.selectedPlatform()); @@ -130,7 +126,7 @@ void BaseProjectWizardDialog::setProjectList(const QStringList &projectList) d->introPage->setProjectList(projectList); } -void BaseProjectWizardDialog::setProjectDirectories(const QStringList &directories) +void BaseProjectWizardDialog::setProjectDirectories(const FilePaths &directories) { d->introPage->setProjectDirectories(directories); } @@ -156,7 +152,7 @@ bool BaseProjectWizardDialog::validateCurrentPage() return Core::BaseFileWizard::validateCurrentPage(); } -Utils::ProjectIntroPage *BaseProjectWizardDialog::introPage() const +ProjectIntroPage *BaseProjectWizardDialog::introPage() const { return d->introPage; } @@ -180,26 +176,26 @@ QString BaseProjectWizardDialog::uniqueProjectName(const FilePath &path) void BaseProjectWizardDialog::addExtensionPages(const QList &wizardPageList) { - foreach (QWizardPage *p,wizardPageList) + for (QWizardPage *p : wizardPageList) addPage(p); } -Utils::Id BaseProjectWizardDialog::selectedPlatform() const +Id BaseProjectWizardDialog::selectedPlatform() const { return d->selectedPlatform; } -void BaseProjectWizardDialog::setSelectedPlatform(Utils::Id platform) +void BaseProjectWizardDialog::setSelectedPlatform(Id platform) { d->selectedPlatform = platform; } -QSet BaseProjectWizardDialog::requiredFeatures() const +QSet BaseProjectWizardDialog::requiredFeatures() const { return d->requiredFeatureSet; } -void BaseProjectWizardDialog::setRequiredFeatures(const QSet &featureSet) +void BaseProjectWizardDialog::setRequiredFeatures(const QSet &featureSet) { d->requiredFeatureSet = featureSet; } diff --git a/src/plugins/projectexplorer/baseprojectwizarddialog.h b/src/plugins/projectexplorer/baseprojectwizarddialog.h index 995b4c7facf..ef05f744fda 100644 --- a/src/plugins/projectexplorer/baseprojectwizarddialog.h +++ b/src/plugins/projectexplorer/baseprojectwizarddialog.h @@ -30,12 +30,11 @@ #include #include +#include + #include -namespace Utils { -class FilePath; -class ProjectIntroPage; -} // Utils +namespace Utils { class ProjectIntroPage; } namespace ProjectExplorer { @@ -68,7 +67,7 @@ public: void setFilePath(const Utils::FilePath &path); void setProjectName(const QString &name); void setProjectList(const QStringList &projectList); - void setProjectDirectories(const QStringList &directories); + void setProjectDirectories(const Utils::FilePaths &directories); void setForceSubProject(bool force); signals: diff --git a/src/plugins/projectexplorer/devicesupport/idevice.cpp b/src/plugins/projectexplorer/devicesupport/idevice.cpp index 5fae1d38631..8c90a7fc146 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/idevice.cpp @@ -630,7 +630,8 @@ void IDevice::fromMap(const QVariantMap &map) ? QSsh::SshConnectionParameters::AuthenticationTypeAll : static_cast(storedAuthType); - d->sshParameters.privateKeyFile = map.value(QLatin1String(KeyFileKey), defaultPrivateKeyFilePath()).toString(); + d->sshParameters.privateKeyFile = + FilePath::fromVariant(map.value(QLatin1String(KeyFileKey), defaultPrivateKeyFilePath())); d->sshParameters.timeout = map.value(QLatin1String(TimeoutKey), DefaultTimeout).toInt(); d->sshParameters.hostKeyCheckingMode = static_cast (map.value(QLatin1String(HostKeyCheckingKey), QSsh::SshHostKeyCheckingNone).toInt()); @@ -666,7 +667,7 @@ QVariantMap IDevice::toMap() const map.insert(QLatin1String(SshPortKey), d->sshParameters.port()); map.insert(QLatin1String(UserNameKey), d->sshParameters.userName()); map.insert(QLatin1String(AuthKey), d->sshParameters.authenticationType); - map.insert(QLatin1String(KeyFileKey), d->sshParameters.privateKeyFile); + map.insert(QLatin1String(KeyFileKey), d->sshParameters.privateKeyFile.toVariant()); map.insert(QLatin1String(TimeoutKey), d->sshParameters.timeout); map.insert(QLatin1String(HostKeyCheckingKey), d->sshParameters.hostKeyCheckingMode); diff --git a/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp b/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp index 483b930d639..d7584ede0bb 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp @@ -62,6 +62,8 @@ using namespace Utils; +namespace ProjectExplorer { + const char NAME_KEY[] = "name"; const char DISPLAY_NAME_KEY[] = "trDisplayName"; const char TOOLTIP_KEY[] = "trToolTip"; @@ -75,8 +77,7 @@ const char DATA_KEY[] = "data"; const char IS_COMPLETE_KEY[] = "isComplete"; const char IS_COMPLETE_MESSAGE_KEY[] = "trIncompleteMessage"; -namespace { -QVariant consumeValue(QVariantMap &map, const QString &key, const QVariant &defaultValue = QVariant()) +static QVariant consumeValue(QVariantMap &map, const QString &key, const QVariant &defaultValue = {}) { QVariantMap::iterator i = map.find(key); if (i != map.end()) { @@ -87,7 +88,7 @@ QVariant consumeValue(QVariantMap &map, const QString &key, const QVariant &defa return defaultValue; } -void warnAboutUnsupportedKeys(const QVariantMap &map, const QString &name, const QString &type = QString()) +static void warnAboutUnsupportedKeys(const QVariantMap &map, const QString &name, const QString &type = {}) { if (!map.isEmpty()) { @@ -98,9 +99,7 @@ void warnAboutUnsupportedKeys(const QVariantMap &map, const QString &name, const qWarning().noquote() << QString("Field %1 has unsupported keys: %2").arg(typeAndName, map.keys().join(", ")); } } -} // namespace -namespace ProjectExplorer { // -------------------------------------------------------------------- // Helper: @@ -811,8 +810,8 @@ bool PathChooserField::parseData(const QVariant &data, QString *errorMessage) QVariantMap tmp = data.toMap(); - m_path = consumeValue(tmp, "path").toString(); - m_basePath = consumeValue(tmp, "basePath").toString(); + m_path = FilePath::fromVariant(consumeValue(tmp, "path")); + m_basePath = FilePath::fromVariant(consumeValue(tmp, "basePath")); m_historyId = consumeValue(tmp, "historyId").toString(); QString kindStr = consumeValue(tmp, "kind", "existingDirectory").toString(); @@ -851,7 +850,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->filePath().toString() != m_path) + if (w->filePath() != m_path) setHasUserChanges(); }); return w; @@ -887,23 +886,19 @@ void PathChooserField::initializeData(MacroExpander *expander) { auto w = qobject_cast(widget()); QTC_ASSERT(w, return); - w->setBaseDirectory(expander->expand(FilePath::fromString(m_basePath))); + w->setBaseDirectory(expander->expand(m_basePath)); w->setExpectedKind(m_kind); - - if (m_currentPath.isNull()) - w->setPath(expander->expand(m_path)); - else - w->setPath(m_currentPath); + w->setFilePath(expander->expand(m_path)); } void PathChooserField::fromSettings(const QVariant &value) { - m_path = value.toString(); + m_path = FilePath::fromVariant(value); } QVariant PathChooserField::toSettings() const { - return qobject_cast(widget())->filePath().toString(); + return qobject_cast(widget())->filePath().toVariant(); } // -------------------------------------------------------------------- diff --git a/src/plugins/projectexplorer/jsonwizard/jsonfieldpage_p.h b/src/plugins/projectexplorer/jsonwizard/jsonfieldpage_p.h index f64ebd0b36a..251315a510b 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonfieldpage_p.h +++ b/src/plugins/projectexplorer/jsonwizard/jsonfieldpage_p.h @@ -216,21 +216,18 @@ private: { QString result; QTextStream out(&result); - out << "PathChooser{path:" << m_path + out << "PathChooser{path:" << m_path.toString() << "; base:" << m_basePath << "; historyId:" << m_historyId << "; kind:" << (int)Utils::PathChooser::ExistingDirectory - << "; currentPath:" << m_currentPath << "}"; return result; } - QString m_path; - QString m_basePath; + Utils::FilePath m_path; + Utils::FilePath m_basePath; QString m_historyId; Utils::PathChooser::Kind m_kind = Utils::PathChooser::ExistingDirectory; - - QString m_currentPath; }; class CheckBoxField : public JsonFieldPage::Field diff --git a/src/plugins/projectexplorer/kitinformation.cpp b/src/plugins/projectexplorer/kitinformation.cpp index 91a90a65981..cabe83f1941 100644 --- a/src/plugins/projectexplorer/kitinformation.cpp +++ b/src/plugins/projectexplorer/kitinformation.cpp @@ -1070,7 +1070,7 @@ void DeviceKitAspect::addToMacroExpander(Kit *kit, Utils::MacroExpander *expande expander->registerVariable("Device:KeyFile", tr("Private key file"), [kit]() -> QString { const IDevice::ConstPtr device = DeviceKitAspect::device(kit); - return device ? device->sshParameters().privateKeyFile : QString(); + return device ? device->sshParameters().privateKeyFile.toString() : QString(); }); expander->registerVariable("Device:Name", tr("Device name"), [kit]() -> QString { @@ -1297,7 +1297,7 @@ void BuildDeviceKitAspect::addToMacroExpander(Kit *kit, Utils::MacroExpander *ex expander->registerVariable("BuildDevice:KeyFile", tr("Build private key file"), [kit]() -> QString { const IDevice::ConstPtr device = BuildDeviceKitAspect::device(kit); - return device ? device->sshParameters().privateKeyFile : QString(); + return device ? device->sshParameters().privateKeyFile.toString() : QString(); }); expander->registerVariable("BuildDevice:Name", tr("Build device name"), [kit]() -> QString { diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index b5fdda4be47..852b5c27e87 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -3619,10 +3619,10 @@ void ProjectExplorerPluginPrivate::addExistingProjects() if (subProjectFilePaths.empty()) return; FilePaths failedProjects; - QStringList addedProjects; + FilePaths addedProjects; for (const FilePath &filePath : qAsConst(subProjectFilePaths)) { if (projectNode->addSubProject(filePath)) - addedProjects << filePath.toString(); + addedProjects << filePath; else failedProjects << filePath; } @@ -3633,7 +3633,7 @@ void ProjectExplorerPluginPrivate::addExistingProjects() message + "\n " + FilePath::formatFilePaths(failedProjects, "\n ")); return; } - VcsManager::promptToAdd(dir.toString(), addedProjects); + VcsManager::promptToAdd(dir, addedProjects); } void ProjectExplorerPluginPrivate::handleAddExistingFiles() @@ -3685,7 +3685,7 @@ void ProjectExplorerPlugin::addExistingFiles(FolderNode *folderNode, const FileP [¬Added](const FilePath &f) { return !notAdded.contains(f); }); } - VcsManager::promptToAdd(dir.toString(), Utils::transform(fileNames, &FilePath::toString)); + VcsManager::promptToAdd(dir, fileNames); } void ProjectExplorerPluginPrivate::removeProject() @@ -4209,6 +4209,10 @@ AllProjectFilesFilter::AllProjectFilesFilter() setDefaultIncludedByDefault(false); // but not included in default setFilters({}); setIsCustomFilter(false); + setDescription(ProjectExplorerPluginPrivate::tr( + "Matches all files from all project directories. Append \"+\" or " + "\":\" to jump to the given line number. Append another " + "\"+\" or \":\" to jump to the column number as well.")); } const char kDirectoriesKey[] = "directories"; diff --git a/src/plugins/qmldesigner/designercore/include/abstractproperty.h b/src/plugins/qmldesigner/designercore/include/abstractproperty.h index 7f6671be5ea..cb717664454 100644 --- a/src/plugins/qmldesigner/designercore/include/abstractproperty.h +++ b/src/plugins/qmldesigner/designercore/include/abstractproperty.h @@ -66,7 +66,6 @@ class QMLDESIGNERCORE_EXPORT AbstractProperty friend QMLDESIGNERCORE_EXPORT bool operator ==(const AbstractProperty &property1, const AbstractProperty &property2); friend QMLDESIGNERCORE_EXPORT bool operator !=(const AbstractProperty &property1, const AbstractProperty &property2); - friend QMLDESIGNERCORE_EXPORT uint qHash(const AbstractProperty& property); public: AbstractProperty(); @@ -103,6 +102,11 @@ public: Model *model() const; AbstractView *view() const; + friend auto qHash(const AbstractProperty &property) + { + return ::qHash(property.m_internalNode.data()) ^ ::qHash(property.m_propertyName); + } + protected: AbstractProperty(const PropertyName &propertyName, const Internal::InternalNodePointer &internalNode, Model* model, AbstractView *view); AbstractProperty(const Internal::InternalPropertyPointer &property, Model* model, AbstractView *view); @@ -118,7 +122,6 @@ private: QMLDESIGNERCORE_EXPORT bool operator ==(const AbstractProperty &property1, const AbstractProperty &property2); QMLDESIGNERCORE_EXPORT bool operator !=(const AbstractProperty &property1, const AbstractProperty &property2); -QMLDESIGNERCORE_EXPORT uint qHash(const AbstractProperty& property); QMLDESIGNERCORE_EXPORT QTextStream& operator<<(QTextStream &stream, const AbstractProperty &property); QMLDESIGNERCORE_EXPORT QDebug operator<<(QDebug debug, const AbstractProperty &AbstractProperty); } diff --git a/src/plugins/qmldesigner/designercore/include/modelnode.h b/src/plugins/qmldesigner/designercore/include/modelnode.h index 7fba10d3cd9..a34762ff50a 100644 --- a/src/plugins/qmldesigner/designercore/include/modelnode.h +++ b/src/plugins/qmldesigner/designercore/include/modelnode.h @@ -71,7 +71,6 @@ class QMLDESIGNERCORE_EXPORT ModelNode { friend QMLDESIGNERCORE_EXPORT bool operator ==(const ModelNode &firstNode, const ModelNode &secondNode); friend QMLDESIGNERCORE_EXPORT bool operator !=(const ModelNode &firstNode, const ModelNode &secondNode); - friend QMLDESIGNERCORE_EXPORT uint qHash(const ModelNode & node); friend QMLDESIGNERCORE_EXPORT QDebug operator<<(QDebug debug, const ModelNode &modelNode); friend QMLDESIGNERCORE_EXPORT bool operator <(const ModelNode &firstNode, const ModelNode &secondNode); friend QMLDESIGNERCORE_EXPORT QList toInternalNodeList(const QList &nodeList); @@ -248,6 +247,8 @@ public: swap(first.m_view, second.m_view); } + friend auto qHash(const ModelNode &node) { return ::qHash(node.m_internalNode.data()); } + private: // functions Internal::InternalNodePointer internalNode() const; @@ -261,7 +262,6 @@ private: // variables QMLDESIGNERCORE_EXPORT bool operator ==(const ModelNode &firstNode, const ModelNode &secondNode); QMLDESIGNERCORE_EXPORT bool operator !=(const ModelNode &firstNode, const ModelNode &secondNode); -QMLDESIGNERCORE_EXPORT uint qHash(const ModelNode & node); QMLDESIGNERCORE_EXPORT bool operator <(const ModelNode &firstNode, const ModelNode &secondNode); QMLDESIGNERCORE_EXPORT QDebug operator<<(QDebug debug, const ModelNode &modelNode); QMLDESIGNERCORE_EXPORT QTextStream& operator<<(QTextStream &stream, const ModelNode &modelNode); diff --git a/src/plugins/qmldesigner/designercore/include/nodeabstractproperty.h b/src/plugins/qmldesigner/designercore/include/nodeabstractproperty.h index 8c2f67e6ad4..fcca9edd730 100644 --- a/src/plugins/qmldesigner/designercore/include/nodeabstractproperty.h +++ b/src/plugins/qmldesigner/designercore/include/nodeabstractproperty.h @@ -42,7 +42,6 @@ class QMLDESIGNERCORE_EXPORT NodeAbstractProperty : public AbstractProperty friend QMLDESIGNERCORE_EXPORT bool operator ==(const NodeAbstractProperty &property1, const NodeAbstractProperty &property2); friend QMLDESIGNERCORE_EXPORT bool operator !=(const NodeAbstractProperty &property1, const NodeAbstractProperty &property2); - friend QMLDESIGNERCORE_EXPORT uint qHash(const NodeAbstractProperty& property); public: NodeAbstractProperty(); @@ -56,6 +55,8 @@ public: QList allSubNodes(); QList directSubNodes() const; + friend auto qHash(const NodeAbstractProperty &property) { qHash(AbstractProperty(property)); } + protected: NodeAbstractProperty(const PropertyName &propertyName, const Internal::InternalNodePointer &internalNode, Model *model, AbstractView *view); NodeAbstractProperty(const Internal::InternalNodeAbstractPropertyPointer &property, Model *model, AbstractView *view); @@ -65,7 +66,6 @@ protected: QMLDESIGNERCORE_EXPORT bool operator ==(const NodeAbstractProperty &property1, const NodeAbstractProperty &property2); QMLDESIGNERCORE_EXPORT bool operator !=(const NodeAbstractProperty &property1, const NodeAbstractProperty &property2); -QMLDESIGNERCORE_EXPORT uint qHash(const NodeAbstractProperty& property); QMLDESIGNERCORE_EXPORT QTextStream& operator<<(QTextStream &stream, const NodeAbstractProperty &property); QMLDESIGNERCORE_EXPORT QDebug operator<<(QDebug debug, const NodeAbstractProperty &property); diff --git a/src/plugins/qmldesigner/designercore/include/qml3dnode.h b/src/plugins/qmldesigner/designercore/include/qml3dnode.h index e2e76889790..d52cacb49b5 100644 --- a/src/plugins/qmldesigner/designercore/include/qml3dnode.h +++ b/src/plugins/qmldesigner/designercore/include/qml3dnode.h @@ -55,12 +55,12 @@ public: void setBindingProperty(const PropertyName &name, const QString &expression) override; bool isBlocked(const PropertyName &propName) const override; + friend auto qHash(const Qml3DNode &node) { return qHash(node.modelNode()); } + private: void handleEulerRotationSet(); }; -QMLDESIGNERCORE_EXPORT uint qHash(const Qml3DNode &node); - QMLDESIGNERCORE_EXPORT QList toModelNodeList(const QList &fxItemNodeList); QMLDESIGNERCORE_EXPORT QList toQml3DNodeList(const QList &modelNodeList); diff --git a/src/plugins/qmldesigner/designercore/include/qmlitemnode.h b/src/plugins/qmldesigner/designercore/include/qmlitemnode.h index 38b5f24c773..579a4ca7b85 100644 --- a/src/plugins/qmldesigner/designercore/include/qmlitemnode.h +++ b/src/plugins/qmldesigner/designercore/include/qmlitemnode.h @@ -147,6 +147,8 @@ public: bool isFlowItem() const; bool isFlowActionArea() const; ModelNode rootModelNode() const; + + friend auto qHash(const QmlItemNode &node) { return qHash(node.modelNode()); } }; class QmlFlowItemNode; @@ -218,8 +220,6 @@ protected: }; -QMLDESIGNERCORE_EXPORT uint qHash(const QmlItemNode &node); - QMLDESIGNERCORE_EXPORT QList toModelNodeList(const QList &fxItemNodeList); QMLDESIGNERCORE_EXPORT QList toQmlItemNodeList(const QList &modelNodeList); QMLDESIGNERCORE_EXPORT QList toQmlItemNodeListKeppInvalid(const QList &modelNodeList); diff --git a/src/plugins/qmldesigner/designercore/include/qmlmodelnodefacade.h b/src/plugins/qmldesigner/designercore/include/qmlmodelnodefacade.h index db2c36381ba..2a883cf7772 100644 --- a/src/plugins/qmldesigner/designercore/include/qmlmodelnodefacade.h +++ b/src/plugins/qmldesigner/designercore/include/qmlmodelnodefacade.h @@ -37,8 +37,7 @@ class QMLDESIGNERCORE_EXPORT QmlModelNodeFacade { public: operator ModelNode() const; - ModelNode modelNode(); - const ModelNode modelNode() const; + ModelNode modelNode() const { return m_modelNode; } bool hasModelNode() const; static bool isValidQmlModelNodeFacade(const ModelNode &modelNode); virtual bool isValid() const; diff --git a/src/plugins/qmldesigner/designercore/include/qmlobjectnode.h b/src/plugins/qmldesigner/designercore/include/qmlobjectnode.h index 43f975e5cf5..59f99bbe398 100644 --- a/src/plugins/qmldesigner/designercore/include/qmlobjectnode.h +++ b/src/plugins/qmldesigner/designercore/include/qmlobjectnode.h @@ -127,6 +127,8 @@ public: virtual bool isBlocked(const PropertyName &propName) const; + friend auto qHash(const QmlObjectNode &node) { return qHash(node.modelNode()); } + protected: NodeInstance nodeInstance() const; QmlObjectNode nodeForInstance(const NodeInstance &instance) const; @@ -136,7 +138,6 @@ protected: QList allDefinedStates() const; }; -QMLDESIGNERCORE_EXPORT uint qHash(const QmlObjectNode &node); QMLDESIGNERCORE_EXPORT QList toModelNodeList(const QList &fxObjectNodeList); QMLDESIGNERCORE_EXPORT QList toQmlObjectNodeList(const QList &modelNodeList); }// QmlDesigner diff --git a/src/plugins/qmldesigner/designercore/include/qmlvisualnode.h b/src/plugins/qmldesigner/designercore/include/qmlvisualnode.h index aae262686ae..114fef0d63c 100644 --- a/src/plugins/qmldesigner/designercore/include/qmlvisualnode.h +++ b/src/plugins/qmldesigner/designercore/include/qmlvisualnode.h @@ -118,8 +118,6 @@ private: void setDoubleProperty(const PropertyName &name, double value); }; -QMLDESIGNERCORE_EXPORT uint qHash(const QmlItemNode &node); - class QMLDESIGNERCORE_EXPORT QmlModelStateGroup { friend class QmlVisualNode; diff --git a/src/plugins/qmldesigner/designercore/model/abstractproperty.cpp b/src/plugins/qmldesigner/designercore/model/abstractproperty.cpp index 94943349210..4b2ff2f39cc 100644 --- a/src/plugins/qmldesigner/designercore/model/abstractproperty.cpp +++ b/src/plugins/qmldesigner/designercore/model/abstractproperty.cpp @@ -357,13 +357,6 @@ bool operator !=(const AbstractProperty &property1, const AbstractProperty &prop return !(property1 == property2); } -uint qHash(const AbstractProperty &property) -{ - //### to do - return ::qHash(property.m_internalNode.data()) - ^ ::qHash(property.m_propertyName); -} - QDebug operator<<(QDebug debug, const AbstractProperty &property) { return debug.nospace() << "AbstractProperty(" << (property.isValid() ? property.name() : PropertyName("invalid")) << ')'; diff --git a/src/plugins/qmldesigner/designercore/model/modelnode.cpp b/src/plugins/qmldesigner/designercore/model/modelnode.cpp index 924172b5b1a..7e4f2b4b2a7 100644 --- a/src/plugins/qmldesigner/designercore/model/modelnode.cpp +++ b/src/plugins/qmldesigner/designercore/model/modelnode.cpp @@ -768,12 +768,6 @@ Internal::InternalNodePointer ModelNode::internalNode() const return m_internalNode; } - -uint qHash(const ModelNode &node) -{ - return ::qHash(node.internalId()); -} - /*! \brief returns the model of the node \return returns the model of the node diff --git a/src/plugins/qmldesigner/designercore/model/nodeabstractproperty.cpp b/src/plugins/qmldesigner/designercore/model/nodeabstractproperty.cpp index 41e7123823e..b34c6fefc05 100644 --- a/src/plugins/qmldesigner/designercore/model/nodeabstractproperty.cpp +++ b/src/plugins/qmldesigner/designercore/model/nodeabstractproperty.cpp @@ -183,11 +183,6 @@ bool operator !=(const NodeAbstractProperty &property1, const NodeAbstractProper return !(property1 == property2); } -uint qHash(const NodeAbstractProperty &property) -{ - return qHash(AbstractProperty(property)); -} - QDebug operator<<(QDebug debug, const NodeAbstractProperty &property) { return debug.nospace() << "NodeAbstractProperty(" << (property.isValid() ? property.name() : PropertyName("invalid")) << ')'; diff --git a/src/plugins/qmldesigner/designercore/model/qmlitemnode.cpp b/src/plugins/qmldesigner/designercore/model/qmlitemnode.cpp index 7dc831caf19..03ae0ecd1dc 100644 --- a/src/plugins/qmldesigner/designercore/model/qmlitemnode.cpp +++ b/src/plugins/qmldesigner/designercore/model/qmlitemnode.cpp @@ -480,11 +480,6 @@ QPixmap QmlItemNode::instanceBlurredRenderPixmap() const return nodeInstance().blurredRenderPixmap(); } -uint qHash(const QmlItemNode &node) -{ - return qHash(node.modelNode()); -} - QList toModelNodeList(const QList &qmlItemNodeList) { QList modelNodeList; diff --git a/src/plugins/qmldesigner/designercore/model/qmlmodelnodefacade.cpp b/src/plugins/qmldesigner/designercore/model/qmlmodelnodefacade.cpp index 5c02c946768..5094f0b2bd2 100644 --- a/src/plugins/qmldesigner/designercore/model/qmlmodelnodefacade.cpp +++ b/src/plugins/qmldesigner/designercore/model/qmlmodelnodefacade.cpp @@ -60,16 +60,6 @@ QmlModelNodeFacade::operator ModelNode() const return m_modelNode; } -ModelNode QmlModelNodeFacade::modelNode() -{ - return m_modelNode; -} - -const ModelNode QmlModelNodeFacade::modelNode() const -{ - return m_modelNode; -} - bool QmlModelNodeFacade::hasModelNode() const { return m_modelNode.isValid(); diff --git a/src/plugins/qmldesigner/designercore/model/qmlobjectnode.cpp b/src/plugins/qmldesigner/designercore/model/qmlobjectnode.cpp index 7975fb6d2ef..556a7624ba9 100644 --- a/src/plugins/qmldesigner/designercore/model/qmlobjectnode.cpp +++ b/src/plugins/qmldesigner/designercore/model/qmlobjectnode.cpp @@ -737,11 +737,6 @@ QmlVisualNode QmlObjectNode::toQmlVisualNode() const return QmlVisualNode(modelNode()); } -uint qHash(const QmlObjectNode &node) -{ - return qHash(node.modelNode()); -} - QString QmlObjectNode::simplifiedTypeName() const { return modelNode().simplifiedTypeName(); diff --git a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.cpp b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.cpp index 9db81d1270c..7187799790f 100644 --- a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.cpp +++ b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.cpp @@ -123,7 +123,7 @@ void GenericLinuxDeviceConfigurationWidget::userNameEditingFinished() void GenericLinuxDeviceConfigurationWidget::keyFileEditingFinished() { SshConnectionParameters sshParams = device()->sshParameters(); - sshParams.privateKeyFile = m_ui->keyFileLineEdit->filePath().toString(); + sshParams.privateKeyFile = m_ui->keyFileLineEdit->filePath(); device()->setSshParameters(sshParams); } @@ -138,9 +138,9 @@ void GenericLinuxDeviceConfigurationWidget::handleFreePortsChanged() updatePortsWarningLabel(); } -void GenericLinuxDeviceConfigurationWidget::setPrivateKey(const QString &path) +void GenericLinuxDeviceConfigurationWidget::setPrivateKey(const FilePath &path) { - m_ui->keyFileLineEdit->setPath(path); + m_ui->keyFileLineEdit->setFilePath(path); keyFileEditingFinished(); } @@ -211,7 +211,7 @@ void GenericLinuxDeviceConfigurationWidget::initGui() m_ui->portsLineEdit->setText(device()->freePorts().toString()); m_ui->timeoutSpinBox->setValue(sshParams.timeout); m_ui->userLineEdit->setText(sshParams.userName()); - m_ui->keyFileLineEdit->setPath(sshParams.privateKeyFile); + m_ui->keyFileLineEdit->setFilePath(sshParams.privateKeyFile); m_ui->gdbServerLineEdit->setText(device()->debugServerPath().toString()); updatePortsWarningLabel(); } diff --git a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.h b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.h index bc4383e6c9c..20c8b2aecbf 100644 --- a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.h +++ b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.h @@ -52,7 +52,7 @@ private: void keyFileEditingFinished(); void gdbServerEditingFinished(); void handleFreePortsChanged(); - void setPrivateKey(const QString &path); + void setPrivateKey(const Utils::FilePath &path); void createNewKey(); void hostKeyCheckingChanged(bool doCheck); diff --git a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.cpp b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.cpp index 9165ee56c8f..e069892ca0d 100644 --- a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.cpp +++ b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.cpp @@ -33,7 +33,6 @@ #include #include -#include #include #include #include @@ -149,10 +148,10 @@ QString GenericLinuxDeviceConfigurationWizardFinalPage::infoText() const struct GenericLinuxDeviceConfigurationWizardKeyDeploymentPage::Private { - QStringList defaultKeys() const + FilePaths defaultKeys() const { - const QString baseDir = QDir::homePath() + "/.ssh"; - return QStringList{baseDir + "/id_rsa", baseDir + "/id_ecdsa", baseDir + "/id_ed25519"}; + const FilePath baseDir = FileUtils::homePath() / ".ssh"; + return {baseDir / "id_rsa", baseDir / "id_ecdsa", baseDir / "id_ed25519"}; } PathChooser keyFileChooser; @@ -200,9 +199,9 @@ GenericLinuxDeviceConfigurationWizardKeyDeploymentPage::GenericLinuxDeviceConfig d->iconLabel.clear(); emit completeChanged(); }); - for (const QString &defaultKey : d->defaultKeys()) { - if (QFileInfo::exists(defaultKey)) { - d->keyFileChooser.setPath(defaultKey); + for (const FilePath &defaultKey : d->defaultKeys()) { + if (defaultKey.exists()) { + d->keyFileChooser.setFilePath(defaultKey); break; } } @@ -221,7 +220,7 @@ void GenericLinuxDeviceConfigurationWizardKeyDeploymentPage::setDevice(const Lin void GenericLinuxDeviceConfigurationWizardKeyDeploymentPage::initializePage() { if (!d->device->sshParameters().privateKeyFile.isEmpty()) - d->keyFileChooser.setPath(privateKeyFilePath()); + d->keyFileChooser.setFilePath(privateKeyFilePath()); d->iconLabel.clear(); } @@ -232,25 +231,25 @@ bool GenericLinuxDeviceConfigurationWizardKeyDeploymentPage::isComplete() const bool GenericLinuxDeviceConfigurationWizardKeyDeploymentPage::validatePage() { - if (!d->defaultKeys().contains(d->keyFileChooser.filePath().toString())) { + if (!d->defaultKeys().contains(d->keyFileChooser.filePath())) { SshConnectionParameters sshParams = d->device->sshParameters(); sshParams.authenticationType = SshConnectionParameters::AuthenticationTypeSpecificKey; - sshParams.privateKeyFile = d->keyFileChooser.filePath().toString(); + sshParams.privateKeyFile = d->keyFileChooser.filePath(); d->device->setSshParameters(sshParams); } return true; } -QString GenericLinuxDeviceConfigurationWizardKeyDeploymentPage::privateKeyFilePath() const +FilePath GenericLinuxDeviceConfigurationWizardKeyDeploymentPage::privateKeyFilePath() const { - return d->keyFileChooser.filePath().toString(); + return d->keyFileChooser.filePath(); } void GenericLinuxDeviceConfigurationWizardKeyDeploymentPage::createKey() { SshKeyCreationDialog dlg(this); if (dlg.exec() == QDialog::Accepted) - d->keyFileChooser.setPath(dlg.privateKeyFilePath()); + d->keyFileChooser.setFilePath(dlg.privateKeyFilePath()); } void GenericLinuxDeviceConfigurationWizardKeyDeploymentPage::deployKey() diff --git a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.h b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.h index 7905a7de643..2b8c6f641f5 100644 --- a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.h +++ b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.h @@ -75,7 +75,7 @@ private: bool isComplete() const override; bool validatePage() override; - QString privateKeyFilePath() const; + Utils::FilePath privateKeyFilePath() const; void createKey(); void deployKey(); diff --git a/src/plugins/remotelinux/publickeydeploymentdialog.cpp b/src/plugins/remotelinux/publickeydeploymentdialog.cpp index 76e0add6db2..fd43803a262 100644 --- a/src/plugins/remotelinux/publickeydeploymentdialog.cpp +++ b/src/plugins/remotelinux/publickeydeploymentdialog.cpp @@ -49,17 +49,17 @@ using namespace Internal; PublicKeyDeploymentDialog *PublicKeyDeploymentDialog::createDialog( const IDevice::ConstPtr &deviceConfig, QWidget *parent) { - const FilePath dir = FilePath::fromString(deviceConfig->sshParameters().privateKeyFile).parentDir(); + const FilePath dir = deviceConfig->sshParameters().privateKeyFile.parentDir(); const FilePath publicKeyFileName = FileUtils::getOpenFilePath(nullptr, tr("Choose Public Key File"), dir, tr("Public Key Files (*.pub);;All Files (*)")); if (publicKeyFileName.isEmpty()) return nullptr; - return new PublicKeyDeploymentDialog(deviceConfig, publicKeyFileName.toString(), parent); + return new PublicKeyDeploymentDialog(deviceConfig, publicKeyFileName, parent); } PublicKeyDeploymentDialog::PublicKeyDeploymentDialog(const IDevice::ConstPtr &deviceConfig, - const QString &publicKeyFileName, QWidget *parent) + const FilePath &publicKeyFileName, QWidget *parent) : QProgressDialog(parent), d(new PublicKeyDeploymentDialogPrivate) { setAutoReset(false); diff --git a/src/plugins/remotelinux/publickeydeploymentdialog.h b/src/plugins/remotelinux/publickeydeploymentdialog.h index 442678a8b56..e2792cc376f 100644 --- a/src/plugins/remotelinux/publickeydeploymentdialog.h +++ b/src/plugins/remotelinux/publickeydeploymentdialog.h @@ -43,7 +43,7 @@ public: QWidget *parent = nullptr); PublicKeyDeploymentDialog(const ProjectExplorer::IDevice::ConstPtr &deviceConfig, - const QString &publicKeyFileName, QWidget *parent = nullptr); + const Utils::FilePath &publicKeyFileName, QWidget *parent = nullptr); ~PublicKeyDeploymentDialog() override; diff --git a/src/plugins/remotelinux/sshkeydeployer.cpp b/src/plugins/remotelinux/sshkeydeployer.cpp index cb55102a1ea..9d5435ed4bf 100644 --- a/src/plugins/remotelinux/sshkeydeployer.cpp +++ b/src/plugins/remotelinux/sshkeydeployer.cpp @@ -26,9 +26,10 @@ #include "sshkeydeployer.h" #include -#include +#include using namespace QSsh; +using namespace Utils; namespace RemoteLinux { namespace Internal { @@ -53,12 +54,12 @@ SshKeyDeployer::~SshKeyDeployer() } void SshKeyDeployer::deployPublicKey(const SshConnectionParameters &sshParams, - const QString &keyFilePath) + const FilePath &keyFilePath) { cleanup(); - Utils::FileReader reader; - if (!reader.fetch(Utils::FilePath::fromString(keyFilePath))) { + FileReader reader; + if (!reader.fetch(keyFilePath)) { emit error(tr("Public key error: %1").arg(reader.errorString())); return; } diff --git a/src/plugins/remotelinux/sshkeydeployer.h b/src/plugins/remotelinux/sshkeydeployer.h index 664543cb3c3..984f7a664f5 100644 --- a/src/plugins/remotelinux/sshkeydeployer.h +++ b/src/plugins/remotelinux/sshkeydeployer.h @@ -30,6 +30,7 @@ #include namespace QSsh { class SshConnectionParameters; } +namespace Utils { class FilePath; } namespace RemoteLinux { namespace Internal { class SshKeyDeployerPrivate; } @@ -43,7 +44,7 @@ public: ~SshKeyDeployer() override; void deployPublicKey(const QSsh::SshConnectionParameters &sshParams, - const QString &keyFilePath); + const Utils::FilePath &keyFilePath); void stopDeployment(); signals: diff --git a/src/plugins/resourceeditor/qrceditor/resourcefile.cpp b/src/plugins/resourceeditor/qrceditor/resourcefile.cpp index f4ab60b6f43..b89ddffb88a 100644 --- a/src/plugins/resourceeditor/qrceditor/resourcefile.cpp +++ b/src/plugins/resourceeditor/qrceditor/resourcefile.cpp @@ -30,7 +30,9 @@ #include #include #include -#include + +#include +#include #include #include @@ -995,7 +997,8 @@ void ResourceModel::addFiles(int prefixIndex, const QStringList &fileNames, int firstFile = cnt; lastFile = cnt + unique_list.count() - 1; - Core::VcsManager::promptToAdd(m_resource_file.filePath().absolutePath().toString(), fileNames); + Core::VcsManager::promptToAdd(m_resource_file.filePath().absolutePath(), + Utils::transform(fileNames, &FilePath::fromString)); } diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 74af4402ea3..d7643af772c 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -5173,7 +5173,7 @@ void TextEditorWidget::mousePressEvent(QMouseEvent *e) if (e->button() == Qt::LeftButton) { MultiTextCursor multiCursor = multiTextCursor(); const QTextCursor &cursor = cursorForPosition(e->pos()); - if (e->modifiers() & Qt::AltModifier) { + if (e->modifiers() & Qt::AltModifier && !(e->modifiers() & Qt::ControlModifier)) { if (e->modifiers() & Qt::ShiftModifier) { QTextCursor c = multiCursor.mainCursor(); c.setPosition(cursor.position(), QTextCursor::KeepAnchor); diff --git a/tests/auto/ssh/tst_ssh.cpp b/tests/auto/ssh/tst_ssh.cpp index 0990f5727f7..a6039f05c17 100644 --- a/tests/auto/ssh/tst_ssh.cpp +++ b/tests/auto/ssh/tst_ssh.cpp @@ -94,7 +94,7 @@ static SshConnectionParameters getParameters() params.setPort(getPortFromEnvironment()); params.setUserName(getUserFromEnvironment()); params.timeout = 10; - params.privateKeyFile = getKeyFileFromEnvironment(); + params.privateKeyFile = Utils::FilePath::fromUserInput(getKeyFileFromEnvironment()); params.authenticationType = !params.privateKeyFile.isEmpty() ? SshConnectionParameters::AuthenticationTypeSpecificKey : SshConnectionParameters::AuthenticationTypeAll; @@ -179,7 +179,7 @@ void tst_Ssh::errorHandling() params.setUserName(user); params.timeout = 3; params.authenticationType = authType; - params.privateKeyFile = keyFile; + params.privateKeyFile = Utils::FilePath::fromString(keyFile); SshConnection connection(params); QEventLoop loop; bool disconnected = false; diff --git a/tests/unit/unittest/CMakeLists.txt b/tests/unit/unittest/CMakeLists.txt index f9f4f73e26e..5699475432c 100644 --- a/tests/unit/unittest/CMakeLists.txt +++ b/tests/unit/unittest/CMakeLists.txt @@ -474,3 +474,18 @@ extend_qtc_test(unittest SOURCES clangformat-test.cpp ) + +get_filename_component( + QMLDOM_STANDALONE_CMAKELISTS + "${CMAKE_CURRENT_SOURCE_DIR}/../../../../qmldom_standalone/src/qmldom/standalone/" + ABSOLUTE +) + +if(EXISTS ${QMLDOM_STANDALONE_CMAKELISTS}) + add_subdirectory(${QMLDOM_STANDALONE_CMAKELISTS} qmldom_standalone) + extend_qtc_test(unittest + DEPENDS qmldomlib + SOURCES + qmldom-test.cpp + ) +endif() diff --git a/tests/unit/unittest/qmldom-test.cpp b/tests/unit/unittest/qmldom-test.cpp new file mode 100644 index 00000000000..b7e8557f10e --- /dev/null +++ b/tests/unit/unittest/qmldom-test.cpp @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +#include "googletest.h" + +// cast of the top level items (DomEnvironments,...) +#include + +// everything is in the QQmlJS::Dom namespace +using namespace QQmlJS::Dom; + +namespace { + +class QmlDom : public ::testing::Test +{ +public: +// static void SetUpTestCase(); +// static void TearDownTestCase(); + +protected: +}; + +TEST_F(QmlDom, First) +{ + DomItem env = DomEnvironment::create({}, DomEnvironment::Option::SingleThreaded + | DomEnvironment::Option::NoDependencies); +} + +} // anonymous