summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2015-01-10 23:40:32 +0200
committerhjk <hjk@theqtcompany.com>2015-01-29 11:15:43 +0000
commit8b5dcc13c539e755b67bfb6ae38553534c9b3d11 (patch)
tree6ece649b191598e412049646832a59ae096f850c /src/plugins
parent6fd0d4ed339fe656bc68d7b31ba9d8e63955b12a (diff)
downloadqt-creator-8b5dcc13c539e755b67bfb6ae38553534c9b3d11.tar.gz
Replace QFileInfo::fileName() with FileName::fileName()
Change-Id: I4852ff215abf25649fc5eac1e922ae901839ca3d Reviewed-by: hjk <hjk@theqtcompany.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/android/androidmanifestdocument.cpp2
-rw-r--r--src/plugins/android/androidtoolchain.cpp6
-rw-r--r--src/plugins/android/javaeditor.cpp2
-rw-r--r--src/plugins/bookmarks/bookmarkmanager.cpp2
-rw-r--r--src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp2
-rw-r--r--src/plugins/cmakeprojectmanager/cmakeeditor.cpp2
-rw-r--r--src/plugins/cmakeprojectmanager/cmakeproject.cpp2
-rw-r--r--src/plugins/coreplugin/dialogs/openwithdialog.cpp5
-rw-r--r--src/plugins/coreplugin/editormanager/editormanager.cpp2
-rw-r--r--src/plugins/coreplugin/idocument.cpp3
-rw-r--r--src/plugins/coreplugin/locator/filesystemfilter.cpp2
-rw-r--r--src/plugins/coreplugin/toolsettings.cpp2
-rw-r--r--src/plugins/cpaster/frontend/argumentscollector.cpp5
-rw-r--r--src/plugins/cppeditor/cppelementevaluator.cpp3
-rw-r--r--src/plugins/cppeditor/cpppreprocessordialog.cpp2
-rw-r--r--src/plugins/cppeditor/cppquickfixes.cpp2
-rw-r--r--src/plugins/cpptools/cppfilesettingspage.cpp4
-rw-r--r--src/plugins/cpptools/cppmodelmanager_test.cpp7
-rw-r--r--src/plugins/debugger/breakhandler.cpp2
-rw-r--r--src/plugins/debugger/cdb/cdbparsehelpers.cpp3
-rw-r--r--src/plugins/debugger/debuggerdialogs.cpp2
-rw-r--r--src/plugins/debugger/debuggerplugin.cpp2
-rw-r--r--src/plugins/debugger/gdb/gdbengine.cpp4
-rw-r--r--src/plugins/debugger/qml/qmlinspectoragent.cpp4
-rw-r--r--src/plugins/debugger/qml/qmlv8debuggerclient.cpp2
-rw-r--r--src/plugins/debugger/sourceagent.cpp4
-rw-r--r--src/plugins/debugger/stackhandler.cpp4
-rw-r--r--src/plugins/diffeditor/diffeditor.cpp7
-rw-r--r--src/plugins/git/gerrit/gerritplugin.cpp2
-rw-r--r--src/plugins/ios/iosrunconfiguration.cpp4
-rw-r--r--src/plugins/projectexplorer/abstractprocessstep.cpp2
-rw-r--r--src/plugins/projectexplorer/allprojectsfind.cpp2
-rw-r--r--src/plugins/projectexplorer/deployablefile.cpp5
-rw-r--r--src/plugins/projectexplorer/processparameters.cpp4
-rw-r--r--src/plugins/projectexplorer/projectmodels.cpp10
-rw-r--r--src/plugins/projectexplorer/projectnodes.cpp7
-rw-r--r--src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp4
-rw-r--r--src/plugins/qmakeandroidsupport/qmakeandroidrunconfiguration.cpp5
-rw-r--r--src/plugins/qmakeprojectmanager/customwidgetwizard/plugingenerator.cpp2
-rw-r--r--src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.cpp4
-rw-r--r--src/plugins/qmakeprojectmanager/profileeditor.cpp2
-rw-r--r--src/plugins/qmakeprojectmanager/qmakenodes.cpp4
-rw-r--r--src/plugins/qmakeprojectmanager/qmakeproject.cpp6
-rw-r--r--src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.cpp4
-rw-r--r--src/plugins/qmakeprojectmanager/qmakestep.cpp6
-rw-r--r--src/plugins/qmakeprojectmanager/wizards/consoleappwizard.cpp5
-rw-r--r--src/plugins/qmakeprojectmanager/wizards/guiappwizard.cpp9
-rw-r--r--src/plugins/qmakeprojectmanager/wizards/librarywizard.cpp11
-rw-r--r--src/plugins/qmakeprojectmanager/wizards/testwizard.cpp3
-rw-r--r--src/plugins/qmldesigner/components/pluginmanager/pluginpath.cpp4
-rw-r--r--src/plugins/qmldesigner/designercore/pluginmanager/widgetpluginpath.cpp5
-rw-r--r--src/plugins/qmljstools/qmljslocatordata.cpp3
-rw-r--r--src/plugins/qmlprojectmanager/fileformat/filefilteritems.cpp3
-rw-r--r--src/plugins/qnx/bardescriptordocument.cpp2
-rw-r--r--src/plugins/qnx/bardescriptoreditorassetswidget.cpp2
-rw-r--r--src/plugins/qnx/bardescriptoreditorentrypointwidget.cpp4
-rw-r--r--src/plugins/qnx/qnxanalyzesupport.cpp4
-rw-r--r--src/plugins/qnx/qnxdebugsupport.cpp4
-rw-r--r--src/plugins/qnx/qnxruncontrol.cpp4
-rw-r--r--src/plugins/qtsupport/screenshotcropper.cpp5
-rw-r--r--src/plugins/remotelinux/abstractuploadandinstallpackageservice.cpp5
-rw-r--r--src/plugins/resourceeditor/resourcenode.cpp4
-rw-r--r--src/plugins/texteditor/codecselector.cpp4
-rw-r--r--src/plugins/texteditor/codestylepool.cpp8
-rw-r--r--src/plugins/texteditor/findincurrentfile.cpp3
-rw-r--r--src/plugins/texteditor/fontsettings.cpp4
-rw-r--r--src/plugins/texteditor/fontsettingspage.cpp3
-rw-r--r--src/plugins/valgrind/memchecktool.cpp4
-rw-r--r--src/plugins/valgrind/valgrindprocess.cpp10
-rw-r--r--src/plugins/vcsbase/vcsbaseclient.cpp2
-rw-r--r--src/plugins/vcsbase/vcsbaseeditor.cpp2
71 files changed, 150 insertions, 129 deletions
diff --git a/src/plugins/android/androidmanifestdocument.cpp b/src/plugins/android/androidmanifestdocument.cpp
index cf7cfee3a9..1a41fa5df7 100644
--- a/src/plugins/android/androidmanifestdocument.cpp
+++ b/src/plugins/android/androidmanifestdocument.cpp
@@ -61,7 +61,7 @@ QString AndroidManifestDocument::defaultPath() const
QString AndroidManifestDocument::suggestedFileName() const
{
- return filePath().toFileInfo().fileName();
+ return filePath().fileName();
}
bool AndroidManifestDocument::isModified() const
diff --git a/src/plugins/android/androidtoolchain.cpp b/src/plugins/android/androidtoolchain.cpp
index b2176437a7..73fa8457e0 100644
--- a/src/plugins/android/androidtoolchain.cpp
+++ b/src/plugins/android/androidtoolchain.cpp
@@ -301,7 +301,7 @@ QList<AndroidToolChainFactory::AndroidToolChainInformation> AndroidToolChainFact
QDirIterator it(path.appendPath(QLatin1String("toolchains")).toString(),
QStringList() << QLatin1String("*"), QDir::Dirs);
while (it.hasNext()) {
- const QString &fileName = QFileInfo(it.next()).fileName();
+ const QString &fileName = FileName::fromString(it.next()).fileName();
int idx = versionRegExp.indexIn(fileName);
if (idx == -1)
continue;
@@ -376,7 +376,7 @@ QList<ToolChain *> AndroidToolChainFactory::createToolChainsForNdk(const Utils::
QMap<Abi::Architecture, AndroidToolChain *> newestToolChainForArch;
while (it.hasNext()) {
- const QString &fileName = QFileInfo(it.next()).fileName();
+ const QString &fileName = FileName::fromString(it.next()).fileName();
int idx = versionRegExp.indexIn(fileName);
if (idx == -1)
continue;
@@ -417,7 +417,7 @@ QList<int> AndroidToolChainFactory::newestToolChainVersionForArch(Abi::Architect
QDirIterator it(path.appendPath(QLatin1String("toolchains")).toString(),
QStringList() << QLatin1String("*"), QDir::Dirs);
while (it.hasNext()) {
- const QString &fileName = QFileInfo(it.next()).fileName();
+ const QString &fileName = FileName::fromString(it.next()).fileName();
int idx = versionRegExp.indexIn(fileName);
if (idx == -1)
continue;
diff --git a/src/plugins/android/javaeditor.cpp b/src/plugins/android/javaeditor.cpp
index c8194db492..deb7811392 100644
--- a/src/plugins/android/javaeditor.cpp
+++ b/src/plugins/android/javaeditor.cpp
@@ -76,7 +76,7 @@ QString JavaDocument::defaultPath() const
QString JavaDocument::suggestedFileName() const
{
- return filePath().toFileInfo().fileName();
+ return filePath().fileName();
}
diff --git a/src/plugins/bookmarks/bookmarkmanager.cpp b/src/plugins/bookmarks/bookmarkmanager.cpp
index 43dd21b83e..c81a9aed98 100644
--- a/src/plugins/bookmarks/bookmarkmanager.cpp
+++ b/src/plugins/bookmarks/bookmarkmanager.cpp
@@ -388,7 +388,7 @@ QVariant BookmarkManager::data(const QModelIndex &index, int role) const
Bookmark *bookMark = m_bookmarksList.at(index.row());
if (role == BookmarkManager::Filename)
- return QFileInfo(bookMark->fileName()).fileName();
+ return FileName::fromString(bookMark->fileName()).fileName();
if (role == BookmarkManager::LineNumber)
return bookMark->lineNumber();
if (role == BookmarkManager::Directory)
diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp
index 5326b27c9b..06fb75eb28 100644
--- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp
+++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp
@@ -63,7 +63,7 @@ static QString shadowBuildDirectory(const QString &projectFilePath, const Kit *k
return QString();
QFileInfo info(projectFilePath);
- const QString projectName = QFileInfo(info.absolutePath()).fileName();
+ const QString projectName = FileName::fromString(info.absolutePath()).fileName();
ProjectMacroExpander expander(projectName, k, bcName);
QDir projectDir = QDir(Project::projectDirectory(FileName::fromString(projectFilePath)).toString());
QString buildPath = expander.expand(Core::DocumentManager::buildDirectory());
diff --git a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp
index 3acf674867..1ba12578cc 100644
--- a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp
+++ b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp
@@ -257,7 +257,7 @@ QString CMakeDocument::defaultPath() const
QString CMakeDocument::suggestedFileName() const
{
- return filePath().toFileInfo().fileName();
+ return filePath().fileName();
}
//
diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp
index cd23330aa5..d650261006 100644
--- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp
+++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp
@@ -1213,7 +1213,7 @@ void CMakeCbpParser::parseUnit()
m_cmakeFileList.append( new ProjectExplorer::FileNode(fileName, ProjectExplorer::ProjectFileType, false));
} else {
bool generated = false;
- QString onlyFileName = QFileInfo(fileName).fileName();
+ QString onlyFileName = Utils::FileName::fromString(fileName).fileName();
if ( (onlyFileName.startsWith(QLatin1String("moc_")) && onlyFileName.endsWith(QLatin1String(".cxx")))
|| (onlyFileName.startsWith(QLatin1String("ui_")) && onlyFileName.endsWith(QLatin1String(".h")))
|| (onlyFileName.startsWith(QLatin1String("qrc_")) && onlyFileName.endsWith(QLatin1String(".cxx"))))
diff --git a/src/plugins/coreplugin/dialogs/openwithdialog.cpp b/src/plugins/coreplugin/dialogs/openwithdialog.cpp
index 5063810077..beda9fa884 100644
--- a/src/plugins/coreplugin/dialogs/openwithdialog.cpp
+++ b/src/plugins/coreplugin/dialogs/openwithdialog.cpp
@@ -30,8 +30,9 @@
#include "openwithdialog.h"
+#include <utils/fileutils.h>
+
#include <QPushButton>
-#include <QFileInfo>
using namespace Core;
using namespace Core::Internal;
@@ -41,7 +42,7 @@ OpenWithDialog::OpenWithDialog(const QString &fileName, QWidget *parent)
{
setupUi(this);
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);
connect(buttonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked()),
diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp
index eab09cd7a0..5454e02031 100644
--- a/src/plugins/coreplugin/editormanager/editormanager.cpp
+++ b/src/plugins/coreplugin/editormanager/editormanager.cpp
@@ -1612,7 +1612,7 @@ void EditorManagerPrivate::copyFileNameFromContextMenu()
{
if (!d->m_contextMenuEntry)
return;
- QApplication::clipboard()->setText(QFileInfo(d->m_contextMenuEntry->fileName()).fileName());
+ QApplication::clipboard()->setText(FileName::fromString(d->m_contextMenuEntry->fileName()).fileName());
}
void EditorManagerPrivate::saveDocumentFromContextMenu()
diff --git a/src/plugins/coreplugin/idocument.cpp b/src/plugins/coreplugin/idocument.cpp
index 9c2c470ad5..ab8a44690e 100644
--- a/src/plugins/coreplugin/idocument.cpp
+++ b/src/plugins/coreplugin/idocument.cpp
@@ -32,6 +32,7 @@
#include "infobar.h"
+#include <utils/fileutils.h>
#include <utils/qtcassert.h>
#include <QFile>
@@ -263,7 +264,7 @@ QString IDocument::displayName() const
{
if (!d->displayName.isEmpty())
return d->displayName;
- return d->filePath.toFileInfo().fileName();
+ return d->filePath.fileName();
}
/*!
diff --git a/src/plugins/coreplugin/locator/filesystemfilter.cpp b/src/plugins/coreplugin/locator/filesystemfilter.cpp
index d4aff295e0..06e8d2ce0c 100644
--- a/src/plugins/coreplugin/locator/filesystemfilter.cpp
+++ b/src/plugins/coreplugin/locator/filesystemfilter.cpp
@@ -119,7 +119,7 @@ QList<LocatorFilterEntry> FileSystemFilter::matchesFor(QFutureInterface<LocatorF
// file names can match with +linenumber or :linenumber
name = entry;
const QString lineNoSuffix = EditorManager::splitLineNumber(&name);
- name = QFileInfo(name).fileName();
+ name = Utils::FileName::fromString(name).fileName();
foreach (const QString &file, files) {
if (future.isCanceled())
break;
diff --git a/src/plugins/coreplugin/toolsettings.cpp b/src/plugins/coreplugin/toolsettings.cpp
index ba6afee6a2..1de6c19cd6 100644
--- a/src/plugins/coreplugin/toolsettings.cpp
+++ b/src/plugins/coreplugin/toolsettings.cpp
@@ -149,7 +149,7 @@ void ToolSettings::apply()
if (tool->preset() && (*tool) != (*(tool->preset()))) {
// check if we need to choose a new file name
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);
// TODO error handling if newFilePath.isEmpty() (i.e. failed to find a unused name)
tool->setFileName(newFilePath);
diff --git a/src/plugins/cpaster/frontend/argumentscollector.cpp b/src/plugins/cpaster/frontend/argumentscollector.cpp
index 10946a4216..ed9f418812 100644
--- a/src/plugins/cpaster/frontend/argumentscollector.cpp
+++ b/src/plugins/cpaster/frontend/argumentscollector.cpp
@@ -30,7 +30,8 @@
#include "argumentscollector.h"
-#include <QFileInfo>
+#include <utils/fileutils.h>
+
#include <QCoreApplication>
static QString pasteRequestString() { return QLatin1String("paste"); }
@@ -72,7 +73,7 @@ bool ArgumentsCollector::collect(const QStringList &args)
QString ArgumentsCollector::usageString() const
{
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")
.arg(pasteRequestString(), listProtocolsRequestString(), helpRequestString());
usage += QString::fromLatin1("Possible options for request \"%1\": \"%2 <file>\" (default: stdin), "
diff --git a/src/plugins/cppeditor/cppelementevaluator.cpp b/src/plugins/cppeditor/cppelementevaluator.cpp
index 55c3772262..02502aad6b 100644
--- a/src/plugins/cppeditor/cppelementevaluator.cpp
+++ b/src/plugins/cppeditor/cppelementevaluator.cpp
@@ -38,7 +38,6 @@
#include <cplusplus/TypeOfExpression.h>
#include <QDir>
-#include <QFileInfo>
#include <QSet>
#include <QQueue>
@@ -258,7 +257,7 @@ Unknown::Unknown(const QString &type) : type(type)
CppInclude::CppInclude(const Document::Include &includeFile) :
path(QDir::toNativeSeparators(includeFile.resolvedFileName())),
- fileName(QFileInfo(includeFile.resolvedFileName()).fileName())
+ fileName(Utils::FileName::fromString(includeFile.resolvedFileName()).fileName())
{
helpCategory = TextEditor::HelpItem::Brief;
helpIdCandidates = QStringList(fileName);
diff --git a/src/plugins/cppeditor/cpppreprocessordialog.cpp b/src/plugins/cppeditor/cpppreprocessordialog.cpp
index 47f26a10de..55777263b6 100644
--- a/src/plugins/cppeditor/cpppreprocessordialog.cpp
+++ b/src/plugins/cppeditor/cpppreprocessordialog.cpp
@@ -53,7 +53,7 @@ CppPreProcessorDialog::CppPreProcessorDialog(QWidget *parent, const QString &fil
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
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);
CppSnippetProvider().decorateEditor(m_ui->editWidget);
diff --git a/src/plugins/cppeditor/cppquickfixes.cpp b/src/plugins/cppeditor/cppquickfixes.cpp
index f0fc46e9f1..77d0f308cc 100644
--- a/src/plugins/cppeditor/cppquickfixes.cpp
+++ b/src/plugins/cppeditor/cppquickfixes.cpp
@@ -1917,7 +1917,7 @@ void AddIncludeForUndefinedIdentifier::match(const CppQuickFixInterface &interfa
header.toString(),
headerPaths);
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);
int priority = 0;
diff --git a/src/plugins/cpptools/cppfilesettingspage.cpp b/src/plugins/cpptools/cppfilesettingspage.cpp
index 16cb13341c..c37e91bda2 100644
--- a/src/plugins/cpptools/cppfilesettingspage.cpp
+++ b/src/plugins/cpptools/cppfilesettingspage.cpp
@@ -40,11 +40,11 @@
#include <cppeditor/cppeditorconstants.h>
#include <utils/environment.h>
+#include <utils/fileutils.h>
#include <QSettings>
#include <QDebug>
#include <QFile>
-#include <QFileInfo>
#include <QCoreApplication>
#include <QDate>
#include <QLocale>
@@ -157,7 +157,7 @@ static bool keyWordReplacement(const QString &keyWord,
return true;
}
if (keyWord == QLatin1String("%FILENAME%")) {
- *value = QFileInfo(file).fileName();
+ *value = Utils::FileName::fromString(file).fileName();
return true;
}
if (keyWord == QLatin1String("%DATE%")) {
diff --git a/src/plugins/cpptools/cppmodelmanager_test.cpp b/src/plugins/cpptools/cppmodelmanager_test.cpp
index ba45e0405b..1e14de0ecf 100644
--- a/src/plugins/cpptools/cppmodelmanager_test.cpp
+++ b/src/plugins/cpptools/cppmodelmanager_test.cpp
@@ -45,7 +45,6 @@
#include <utils/hostosinfo.h>
#include <QDebug>
-#include <QFileInfo>
#include <QtTest>
using namespace CppTools;
@@ -653,7 +652,7 @@ void CppToolsPlugin::test_modelmanager_extraeditorsupport_uiFiles()
QHashIterator<Utils::FileName, QPair<QByteArray, unsigned> > it = workingCopy.iterator();
while (it.hasNext()) {
it.next();
- fileNamesInWorkinCopy << QFileInfo(it.key().toString()).fileName();
+ fileNamesInWorkinCopy << Utils::FileName::fromString(it.key().toString()).fileName();
}
fileNamesInWorkinCopy.sort();
const QString expectedUiHeaderFileName = _("ui_mainwindow.h");
@@ -671,8 +670,8 @@ void CppToolsPlugin::test_modelmanager_extraeditorsupport_uiFiles()
QVERIFY(document);
const QStringList includedFiles = document->includedFiles();
QCOMPARE(includedFiles.size(), 2);
- QCOMPARE(QFileInfo(includedFiles.at(0)).fileName(), _("mainwindow.h"));
- QCOMPARE(QFileInfo(includedFiles.at(1)).fileName(), _("ui_mainwindow.h"));
+ QCOMPARE(Utils::FileName::fromString(includedFiles.at(0)).fileName(), _("mainwindow.h"));
+ QCOMPARE(Utils::FileName::fromString(includedFiles.at(1)).fileName(), _("ui_mainwindow.h"));
}
/// QTCREATORBUG-9828: Locator shows symbols of closed files
diff --git a/src/plugins/debugger/breakhandler.cpp b/src/plugins/debugger/breakhandler.cpp
index 912bd090fb..f4d0188f26 100644
--- a/src/plugins/debugger/breakhandler.cpp
+++ b/src/plugins/debugger/breakhandler.cpp
@@ -620,7 +620,7 @@ QVariant BreakpointItem::data(int column, int role) const
if (str.isEmpty() && !m_params.fileName.isEmpty())
str = m_params.fileName;
if (str.isEmpty()) {
- QString s = QFileInfo(str).fileName();
+ QString s = Utils::FileName::fromString(str).fileName();
if (!s.isEmpty())
str = s;
}
diff --git a/src/plugins/debugger/cdb/cdbparsehelpers.cpp b/src/plugins/debugger/cdb/cdbparsehelpers.cpp
index 0e01d80c3b..dff2848603 100644
--- a/src/plugins/debugger/cdb/cdbparsehelpers.cpp
+++ b/src/plugins/debugger/cdb/cdbparsehelpers.cpp
@@ -37,6 +37,7 @@
#include <debugger/shared/hostutils.h>
#include <debugger/threaddata.h>
+#include <utils/fileutils.h>
#include <utils/qtcassert.h>
#include <QDir>
@@ -87,7 +88,7 @@ static inline QString cdbBreakPointFileName(const BreakpointParameters &bp,
if (bp.fileName.isEmpty())
return bp.fileName;
if (bp.pathUsage == BreakpointUseShortPath)
- return QFileInfo(bp.fileName).fileName();
+ return Utils::FileName::fromString(bp.fileName).fileName();
return cdbSourcePathMapping(QDir::toNativeSeparators(bp.fileName), sourcePathMapping, SourceToDebugger);
}
diff --git a/src/plugins/debugger/debuggerdialogs.cpp b/src/plugins/debugger/debuggerdialogs.cpp
index 999045522d..c18478b308 100644
--- a/src/plugins/debugger/debuggerdialogs.cpp
+++ b/src/plugins/debugger/debuggerdialogs.cpp
@@ -181,7 +181,7 @@ QString StartApplicationParameters::displayName() const
{
const int maxLength = 60;
- QString name = QFileInfo(localExecutable).fileName() + QLatin1Char(' ') + processArgs;
+ QString name = FileName::fromString(localExecutable).fileName() + QLatin1Char(' ') + processArgs;
if (name.size() > 60) {
int index = name.lastIndexOf(QLatin1Char(' '), maxLength);
if (index == -1)
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp
index 83d8d7440c..2e7377d17d 100644
--- a/src/plugins/debugger/debuggerplugin.cpp
+++ b/src/plugins/debugger/debuggerplugin.cpp
@@ -634,7 +634,7 @@ public:
message = tr("0x%1 hit").arg(data.address, 0, 16);
} else {
//: Message tracepoint: %1 file, %2 line %3 function hit.
- message = tr("%1:%2 %3() hit").arg(QFileInfo(data.fileName).fileName()).
+ message = tr("%1:%2 %3() hit").arg(FileName::fromString(data.fileName).fileName()).
arg(data.lineNumber).
arg(cppFunctionAt(data.fileName, data.lineNumber));
}
diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp
index f1f3ec8168..54c901b6ae 100644
--- a/src/plugins/debugger/gdb/gdbengine.cpp
+++ b/src/plugins/debugger/gdb/gdbengine.cpp
@@ -1860,7 +1860,7 @@ QString GdbEngine::cleanupFullName(const QString &fileName)
}
cleanFilePath.clear();
- const QString base = QFileInfo(fileName).fileName();
+ const QString base = FileName::fromString(fileName).fileName();
QMap<QString, QString>::const_iterator jt = m_baseNameToFullName.find(base);
while (jt != m_baseNameToFullName.end() && jt.key() == base) {
@@ -2438,7 +2438,7 @@ QString GdbEngine::breakLocation(const QString &file) const
{
QString where = m_fullToShortName.value(file);
if (where.isEmpty())
- return QFileInfo(file).fileName();
+ return FileName::fromString(file).fileName();
return where;
}
diff --git a/src/plugins/debugger/qml/qmlinspectoragent.cpp b/src/plugins/debugger/qml/qmlinspectoragent.cpp
index 7d7681661d..b3945ffd3b 100644
--- a/src/plugins/debugger/qml/qmlinspectoragent.cpp
+++ b/src/plugins/debugger/qml/qmlinspectoragent.cpp
@@ -37,11 +37,11 @@
#include <debugger/watchhandler.h>
#include <qmldebug/qmldebugconstants.h>
+#include <utils/fileutils.h>
#include <utils/qtcassert.h>
#include <utils/savedaction.h>
#include <QElapsedTimer>
-#include <QFileInfo>
#include <QLoggingCategory>
using namespace QmlDebug;
@@ -583,7 +583,7 @@ void QmlInspectorAgent::fetchContextObjectsForLocation(const QString &file,
log(LogSend, QString::fromLatin1("FETCH_OBJECTS_FOR_LOCATION %1:%2:%3").arg(file)
.arg(QString::number(lineNumber)).arg(QString::number(columnNumber)));
- quint32 queryId = m_engineClient->queryObjectsForLocation(QFileInfo(file).fileName(),
+ quint32 queryId = m_engineClient->queryObjectsForLocation(Utils::FileName::fromString(file).fileName(),
lineNumber, columnNumber);
qCDebug(qmlInspectorLog) << __FUNCTION__ << '(' << file << ':' << lineNumber
<< ':' << columnNumber << ')' << " - query id" << queryId;
diff --git a/src/plugins/debugger/qml/qmlv8debuggerclient.cpp b/src/plugins/debugger/qml/qmlv8debuggerclient.cpp
index 5823b1c51d..08a512dc16 100644
--- a/src/plugins/debugger/qml/qmlv8debuggerclient.cpp
+++ b/src/plugins/debugger/qml/qmlv8debuggerclient.cpp
@@ -471,7 +471,7 @@ void QmlV8DebuggerClientPrivate::setBreakpoint(const QString type, const QString
args.setProperty(_(TYPE), QScriptValue(type));
if (type == _(SCRIPTREGEXP))
args.setProperty(_(TARGET),
- QScriptValue(QFileInfo(target).fileName()));
+ QScriptValue(Utils::FileName::fromString(target).fileName()));
else
args.setProperty(_(TARGET), QScriptValue(target));
diff --git a/src/plugins/debugger/sourceagent.cpp b/src/plugins/debugger/sourceagent.cpp
index 20429383fe..169c016399 100644
--- a/src/plugins/debugger/sourceagent.cpp
+++ b/src/plugins/debugger/sourceagent.cpp
@@ -40,10 +40,10 @@
#include <cppeditor/cppeditorconstants.h>
+#include <utils/fileutils.h>
#include <utils/qtcassert.h>
#include <QDebug>
-#include <QFileInfo>
#include <QTextBlock>
#include <limits.h>
@@ -107,7 +107,7 @@ void SourceAgent::setContent(const QString &filePath, const QString &content)
if (!d->editor) {
QString titlePattern = d->producer + QLatin1String(": ")
- + QFileInfo(filePath).fileName();
+ + Utils::FileName::fromString(filePath).fileName();
d->editor = qobject_cast<BaseTextEditor *>(
EditorManager::openEditorWithContents(
CppEditor::Constants::CPPEDITOR_ID,
diff --git a/src/plugins/debugger/stackhandler.cpp b/src/plugins/debugger/stackhandler.cpp
index eeb3ad948c..b408496b5f 100644
--- a/src/plugins/debugger/stackhandler.cpp
+++ b/src/plugins/debugger/stackhandler.cpp
@@ -34,11 +34,11 @@
#include "debuggercore.h"
#include "simplifytype.h"
+#include <utils/fileutils.h>
#include <utils/qtcassert.h>
#include <utils/savedaction.h>
#include <QDebug>
-#include <QFileInfo>
namespace Debugger {
namespace Internal {
@@ -111,7 +111,7 @@ QVariant StackHandler::data(const QModelIndex &index, int role) const
case StackFunctionNameColumn:
return simplifyType(frame.function);
case StackFileNameColumn:
- return frame.file.isEmpty() ? frame.from : QFileInfo(frame.file).fileName();
+ return frame.file.isEmpty() ? frame.from : Utils::FileName::fromString(frame.file).fileName();
case StackLineNumberColumn:
return frame.line > 0 ? QVariant(frame.line) : QVariant();
case StackAddressColumn:
diff --git a/src/plugins/diffeditor/diffeditor.cpp b/src/plugins/diffeditor/diffeditor.cpp
index bb97af7581..7132c91364 100644
--- a/src/plugins/diffeditor/diffeditor.cpp
+++ b/src/plugins/diffeditor/diffeditor.cpp
@@ -44,6 +44,8 @@
#include <texteditor/displaysettings.h>
#include <texteditor/marginsettings.h>
+#include <utils/fileutils.h>
+
#include <QStackedWidget>
#include <QToolButton>
#include <QSpinBox>
@@ -52,7 +54,6 @@
#include <QHBoxLayout>
#include <QToolBar>
#include <QComboBox>
-#include <QFileInfo>
#include <QDir>
#include <QTextCodec>
#include <QTextBlock>
@@ -421,8 +422,8 @@ void DiffEditor::slotDiffFilesChanged(const QList<FileData> &diffFileList,
for (int i = 0; i < count; i++) {
const DiffFileInfo leftEntry = diffFileList.at(i).leftFileInfo;
const DiffFileInfo rightEntry = diffFileList.at(i).rightFileInfo;
- const QString leftShortFileName = QFileInfo(leftEntry.fileName).fileName();
- const QString rightShortFileName = QFileInfo(rightEntry.fileName).fileName();
+ const QString leftShortFileName = Utils::FileName::fromString(leftEntry.fileName).fileName();
+ const QString rightShortFileName = Utils::FileName::fromString(rightEntry.fileName).fileName();
QString itemText;
QString itemToolTip;
if (leftEntry.fileName == rightEntry.fileName) {
diff --git a/src/plugins/git/gerrit/gerritplugin.cpp b/src/plugins/git/gerrit/gerritplugin.cpp
index e74b888054..acb346c412 100644
--- a/src/plugins/git/gerrit/gerritplugin.cpp
+++ b/src/plugins/git/gerrit/gerritplugin.cpp
@@ -536,7 +536,7 @@ QString GerritPlugin::findLocalRepository(QString project, const QString &branch
branchRegexp.reset(); // Oops.
}
foreach (const QString &repository, gitRepositories) {
- const QString fileName = QFileInfo(repository).fileName();
+ const QString fileName = Utils::FileName::fromString(repository).fileName();
if ((!branchRegexp.isNull() && branchRegexp->exactMatch(fileName))
|| fileName == project) {
// Perform a check on the branch.
diff --git a/src/plugins/ios/iosrunconfiguration.cpp b/src/plugins/ios/iosrunconfiguration.cpp
index dff575cd99..25d8a40167 100644
--- a/src/plugins/ios/iosrunconfiguration.cpp
+++ b/src/plugins/ios/iosrunconfiguration.cpp
@@ -46,6 +46,8 @@
#include <qtsupport/qtoutputformatter.h>
#include <qtsupport/qtkitinformation.h>
+#include <utils/fileutils.h>
+
#include <QList>
#include <QStandardItemModel>
@@ -301,7 +303,7 @@ QString IosRunConfiguration::disabledReason() const
{
if (m_parseInProgress)
return tr("The .pro file \"%1\" is currently being parsed.")
- .arg(QFileInfo(m_profilePath).fileName());
+ .arg(FileName::fromString(m_profilePath).fileName());
if (!m_parseSuccess)
return static_cast<QmakeProject *>(target()->project())
->disabledReasonForRunConfiguration(m_profilePath);
diff --git a/src/plugins/projectexplorer/abstractprocessstep.cpp b/src/plugins/projectexplorer/abstractprocessstep.cpp
index 5689471d9f..01c19e9198 100644
--- a/src/plugins/projectexplorer/abstractprocessstep.cpp
+++ b/src/plugins/projectexplorer/abstractprocessstep.cpp
@@ -415,7 +415,7 @@ void AbstractProcessStep::taskAdded(const Task &task)
// 3. give up.
QList<QFileInfo> possibleFiles;
- QString fileName = QFileInfo(filePath).fileName();
+ QString fileName = Utils::FileName::fromString(filePath).fileName();
foreach (const QString &file, project()->files(Project::AllFiles)) {
QFileInfo candidate(file);
if (candidate.fileName() == fileName)
diff --git a/src/plugins/projectexplorer/allprojectsfind.cpp b/src/plugins/projectexplorer/allprojectsfind.cpp
index 991062b534..0f5720b420 100644
--- a/src/plugins/projectexplorer/allprojectsfind.cpp
+++ b/src/plugins/projectexplorer/allprojectsfind.cpp
@@ -93,7 +93,7 @@ Utils::FileIterator *AllProjectsFind::filesForProjects(const QStringList &nameFi
foreach (const QString &file, projectFiles) {
if (Utils::anyOf(filterRegs,
[&file](QRegExp reg) {
- return (reg.exactMatch(file) || reg.exactMatch(QFileInfo(file).fileName()));
+ return (reg.exactMatch(file) || reg.exactMatch(Utils::FileName::fromString(file).fileName()));
})) {
filteredFiles.append(file);
}
diff --git a/src/plugins/projectexplorer/deployablefile.cpp b/src/plugins/projectexplorer/deployablefile.cpp
index d83ace4ab2..f9f893952d 100644
--- a/src/plugins/projectexplorer/deployablefile.cpp
+++ b/src/plugins/projectexplorer/deployablefile.cpp
@@ -30,7 +30,8 @@
#include "deployablefile.h"
-#include <QFileInfo>
+#include <utils/fileutils.h>
+
#include <QHash>
using namespace Utils;
@@ -55,7 +56,7 @@ DeployableFile::DeployableFile(const FileName &localFilePath, const QString &rem
QString DeployableFile::remoteFilePath() const
{
return m_remoteDir.isEmpty()
- ? QString() : m_remoteDir + QLatin1Char('/') + m_localFilePath.toFileInfo().fileName();
+ ? QString() : m_remoteDir + QLatin1Char('/') + m_localFilePath.fileName();
}
bool DeployableFile::isValid() const
diff --git a/src/plugins/projectexplorer/processparameters.cpp b/src/plugins/projectexplorer/processparameters.cpp
index 20ff0f4d28..60def0d725 100644
--- a/src/plugins/projectexplorer/processparameters.cpp
+++ b/src/plugins/projectexplorer/processparameters.cpp
@@ -30,10 +30,10 @@
#include "processparameters.h"
+#include <utils/fileutils.h>
#include <utils/macroexpander.h>
#include <utils/qtcprocess.h>
-#include <QFileInfo>
#include <QDir>
/*!
@@ -163,7 +163,7 @@ QString ProcessParameters::prettyCommand() const
QString cmd = m_command;
if (m_macroExpander)
cmd = m_macroExpander->expand(cmd);
- return QFileInfo(cmd).fileName();
+ return Utils::FileName::fromString(cmd).fileName();
}
QString ProcessParameters::prettyArguments() const
diff --git a/src/plugins/projectexplorer/projectmodels.cpp b/src/plugins/projectexplorer/projectmodels.cpp
index 0344d30172..fbc382a2c2 100644
--- a/src/plugins/projectexplorer/projectmodels.cpp
+++ b/src/plugins/projectexplorer/projectmodels.cpp
@@ -63,8 +63,8 @@ bool sortNodes(Node *n1, Node *n2)
FileNode *file2 = dynamic_cast<FileNode*>(n2);
if (file1 && file1->fileType() == ProjectFileType) {
if (file2 && file2->fileType() == ProjectFileType) {
- const QString fileName1 = QFileInfo(file1->path()).fileName();
- const QString fileName2 = QFileInfo(file2->path()).fileName();
+ const QString fileName1 = Utils::FileName::fromString(file1->path()).fileName();
+ const QString fileName2 = Utils::FileName::fromString(file2->path()).fileName();
int result = caseFriendlyCompare(fileName1, fileName2);
if (result != 0)
@@ -149,8 +149,8 @@ bool sortNodes(Node *n1, Node *n2)
const QString filePath1 = n1->path();
const QString filePath2 = n2->path();
- const QString fileName1 = QFileInfo(filePath1).fileName();
- const QString fileName2 = QFileInfo(filePath2).fileName();
+ const QString fileName1 = Utils::FileName::fromString(filePath1).fileName();
+ const QString fileName2 = Utils::FileName::fromString(filePath2).fileName();
result = caseFriendlyCompare(fileName1, fileName2);
if (result != 0) {
@@ -288,7 +288,7 @@ QVariant FlatModel::data(const QModelIndex &index, int role) const
break;
}
case Qt::EditRole: {
- result = QFileInfo(node->path()).fileName();
+ result = Utils::FileName::fromString(node->path()).fileName();
break;
}
case Qt::ToolTipRole: {
diff --git a/src/plugins/projectexplorer/projectnodes.cpp b/src/plugins/projectexplorer/projectnodes.cpp
index 3ae9dec488..5fc890c964 100644
--- a/src/plugins/projectexplorer/projectnodes.cpp
+++ b/src/plugins/projectexplorer/projectnodes.cpp
@@ -40,6 +40,7 @@
#include <coreplugin/iversioncontrol.h>
#include <coreplugin/vcsmanager.h>
#include <utils/algorithm.h>
+#include <utils/fileutils.h>
#include <utils/qtcassert.h>
#include <QFileInfo>
@@ -168,7 +169,7 @@ int Node::line() const
QString Node::displayName() const
{
- return QFileInfo(path()).fileName();
+ return Utils::FileName::fromString(path()).fileName();
}
QString Node::tooltip() const
@@ -348,7 +349,7 @@ bool FolderNode::renameFile(const QString &filePath, const QString &newFilePath)
FolderNode::AddNewInformation FolderNode::addNewInformation(const QStringList &files, Node *context) const
{
Q_UNUSED(files);
- return AddNewInformation(QFileInfo(path()).fileName(), context == this ? 120 : 100);
+ return AddNewInformation(Utils::FileName::fromString(path()).fileName(), context == this ? 120 : 100);
}
/*!
@@ -549,7 +550,7 @@ ProjectNode::ProjectNode(const QString &projectFilePath)
setNodeType(ProjectNodeType);
// project node "manages" itself
setProjectNode(this);
- setDisplayName(QFileInfo(projectFilePath).fileName());
+ setDisplayName(Utils::FileName::fromString(projectFilePath).fileName());
}
QString ProjectNode::vcsTopic() const
diff --git a/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp b/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp
index 9e49e809e2..ddff34bae4 100644
--- a/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp
+++ b/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp
@@ -58,6 +58,8 @@
#include <projectexplorer/session.h>
#include <projectexplorer/target.h>
#include <qtsupport/qtsupportconstants.h>
+
+#include <utils/fileutils.h>
#include <utils/qtcassert.h>
#include <QAction>
@@ -286,7 +288,7 @@ void QbsProjectManagerPlugin::updateBuildActions()
&& !BuildManager::isBuilding(m_editorProject)
&& !m_editorProject->isParsing();
- fileName = QFileInfo(m_editorNode->path()).fileName();
+ fileName = Utils::FileName::fromString(m_editorNode->path()).fileName();
fileVisible = m_editorProject && m_editorNode && dynamic_cast<QbsBaseProjectNode *>(m_editorNode->projectNode());
QbsProductNode *productNode
diff --git a/src/plugins/qmakeandroidsupport/qmakeandroidrunconfiguration.cpp b/src/plugins/qmakeandroidsupport/qmakeandroidrunconfiguration.cpp
index 3c0bbac73f..7e7a9fa5ba 100644
--- a/src/plugins/qmakeandroidsupport/qmakeandroidrunconfiguration.cpp
+++ b/src/plugins/qmakeandroidsupport/qmakeandroidrunconfiguration.cpp
@@ -37,8 +37,11 @@
#include <qmakeprojectmanager/qmakeproject.h>
#include <qmakeprojectmanager/qmakenodes.h>
+#include <utils/fileutils.h>
#include <utils/qtcassert.h>
+#include <QFileInfo>
+
namespace {
QLatin1String PRO_FILE_KEY("QMakeProjectManager.QmakeAndroidRunConfiguration.ProFile");
}
@@ -120,7 +123,7 @@ QString QmakeAndroidRunConfiguration::disabledReason() const
{
if (m_parseInProgress)
return tr("The .pro file \"%1\" is currently being parsed.")
- .arg(QFileInfo(m_proFilePath).fileName());
+ .arg(Utils::FileName::fromString(m_proFilePath).fileName());
if (!m_parseSuccess)
return static_cast<QmakeProject *>(target()->project())->disabledReasonForRunConfiguration(m_proFilePath);
diff --git a/src/plugins/qmakeprojectmanager/customwidgetwizard/plugingenerator.cpp b/src/plugins/qmakeprojectmanager/customwidgetwizard/plugingenerator.cpp
index d4ad35b098..3858efd261 100644
--- a/src/plugins/qmakeprojectmanager/customwidgetwizard/plugingenerator.cpp
+++ b/src/plugins/qmakeprojectmanager/customwidgetwizard/plugingenerator.cpp
@@ -132,7 +132,7 @@ QList<Core::GeneratedFile> PluginGenerator::generatePlugin(const GenerationPara
QString iconResource;
if (!wo.iconFile.isEmpty()) {
iconResource = QLatin1String("QLatin1String(\":/");
- iconResource += QFileInfo(wo.iconFile).fileName();
+ iconResource += Utils::FileName::fromString(wo.iconFile).fileName();
iconResource += QLatin1String("\")");
}
sm.insert(QLatin1String("WIDGET_ICON"),iconResource);
diff --git a/src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.cpp b/src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.cpp
index 47245929f2..e1de836a9b 100644
--- a/src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.cpp
+++ b/src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.cpp
@@ -41,7 +41,9 @@
#include <qtsupport/qtkitinformation.h>
#include <qtsupport/qtoutputformatter.h>
#include <qtsupport/qtsupportconstants.h>
+
#include <utils/detailswidget.h>
+#include <utils/fileutils.h>
#include <utils/hostosinfo.h>
#include <utils/pathchooser.h>
#include <utils/persistentsettings.h>
@@ -121,7 +123,7 @@ QString DesktopQmakeRunConfiguration::disabledReason() const
{
if (m_parseInProgress)
return tr("The .pro file \"%1\" is currently being parsed.")
- .arg(QFileInfo(m_proFilePath).fileName());
+ .arg(FileName::fromString(m_proFilePath).fileName());
if (!m_parseSuccess)
return static_cast<QmakeProject *>(target()->project())->disabledReasonForRunConfiguration(m_proFilePath);
diff --git a/src/plugins/qmakeprojectmanager/profileeditor.cpp b/src/plugins/qmakeprojectmanager/profileeditor.cpp
index 07fb025649..1a9e28b4ad 100644
--- a/src/plugins/qmakeprojectmanager/profileeditor.cpp
+++ b/src/plugins/qmakeprojectmanager/profileeditor.cpp
@@ -190,7 +190,7 @@ QString ProFileDocument::defaultPath() const
QString ProFileDocument::suggestedFileName() const
{
- return filePath().toFileInfo().fileName();
+ return filePath().fileName();
}
//
diff --git a/src/plugins/qmakeprojectmanager/qmakenodes.cpp b/src/plugins/qmakeprojectmanager/qmakenodes.cpp
index 20584262b4..f36ca92564 100644
--- a/src/plugins/qmakeprojectmanager/qmakenodes.cpp
+++ b/src/plugins/qmakeprojectmanager/qmakenodes.cpp
@@ -1121,7 +1121,7 @@ bool QmakePriFileNode::renameFile(const QString &filePath, const QString &newFil
ProjectExplorer::FolderNode::AddNewInformation QmakePriFileNode::addNewInformation(const QStringList &files, Node *context) const
{
Q_UNUSED(files)
- return ProjectExplorer::FolderNode::AddNewInformation(QFileInfo(path()).fileName(), context && context->projectNode() == this ? 120 : 90);
+ return ProjectExplorer::FolderNode::AddNewInformation(FileName::fromString(path()).fileName(), context && context->projectNode() == this ? 120 : 90);
}
bool QmakePriFileNode::priFileWritable(const QString &path)
@@ -1623,7 +1623,7 @@ bool QmakeProFileNode::showInSimpleTree() const
ProjectExplorer::FolderNode::AddNewInformation QmakeProFileNode::addNewInformation(const QStringList &files, Node *context) const
{
Q_UNUSED(files)
- return AddNewInformation(QFileInfo(path()).fileName(), context && context->projectNode() == this ? 120 : 100);
+ return AddNewInformation(FileName::fromString(path()).fileName(), context && context->projectNode() == this ? 120 : 100);
}
bool QmakeProFileNode::showInSimpleTree(QmakeProjectType projectType) const
diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.cpp b/src/plugins/qmakeprojectmanager/qmakeproject.cpp
index 271d64a100..993c3cad3a 100644
--- a/src/plugins/qmakeprojectmanager/qmakeproject.cpp
+++ b/src/plugins/qmakeprojectmanager/qmakeproject.cpp
@@ -1428,17 +1428,17 @@ QString QmakeProject::disabledReasonForRunConfiguration(const QString &proFilePa
{
if (!QFileInfo::exists(proFilePath))
return tr("The .pro file \"%1\" does not exist.")
- .arg(QFileInfo(proFilePath).fileName());
+ .arg(FileName::fromString(proFilePath).fileName());
if (!m_rootProjectNode) // Shutting down
return QString();
if (!m_rootProjectNode->findProFileFor(proFilePath))
return tr("The .pro file \"%1\" is not part of the project.")
- .arg(QFileInfo(proFilePath).fileName());
+ .arg(FileName::fromString(proFilePath).fileName());
return tr("The .pro file \"%1\" could not be parsed.")
- .arg(QFileInfo(proFilePath).fileName());
+ .arg(FileName::fromString(proFilePath).fileName());
}
QString QmakeProject::buildNameFor(const Kit *k)
diff --git a/src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.cpp b/src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.cpp
index d164aeb564..06775554dd 100644
--- a/src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.cpp
+++ b/src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.cpp
@@ -345,7 +345,7 @@ void QmakeProjectManagerPlugin::updateContextActions(ProjectExplorer::Node *node
m_rebuildSubProjectAction->setParameter(subProjectName);
m_cleanSubProjectAction->setParameter(subProjectName);
m_buildSubProjectContextMenu->setParameter(subProjectName);
- m_buildFileAction->setParameter(buildFilePossible ? QFileInfo(fileNode->path()).fileName() : QString());
+ m_buildFileAction->setParameter(buildFilePossible ? Utils::FileName::fromString(fileNode->path()).fileName() : QString());
QmakeBuildConfiguration *buildConfiguration = (qmakeProject && qmakeProject->activeTarget()) ?
static_cast<QmakeBuildConfiguration *>(qmakeProject->activeTarget()->activeBuildConfiguration()) : 0;
@@ -395,7 +395,7 @@ void QmakeProjectManagerPlugin::updateBuildFileAction()
QString file = currentDocument->filePath().toString();
Node *node = SessionManager::nodeForFile(file);
Project *project = SessionManager::projectForFile(file);
- m_buildFileAction->setParameter(QFileInfo(file).fileName());
+ m_buildFileAction->setParameter(Utils::FileName::fromString(file).fileName());
visible = qobject_cast<QmakeProject *>(project)
&& node
&& dynamic_cast<QmakePriFileNode *>(node->projectNode());
diff --git a/src/plugins/qmakeprojectmanager/qmakestep.cpp b/src/plugins/qmakeprojectmanager/qmakestep.cpp
index bc43f4bf8a..5ddbe9b53c 100644
--- a/src/plugins/qmakeprojectmanager/qmakestep.cpp
+++ b/src/plugins/qmakeprojectmanager/qmakestep.cpp
@@ -129,7 +129,7 @@ QString QMakeStep::allArguments(bool shorted)
if (bc->subNodeBuild())
arguments << QDir::toNativeSeparators(bc->subNodeBuild()->path());
else if (shorted)
- arguments << project()->projectFilePath().toFileInfo().fileName();
+ arguments << project()->projectFilePath().fileName();
else
arguments << project()->projectFilePath().toUserOutput();
@@ -645,7 +645,7 @@ void QMakeStepConfigWidget::updateSummaryLabel()
// We don't want the full path to the .pro file
QString args = m_step->allArguments(true);
// And we only use the .pro filename not the full path
- QString program = qtVersion->qmakeCommand().toFileInfo().fileName();
+ QString program = qtVersion->qmakeCommand().fileName();
setSummaryText(tr("<b>qmake:</b> %1 %2").arg(program, args));
}
@@ -682,7 +682,7 @@ void QMakeStepConfigWidget::updateEffectiveQMakeCall()
QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitInformation::qtVersion(m_step->target()->kit());
QString program = tr("<No Qt version>");
if (qtVersion)
- program = qtVersion->qmakeCommand().toFileInfo().fileName();
+ program = qtVersion->qmakeCommand().fileName();
m_ui->qmakeArgumentsEdit->setPlainText(program + QLatin1Char(' ') + m_step->allArguments());
}
diff --git a/src/plugins/qmakeprojectmanager/wizards/consoleappwizard.cpp b/src/plugins/qmakeprojectmanager/wizards/consoleappwizard.cpp
index c47e26734e..6d39e93af5 100644
--- a/src/plugins/qmakeprojectmanager/wizards/consoleappwizard.cpp
+++ b/src/plugins/qmakeprojectmanager/wizards/consoleappwizard.cpp
@@ -36,8 +36,9 @@
#include <cpptools/abstracteditorsupport.h>
#include <qtsupport/qtsupportconstants.h>
+#include <utils/fileutils.h>
+
#include <QCoreApplication>
-#include <QFileInfo>
#include <QTextStream>
static const char mainCppC[] =
@@ -98,7 +99,7 @@ Core::GeneratedFiles
QTextStream proStr(&contents);
QtProjectParameters::writeProFileHeader(proStr);
params.writeProFile(proStr);
- proStr << "\n\nSOURCES += " << QFileInfo(sourceFileName).fileName() << '\n';
+ proStr << "\n\nSOURCES += " << Utils::FileName::fromString(sourceFileName).fileName() << '\n';
}
profile.setContents(contents);
return Core::GeneratedFiles() << source << profile;
diff --git a/src/plugins/qmakeprojectmanager/wizards/guiappwizard.cpp b/src/plugins/qmakeprojectmanager/wizards/guiappwizard.cpp
index fd07f4d8ab..c68f41aca3 100644
--- a/src/plugins/qmakeprojectmanager/wizards/guiappwizard.cpp
+++ b/src/plugins/qmakeprojectmanager/wizards/guiappwizard.cpp
@@ -44,7 +44,6 @@
#include <QCoreApplication>
#include <QDir>
#include <QTextStream>
-#include <QFileInfo>
#include <QSharedPointer>
static const char mainSourceFileC[] = "main";
@@ -195,11 +194,11 @@ Core::GeneratedFiles GuiAppWizard::generateFiles(const QWizard *w,
QTextStream proStr(&contents);
QtProjectParameters::writeProFileHeader(proStr);
projectParams.writeProFile(proStr);
- proStr << "\n\nSOURCES += " << QFileInfo(mainSourceFileName).fileName()
- << "\\\n " << QFileInfo(formSource.path()).fileName()
- << "\n\nHEADERS += " << QFileInfo(formHeader.path()).fileName();
+ proStr << "\n\nSOURCES += " << Utils::FileName::fromString(mainSourceFileName).fileName()
+ << "\\\n " << Utils::FileName::fromString(formSource.path()).fileName()
+ << "\n\nHEADERS += " << Utils::FileName::fromString(formHeader.path()).fileName();
if (params.designerForm)
- proStr << "\n\nFORMS += " << QFileInfo(form->path()).fileName();
+ proStr << "\n\nFORMS += " << Utils::FileName::fromString(form->path()).fileName();
if (params.isMobileApplication) {
proStr << "\n\nCONFIG += mobility"
<< "\nMOBILITY = "
diff --git a/src/plugins/qmakeprojectmanager/wizards/librarywizard.cpp b/src/plugins/qmakeprojectmanager/wizards/librarywizard.cpp
index 14f8bcfa2c..ef27b08769 100644
--- a/src/plugins/qmakeprojectmanager/wizards/librarywizard.cpp
+++ b/src/plugins/qmakeprojectmanager/wizards/librarywizard.cpp
@@ -35,7 +35,8 @@
#include <projectexplorer/projectexplorerconstants.h>
#include <qtsupport/qtsupportconstants.h>
-#include <QFileInfo>
+#include <utils/fileutils.h>
+
#include <QTextStream>
#include <QCoreApplication>
@@ -96,12 +97,12 @@ Core::GeneratedFiles LibraryWizard::generateFiles(const QWizard *w,
source.setAttributes(Core::GeneratedFile::OpenEditorAttribute);
const QString headerFileFullName = buildFileName(projectPath, params.headerFileName, headerSuffix());
- const QString headerFileName = QFileInfo(headerFileFullName).fileName();
+ const QString headerFileName = Utils::FileName::fromString(headerFileFullName).fileName();
QString pluginJsonFileFullName;
QString pluginJsonFileName;
if (projectParams.type == QtProjectParameters::Qt4Plugin) {
pluginJsonFileFullName = buildFileName(projectPath, projectParams.fileName, QLatin1String("json"));
- pluginJsonFileName = QFileInfo(pluginJsonFileFullName).fileName();
+ pluginJsonFileName = Utils::FileName::fromString(pluginJsonFileFullName).fileName();
}
Core::GeneratedFile header(headerFileFullName);
@@ -111,7 +112,7 @@ Core::GeneratedFiles LibraryWizard::generateFiles(const QWizard *w,
if (projectParams.type == QtProjectParameters::SharedLibrary) {
const QString globalHeaderName = buildFileName(projectPath, projectParams.fileName.toLower() + QLatin1String(sharedHeaderPostfixC), headerSuffix());
Core::GeneratedFile globalHeader(globalHeaderName);
- globalHeaderFileName = QFileInfo(globalHeader.path()).fileName();
+ globalHeaderFileName = Utils::FileName::fromString(globalHeader.path()).fileName();
globalHeader.setContents(CppTools::AbstractEditorSupport::licenseTemplate(globalHeaderFileName)
+ LibraryParameters::generateSharedHeader(globalHeaderFileName, projectParams.fileName, sharedLibExportMacro));
rc.push_back(globalHeader);
@@ -138,7 +139,7 @@ Core::GeneratedFiles LibraryWizard::generateFiles(const QWizard *w,
QTextStream proStr(&profileContents);
QtProjectParameters::writeProFileHeader(proStr);
projectParams.writeProFile(proStr);
- proStr << "\nSOURCES += " << QFileInfo(source.path()).fileName()
+ proStr << "\nSOURCES += " << Utils::FileName::fromString(source.path()).fileName()
<< "\n\nHEADERS += " << headerFileName;
if (!globalHeaderFileName.isEmpty())
proStr << "\\\n " << globalHeaderFileName << '\n';
diff --git a/src/plugins/qmakeprojectmanager/wizards/testwizard.cpp b/src/plugins/qmakeprojectmanager/wizards/testwizard.cpp
index ce43eddd00..e257f717e1 100644
--- a/src/plugins/qmakeprojectmanager/wizards/testwizard.cpp
+++ b/src/plugins/qmakeprojectmanager/wizards/testwizard.cpp
@@ -35,6 +35,7 @@
#include <projectexplorer/projectexplorerconstants.h>
#include <qtsupport/qtsupportconstants.h>
+#include <utils/fileutils.h>
#include <utils/qtcassert.h>
#include <QCoreApplication>
@@ -175,7 +176,7 @@ Core::GeneratedFiles TestWizard::generateFiles(const QWizard *w, QString *errorM
QTextStream proStr(&contents);
QtProjectParameters::writeProFileHeader(proStr);
projectParams.writeProFile(proStr);
- proStr << "\n\nSOURCES += " << QFileInfo(sourceFilePath).fileName() << '\n'
+ proStr << "\n\nSOURCES += " << Utils::FileName::fromString(sourceFilePath).fileName() << '\n'
<< "DEFINES += SRCDIR=\\\\\\\"$$PWD/\\\\\\\"\n";
}
profile.setContents(contents);
diff --git a/src/plugins/qmldesigner/components/pluginmanager/pluginpath.cpp b/src/plugins/qmldesigner/components/pluginmanager/pluginpath.cpp
index b4697348db..9b6e57499d 100644
--- a/src/plugins/qmldesigner/components/pluginmanager/pluginpath.cpp
+++ b/src/plugins/qmldesigner/components/pluginmanager/pluginpath.cpp
@@ -31,6 +31,8 @@
#include "pluginpath.h"
#include "pluginmanager.h"
+#include <utils/fileutils.h>
+
#include <iplugin.h>
#include <QLibrary>
#include <QPluginLoader>
@@ -173,7 +175,7 @@ QStandardItem *PluginPath::createModelItem()
QStandardItem *failedCategory = 0;
const auto end = m_plugins.end();
for (auto it = m_plugins.begin(); it != end; ++it) {
- QStandardItem *pluginItem = new QStandardItem(QFileInfo(it->path).fileName());
+ QStandardItem *pluginItem = new QStandardItem(Utils::FileName::fromString(it->path).fileName());
if (instance(*it)) {
pluginItem->appendRow(new QStandardItem(QString::fromUtf8(it->instanceGuard->metaObject()->className())));
pathItem->appendRow(pluginItem);
diff --git a/src/plugins/qmldesigner/designercore/pluginmanager/widgetpluginpath.cpp b/src/plugins/qmldesigner/designercore/pluginmanager/widgetpluginpath.cpp
index 6fe3d5e725..8a4769e172 100644
--- a/src/plugins/qmldesigner/designercore/pluginmanager/widgetpluginpath.cpp
+++ b/src/plugins/qmldesigner/designercore/pluginmanager/widgetpluginpath.cpp
@@ -30,6 +30,9 @@
#include "widgetpluginpath.h"
#include <iwidgetplugin.h>
+
+#include <utils/fileutils.h>
+
#include <QLibrary>
#include <QPluginLoader>
#include <QFileInfo>
@@ -192,7 +195,7 @@ QStandardItem *WidgetPluginPath::createModelItem()
QStandardItem *failedCategory = 0;
const auto end = m_plugins.end();
for (auto it = m_plugins.begin(); it != end; ++it) {
- QStandardItem *pluginItem = new QStandardItem(QFileInfo(it->path).fileName());
+ QStandardItem *pluginItem = new QStandardItem(Utils::FileName::fromString(it->path).fileName());
if (instance(*it)) {
pluginItem->appendRow(new QStandardItem(QString::fromUtf8(it->instanceGuard->metaObject()->className())));
pathItem->appendRow(pluginItem);
diff --git a/src/plugins/qmljstools/qmljslocatordata.cpp b/src/plugins/qmljstools/qmljslocatordata.cpp
index 5af4141b44..73362d175d 100644
--- a/src/plugins/qmljstools/qmljslocatordata.cpp
+++ b/src/plugins/qmljstools/qmljslocatordata.cpp
@@ -35,7 +35,6 @@
//#include <qmljs/qmljsinterpreter.h>
#include <qmljs/parser/qmljsast_p.h>
-#include <QFileInfo>
#include <QMutexLocker>
using namespace QmlJSTools::Internal;
@@ -75,7 +74,7 @@ public:
if (!doc->componentName().isEmpty())
m_documentContext = doc->componentName();
else
- m_documentContext = QFileInfo(doc->fileName()).fileName();
+ m_documentContext = Utils::FileName::fromString(doc->fileName()).fileName();
accept(doc->ast(), m_documentContext);
return m_entries;
}
diff --git a/src/plugins/qmlprojectmanager/fileformat/filefilteritems.cpp b/src/plugins/qmlprojectmanager/fileformat/filefilteritems.cpp
index 551ae8b625..84091b8b9b 100644
--- a/src/plugins/qmlprojectmanager/fileformat/filefilteritems.cpp
+++ b/src/plugins/qmlprojectmanager/fileformat/filefilteritems.cpp
@@ -31,6 +31,7 @@
#include "filefilteritems.h"
#include <utils/filesystemwatcher.h>
+#include <utils/fileutils.h>
#include <utils/qtcassert.h>
#include <QDebug>
@@ -179,7 +180,7 @@ bool FileFilterBaseItem::matchesFile(const QString &filePath) const
return true;
}
- const QString &fileName = QFileInfo(filePath).fileName();
+ const QString &fileName = Utils::FileName::fromString(filePath).fileName();
if (!fileMatches(fileName))
return false;
diff --git a/src/plugins/qnx/bardescriptordocument.cpp b/src/plugins/qnx/bardescriptordocument.cpp
index 263556eded..dd762bb08a 100644
--- a/src/plugins/qnx/bardescriptordocument.cpp
+++ b/src/plugins/qnx/bardescriptordocument.cpp
@@ -99,7 +99,7 @@ QString BarDescriptorDocument::defaultPath() const
QString BarDescriptorDocument::suggestedFileName() const
{
- return filePath().toFileInfo().fileName();
+ return filePath().fileName();
}
bool BarDescriptorDocument::shouldAutoSave() const
diff --git a/src/plugins/qnx/bardescriptoreditorassetswidget.cpp b/src/plugins/qnx/bardescriptoreditorassetswidget.cpp
index b66a58d65e..03945cad5b 100644
--- a/src/plugins/qnx/bardescriptoreditorassetswidget.cpp
+++ b/src/plugins/qnx/bardescriptoreditorassetswidget.cpp
@@ -101,7 +101,7 @@ void BarDescriptorEditorAssetsWidget::addAsset(const QString &fullPath)
BarDescriptorAsset asset;
asset.source = fullPath;
- asset.destination = QFileInfo(fullPath).fileName();
+ asset.destination = Utils::FileName::fromString(fullPath).fileName();
asset.entry = false;
addAsset(asset);
}
diff --git a/src/plugins/qnx/bardescriptoreditorentrypointwidget.cpp b/src/plugins/qnx/bardescriptoreditorentrypointwidget.cpp
index 58f2f20836..a95637b9ce 100644
--- a/src/plugins/qnx/bardescriptoreditorentrypointwidget.cpp
+++ b/src/plugins/qnx/bardescriptoreditorentrypointwidget.cpp
@@ -111,11 +111,11 @@ void BarDescriptorEditorEntryPointWidget::updateWidgetValue(BarDescriptorDocumen
void BarDescriptorEditorEntryPointWidget::emitChanged(BarDescriptorDocument::Tag tag)
{
if (tag == BarDescriptorDocument::icon) {
- emit changed(tag, QFileInfo(m_ui->iconFilePath->path()).fileName());
+ emit changed(tag, Utils::FileName::fromString(m_ui->iconFilePath->path()).fileName());
} else if (tag == BarDescriptorDocument::splashScreens) {
QStringList list;
foreach (const QString &splashScreen, m_splashScreenModel->stringList())
- list << QFileInfo(splashScreen).fileName();
+ list << Utils::FileName::fromString(splashScreen).fileName();
emit changed(tag, list);
} else {
diff --git a/src/plugins/qnx/qnxanalyzesupport.cpp b/src/plugins/qnx/qnxanalyzesupport.cpp
index 985329f1c5..c1f78ed28d 100644
--- a/src/plugins/qnx/qnxanalyzesupport.cpp
+++ b/src/plugins/qnx/qnxanalyzesupport.cpp
@@ -43,8 +43,6 @@
#include <utils/qtcassert.h>
#include <utils/qtcprocess.h>
-#include <QFileInfo>
-
using namespace ProjectExplorer;
using namespace Qnx;
@@ -72,7 +70,7 @@ QnxAnalyzeSupport::QnxAnalyzeSupport(QnxRunConfiguration *runConfig,
ProjectExplorer::IDevice::ConstPtr dev = ProjectExplorer::DeviceKitInformation::device(runConfig->target()->kit());
QnxDeviceConfiguration::ConstPtr qnxDevice = dev.dynamicCast<const QnxDeviceConfiguration>();
- const QString applicationId = QFileInfo(runConfig->remoteExecutableFilePath()).fileName();
+ const QString applicationId = Utils::FileName::fromString(runConfig->remoteExecutableFilePath()).fileName();
m_slog2Info = new Slog2InfoRunner(applicationId, qnxDevice, this);
connect(m_slog2Info, SIGNAL(output(QString,Utils::OutputFormat)), this, SLOT(showMessage(QString,Utils::OutputFormat)));
connect(runner, SIGNAL(remoteProcessStarted()), m_slog2Info, SLOT(start()));
diff --git a/src/plugins/qnx/qnxdebugsupport.cpp b/src/plugins/qnx/qnxdebugsupport.cpp
index 3fa9d1294f..b969b2084b 100644
--- a/src/plugins/qnx/qnxdebugsupport.cpp
+++ b/src/plugins/qnx/qnxdebugsupport.cpp
@@ -46,8 +46,6 @@
#include <utils/qtcassert.h>
#include <utils/qtcprocess.h>
-#include <QFileInfo>
-
using namespace ProjectExplorer;
using namespace RemoteLinux;
@@ -73,7 +71,7 @@ QnxDebugSupport::QnxDebugSupport(QnxRunConfiguration *runConfig, Debugger::Debug
connect(m_runControl, &Debugger::DebuggerRunControl::requestRemoteSetup,
this, &QnxDebugSupport::handleAdapterSetupRequested);
- const QString applicationId = QFileInfo(runConfig->remoteExecutableFilePath()).fileName();
+ const QString applicationId = Utils::FileName::fromString(runConfig->remoteExecutableFilePath()).fileName();
ProjectExplorer::IDevice::ConstPtr dev = ProjectExplorer::DeviceKitInformation::device(runConfig->target()->kit());
QnxDeviceConfiguration::ConstPtr qnxDevice = dev.dynamicCast<const QnxDeviceConfiguration>();
diff --git a/src/plugins/qnx/qnxruncontrol.cpp b/src/plugins/qnx/qnxruncontrol.cpp
index e748530f1b..1fa57c5ea6 100644
--- a/src/plugins/qnx/qnxruncontrol.cpp
+++ b/src/plugins/qnx/qnxruncontrol.cpp
@@ -39,8 +39,6 @@
#include <projectexplorer/runconfiguration.h>
#include <projectexplorer/target.h>
-#include <QFileInfo>
-
using namespace Qnx;
using namespace Qnx::Internal;
using namespace RemoteLinux;
@@ -55,7 +53,7 @@ QnxRunControl::QnxRunControl(ProjectExplorer::RunConfiguration *runConfig)
QnxRunConfiguration *qnxRunConfig = qobject_cast<QnxRunConfiguration *>(runConfig);
QTC_CHECK(qnxRunConfig);
- const QString applicationId = QFileInfo(qnxRunConfig->remoteExecutableFilePath()).fileName();
+ const QString applicationId = Utils::FileName::fromString(qnxRunConfig->remoteExecutableFilePath()).fileName();
m_slog2Info = new Slog2InfoRunner(applicationId, qnxDevice, this);
connect(m_slog2Info, SIGNAL(output(QString,Utils::OutputFormat)), this, SLOT(appendMessage(QString,Utils::OutputFormat)));
connect(this, SIGNAL(started()), m_slog2Info, SLOT(start()));
diff --git a/src/plugins/qtsupport/screenshotcropper.cpp b/src/plugins/qtsupport/screenshotcropper.cpp
index 9628261cf6..9ad7eee685 100644
--- a/src/plugins/qtsupport/screenshotcropper.cpp
+++ b/src/plugins/qtsupport/screenshotcropper.cpp
@@ -30,12 +30,13 @@
#include "screenshotcropper.h"
+#include <utils/fileutils.h>
+
#include <coreplugin/icore.h>
#include <QXmlStreamReader>
#include <QXmlStreamWriter>
#include <QDebug>
#include <QFile>
-#include <QFileInfo>
namespace QtSupport {
namespace Internal {
@@ -57,7 +58,7 @@ Q_GLOBAL_STATIC(AreasOfInterest, welcomeScreenAreas)
static inline QString fileNameForPath(const QString &path)
{
- return QFileInfo(path).fileName();
+ return Utils::FileName::fromString(path).fileName();
}
static QRect cropRectForAreaOfInterest(const QSize &imageSize, const QSize &cropSize, const QRect &areaOfInterest)
diff --git a/src/plugins/remotelinux/abstractuploadandinstallpackageservice.cpp b/src/plugins/remotelinux/abstractuploadandinstallpackageservice.cpp
index fd5add8920..54e5a3bb89 100644
--- a/src/plugins/remotelinux/abstractuploadandinstallpackageservice.cpp
+++ b/src/plugins/remotelinux/abstractuploadandinstallpackageservice.cpp
@@ -36,7 +36,6 @@
#include <projectexplorer/deployablefile.h>
#include <utils/qtcassert.h>
-#include <QFileInfo>
#include <QString>
using namespace ProjectExplorer;
@@ -115,7 +114,7 @@ void AbstractUploadAndInstallPackageService::doDeploy()
QTC_ASSERT(d->state == Inactive, return);
d->state = Uploading;
- const QString fileName = QFileInfo(packageFilePath()).fileName();
+ const QString fileName = Utils::FileName::fromString(packageFilePath()).fileName();
const QString remoteFilePath = uploadDir() + QLatin1Char('/') + fileName;
connect(d->uploader, SIGNAL(progress(QString)), SIGNAL(progressMessage(QString)));
connect(d->uploader, SIGNAL(uploadFinished(QString)), SLOT(handleUploadFinished(QString)));
@@ -151,7 +150,7 @@ void AbstractUploadAndInstallPackageService::handleUploadFinished(const QString
emit progressMessage(tr("Successfully uploaded package file."));
const QString remoteFilePath = uploadDir() + QLatin1Char('/')
- + QFileInfo(packageFilePath()).fileName();
+ + Utils::FileName::fromString(packageFilePath()).fileName();
d->state = Installing;
emit progressMessage(tr("Installing package to device..."));
connect(packageInstaller(), SIGNAL(stdoutData(QString)), SIGNAL(stdOutData(QString)));
diff --git a/src/plugins/resourceeditor/resourcenode.cpp b/src/plugins/resourceeditor/resourcenode.cpp
index b33a5cd0b7..0ddc6ff0bc 100644
--- a/src/plugins/resourceeditor/resourcenode.cpp
+++ b/src/plugins/resourceeditor/resourcenode.cpp
@@ -256,7 +256,7 @@ bool ResourceTopLevelNode::removePrefix(const QString &prefix, const QString &la
ProjectExplorer::FolderNode::AddNewInformation ResourceTopLevelNode::addNewInformation(const QStringList &files, Node *context) const
{
QString name = QCoreApplication::translate("ResourceTopLevelNode", "%1 Prefix: %2")
- .arg(QFileInfo(path()).fileName())
+ .arg(Utils::FileName::fromString(path()).fileName())
.arg(QLatin1Char('/'));
int p = -1;
@@ -390,7 +390,7 @@ bool ResourceFolderNode::renamePrefix(const QString &prefix, const QString &lang
ProjectExplorer::FolderNode::AddNewInformation ResourceFolderNode::addNewInformation(const QStringList &files, Node *context) const
{
QString name = QCoreApplication::translate("ResourceTopLevelNode", "%1 Prefix: %2")
- .arg(QFileInfo(m_topLevelNode->path()).fileName())
+ .arg(Utils::FileName::fromString(m_topLevelNode->path()).fileName())
.arg(displayName());
int p = -1; // never the default
diff --git a/src/plugins/texteditor/codecselector.cpp b/src/plugins/texteditor/codecselector.cpp
index cdf09bccba..4dce312f47 100644
--- a/src/plugins/texteditor/codecselector.cpp
+++ b/src/plugins/texteditor/codecselector.cpp
@@ -32,10 +32,10 @@
#include "textdocument.h"
#include <utils/algorithm.h>
+#include <utils/fileutils.h>
#include <utils/itemviews.h>
#include <QDebug>
-#include <QFileInfo>
#include <QTextCodec>
#include <QPushButton>
#include <QScrollBar>
@@ -79,7 +79,7 @@ CodecSelector::CodecSelector(QWidget *parent, TextDocument *doc)
if (m_hasDecodingError)
decodingErrorHint = QLatin1Char('\n') + tr("The following encodings are likely to fit:");
m_label->setText(tr("Select encoding for \"%1\".%2")
- .arg(doc->filePath().toFileInfo().fileName())
+ .arg(doc->filePath().fileName())
.arg(decodingErrorHint));
m_listWidget = new CodecListWidget(this);
diff --git a/src/plugins/texteditor/codestylepool.cpp b/src/plugins/texteditor/codestylepool.cpp
index 20c959ceba..6e297ed80d 100644
--- a/src/plugins/texteditor/codestylepool.cpp
+++ b/src/plugins/texteditor/codestylepool.cpp
@@ -32,12 +32,16 @@
#include "icodestylepreferencesfactory.h"
#include "icodestylepreferences.h"
#include "tabsettings.h"
-#include <utils/persistentsettings.h>
+
#include <coreplugin/icore.h>
+#include <utils/fileutils.h>
+#include <utils/persistentsettings.h>
+
#include <QMap>
#include <QDir>
#include <QDebug>
+#include <QFileInfo>
using namespace TextEditor;
@@ -202,7 +206,7 @@ void CodeStylePool::removeCodeStyle(ICodeStylePreferences *codeStyle)
d->m_idToCodeStyle.remove(codeStyle->id());
QDir dir(settingsDir());
- dir.remove(settingsPath(codeStyle->id()).toFileInfo().fileName());
+ dir.remove(settingsPath(codeStyle->id()).fileName());
delete codeStyle;
}
diff --git a/src/plugins/texteditor/findincurrentfile.cpp b/src/plugins/texteditor/findincurrentfile.cpp
index 1c54e1c064..93ca6fc6f8 100644
--- a/src/plugins/texteditor/findincurrentfile.cpp
+++ b/src/plugins/texteditor/findincurrentfile.cpp
@@ -32,6 +32,7 @@
#include "texteditor.h"
#include <utils/filesearch.h>
+#include <utils/fileutils.h>
#include <coreplugin/icore.h>
#include <coreplugin/editormanager/ieditor.h>
#include <coreplugin/editormanager/editormanager.h>
@@ -78,7 +79,7 @@ QVariant FindInCurrentFile::additionalParameters() const
QString FindInCurrentFile::label() const
{
- return tr("File \"%1\":").arg(m_currentDocument->filePath().toFileInfo().fileName());
+ return tr("File \"%1\":").arg(m_currentDocument->filePath().fileName());
}
QString FindInCurrentFile::toolTip() const
diff --git a/src/plugins/texteditor/fontsettings.cpp b/src/plugins/texteditor/fontsettings.cpp
index adb7723e1e..8dccf20df4 100644
--- a/src/plugins/texteditor/fontsettings.cpp
+++ b/src/plugins/texteditor/fontsettings.cpp
@@ -31,13 +31,13 @@
#include "fontsettings.h"
#include "fontsettingspage.h"
+#include <utils/fileutils.h>
#include <utils/hostosinfo.h>
#include <coreplugin/icore.h>
#include <QCoreApplication>
#include <QDebug>
#include <QFile>
-#include <QFileInfo>
#include <QFont>
#include <QSettings>
#include <QTextCharFormat>
@@ -117,7 +117,7 @@ bool FontSettings::fromSettings(const QString &category,
// Load the selected color scheme
QString scheme = s->value(group + QLatin1String(schemeFileNameKey)).toString();
if (scheme.isEmpty() || !QFile::exists(scheme))
- scheme = defaultSchemeFileName(QFileInfo(scheme).fileName());
+ scheme = defaultSchemeFileName(Utils::FileName::fromString(scheme).fileName());
loadColorScheme(scheme, descriptions);
} else {
// Load color scheme from ini file
diff --git a/src/plugins/texteditor/fontsettingspage.cpp b/src/plugins/texteditor/fontsettingspage.cpp
index b31a3e4a4f..fd98f2f76f 100644
--- a/src/plugins/texteditor/fontsettingspage.cpp
+++ b/src/plugins/texteditor/fontsettingspage.cpp
@@ -34,6 +34,7 @@
#include "ui_fontsettingspage.h"
#include <coreplugin/icore.h>
+#include <utils/fileutils.h>
#include <utils/stringutils.h>
#include <utils/qtcassert.h>
@@ -562,7 +563,7 @@ void FontSettingsPage::refreshColorSchemeList()
int selected = 0;
QStringList schemeList = styleDir.entryList();
- QString defaultScheme = QFileInfo(FontSettings::defaultSchemeFileName()).fileName();
+ QString defaultScheme = Utils::FileName::fromString(FontSettings::defaultSchemeFileName()).fileName();
if (schemeList.removeAll(defaultScheme))
schemeList.prepend(defaultScheme);
foreach (const QString &file, schemeList) {
diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp
index ad56823bfa..e3b3888d6f 100644
--- a/src/plugins/valgrind/memchecktool.cpp
+++ b/src/plugins/valgrind/memchecktool.cpp
@@ -462,12 +462,12 @@ void MemcheckTool::engineStarting(const AnalyzerRunControl *engine)
const MemcheckRunControl *mEngine = dynamic_cast<const MemcheckRunControl *>(engine);
QTC_ASSERT(mEngine, return);
- const QString name = QFileInfo(mEngine->executable()).fileName();
+ const QString name = Utils::FileName::fromString(mEngine->executable()).fileName();
m_errorView->setDefaultSuppressionFile(dir + name + QLatin1String(".supp"));
foreach (const QString &file, mEngine->suppressionFiles()) {
- QAction *action = m_filterMenu->addAction(QFileInfo(file).fileName());
+ QAction *action = m_filterMenu->addAction(Utils::FileName::fromString(file).fileName());
action->setToolTip(file);
action->setData(file);
connect(action, SIGNAL(triggered(bool)),
diff --git a/src/plugins/valgrind/valgrindprocess.cpp b/src/plugins/valgrind/valgrindprocess.cpp
index 28f655b49d..0656d189ab 100644
--- a/src/plugins/valgrind/valgrindprocess.cpp
+++ b/src/plugins/valgrind/valgrindprocess.cpp
@@ -31,13 +31,13 @@
#include "valgrindprocess.h"
-#include <QDebug>
-#include <QEventLoop>
-#include <QFileInfo>
-
+#include <utils/fileutils.h>
#include <utils/qtcassert.h>
#include <utils/qtcprocess.h>
+#include <QDebug>
+#include <QEventLoop>
+
namespace Valgrind {
ValgrindProcess::ValgrindProcess(bool isLocal, const QSsh::SshConnectionParameters &sshParams,
@@ -282,7 +282,7 @@ void ValgrindProcess::remoteProcessStarted()
" | tail -n 1" // limit to single process
// we pick the last one, first would be "bash -c ..."
" | awk '{print $1;}'" // get pid
- ).arg(proc, QFileInfo(m_remote.m_debuggee).fileName());
+ ).arg(proc, Utils::FileName::fromString(m_remote.m_debuggee).fileName());
m_remote.m_findPID = m_remote.m_connection->createRemoteProcess(cmd.toUtf8());
connect(m_remote.m_findPID.data(), SIGNAL(readyReadStandardError()),
diff --git a/src/plugins/vcsbase/vcsbaseclient.cpp b/src/plugins/vcsbase/vcsbaseclient.cpp
index 10dbdc7122..79d9077552 100644
--- a/src/plugins/vcsbase/vcsbaseclient.cpp
+++ b/src/plugins/vcsbase/vcsbaseclient.cpp
@@ -507,7 +507,7 @@ QString VcsBaseClient::vcsEditorTitle(const QString &vcsCmd, const QString &sour
const Utils::FileName binary = settings()->binaryPath();
return binary.toFileInfo().baseName() +
QLatin1Char(' ') + vcsCmd + QLatin1Char(' ') +
- QFileInfo(sourceId).fileName();
+ Utils::FileName::fromString(sourceId).fileName();
}
VcsBaseEditorWidget *VcsBaseClient::createVcsEditor(Core::Id kind, QString title,
diff --git a/src/plugins/vcsbase/vcsbaseeditor.cpp b/src/plugins/vcsbase/vcsbaseeditor.cpp
index b1cbac71b3..388bc829c2 100644
--- a/src/plugins/vcsbase/vcsbaseeditor.cpp
+++ b/src/plugins/vcsbase/vcsbaseeditor.cpp
@@ -851,7 +851,7 @@ void VcsBaseEditorWidget::slotPopulateDiffBrowser()
lastFileName = file;
// ignore any headers
d->m_entrySections.push_back(d->m_entrySections.empty() ? 0 : lineNumber);
- entriesComboBox->addItem(QFileInfo(file).fileName());
+ entriesComboBox->addItem(Utils::FileName::fromString(file).fileName());
}
}
}