diff --git a/src/libs/core/extractor.cpp b/src/libs/core/extractor.cpp index 97c68e0..df16a51 100644 --- a/src/libs/core/extractor.cpp +++ b/src/libs/core/extractor.cpp @@ -58,7 +58,7 @@ void Extractor::extract(const QString &filePath, const QString &destination, con QDir destinationDir(destination); if (!root.isEmpty()) - destinationDir = destinationDir.absoluteFilePath(root); + destinationDir = destinationDir.filePath(root); // TODO: Do not strip root directory in archive if it equals to 'root' archive_entry *entry; @@ -71,7 +71,7 @@ void Extractor::extract(const QString &filePath, const QString &destination, con #endif if (!root.isEmpty()) pathname.remove(0, pathname.indexOf(QLatin1String("/")) + 1); - archive_entry_set_pathname(entry, qPrintable(destinationDir.absoluteFilePath(pathname))); + archive_entry_set_pathname(entry, qPrintable(destinationDir.filePath(pathname))); archive_read_extract(info.archiveHandle, entry, 0); } diff --git a/src/libs/registry/docset.cpp b/src/libs/registry/docset.cpp index 254bf2d..eba3896 100644 --- a/src/libs/registry/docset.cpp +++ b/src/libs/registry/docset.cpp @@ -74,7 +74,7 @@ Docset::Docset(const QString &path) : // Attempt to find the icon in any supported format for (const QString &iconFile : dir.entryList({QStringLiteral("icon.*")}, QDir::Files)) { - m_icon = QIcon(dir.absoluteFilePath(iconFile)); + m_icon = QIcon(dir.filePath(iconFile)); if (!m_icon.availableSizes().isEmpty()) break; } @@ -88,9 +88,9 @@ Docset::Docset(const QString &path) : // /Articles/ConfigFiles.html Util::Plist plist; if (dir.exists(QStringLiteral("Info.plist"))) - plist.read(dir.absoluteFilePath(QStringLiteral("Info.plist"))); + plist.read(dir.filePath(QStringLiteral("Info.plist"))); else if (dir.exists(QStringLiteral("info.plist"))) - plist.read(dir.absoluteFilePath(QStringLiteral("info.plist"))); + plist.read(dir.filePath(QStringLiteral("info.plist"))); else return; @@ -122,7 +122,7 @@ Docset::Docset(const QString &path) : if (!dir.cd(QStringLiteral("Resources")) || !dir.exists(QStringLiteral("docSet.dsidx"))) return; - m_db = new Util::SQLiteDatabase(dir.absoluteFilePath(QStringLiteral("docSet.dsidx"))); + m_db = new Util::SQLiteDatabase(dir.filePath(QStringLiteral("docSet.dsidx"))); if (!m_db->isOpen()) { qWarning("SQL Error: %s", qPrintable(m_db->lastError())); @@ -214,7 +214,7 @@ QString Docset::path() const QString Docset::documentPath() const { - return QDir(m_path).absoluteFilePath(QStringLiteral("Contents/Resources/Documents")); + return QDir(m_path).filePath(QStringLiteral("Contents/Resources/Documents")); } QIcon Docset::icon() const @@ -484,7 +484,7 @@ QUrl Docset::createPageUrl(const QString &path, const QString &fragment) const realPath.remove(dashEntryRegExp); realFragment.remove(dashEntryRegExp); - QUrl url = QUrl::fromLocalFile(QDir(documentPath()).absoluteFilePath(realPath)); + QUrl url = QUrl::fromLocalFile(QDir(documentPath()).filePath(realPath)); if (!realFragment.isEmpty()) { if (realFragment.startsWith(QLatin1String("//apple_ref")) || realFragment.startsWith(QLatin1String("//dash_ref"))) { diff --git a/src/libs/registry/docsetregistry.cpp b/src/libs/registry/docsetregistry.cpp index b0a586f..a0816b5 100644 --- a/src/libs/registry/docsetregistry.cpp +++ b/src/libs/registry/docsetregistry.cpp @@ -183,8 +183,8 @@ void DocsetRegistry::addDocsetsFromFolder(const QString &path) const QDir dir(path); for (const QFileInfo &subdir : dir.entryInfoList(QDir::NoDotAndDotDot | QDir::AllDirs)) { if (subdir.suffix() == QLatin1String("docset")) - addDocset(subdir.absoluteFilePath()); + addDocset(subdir.filePath()); else - addDocsetsFromFolder(subdir.absoluteFilePath()); + addDocsetsFromFolder(subdir.filePath()); } } diff --git a/src/libs/ui/docsetsdialog.cpp b/src/libs/ui/docsetsdialog.cpp index 16021e2..6a1cbc5 100644 --- a/src/libs/ui/docsetsdialog.cpp +++ b/src/libs/ui/docsetsdialog.cpp @@ -487,7 +487,7 @@ void DocsetsDialog::extractionCompleted(const QString &filePath) const QString docsetName = docsetNameForTmpFilePath(filePath); const QDir dataDir(m_application->settings()->docsetPath); - const QString docsetPath = dataDir.absoluteFilePath(docsetName + QLatin1String(".docset")); + const QString docsetPath = dataDir.filePath(docsetName + QLatin1String(".docset")); // Write metadata about docset Registry::DocsetMetadata metadata = m_availableDocsets.contains(docsetName)