diff --git a/src/libs/utils/categorysortfiltermodel.cpp b/src/libs/utils/categorysortfiltermodel.cpp index 8d3b1899ffb..f3b5e8e6e02 100644 --- a/src/libs/utils/categorysortfiltermodel.cpp +++ b/src/libs/utils/categorysortfiltermodel.cpp @@ -12,6 +12,12 @@ CategorySortFilterModel::CategorySortFilterModel(QObject *parent) { } +void CategorySortFilterModel::setNewItemRole(int role) +{ + m_newItemRole = role; + invalidate(); +} + bool CategorySortFilterModel::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const { @@ -21,6 +27,12 @@ bool CategorySortFilterModel::filterAcceptsRow(int source_row, const QModelIndex &categoryIndex = sourceModel()->index(source_row, 0, source_parent); if (regexp.match(sourceModel()->data(categoryIndex, filterRole()).toString()).hasMatch()) return true; + + if (m_newItemRole != -1 && categoryIndex.isValid()) { + if (categoryIndex.data(m_newItemRole).toBool()) + return true; + } + const int rowCount = sourceModel()->rowCount(categoryIndex); for (int row = 0; row < rowCount; ++row) { if (filterAcceptsRow(row, categoryIndex)) @@ -28,6 +40,14 @@ bool CategorySortFilterModel::filterAcceptsRow(int source_row, } return false; } + + if (m_newItemRole != -1) { + const QModelIndex &idx = sourceModel()->index(source_row, 0, source_parent); + if (idx.data(m_newItemRole).toBool()) + return true; + } + + return QSortFilterProxyModel::filterAcceptsRow(source_row, source_parent); } diff --git a/src/libs/utils/categorysortfiltermodel.h b/src/libs/utils/categorysortfiltermodel.h index 405419dedf3..f9f787b352f 100644 --- a/src/libs/utils/categorysortfiltermodel.h +++ b/src/libs/utils/categorysortfiltermodel.h @@ -14,8 +14,14 @@ class QTCREATOR_UTILS_EXPORT CategorySortFilterModel : public QSortFilterProxyMo public: CategorySortFilterModel(QObject *parent = nullptr); + // "New" items will always be accepted, regardless of the filter. + void setNewItemRole(int role); + protected: bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override; + +private: + int m_newItemRole = -1; }; } // Utils diff --git a/src/libs/utils/detailsbutton.cpp b/src/libs/utils/detailsbutton.cpp index d5ab48238f8..32182d8ecf4 100644 --- a/src/libs/utils/detailsbutton.cpp +++ b/src/libs/utils/detailsbutton.cpp @@ -5,6 +5,7 @@ #include #include +#include #include #include @@ -81,6 +82,14 @@ QSize DetailsButton::sizeHint() const spacing + fontMetrics().height() + spacing); } +QColor DetailsButton::outlineColor() +{ + return HostOsInfo::isMacHost() + ? QGuiApplication::palette().color(QPalette::Mid) + : StyleHelper::mergedColors(creatorTheme()->color(Theme::TextColorNormal), + creatorTheme()->color(Theme::BackgroundColorNormal), 15); +} + void DetailsButton::paintEvent(QPaintEvent *e) { Q_UNUSED(e) @@ -93,11 +102,8 @@ void DetailsButton::paintEvent(QPaintEvent *e) p.restore(); } - if (!creatorTheme()->flag(Theme::FlatProjectsMode)) { - const QColor outlineColor = palette().color(HostOsInfo::isMacHost() ? QPalette::Mid - : QPalette::Midlight); - qDrawPlainRect(&p, rect(), outlineColor); - } + if (!creatorTheme()->flag(Theme::FlatProjectsMode)) + qDrawPlainRect(&p, rect(), outlineColor()); const QRect textRect(spacing + 3, 0, width(), height()); p.drawText(textRect, Qt::AlignLeft | Qt::AlignVCenter, text()); diff --git a/src/libs/utils/detailsbutton.h b/src/libs/utils/detailsbutton.h index 8895418f805..844c9e13c20 100644 --- a/src/libs/utils/detailsbutton.h +++ b/src/libs/utils/detailsbutton.h @@ -49,6 +49,7 @@ class QTCREATOR_UTILS_EXPORT DetailsButton : public ExpandButton public: DetailsButton(QWidget *parent = nullptr); QSize sizeHint() const override; + static QColor outlineColor(); private: void paintEvent(QPaintEvent *e) override; diff --git a/src/libs/utils/detailswidget.cpp b/src/libs/utils/detailswidget.cpp index e1ad8c19489..6b60bac0d87 100644 --- a/src/libs/utils/detailswidget.cpp +++ b/src/libs/utils/detailswidget.cpp @@ -227,11 +227,8 @@ void DetailsWidget::paintEvent(QPaintEvent *paintEvent) : palette().color(QPalette::Window); p.fillRect(rect(), bgColor); } - if (!creatorTheme()->flag(Theme::FlatProjectsMode)) { - const QColor outlineColor = palette().color(HostOsInfo::isMacHost() ? QPalette::Mid - : QPalette::Midlight); - qDrawPlainRect(&p, rect(), outlineColor); - } + if (!creatorTheme()->flag(Theme::FlatProjectsMode)) + qDrawPlainRect(&p, rect(), DetailsButton::outlineColor()); } void DetailsWidget::enterEvent(QEnterEvent *event) diff --git a/src/libs/utils/filepath.cpp b/src/libs/utils/filepath.cpp index d8123608cd8..d52bcdf9d42 100644 --- a/src/libs/utils/filepath.cpp +++ b/src/libs/utils/filepath.cpp @@ -966,7 +966,7 @@ FilePath FilePath::relativeChildPath(const FilePath &parent) const return res; } -/// \returns the relativePath of FilePath to given \a anchor. +/// \returns the relativePath of FilePath from a given \a anchor. /// Both, FilePath and anchor may be files or directories. /// Example usage: /// @@ -978,7 +978,7 @@ FilePath FilePath::relativeChildPath(const FilePath &parent) const /// /// The debug output will be "../b/ar/file.txt". /// -FilePath FilePath::relativePath(const FilePath &anchor) const +FilePath FilePath::relativePathFrom(const FilePath &anchor) const { QTC_ASSERT(isSameDevice(anchor), return *this); diff --git a/src/libs/utils/filepath.h b/src/libs/utils/filepath.h index 9bb65be2935..f7ba8631bcb 100644 --- a/src/libs/utils/filepath.h +++ b/src/libs/utils/filepath.h @@ -153,7 +153,7 @@ public: [[nodiscard]] FilePath resolveSymlinks() const; [[nodiscard]] FilePath withExecutableSuffix() const; [[nodiscard]] FilePath relativeChildPath(const FilePath &parent) const; - [[nodiscard]] FilePath relativePath(const FilePath &anchor) const; + [[nodiscard]] FilePath relativePathFrom(const FilePath &anchor) const; [[nodiscard]] FilePath searchInDirectories(const FilePaths &dirs) const; [[nodiscard]] Environment deviceEnvironment() const; [[nodiscard]] FilePath onDevice(const FilePath &deviceTemplate) const; diff --git a/src/libs/utils/qtcprocess.cpp b/src/libs/utils/qtcprocess.cpp index 1ffbccea6f1..285ba25eb42 100644 --- a/src/libs/utils/qtcprocess.cpp +++ b/src/libs/utils/qtcprocess.cpp @@ -634,6 +634,8 @@ public: void setProcessInterface(ProcessInterface *process) { + if (m_process) + m_process->disconnect(); m_process.reset(process); m_process->setParent(this); connect(m_process.get(), &ProcessInterface::started, @@ -805,6 +807,14 @@ GeneralProcessBlockingImpl::GeneralProcessBlockingImpl(QtcProcessPrivate *parent // In order to move the process interface into another thread together with handle parent->m_process.get()->setParent(m_processHandler.get()); m_processHandler->setParent(this); + // So the hierarchy looks like: + // QtcProcessPrivate + // | + // +- GeneralProcessBlockingImpl + // | + // +- ProcessInterfaceHandler + // | + // +- ProcessInterface } bool GeneralProcessBlockingImpl::waitForSignal(ProcessSignalType newSignal, int msecs) @@ -998,6 +1008,8 @@ QtcProcess::~QtcProcess() { QTC_ASSERT(!d->m_guard.isLocked(), qWarning("Deleting QtcProcess instance directly from " "one of its signal handlers will lead to crash!")); + if (d->m_process) + d->m_process->disconnect(); delete d; } diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index 3dc13248b41..c48fdadea6c 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -236,6 +236,7 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildSystem *bs) : m_configTextFilterModel->setSourceModel(m_configFilterModel); m_configTextFilterModel->setSortRole(Qt::DisplayRole); m_configTextFilterModel->setFilterKeyColumn(-1); + m_configTextFilterModel->setNewItemRole(ConfigModel::ItemIsUserNew); connect(m_configTextFilterModel, &QAbstractItemModel::layoutChanged, this, [this]() { QModelIndex selectedIdx = m_configView->currentIndex(); diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index 7c3db2c7403..0cf89fd241a 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -67,7 +67,7 @@ static void copySourcePathsToClipboard(const FilePaths &srcPaths, const ProjectN QClipboard *clip = QGuiApplication::clipboard(); QString data = Utils::transform(srcPaths, [projDir = node->filePath()](const FilePath &path) { - return path.relativePath(projDir).cleanPath().toString(); + return path.relativePathFrom(projDir).cleanPath().toString(); }).join(" "); clip->setText(data); } @@ -301,7 +301,7 @@ FilePaths CMakeBuildSystem::filesGeneratedFrom(const FilePath &sourceFile) const baseDirectory = baseDirectory.parentDir(); } - const FilePath relativePath = baseDirectory.relativePath(project); + const FilePath relativePath = baseDirectory.relativePathFrom(project); FilePath generatedFilePath = buildConfiguration()->buildDirectory().resolvePath(relativePath); if (sourceFile.suffix() == "ui") { diff --git a/src/plugins/cmakeprojectmanager/configmodel.cpp b/src/plugins/cmakeprojectmanager/configmodel.cpp index 084d917ffa8..43fb28d7d06 100644 --- a/src/plugins/cmakeprojectmanager/configmodel.cpp +++ b/src/plugins/cmakeprojectmanager/configmodel.cpp @@ -546,6 +546,9 @@ QVariant ConfigModelTreeItem::data(int column, int role) const if (role == ConfigModel::ItemIsInitialRole) { return dataItem->isInitial ? "1" : "0"; } + if (role == ConfigModel::ItemIsUserNew) { + return dataItem->isUserNew ? "1" : "0"; + } auto fontRole = [this]() -> QFont { QFont font; diff --git a/src/plugins/cmakeprojectmanager/configmodel.h b/src/plugins/cmakeprojectmanager/configmodel.h index 2d235a30aa9..71b4db5a347 100644 --- a/src/plugins/cmakeprojectmanager/configmodel.h +++ b/src/plugins/cmakeprojectmanager/configmodel.h @@ -18,7 +18,8 @@ class ConfigModel : public Utils::TreeModel<> public: enum Roles { ItemIsAdvancedRole = Qt::UserRole, - ItemIsInitialRole + ItemIsInitialRole, + ItemIsUserNew, }; struct DataItem { diff --git a/src/plugins/cmakeprojectmanager/presetsmacros.cpp b/src/plugins/cmakeprojectmanager/presetsmacros.cpp index 2623a0cfed1..37896bfb700 100644 --- a/src/plugins/cmakeprojectmanager/presetsmacros.cpp +++ b/src/plugins/cmakeprojectmanager/presetsmacros.cpp @@ -10,10 +10,8 @@ namespace CMakeProjectManager::Internal::CMakePresets::Macros { -QString getHostSystemName() +static QString getHostSystemName(Utils::OsType osType) { - Utils::OsType osType = Utils::HostOsInfo::hostOs(); - switch (osType) { case Utils::OsTypeWindows: return "Windows"; @@ -29,9 +27,9 @@ QString getHostSystemName() return "Other"; } -void expandAllButEnv(const PresetsDetails::ConfigurePreset &preset, - const Utils::FilePath &sourceDirectory, - QString &value) +static void expandAllButEnv(const PresetsDetails::ConfigurePreset &preset, + const Utils::FilePath &sourceDirectory, + QString &value) { value.replace("${dollar}", "$"); @@ -43,12 +41,12 @@ void expandAllButEnv(const PresetsDetails::ConfigurePreset &preset, if (preset.generator) value.replace("${generator}", preset.generator.value()); - value.replace("${hostSystemName}", getHostSystemName()); + value.replace("${hostSystemName}", getHostSystemName(sourceDirectory.osType())); } -void expandAllButEnv(const PresetsDetails::BuildPreset &preset, - const Utils::FilePath &sourceDirectory, - QString &value) +static void expandAllButEnv(const PresetsDetails::BuildPreset &preset, + const Utils::FilePath &sourceDirectory, + QString &value) { value.replace("${dollar}", "$"); @@ -59,9 +57,9 @@ void expandAllButEnv(const PresetsDetails::BuildPreset &preset, value.replace("${presetName}", preset.name); } -QString expandMacroEnv(const QString ¯oPrefix, - const QString &value, - const std::function &op) +static QString expandMacroEnv(const QString ¯oPrefix, + const QString &value, + const std::function &op) { const QString startToken = QString("$%1{").arg(macroPrefix); const QString endToken = QString("}"); diff --git a/src/plugins/gitlab/gitlabclonedialog.cpp b/src/plugins/gitlab/gitlabclonedialog.cpp index 669a587c14e..7616e53fb47 100644 --- a/src/plugins/gitlab/gitlabclonedialog.cpp +++ b/src/plugins/gitlab/gitlabclonedialog.cpp @@ -221,7 +221,7 @@ void GitLabCloneDialog::cloneFinished(bool success) accept(); } else { const QStringList pFiles = Utils::transform(filesWeMayOpen, [base](const FilePath &f) { - return f.relativePath(base).toUserOutput(); + return f.relativePathFrom(base).toUserOutput(); }); bool ok = false; const QString fileToOpen diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index bdce4800105..41ec7c6b92b 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -445,7 +445,7 @@ static QStringList filteredFlags(const QStringList &allFlags, bool considerSysro ToolChain::MacroInspectionRunner GccToolChain::createMacroInspectionRunner() const { // Using a clean environment breaks ccache/distcc/etc. - Environment env = Environment::systemEnvironment(); + Environment env = compilerCommand().deviceEnvironment(); addToEnvironment(env); const QStringList platformCodeGenFlags = m_platformCodeGenFlags; OptionsReinterpreter reinterpretOptions = m_optionsReinterpreter; @@ -852,7 +852,7 @@ void GccToolChain::setOptionsReinterpreter(const OptionsReinterpreter &optionsRe GccToolChain::DetectedAbisResult GccToolChain::detectSupportedAbis() const { - Environment env = Environment::systemEnvironment(); + Environment env = compilerCommand().deviceEnvironment(); addToEnvironment(env); ProjectExplorer::Macros macros = createMacroInspectionRunner()({}).macros; return guessGccAbi(findLocalCompiler(compilerCommand(), env), @@ -863,7 +863,7 @@ GccToolChain::DetectedAbisResult GccToolChain::detectSupportedAbis() const QString GccToolChain::detectVersion() const { - Environment env = Environment::systemEnvironment(); + Environment env = compilerCommand().deviceEnvironment(); addToEnvironment(env); return gccVersion(findLocalCompiler(compilerCommand(), env), env, filteredFlags(platformCodeGenFlags(), true)); @@ -871,7 +871,7 @@ QString GccToolChain::detectVersion() const Utils::FilePath GccToolChain::detectInstallDir() const { - Environment env = Environment::systemEnvironment(); + Environment env = compilerCommand().deviceEnvironment(); addToEnvironment(env); return gccInstallDir(findLocalCompiler(compilerCommand(), env), env, filteredFlags(platformCodeGenFlags(), true)); diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizardscannergenerator.cpp b/src/plugins/projectexplorer/jsonwizard/jsonwizardscannergenerator.cpp index d0bf834fea4..2370e068783 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizardscannergenerator.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizardscannergenerator.cpp @@ -77,7 +77,7 @@ Core::GeneratedFiles JsonWizardScannerGenerator::fileList(Utils::MacroExpander * [](const Utils::FilePath &filePath) { return int(filePath.path().count('/')); }; int minDepth = std::numeric_limits::max(); for (auto it = result.begin(); it != result.end(); ++it) { - const Utils::FilePath relPath = it->filePath().relativePath(projectDir); + const Utils::FilePath relPath = it->filePath().relativePathFrom(projectDir); it->setBinary(binaryPattern.match(relPath.toString()).hasMatch()); bool found = ProjectManager::canOpenProjectForMimeType(Utils::mimeTypeForFile(relPath)); if (found) { @@ -119,7 +119,7 @@ Core::GeneratedFiles JsonWizardScannerGenerator::scan(const Utils::FilePath &dir const Utils::FilePaths entries = dir.dirEntries({{}, QDir::AllEntries | QDir::NoDotAndDotDot}, QDir::DirsLast | QDir::Name); for (const Utils::FilePath &fi : entries) { - const Utils::FilePath relativePath = fi.relativePath(base); + const Utils::FilePath relativePath = fi.relativePathFrom(base); if (fi.isDir() && matchesSubdirectoryPattern(relativePath)) { result += scan(fi, base); } else { diff --git a/src/plugins/projectexplorer/projectnodes.cpp b/src/plugins/projectexplorer/projectnodes.cpp index 9245f7645ff..1b7c0546fe7 100644 --- a/src/plugins/projectexplorer/projectnodes.cpp +++ b/src/plugins/projectexplorer/projectnodes.cpp @@ -39,24 +39,37 @@ static FolderNode *recursiveFindOrCreateFolderNode(FolderNode *folder, const FilePath &overrideBaseDir, const FolderNode::FolderNodeFactory &factory) { - QList paths; - const Utils::FilePath basePath = overrideBaseDir.isEmpty() ? folder->filePath() - : overrideBaseDir; - Utils::FilePath path = basePath.isEmpty() ? directory : basePath.relativeChildPath(directory); + Utils::FilePath path = overrideBaseDir.isEmpty() ? folder->filePath() : overrideBaseDir; - while (!path.isEmpty()) { - paths.append(path); - path = path.parentDir(); + Utils::FilePath directoryWithoutPrefix; + bool isRelative = false; + + if (path.isEmpty() || path.isRootPath()) { + directoryWithoutPrefix = directory; + isRelative = false; + } else { + if (directory.isChildOf(path) || directory == path) { + isRelative = true; + directoryWithoutPrefix = directory.relativeChildPath(path); + } else { + isRelative = false; + path.clear(); + directoryWithoutPrefix = directory; + } } - std::reverse(std::begin(paths), std::end(paths)); + QStringList parts = directoryWithoutPrefix.path().split('/', Qt::SkipEmptyParts); + if (directory.osType() != OsTypeWindows && !isRelative && !parts.isEmpty()) + parts[0].prepend('/'); - FolderNode *parent = folder; - for (const auto ¤tPath : paths) { - FolderNode *next = parent->folderNode(currentPath); + ProjectExplorer::FolderNode *parent = folder; + for (const QString &part : std::as_const(parts)) { + path = path.pathAppended(part); + // Find folder in subFolders + FolderNode *next = parent->folderNode(path); if (!next) { // No FolderNode yet, so create it - auto tmp = factory(currentPath); - tmp->setDisplayName(currentPath.fileName()); + auto tmp = factory(path); + tmp->setDisplayName(part); next = tmp.get(); parent->addNode(std::move(tmp)); } diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp index be62ce4684c..37015295a05 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp @@ -515,7 +515,7 @@ void PropertyEditorValue::commitDrop(const QString &path) Utils::FilePath imagePath = Utils::FilePath::fromString(path); Utils::FilePath currFilePath = QmlDesigner::DocumentManager::currentFilePath(); QmlDesigner::VariantProperty srcProp = texture.variantProperty("source"); - srcProp.setValue(imagePath.relativePath(currFilePath).toUrl()); + srcProp.setValue(imagePath.relativePathFrom(currFilePath).toUrl()); // assign the texture to the property setExpressionWithEmit(texture.id()); diff --git a/src/plugins/qmljstools/qmljsmodelmanager.cpp b/src/plugins/qmljstools/qmljsmodelmanager.cpp index 0fd18bd44c2..2970be9f0d2 100644 --- a/src/plugins/qmljstools/qmljsmodelmanager.cpp +++ b/src/plugins/qmljstools/qmljsmodelmanager.cpp @@ -113,7 +113,7 @@ ModelManagerInterface::ProjectInfo ModelManager::defaultProjectInfoForProject( auto addAppDir = [&baseDir, &projectInfo](const FilePath &mdir) { auto dir = mdir.cleanPath(); if (!baseDir.path().isEmpty()) { - auto rDir = dir.relativePath(baseDir); + auto rDir = dir.relativePathFrom(baseDir); // do not add directories outside the build directory // this might happen for example when we think an executable path belongs to // a bundle, and we need to remove extra directories, but that was not the case diff --git a/src/plugins/qmlprojectmanager/cmakegen/cmakegeneratordialog.cpp b/src/plugins/qmlprojectmanager/cmakegen/cmakegeneratordialog.cpp index 2b1b3382974..306133445f6 100644 --- a/src/plugins/qmlprojectmanager/cmakegen/cmakegeneratordialog.cpp +++ b/src/plugins/qmlprojectmanager/cmakegen/cmakegeneratordialog.cpp @@ -142,7 +142,7 @@ void CmakeGeneratorDialog::refreshNotificationText() continue; if (node->toFilePath().exists() && node->isChecked()) { - QString relativePath = node->toFilePath().relativePath(m_rootDir).toString(); + QString relativePath = node->toFilePath().relativePathFrom(m_rootDir).toString(); cursor.insertImage(iformat); cursor.insertText(QString(FILE_OVERWRITE_NOTIFICATION).arg(relativePath)); } diff --git a/src/plugins/remotelinux/linuxdevice.cpp b/src/plugins/remotelinux/linuxdevice.cpp index 6aee5591945..bb506b64cdd 100644 --- a/src/plugins/remotelinux/linuxdevice.cpp +++ b/src/plugins/remotelinux/linuxdevice.cpp @@ -1046,8 +1046,7 @@ DeviceEnvironmentFetcher::Ptr LinuxDevice::environmentFetcher() const bool LinuxDevice::usableAsBuildDevice() const { - const bool isUsable = qtcEnvironmentVariableIntValue("QTC_ALLOW_REMOTE_LINUX_BUILD_DEVICES"); - return isUsable; + return true; } QString LinuxDevice::userAtHost() const diff --git a/tests/auto/utils/fileutils/tst_fileutils.cpp b/tests/auto/utils/fileutils/tst_fileutils.cpp index 4d600a68c2f..d4cd46965cf 100644 --- a/tests/auto/utils/fileutils/tst_fileutils.cpp +++ b/tests/auto/utils/fileutils/tst_fileutils.cpp @@ -294,7 +294,7 @@ void tst_fileutils::calcRelativePath() void tst_fileutils::relativePath_specials() { - QString path = FilePath("").relativePath("").toString(); + QString path = FilePath("").relativePathFrom("").toString(); QCOMPARE(path, ""); } @@ -320,7 +320,7 @@ void tst_fileutils::relativePath() QFETCH(QString, anchor); QFETCH(QString, result); FilePath actualPath = FilePath::fromString(rootPath + "/" + relative) - .relativePath(FilePath::fromString(rootPath + "/" + anchor)); + .relativePathFrom(FilePath::fromString(rootPath + "/" + anchor)); QCOMPARE(actualPath.toString(), result); }