Commit 8b5dcc13 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by hjk

Replace QFileInfo::fileName() with FileName::fileName()

Change-Id: I4852ff215abf25649fc5eac1e922ae901839ca3d
Reviewed-by: default avatarhjk <hjk@theqtcompany.com>
parent 6fd0d4ed
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include <extensionsystem/pluginmanager.h> #include <extensionsystem/pluginmanager.h>
#include <extensionsystem/pluginspec.h> #include <extensionsystem/pluginspec.h>
#include <qtsingleapplication.h> #include <qtsingleapplication.h>
#include <utils/fileutils.h>
#include <utils/hostosinfo.h> #include <utils/hostosinfo.h>
#include <QDebug> #include <QDebug>
...@@ -172,7 +173,7 @@ static bool copyRecursively(const QString &srcFilePath, ...@@ -172,7 +173,7 @@ static bool copyRecursively(const QString &srcFilePath,
if (srcFileInfo.isDir()) { if (srcFileInfo.isDir()) {
QDir targetDir(tgtFilePath); QDir targetDir(tgtFilePath);
targetDir.cdUp(); targetDir.cdUp();
if (!targetDir.mkdir(QFileInfo(tgtFilePath).fileName())) if (!targetDir.mkdir(Utils::FileName::fromString(tgtFilePath).fileName()))
return false; return false;
QDir sourceDir(srcFilePath); QDir sourceDir(srcFilePath);
QStringList fileNames = sourceDir.entryList(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot | QDir::Hidden | QDir::System); QStringList fileNames = sourceDir.entryList(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot | QDir::Hidden | QDir::System);
......
...@@ -29,7 +29,8 @@ ...@@ -29,7 +29,8 @@
****************************************************************************/ ****************************************************************************/
#include "fileinprojectfinder.h" #include "fileinprojectfinder.h"
#include <utils/qtcassert.h> #include "fileutils.h"
#include "qtcassert.h"
#include <QDebug> #include <QDebug>
#include <QFileInfo> #include <QFileInfo>
...@@ -215,9 +216,9 @@ QString FileInProjectFinder::findFile(const QUrl &fileUrl, bool *success) const ...@@ -215,9 +216,9 @@ QString FileInProjectFinder::findFile(const QUrl &fileUrl, bool *success) const
if (debug) if (debug)
qDebug() << "FileInProjectFinder: checking project files ..."; qDebug() << "FileInProjectFinder: checking project files ...";
const QString fileName = QFileInfo(originalPath).fileName(); const QString fileName = FileName::fromString(originalPath).fileName();
foreach (const QString &f, m_projectFiles) { foreach (const QString &f, m_projectFiles) {
if (QFileInfo(f).fileName() == fileName) { if (FileName::fromString(f).fileName() == fileName) {
m_cache.insert(originalPath, f); m_cache.insert(originalPath, f);
if (success) if (success)
*success = true; *success = true;
......
...@@ -156,7 +156,7 @@ bool FileUtils::copyRecursively(const FileName &srcFilePath, const FileName &tgt ...@@ -156,7 +156,7 @@ bool FileUtils::copyRecursively(const FileName &srcFilePath, const FileName &tgt
if (!tgtFilePath.exists()) { if (!tgtFilePath.exists()) {
QDir targetDir(tgtFilePath.toString()); QDir targetDir(tgtFilePath.toString());
targetDir.cdUp(); targetDir.cdUp();
if (!targetDir.mkdir(tgtFilePath.toFileInfo().fileName())) { if (!targetDir.mkdir(tgtFilePath.fileName())) {
if (error) { if (error) {
*error = QCoreApplication::translate("Utils::FileUtils", "Failed to create directory \"%1\".") *error = QCoreApplication::translate("Utils::FileUtils", "Failed to create directory \"%1\".")
.arg(tgtFilePath.toUserOutput()); .arg(tgtFilePath.toUserOutput());
......
...@@ -372,7 +372,7 @@ void MacroExpander::registerFileVariables(const QByteArray &prefix, ...@@ -372,7 +372,7 @@ void MacroExpander::registerFileVariables(const QByteArray &prefix,
registerVariable(prefix + kFileNamePostfix, registerVariable(prefix + kFileNamePostfix,
tr("%1: File name without path.").arg(heading), tr("%1: File name without path.").arg(heading),
[base]() -> QString { QString tmp = base(); return tmp.isEmpty() ? QString() : QFileInfo(tmp).fileName(); }, [base]() -> QString { QString tmp = base(); return tmp.isEmpty() ? QString() : Utils::FileName::fromString(tmp).fileName(); },
visibleInChooser); visibleInChooser);
registerVariable(prefix + kFileBaseNamePostfix, registerVariable(prefix + kFileBaseNamePostfix,
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
** **
****************************************************************************/ ****************************************************************************/
#include "fileutils.h"
#include "reloadpromptutils.h" #include "reloadpromptutils.h"
#include <QCoreApplication> #include <QCoreApplication>
...@@ -53,7 +54,7 @@ QTCREATOR_UTILS_EXPORT ReloadPromptAnswer reloadPrompt(const QString &fileName, ...@@ -53,7 +54,7 @@ QTCREATOR_UTILS_EXPORT ReloadPromptAnswer reloadPrompt(const QString &fileName,
msg = QCoreApplication::translate("Utils::reloadPrompt", msg = QCoreApplication::translate("Utils::reloadPrompt",
"The file <i>%1</i> has changed outside Qt Creator. Do you want to reload it?"); "The file <i>%1</i> has changed outside Qt Creator. Do you want to reload it?");
} }
msg = msg.arg(QFileInfo(fileName).fileName()); msg = msg.arg(FileName::fromString(fileName).fileName());
return reloadPrompt(title, msg, QDir::toNativeSeparators(fileName), parent); return reloadPrompt(title, msg, QDir::toNativeSeparators(fileName), parent);
} }
......
...@@ -28,8 +28,9 @@ ...@@ -28,8 +28,9 @@
** **
****************************************************************************/ ****************************************************************************/
#include "unixutils.h" #include "unixutils.h"
#include "fileutils.h"
#include <QSettings> #include <QSettings>
#include <QFileInfo> #include <QFileInfo>
#include <QCoreApplication> #include <QCoreApplication>
...@@ -81,7 +82,7 @@ QString UnixUtils::substituteFileBrowserParameters(const QString &pre, const QSt ...@@ -81,7 +82,7 @@ QString UnixUtils::substituteFileBrowserParameters(const QString &pre, const QSt
} else if (c == QLatin1Char('f')) { } else if (c == QLatin1Char('f')) {
s = QLatin1Char('"') + file + QLatin1Char('"'); s = QLatin1Char('"') + file + QLatin1Char('"');
} else if (c == QLatin1Char('n')) { } else if (c == QLatin1Char('n')) {
s = QLatin1Char('"') + QFileInfo(file).fileName() + QLatin1Char('"'); s = QLatin1Char('"') + FileName::fromString(file).fileName() + QLatin1Char('"');
} else if (c == QLatin1Char('%')) { } else if (c == QLatin1Char('%')) {
s = c; s = c;
} else { } else {
......
...@@ -61,7 +61,7 @@ QString AndroidManifestDocument::defaultPath() const ...@@ -61,7 +61,7 @@ QString AndroidManifestDocument::defaultPath() const
QString AndroidManifestDocument::suggestedFileName() const QString AndroidManifestDocument::suggestedFileName() const
{ {
return filePath().toFileInfo().fileName(); return filePath().fileName();
} }
bool AndroidManifestDocument::isModified() const bool AndroidManifestDocument::isModified() const
......
...@@ -301,7 +301,7 @@ QList<AndroidToolChainFactory::AndroidToolChainInformation> AndroidToolChainFact ...@@ -301,7 +301,7 @@ QList<AndroidToolChainFactory::AndroidToolChainInformation> AndroidToolChainFact
QDirIterator it(path.appendPath(QLatin1String("toolchains")).toString(), QDirIterator it(path.appendPath(QLatin1String("toolchains")).toString(),
QStringList() << QLatin1String("*"), QDir::Dirs); QStringList() << QLatin1String("*"), QDir::Dirs);
while (it.hasNext()) { while (it.hasNext()) {
const QString &fileName = QFileInfo(it.next()).fileName(); const QString &fileName = FileName::fromString(it.next()).fileName();
int idx = versionRegExp.indexIn(fileName); int idx = versionRegExp.indexIn(fileName);
if (idx == -1) if (idx == -1)
continue; continue;
...@@ -376,7 +376,7 @@ QList<ToolChain *> AndroidToolChainFactory::createToolChainsForNdk(const Utils:: ...@@ -376,7 +376,7 @@ QList<ToolChain *> AndroidToolChainFactory::createToolChainsForNdk(const Utils::
QMap<Abi::Architecture, AndroidToolChain *> newestToolChainForArch; QMap<Abi::Architecture, AndroidToolChain *> newestToolChainForArch;
while (it.hasNext()) { while (it.hasNext()) {
const QString &fileName = QFileInfo(it.next()).fileName(); const QString &fileName = FileName::fromString(it.next()).fileName();
int idx = versionRegExp.indexIn(fileName); int idx = versionRegExp.indexIn(fileName);
if (idx == -1) if (idx == -1)
continue; continue;
...@@ -417,7 +417,7 @@ QList<int> AndroidToolChainFactory::newestToolChainVersionForArch(Abi::Architect ...@@ -417,7 +417,7 @@ QList<int> AndroidToolChainFactory::newestToolChainVersionForArch(Abi::Architect
QDirIterator it(path.appendPath(QLatin1String("toolchains")).toString(), QDirIterator it(path.appendPath(QLatin1String("toolchains")).toString(),
QStringList() << QLatin1String("*"), QDir::Dirs); QStringList() << QLatin1String("*"), QDir::Dirs);
while (it.hasNext()) { while (it.hasNext()) {
const QString &fileName = QFileInfo(it.next()).fileName(); const QString &fileName = FileName::fromString(it.next()).fileName();
int idx = versionRegExp.indexIn(fileName); int idx = versionRegExp.indexIn(fileName);
if (idx == -1) if (idx == -1)
continue; continue;
......
...@@ -76,7 +76,7 @@ QString JavaDocument::defaultPath() const ...@@ -76,7 +76,7 @@ QString JavaDocument::defaultPath() const
QString JavaDocument::suggestedFileName() const QString JavaDocument::suggestedFileName() const
{ {
return filePath().toFileInfo().fileName(); return filePath().fileName();
} }
......
...@@ -388,7 +388,7 @@ QVariant BookmarkManager::data(const QModelIndex &index, int role) const ...@@ -388,7 +388,7 @@ QVariant BookmarkManager::data(const QModelIndex &index, int role) const
Bookmark *bookMark = m_bookmarksList.at(index.row()); Bookmark *bookMark = m_bookmarksList.at(index.row());
if (role == BookmarkManager::Filename) if (role == BookmarkManager::Filename)
return QFileInfo(bookMark->fileName()).fileName(); return FileName::fromString(bookMark->fileName()).fileName();
if (role == BookmarkManager::LineNumber) if (role == BookmarkManager::LineNumber)
return bookMark->lineNumber(); return bookMark->lineNumber();
if (role == BookmarkManager::Directory) if (role == BookmarkManager::Directory)
......
...@@ -63,7 +63,7 @@ static QString shadowBuildDirectory(const QString &projectFilePath, const Kit *k ...@@ -63,7 +63,7 @@ static QString shadowBuildDirectory(const QString &projectFilePath, const Kit *k
return QString(); return QString();
QFileInfo info(projectFilePath); QFileInfo info(projectFilePath);
const QString projectName = QFileInfo(info.absolutePath()).fileName(); const QString projectName = FileName::fromString(info.absolutePath()).fileName();
ProjectMacroExpander expander(projectName, k, bcName); ProjectMacroExpander expander(projectName, k, bcName);
QDir projectDir = QDir(Project::projectDirectory(FileName::fromString(projectFilePath)).toString()); QDir projectDir = QDir(Project::projectDirectory(FileName::fromString(projectFilePath)).toString());
QString buildPath = expander.expand(Core::DocumentManager::buildDirectory()); QString buildPath = expander.expand(Core::DocumentManager::buildDirectory());
......
...@@ -257,7 +257,7 @@ QString CMakeDocument::defaultPath() const ...@@ -257,7 +257,7 @@ QString CMakeDocument::defaultPath() const
QString CMakeDocument::suggestedFileName() const QString CMakeDocument::suggestedFileName() const
{ {
return filePath().toFileInfo().fileName(); return filePath().fileName();
} }
// //
......
...@@ -1213,7 +1213,7 @@ void CMakeCbpParser::parseUnit() ...@@ -1213,7 +1213,7 @@ void CMakeCbpParser::parseUnit()
m_cmakeFileList.append( new ProjectExplorer::FileNode(fileName, ProjectExplorer::ProjectFileType, false)); m_cmakeFileList.append( new ProjectExplorer::FileNode(fileName, ProjectExplorer::ProjectFileType, false));
} else { } else {
bool generated = false; bool generated = false;
QString onlyFileName = QFileInfo(fileName).fileName(); QString onlyFileName = Utils::FileName::fromString(fileName).fileName();
if ( (onlyFileName.startsWith(QLatin1String("moc_")) && onlyFileName.endsWith(QLatin1String(".cxx"))) if ( (onlyFileName.startsWith(QLatin1String("moc_")) && onlyFileName.endsWith(QLatin1String(".cxx")))
|| (onlyFileName.startsWith(QLatin1String("ui_")) && onlyFileName.endsWith(QLatin1String(".h"))) || (onlyFileName.startsWith(QLatin1String("ui_")) && onlyFileName.endsWith(QLatin1String(".h")))
|| (onlyFileName.startsWith(QLatin1String("qrc_")) && onlyFileName.endsWith(QLatin1String(".cxx")))) || (onlyFileName.startsWith(QLatin1String("qrc_")) && onlyFileName.endsWith(QLatin1String(".cxx"))))
......
...@@ -30,8 +30,9 @@ ...@@ -30,8 +30,9 @@
#include "openwithdialog.h" #include "openwithdialog.h"
#include <utils/fileutils.h>
#include <QPushButton> #include <QPushButton>
#include <QFileInfo>
using namespace Core; using namespace Core;
using namespace Core::Internal; using namespace Core::Internal;
...@@ -41,7 +42,7 @@ OpenWithDialog::OpenWithDialog(const QString &fileName, QWidget *parent) ...@@ -41,7 +42,7 @@ OpenWithDialog::OpenWithDialog(const QString &fileName, QWidget *parent)
{ {
setupUi(this); setupUi(this);
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
label->setText(tr("Open file \"%1\" with:").arg(QFileInfo(fileName).fileName())); label->setText(tr("Open file \"%1\" with:").arg(Utils::FileName::fromString(fileName).fileName()));
buttonBox->button(QDialogButtonBox::Ok)->setDefault(true); buttonBox->button(QDialogButtonBox::Ok)->setDefault(true);
connect(buttonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked()), connect(buttonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked()),
......
...@@ -1612,7 +1612,7 @@ void EditorManagerPrivate::copyFileNameFromContextMenu() ...@@ -1612,7 +1612,7 @@ void EditorManagerPrivate::copyFileNameFromContextMenu()
{ {
if (!d->m_contextMenuEntry) if (!d->m_contextMenuEntry)
return; return;
QApplication::clipboard()->setText(QFileInfo(d->m_contextMenuEntry->fileName()).fileName()); QApplication::clipboard()->setText(FileName::fromString(d->m_contextMenuEntry->fileName()).fileName());
} }
void EditorManagerPrivate::saveDocumentFromContextMenu() void EditorManagerPrivate::saveDocumentFromContextMenu()
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include "infobar.h" #include "infobar.h"
#include <utils/fileutils.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <QFile> #include <QFile>
...@@ -263,7 +264,7 @@ QString IDocument::displayName() const ...@@ -263,7 +264,7 @@ QString IDocument::displayName() const
{ {
if (!d->displayName.isEmpty()) if (!d->displayName.isEmpty())
return d->displayName; return d->displayName;
return d->filePath.toFileInfo().fileName(); return d->filePath.fileName();
} }
/*! /*!
......
...@@ -119,7 +119,7 @@ QList<LocatorFilterEntry> FileSystemFilter::matchesFor(QFutureInterface<LocatorF ...@@ -119,7 +119,7 @@ QList<LocatorFilterEntry> FileSystemFilter::matchesFor(QFutureInterface<LocatorF
// file names can match with +linenumber or :linenumber // file names can match with +linenumber or :linenumber
name = entry; name = entry;
const QString lineNoSuffix = EditorManager::splitLineNumber(&name); const QString lineNoSuffix = EditorManager::splitLineNumber(&name);
name = QFileInfo(name).fileName(); name = Utils::FileName::fromString(name).fileName();
foreach (const QString &file, files) { foreach (const QString &file, files) {
if (future.isCanceled()) if (future.isCanceled())
break; break;
......
...@@ -149,7 +149,7 @@ void ToolSettings::apply() ...@@ -149,7 +149,7 @@ void ToolSettings::apply()
if (tool->preset() && (*tool) != (*(tool->preset()))) { if (tool->preset() && (*tool) != (*(tool->preset()))) {
// check if we need to choose a new file name // check if we need to choose a new file name
if (tool->preset()->fileName() == tool->fileName()) { if (tool->preset()->fileName() == tool->fileName()) {
const QString &fileName = QFileInfo(tool->preset()->fileName()).fileName(); const QString &fileName = Utils::FileName::fromString(tool->preset()->fileName()).fileName();
const QString &newFilePath = getUserFilePath(fileName); const QString &newFilePath = getUserFilePath(fileName);
// TODO error handling if newFilePath.isEmpty() (i.e. failed to find a unused name) // TODO error handling if newFilePath.isEmpty() (i.e. failed to find a unused name)
tool->setFileName(newFilePath); tool->setFileName(newFilePath);
......
...@@ -30,7 +30,8 @@ ...@@ -30,7 +30,8 @@
#include "argumentscollector.h" #include "argumentscollector.h"
#include <QFileInfo> #include <utils/fileutils.h>
#include <QCoreApplication> #include <QCoreApplication>
static QString pasteRequestString() { return QLatin1String("paste"); } static QString pasteRequestString() { return QLatin1String("paste"); }
...@@ -72,7 +73,7 @@ bool ArgumentsCollector::collect(const QStringList &args) ...@@ -72,7 +73,7 @@ bool ArgumentsCollector::collect(const QStringList &args)
QString ArgumentsCollector::usageString() const QString ArgumentsCollector::usageString() const
{ {
QString usage = QString::fromLatin1("Usage:\n\t%1 <request> [ <request options>]\n\t") QString usage = QString::fromLatin1("Usage:\n\t%1 <request> [ <request options>]\n\t")
.arg(QFileInfo(QCoreApplication::applicationFilePath()).fileName()); .arg(Utils::FileName::fromString(QCoreApplication::applicationFilePath()).fileName());
usage += QString::fromLatin1("Possible requests: \"%1\", \"%2\", \"%3\"\n\t") usage += QString::fromLatin1("Possible requests: \"%1\", \"%2\", \"%3\"\n\t")
.arg(pasteRequestString(), listProtocolsRequestString(), helpRequestString()); .arg(pasteRequestString(), listProtocolsRequestString(), helpRequestString());
usage += QString::fromLatin1("Possible options for request \"%1\": \"%2 <file>\" (default: stdin), " usage += QString::fromLatin1("Possible options for request \"%1\": \"%2 <file>\" (default: stdin), "
......
...@@ -38,7 +38,6 @@ ...@@ -38,7 +38,6 @@
#include <cplusplus/TypeOfExpression.h> #include <cplusplus/TypeOfExpression.h>
#include <QDir> #include <QDir>
#include <QFileInfo>
#include <QSet> #include <QSet>
#include <QQueue> #include <QQueue>
...@@ -258,7 +257,7 @@ Unknown::Unknown(const QString &type) : type(type) ...@@ -258,7 +257,7 @@ Unknown::Unknown(const QString &type) : type(type)
CppInclude::CppInclude(const Document::Include &includeFile) : CppInclude::CppInclude(const Document::Include &includeFile) :
path(QDir::toNativeSeparators(includeFile.resolvedFileName())), path(QDir::toNativeSeparators(includeFile.resolvedFileName())),
fileName(QFileInfo(includeFile.resolvedFileName()).fileName()) fileName(Utils::FileName::fromString(includeFile.resolvedFileName()).fileName())
{ {
helpCategory = TextEditor::HelpItem::Brief; helpCategory = TextEditor::HelpItem::Brief;
helpIdCandidates = QStringList(fileName); helpIdCandidates = QStringList(fileName);
......
...@@ -53,7 +53,7 @@ CppPreProcessorDialog::CppPreProcessorDialog(QWidget *parent, const QString &fil ...@@ -53,7 +53,7 @@ CppPreProcessorDialog::CppPreProcessorDialog(QWidget *parent, const QString &fil
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
m_ui->setupUi(this); m_ui->setupUi(this);
m_ui->editorLabel->setText(m_ui->editorLabel->text().arg(QFileInfo(m_filePath).fileName())); m_ui->editorLabel->setText(m_ui->editorLabel->text().arg(Utils::FileName::fromString(m_filePath).fileName()));
m_ui->editWidget->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); m_ui->editWidget->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
CppSnippetProvider().decorateEditor(m_ui->editWidget); CppSnippetProvider().decorateEditor(m_ui->editWidget);
......
...@@ -1917,7 +1917,7 @@ void AddIncludeForUndefinedIdentifier::match(const CppQuickFixInterface &interfa ...@@ -1917,7 +1917,7 @@ void AddIncludeForUndefinedIdentifier::match(const CppQuickFixInterface &interfa
header.toString(), header.toString(),
headerPaths); headerPaths);
if (include.size() > 2) { if (include.size() > 2) {
const QString headerFileName = QFileInfo(info->fileName()).fileName(); const QString headerFileName = Utils::FileName::fromString(info->fileName()).fileName();
QTC_ASSERT(!headerFileName.isEmpty(), break); QTC_ASSERT(!headerFileName.isEmpty(), break);
int priority = 0; int priority = 0;
......
...@@ -40,11 +40,11 @@ ...@@ -40,11 +40,11 @@
#include <cppeditor/cppeditorconstants.h> #include <cppeditor/cppeditorconstants.h>
#include <utils/environment.h> #include <utils/environment.h>
#include <utils/fileutils.h>
#include <QSettings> #include <QSettings>
#include <QDebug> #include <QDebug>
#include <QFile> #include <QFile>
#include <QFileInfo>
#include <QCoreApplication> #include <QCoreApplication>
#include <QDate> #include <QDate>
#include <QLocale> #include <QLocale>
...@@ -157,7 +157,7 @@ static bool keyWordReplacement(const QString &keyWord, ...@@ -157,7 +157,7 @@ static bool keyWordReplacement(const QString &keyWord,
return true; return true;
} }
if (keyWord == QLatin1String("%FILENAME%")) { if (keyWord == QLatin1String("%FILENAME%")) {
*value = QFileInfo(file).fileName(); *value = Utils::FileName::fromString(file).fileName();
return true; return true;
} }
if (keyWord == QLatin1String("%DATE%")) { if (keyWord == QLatin1String("%DATE%")) {
......
...@@ -45,7 +45,6 @@ ...@@ -45,7 +45,6 @@
#include <utils/hostosinfo.h> #include <utils/hostosinfo.h>
#include <QDebug> #include <QDebug>
#include <QFileInfo>
#include <QtTest> #include <QtTest>
using namespace CppTools; using namespace CppTools;
...@@ -653,7 +652,7 @@ void CppToolsPlugin::test_modelmanager_extraeditorsupport_uiFiles() ...@@ -653,7 +652,7 @@ void CppToolsPlugin::test_modelmanager_extraeditorsupport_uiFiles()
QHashIterator<Utils::FileName, QPair<QByteArray, unsigned> > it = workingCopy.iterator(); QHashIterator<Utils::FileName, QPair<QByteArray, unsigned> > it = workingCopy.iterator();
while (it.hasNext()) { while (it.hasNext()) {
it.next(); it.next();
fileNamesInWorkinCopy << QFileInfo(it.key().toString()).fileName(); fileNamesInWorkinCopy << Utils::FileName::fromString(it.key().toString()).fileName();
} }
fileNamesInWorkinCopy.sort(); fileNamesInWorkinCopy.sort();
const QString expectedUiHeaderFileName = _("ui_mainwindow.h"); const QString expectedUiHeaderFileName = _("ui_mainwindow.h");
...@@ -671,8 +670,8 @@ void CppToolsPlugin::test_modelmanager_extraeditorsupport_uiFiles() ...@@ -671,8 +670,8 @@ void CppToolsPlugin::test_modelmanager_extraeditorsupport_uiFiles()
QVERIFY(document); QVERIFY(document);
const QStringList includedFiles = document->includedFiles(); const QStringList includedFiles = document->includedFiles();
QCOMPARE(includedFiles.size(), 2); QCOMPARE(includedFiles.size(), 2);
QCOMPARE(QFileInfo(includedFiles.at(0)).fileName(), _("mainwindow.h")); QCOMPARE(Utils::FileName::fromString(includedFiles.at(0)).fileName(), _("mainwindow.h"));
QCOMPARE(QFileInfo(includedFiles.at(1)).fileName(), _("ui_mainwindow.h")); QCOMPARE(Utils::FileName::fromString(includedFiles.at(1)).fileName(), _("ui_mainwindow.h"));
} }
/// QTCREATORBUG-9828: Locator shows symbols of closed files /// QTCREATORBUG-9828: Locator shows symbols of closed files
......
...@@ -620,7 +620,7 @@ QVariant BreakpointItem::data(int column, int role) const ...@@ -620,7 +620,7 @@ QVariant BreakpointItem::data(int column, int role) const
if (str.isEmpty() && !m_params.fileName.isEmpty()) if (str.isEmpty() && !m_params.fileName.isEmpty())
str = m_params.fileName; str = m_params.fileName;
if (str.isEmpty()) { if (str.isEmpty()) {
QString s = QFileInfo(str).fileName(); QString s = Utils::FileName::fromString(str).fileName();
if (!s.isEmpty()) if (!s.isEmpty())
str = s; str = s;
} }
......