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

Change-Id: I4852ff215abf25649fc5eac1e922ae901839ca3d
Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
Orgad Shaneh
2015-01-10 23:40:32 +02:00
committed by hjk
parent 6fd0d4ed33
commit 8b5dcc13c5
77 changed files with 163 additions and 138 deletions

View File

@@ -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,
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);

View File

@@ -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
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;

View File

@@ -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());

View File

@@ -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,

View File

@@ -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,
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);
} }

View File

@@ -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
} 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 {

View File

@@ -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

View File

@@ -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::
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
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;

View File

@@ -76,7 +76,7 @@ QString JavaDocument::defaultPath() const
QString JavaDocument::suggestedFileName() const QString JavaDocument::suggestedFileName() const
{ {
return filePath().toFileInfo().fileName(); return filePath().fileName();
} }

View File

@@ -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)

View File

@@ -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());

View File

@@ -257,7 +257,7 @@ QString CMakeDocument::defaultPath() const
QString CMakeDocument::suggestedFileName() const QString CMakeDocument::suggestedFileName() const
{ {
return filePath().toFileInfo().fileName(); return filePath().fileName();
} }
// //

View File

@@ -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"))))

View File

@@ -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)
{ {
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()),

View File

@@ -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()

View File

@@ -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
{ {
if (!d->displayName.isEmpty()) if (!d->displayName.isEmpty())
return d->displayName; return d->displayName;
return d->filePath.toFileInfo().fileName(); return d->filePath.fileName();
} }
/*! /*!

View File

@@ -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;

View File

@@ -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);

View File

@@ -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)
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), "

View File

@@ -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)
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);

View File

@@ -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);

View File

@@ -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;

View File

@@ -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,
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%")) {

View File

@@ -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()
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()
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

View File

@@ -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;
} }

View File

@@ -37,6 +37,7 @@
#include <debugger/shared/hostutils.h> #include <debugger/shared/hostutils.h>
#include <debugger/threaddata.h> #include <debugger/threaddata.h>
#include <utils/fileutils.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <QDir> #include <QDir>
@@ -87,7 +88,7 @@ static inline QString cdbBreakPointFileName(const BreakpointParameters &bp,
if (bp.fileName.isEmpty()) if (bp.fileName.isEmpty())
return bp.fileName; return bp.fileName;
if (bp.pathUsage == BreakpointUseShortPath) if (bp.pathUsage == BreakpointUseShortPath)
return QFileInfo(bp.fileName).fileName(); return Utils::FileName::fromString(bp.fileName).fileName();
return cdbSourcePathMapping(QDir::toNativeSeparators(bp.fileName), sourcePathMapping, SourceToDebugger); return cdbSourcePathMapping(QDir::toNativeSeparators(bp.fileName), sourcePathMapping, SourceToDebugger);
} }

View File

@@ -181,7 +181,7 @@ QString StartApplicationParameters::displayName() const
{ {
const int maxLength = 60; const int maxLength = 60;
QString name = QFileInfo(localExecutable).fileName() + QLatin1Char(' ') + processArgs; QString name = FileName::fromString(localExecutable).fileName() + QLatin1Char(' ') + processArgs;
if (name.size() > 60) { if (name.size() > 60) {
int index = name.lastIndexOf(QLatin1Char(' '), maxLength); int index = name.lastIndexOf(QLatin1Char(' '), maxLength);
if (index == -1) if (index == -1)

View File

@@ -634,7 +634,7 @@ public:
message = tr("0x%1 hit").arg(data.address, 0, 16); message = tr("0x%1 hit").arg(data.address, 0, 16);
} else { } else {
//: Message tracepoint: %1 file, %2 line %3 function hit. //: 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(data.lineNumber).
arg(cppFunctionAt(data.fileName, data.lineNumber)); arg(cppFunctionAt(data.fileName, data.lineNumber));
} }

View File

@@ -1860,7 +1860,7 @@ QString GdbEngine::cleanupFullName(const QString &fileName)
} }
cleanFilePath.clear(); 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); QMap<QString, QString>::const_iterator jt = m_baseNameToFullName.find(base);
while (jt != m_baseNameToFullName.end() && jt.key() == 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); QString where = m_fullToShortName.value(file);
if (where.isEmpty()) if (where.isEmpty())
return QFileInfo(file).fileName(); return FileName::fromString(file).fileName();
return where; return where;
} }

View File

@@ -37,11 +37,11 @@
#include <debugger/watchhandler.h> #include <debugger/watchhandler.h>
#include <qmldebug/qmldebugconstants.h> #include <qmldebug/qmldebugconstants.h>
#include <utils/fileutils.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/savedaction.h> #include <utils/savedaction.h>
#include <QElapsedTimer> #include <QElapsedTimer>
#include <QFileInfo>
#include <QLoggingCategory> #include <QLoggingCategory>
using namespace QmlDebug; 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) log(LogSend, QString::fromLatin1("FETCH_OBJECTS_FOR_LOCATION %1:%2:%3").arg(file)
.arg(QString::number(lineNumber)).arg(QString::number(columnNumber))); .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); lineNumber, columnNumber);
qCDebug(qmlInspectorLog) << __FUNCTION__ << '(' << file << ':' << lineNumber qCDebug(qmlInspectorLog) << __FUNCTION__ << '(' << file << ':' << lineNumber
<< ':' << columnNumber << ')' << " - query id" << queryId; << ':' << columnNumber << ')' << " - query id" << queryId;

View File

@@ -471,7 +471,7 @@ void QmlV8DebuggerClientPrivate::setBreakpoint(const QString type, const QString
args.setProperty(_(TYPE), QScriptValue(type)); args.setProperty(_(TYPE), QScriptValue(type));
if (type == _(SCRIPTREGEXP)) if (type == _(SCRIPTREGEXP))
args.setProperty(_(TARGET), args.setProperty(_(TARGET),
QScriptValue(QFileInfo(target).fileName())); QScriptValue(Utils::FileName::fromString(target).fileName()));
else else
args.setProperty(_(TARGET), QScriptValue(target)); args.setProperty(_(TARGET), QScriptValue(target));

View File

@@ -40,10 +40,10 @@
#include <cppeditor/cppeditorconstants.h> #include <cppeditor/cppeditorconstants.h>
#include <utils/fileutils.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <QDebug> #include <QDebug>
#include <QFileInfo>
#include <QTextBlock> #include <QTextBlock>
#include <limits.h> #include <limits.h>
@@ -107,7 +107,7 @@ void SourceAgent::setContent(const QString &filePath, const QString &content)
if (!d->editor) { if (!d->editor) {
QString titlePattern = d->producer + QLatin1String(": ") QString titlePattern = d->producer + QLatin1String(": ")
+ QFileInfo(filePath).fileName(); + Utils::FileName::fromString(filePath).fileName();
d->editor = qobject_cast<BaseTextEditor *>( d->editor = qobject_cast<BaseTextEditor *>(
EditorManager::openEditorWithContents( EditorManager::openEditorWithContents(
CppEditor::Constants::CPPEDITOR_ID, CppEditor::Constants::CPPEDITOR_ID,

View File

@@ -34,11 +34,11 @@
#include "debuggercore.h" #include "debuggercore.h"
#include "simplifytype.h" #include "simplifytype.h"
#include <utils/fileutils.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/savedaction.h> #include <utils/savedaction.h>
#include <QDebug> #include <QDebug>
#include <QFileInfo>
namespace Debugger { namespace Debugger {
namespace Internal { namespace Internal {
@@ -111,7 +111,7 @@ QVariant StackHandler::data(const QModelIndex &index, int role) const
case StackFunctionNameColumn: case StackFunctionNameColumn:
return simplifyType(frame.function); return simplifyType(frame.function);
case StackFileNameColumn: 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: case StackLineNumberColumn:
return frame.line > 0 ? QVariant(frame.line) : QVariant(); return frame.line > 0 ? QVariant(frame.line) : QVariant();
case StackAddressColumn: case StackAddressColumn:

View File

@@ -44,6 +44,8 @@
#include <texteditor/displaysettings.h> #include <texteditor/displaysettings.h>
#include <texteditor/marginsettings.h> #include <texteditor/marginsettings.h>
#include <utils/fileutils.h>
#include <QStackedWidget> #include <QStackedWidget>
#include <QToolButton> #include <QToolButton>
#include <QSpinBox> #include <QSpinBox>
@@ -52,7 +54,6 @@
#include <QHBoxLayout> #include <QHBoxLayout>
#include <QToolBar> #include <QToolBar>
#include <QComboBox> #include <QComboBox>
#include <QFileInfo>
#include <QDir> #include <QDir>
#include <QTextCodec> #include <QTextCodec>
#include <QTextBlock> #include <QTextBlock>
@@ -421,8 +422,8 @@ void DiffEditor::slotDiffFilesChanged(const QList<FileData> &diffFileList,
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
const DiffFileInfo leftEntry = diffFileList.at(i).leftFileInfo; const DiffFileInfo leftEntry = diffFileList.at(i).leftFileInfo;
const DiffFileInfo rightEntry = diffFileList.at(i).rightFileInfo; const DiffFileInfo rightEntry = diffFileList.at(i).rightFileInfo;
const QString leftShortFileName = QFileInfo(leftEntry.fileName).fileName(); const QString leftShortFileName = Utils::FileName::fromString(leftEntry.fileName).fileName();
const QString rightShortFileName = QFileInfo(rightEntry.fileName).fileName(); const QString rightShortFileName = Utils::FileName::fromString(rightEntry.fileName).fileName();
QString itemText; QString itemText;
QString itemToolTip; QString itemToolTip;
if (leftEntry.fileName == rightEntry.fileName) { if (leftEntry.fileName == rightEntry.fileName) {

View File

@@ -536,7 +536,7 @@ QString GerritPlugin::findLocalRepository(QString project, const QString &branch
branchRegexp.reset(); // Oops. branchRegexp.reset(); // Oops.
} }
foreach (const QString &repository, gitRepositories) { 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)) if ((!branchRegexp.isNull() && branchRegexp->exactMatch(fileName))
|| fileName == project) { || fileName == project) {
// Perform a check on the branch. // Perform a check on the branch.

View File

@@ -46,6 +46,8 @@
#include <qtsupport/qtoutputformatter.h> #include <qtsupport/qtoutputformatter.h>
#include <qtsupport/qtkitinformation.h> #include <qtsupport/qtkitinformation.h>
#include <utils/fileutils.h>
#include <QList> #include <QList>
#include <QStandardItemModel> #include <QStandardItemModel>
@@ -301,7 +303,7 @@ QString IosRunConfiguration::disabledReason() const
{ {
if (m_parseInProgress) if (m_parseInProgress)
return tr("The .pro file \"%1\" is currently being parsed.") return tr("The .pro file \"%1\" is currently being parsed.")
.arg(QFileInfo(m_profilePath).fileName()); .arg(FileName::fromString(m_profilePath).fileName());
if (!m_parseSuccess) if (!m_parseSuccess)
return static_cast<QmakeProject *>(target()->project()) return static_cast<QmakeProject *>(target()->project())
->disabledReasonForRunConfiguration(m_profilePath); ->disabledReasonForRunConfiguration(m_profilePath);

View File

@@ -415,7 +415,7 @@ void AbstractProcessStep::taskAdded(const Task &task)
// 3. give up. // 3. give up.
QList<QFileInfo> possibleFiles; QList<QFileInfo> possibleFiles;
QString fileName = QFileInfo(filePath).fileName(); QString fileName = Utils::FileName::fromString(filePath).fileName();
foreach (const QString &file, project()->files(Project::AllFiles)) { foreach (const QString &file, project()->files(Project::AllFiles)) {
QFileInfo candidate(file); QFileInfo candidate(file);
if (candidate.fileName() == fileName) if (candidate.fileName() == fileName)

View File

@@ -93,7 +93,7 @@ Utils::FileIterator *AllProjectsFind::filesForProjects(const QStringList &nameFi
foreach (const QString &file, projectFiles) { foreach (const QString &file, projectFiles) {
if (Utils::anyOf(filterRegs, if (Utils::anyOf(filterRegs,
[&file](QRegExp reg) { [&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); filteredFiles.append(file);
} }

View File

@@ -30,7 +30,8 @@
#include "deployablefile.h" #include "deployablefile.h"
#include <QFileInfo> #include <utils/fileutils.h>
#include <QHash> #include <QHash>
using namespace Utils; using namespace Utils;
@@ -55,7 +56,7 @@ DeployableFile::DeployableFile(const FileName &localFilePath, const QString &rem
QString DeployableFile::remoteFilePath() const QString DeployableFile::remoteFilePath() const
{ {
return m_remoteDir.isEmpty() return m_remoteDir.isEmpty()
? QString() : m_remoteDir + QLatin1Char('/') + m_localFilePath.toFileInfo().fileName(); ? QString() : m_remoteDir + QLatin1Char('/') + m_localFilePath.fileName();
} }
bool DeployableFile::isValid() const bool DeployableFile::isValid() const

View File

@@ -30,10 +30,10 @@
#include "processparameters.h" #include "processparameters.h"
#include <utils/fileutils.h>
#include <utils/macroexpander.h> #include <utils/macroexpander.h>
#include <utils/qtcprocess.h> #include <utils/qtcprocess.h>
#include <QFileInfo>
#include <QDir> #include <QDir>
/*! /*!
@@ -163,7 +163,7 @@ QString ProcessParameters::prettyCommand() const
QString cmd = m_command; QString cmd = m_command;
if (m_macroExpander) if (m_macroExpander)
cmd = m_macroExpander->expand(cmd); cmd = m_macroExpander->expand(cmd);
return QFileInfo(cmd).fileName(); return Utils::FileName::fromString(cmd).fileName();
} }
QString ProcessParameters::prettyArguments() const QString ProcessParameters::prettyArguments() const

View File

@@ -63,8 +63,8 @@ bool sortNodes(Node *n1, Node *n2)
FileNode *file2 = dynamic_cast<FileNode*>(n2); FileNode *file2 = dynamic_cast<FileNode*>(n2);
if (file1 && file1->fileType() == ProjectFileType) { if (file1 && file1->fileType() == ProjectFileType) {
if (file2 && file2->fileType() == ProjectFileType) { if (file2 && file2->fileType() == ProjectFileType) {
const QString fileName1 = QFileInfo(file1->path()).fileName(); const QString fileName1 = Utils::FileName::fromString(file1->path()).fileName();
const QString fileName2 = QFileInfo(file2->path()).fileName(); const QString fileName2 = Utils::FileName::fromString(file2->path()).fileName();
int result = caseFriendlyCompare(fileName1, fileName2); int result = caseFriendlyCompare(fileName1, fileName2);
if (result != 0) if (result != 0)
@@ -149,8 +149,8 @@ bool sortNodes(Node *n1, Node *n2)
const QString filePath1 = n1->path(); const QString filePath1 = n1->path();
const QString filePath2 = n2->path(); const QString filePath2 = n2->path();
const QString fileName1 = QFileInfo(filePath1).fileName(); const QString fileName1 = Utils::FileName::fromString(filePath1).fileName();
const QString fileName2 = QFileInfo(filePath2).fileName(); const QString fileName2 = Utils::FileName::fromString(filePath2).fileName();
result = caseFriendlyCompare(fileName1, fileName2); result = caseFriendlyCompare(fileName1, fileName2);
if (result != 0) { if (result != 0) {
@@ -288,7 +288,7 @@ QVariant FlatModel::data(const QModelIndex &index, int role) const
break; break;
} }
case Qt::EditRole: { case Qt::EditRole: {
result = QFileInfo(node->path()).fileName(); result = Utils::FileName::fromString(node->path()).fileName();
break; break;
} }
case Qt::ToolTipRole: { case Qt::ToolTipRole: {

View File

@@ -40,6 +40,7 @@
#include <coreplugin/iversioncontrol.h> #include <coreplugin/iversioncontrol.h>
#include <coreplugin/vcsmanager.h> #include <coreplugin/vcsmanager.h>
#include <utils/algorithm.h> #include <utils/algorithm.h>
#include <utils/fileutils.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <QFileInfo> #include <QFileInfo>
@@ -168,7 +169,7 @@ int Node::line() const
QString Node::displayName() const QString Node::displayName() const
{ {
return QFileInfo(path()).fileName(); return Utils::FileName::fromString(path()).fileName();
} }
QString Node::tooltip() const 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 FolderNode::AddNewInformation FolderNode::addNewInformation(const QStringList &files, Node *context) const
{ {
Q_UNUSED(files); 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); setNodeType(ProjectNodeType);
// project node "manages" itself // project node "manages" itself
setProjectNode(this); setProjectNode(this);
setDisplayName(QFileInfo(projectFilePath).fileName()); setDisplayName(Utils::FileName::fromString(projectFilePath).fileName());
} }
QString ProjectNode::vcsTopic() const QString ProjectNode::vcsTopic() const

View File

@@ -58,6 +58,8 @@
#include <projectexplorer/session.h> #include <projectexplorer/session.h>
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
#include <qtsupport/qtsupportconstants.h> #include <qtsupport/qtsupportconstants.h>
#include <utils/fileutils.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <QAction> #include <QAction>
@@ -286,7 +288,7 @@ void QbsProjectManagerPlugin::updateBuildActions()
&& !BuildManager::isBuilding(m_editorProject) && !BuildManager::isBuilding(m_editorProject)
&& !m_editorProject->isParsing(); && !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()); fileVisible = m_editorProject && m_editorNode && dynamic_cast<QbsBaseProjectNode *>(m_editorNode->projectNode());
QbsProductNode *productNode QbsProductNode *productNode

View File

@@ -37,8 +37,11 @@
#include <qmakeprojectmanager/qmakeproject.h> #include <qmakeprojectmanager/qmakeproject.h>
#include <qmakeprojectmanager/qmakenodes.h> #include <qmakeprojectmanager/qmakenodes.h>
#include <utils/fileutils.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <QFileInfo>
namespace { namespace {
QLatin1String PRO_FILE_KEY("QMakeProjectManager.QmakeAndroidRunConfiguration.ProFile"); QLatin1String PRO_FILE_KEY("QMakeProjectManager.QmakeAndroidRunConfiguration.ProFile");
} }
@@ -120,7 +123,7 @@ QString QmakeAndroidRunConfiguration::disabledReason() const
{ {
if (m_parseInProgress) if (m_parseInProgress)
return tr("The .pro file \"%1\" is currently being parsed.") 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) if (!m_parseSuccess)
return static_cast<QmakeProject *>(target()->project())->disabledReasonForRunConfiguration(m_proFilePath); return static_cast<QmakeProject *>(target()->project())->disabledReasonForRunConfiguration(m_proFilePath);

View File

@@ -132,7 +132,7 @@ QList<Core::GeneratedFile> PluginGenerator::generatePlugin(const GenerationPara
QString iconResource; QString iconResource;
if (!wo.iconFile.isEmpty()) { if (!wo.iconFile.isEmpty()) {
iconResource = QLatin1String("QLatin1String(\":/"); iconResource = QLatin1String("QLatin1String(\":/");
iconResource += QFileInfo(wo.iconFile).fileName(); iconResource += Utils::FileName::fromString(wo.iconFile).fileName();
iconResource += QLatin1String("\")"); iconResource += QLatin1String("\")");
} }
sm.insert(QLatin1String("WIDGET_ICON"),iconResource); sm.insert(QLatin1String("WIDGET_ICON"),iconResource);

View File

@@ -41,7 +41,9 @@
#include <qtsupport/qtkitinformation.h> #include <qtsupport/qtkitinformation.h>
#include <qtsupport/qtoutputformatter.h> #include <qtsupport/qtoutputformatter.h>
#include <qtsupport/qtsupportconstants.h> #include <qtsupport/qtsupportconstants.h>
#include <utils/detailswidget.h> #include <utils/detailswidget.h>
#include <utils/fileutils.h>
#include <utils/hostosinfo.h> #include <utils/hostosinfo.h>
#include <utils/pathchooser.h> #include <utils/pathchooser.h>
#include <utils/persistentsettings.h> #include <utils/persistentsettings.h>
@@ -121,7 +123,7 @@ QString DesktopQmakeRunConfiguration::disabledReason() const
{ {
if (m_parseInProgress) if (m_parseInProgress)
return tr("The .pro file \"%1\" is currently being parsed.") return tr("The .pro file \"%1\" is currently being parsed.")
.arg(QFileInfo(m_proFilePath).fileName()); .arg(FileName::fromString(m_proFilePath).fileName());
if (!m_parseSuccess) if (!m_parseSuccess)
return static_cast<QmakeProject *>(target()->project())->disabledReasonForRunConfiguration(m_proFilePath); return static_cast<QmakeProject *>(target()->project())->disabledReasonForRunConfiguration(m_proFilePath);

View File

@@ -190,7 +190,7 @@ QString ProFileDocument::defaultPath() const
QString ProFileDocument::suggestedFileName() const QString ProFileDocument::suggestedFileName() const
{ {
return filePath().toFileInfo().fileName(); return filePath().fileName();
} }
// //

View File

@@ -1121,7 +1121,7 @@ bool QmakePriFileNode::renameFile(const QString &filePath, const QString &newFil
ProjectExplorer::FolderNode::AddNewInformation QmakePriFileNode::addNewInformation(const QStringList &files, Node *context) const ProjectExplorer::FolderNode::AddNewInformation QmakePriFileNode::addNewInformation(const QStringList &files, Node *context) const
{ {
Q_UNUSED(files) 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) 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 ProjectExplorer::FolderNode::AddNewInformation QmakeProFileNode::addNewInformation(const QStringList &files, Node *context) const
{ {
Q_UNUSED(files) 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 bool QmakeProFileNode::showInSimpleTree(QmakeProjectType projectType) const

View File

@@ -1428,17 +1428,17 @@ QString QmakeProject::disabledReasonForRunConfiguration(const QString &proFilePa
{ {
if (!QFileInfo::exists(proFilePath)) if (!QFileInfo::exists(proFilePath))
return tr("The .pro file \"%1\" does not exist.") return tr("The .pro file \"%1\" does not exist.")
.arg(QFileInfo(proFilePath).fileName()); .arg(FileName::fromString(proFilePath).fileName());
if (!m_rootProjectNode) // Shutting down if (!m_rootProjectNode) // Shutting down
return QString(); return QString();
if (!m_rootProjectNode->findProFileFor(proFilePath)) if (!m_rootProjectNode->findProFileFor(proFilePath))
return tr("The .pro file \"%1\" is not part of the project.") 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.") 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) QString QmakeProject::buildNameFor(const Kit *k)

View File

@@ -345,7 +345,7 @@ void QmakeProjectManagerPlugin::updateContextActions(ProjectExplorer::Node *node
m_rebuildSubProjectAction->setParameter(subProjectName); m_rebuildSubProjectAction->setParameter(subProjectName);
m_cleanSubProjectAction->setParameter(subProjectName); m_cleanSubProjectAction->setParameter(subProjectName);
m_buildSubProjectContextMenu->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()) ? QmakeBuildConfiguration *buildConfiguration = (qmakeProject && qmakeProject->activeTarget()) ?
static_cast<QmakeBuildConfiguration *>(qmakeProject->activeTarget()->activeBuildConfiguration()) : 0; static_cast<QmakeBuildConfiguration *>(qmakeProject->activeTarget()->activeBuildConfiguration()) : 0;
@@ -395,7 +395,7 @@ void QmakeProjectManagerPlugin::updateBuildFileAction()
QString file = currentDocument->filePath().toString(); QString file = currentDocument->filePath().toString();
Node *node = SessionManager::nodeForFile(file); Node *node = SessionManager::nodeForFile(file);
Project *project = SessionManager::projectForFile(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) visible = qobject_cast<QmakeProject *>(project)
&& node && node
&& dynamic_cast<QmakePriFileNode *>(node->projectNode()); && dynamic_cast<QmakePriFileNode *>(node->projectNode());

View File

@@ -129,7 +129,7 @@ QString QMakeStep::allArguments(bool shorted)
if (bc->subNodeBuild()) if (bc->subNodeBuild())
arguments << QDir::toNativeSeparators(bc->subNodeBuild()->path()); arguments << QDir::toNativeSeparators(bc->subNodeBuild()->path());
else if (shorted) else if (shorted)
arguments << project()->projectFilePath().toFileInfo().fileName(); arguments << project()->projectFilePath().fileName();
else else
arguments << project()->projectFilePath().toUserOutput(); arguments << project()->projectFilePath().toUserOutput();
@@ -645,7 +645,7 @@ void QMakeStepConfigWidget::updateSummaryLabel()
// We don't want the full path to the .pro file // We don't want the full path to the .pro file
QString args = m_step->allArguments(true); QString args = m_step->allArguments(true);
// And we only use the .pro filename not the full path // 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)); 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()); QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitInformation::qtVersion(m_step->target()->kit());
QString program = tr("<No Qt version>"); QString program = tr("<No Qt version>");
if (qtVersion) if (qtVersion)
program = qtVersion->qmakeCommand().toFileInfo().fileName(); program = qtVersion->qmakeCommand().fileName();
m_ui->qmakeArgumentsEdit->setPlainText(program + QLatin1Char(' ') + m_step->allArguments()); m_ui->qmakeArgumentsEdit->setPlainText(program + QLatin1Char(' ') + m_step->allArguments());
} }

View File

@@ -36,8 +36,9 @@
#include <cpptools/abstracteditorsupport.h> #include <cpptools/abstracteditorsupport.h>
#include <qtsupport/qtsupportconstants.h> #include <qtsupport/qtsupportconstants.h>
#include <utils/fileutils.h>
#include <QCoreApplication> #include <QCoreApplication>
#include <QFileInfo>
#include <QTextStream> #include <QTextStream>
static const char mainCppC[] = static const char mainCppC[] =
@@ -98,7 +99,7 @@ Core::GeneratedFiles
QTextStream proStr(&contents); QTextStream proStr(&contents);
QtProjectParameters::writeProFileHeader(proStr); QtProjectParameters::writeProFileHeader(proStr);
params.writeProFile(proStr); params.writeProFile(proStr);
proStr << "\n\nSOURCES += " << QFileInfo(sourceFileName).fileName() << '\n'; proStr << "\n\nSOURCES += " << Utils::FileName::fromString(sourceFileName).fileName() << '\n';
} }
profile.setContents(contents); profile.setContents(contents);
return Core::GeneratedFiles() << source << profile; return Core::GeneratedFiles() << source << profile;

View File

@@ -44,7 +44,6 @@
#include <QCoreApplication> #include <QCoreApplication>
#include <QDir> #include <QDir>
#include <QTextStream> #include <QTextStream>
#include <QFileInfo>
#include <QSharedPointer> #include <QSharedPointer>
static const char mainSourceFileC[] = "main"; static const char mainSourceFileC[] = "main";
@@ -195,11 +194,11 @@ Core::GeneratedFiles GuiAppWizard::generateFiles(const QWizard *w,
QTextStream proStr(&contents); QTextStream proStr(&contents);
QtProjectParameters::writeProFileHeader(proStr); QtProjectParameters::writeProFileHeader(proStr);
projectParams.writeProFile(proStr); projectParams.writeProFile(proStr);
proStr << "\n\nSOURCES += " << QFileInfo(mainSourceFileName).fileName() proStr << "\n\nSOURCES += " << Utils::FileName::fromString(mainSourceFileName).fileName()
<< "\\\n " << QFileInfo(formSource.path()).fileName() << "\\\n " << Utils::FileName::fromString(formSource.path()).fileName()
<< "\n\nHEADERS += " << QFileInfo(formHeader.path()).fileName(); << "\n\nHEADERS += " << Utils::FileName::fromString(formHeader.path()).fileName();
if (params.designerForm) if (params.designerForm)
proStr << "\n\nFORMS += " << QFileInfo(form->path()).fileName(); proStr << "\n\nFORMS += " << Utils::FileName::fromString(form->path()).fileName();
if (params.isMobileApplication) { if (params.isMobileApplication) {
proStr << "\n\nCONFIG += mobility" proStr << "\n\nCONFIG += mobility"
<< "\nMOBILITY = " << "\nMOBILITY = "

View File

@@ -35,7 +35,8 @@
#include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectexplorerconstants.h>
#include <qtsupport/qtsupportconstants.h> #include <qtsupport/qtsupportconstants.h>
#include <QFileInfo> #include <utils/fileutils.h>
#include <QTextStream> #include <QTextStream>
#include <QCoreApplication> #include <QCoreApplication>
@@ -96,12 +97,12 @@ Core::GeneratedFiles LibraryWizard::generateFiles(const QWizard *w,
source.setAttributes(Core::GeneratedFile::OpenEditorAttribute); source.setAttributes(Core::GeneratedFile::OpenEditorAttribute);
const QString headerFileFullName = buildFileName(projectPath, params.headerFileName, headerSuffix()); 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 pluginJsonFileFullName;
QString pluginJsonFileName; QString pluginJsonFileName;
if (projectParams.type == QtProjectParameters::Qt4Plugin) { if (projectParams.type == QtProjectParameters::Qt4Plugin) {
pluginJsonFileFullName = buildFileName(projectPath, projectParams.fileName, QLatin1String("json")); pluginJsonFileFullName = buildFileName(projectPath, projectParams.fileName, QLatin1String("json"));
pluginJsonFileName = QFileInfo(pluginJsonFileFullName).fileName(); pluginJsonFileName = Utils::FileName::fromString(pluginJsonFileFullName).fileName();
} }
Core::GeneratedFile header(headerFileFullName); Core::GeneratedFile header(headerFileFullName);
@@ -111,7 +112,7 @@ Core::GeneratedFiles LibraryWizard::generateFiles(const QWizard *w,
if (projectParams.type == QtProjectParameters::SharedLibrary) { if (projectParams.type == QtProjectParameters::SharedLibrary) {
const QString globalHeaderName = buildFileName(projectPath, projectParams.fileName.toLower() + QLatin1String(sharedHeaderPostfixC), headerSuffix()); const QString globalHeaderName = buildFileName(projectPath, projectParams.fileName.toLower() + QLatin1String(sharedHeaderPostfixC), headerSuffix());
Core::GeneratedFile globalHeader(globalHeaderName); Core::GeneratedFile globalHeader(globalHeaderName);
globalHeaderFileName = QFileInfo(globalHeader.path()).fileName(); globalHeaderFileName = Utils::FileName::fromString(globalHeader.path()).fileName();
globalHeader.setContents(CppTools::AbstractEditorSupport::licenseTemplate(globalHeaderFileName) globalHeader.setContents(CppTools::AbstractEditorSupport::licenseTemplate(globalHeaderFileName)
+ LibraryParameters::generateSharedHeader(globalHeaderFileName, projectParams.fileName, sharedLibExportMacro)); + LibraryParameters::generateSharedHeader(globalHeaderFileName, projectParams.fileName, sharedLibExportMacro));
rc.push_back(globalHeader); rc.push_back(globalHeader);
@@ -138,7 +139,7 @@ Core::GeneratedFiles LibraryWizard::generateFiles(const QWizard *w,
QTextStream proStr(&profileContents); QTextStream proStr(&profileContents);
QtProjectParameters::writeProFileHeader(proStr); QtProjectParameters::writeProFileHeader(proStr);
projectParams.writeProFile(proStr); projectParams.writeProFile(proStr);
proStr << "\nSOURCES += " << QFileInfo(source.path()).fileName() proStr << "\nSOURCES += " << Utils::FileName::fromString(source.path()).fileName()
<< "\n\nHEADERS += " << headerFileName; << "\n\nHEADERS += " << headerFileName;
if (!globalHeaderFileName.isEmpty()) if (!globalHeaderFileName.isEmpty())
proStr << "\\\n " << globalHeaderFileName << '\n'; proStr << "\\\n " << globalHeaderFileName << '\n';

View File

@@ -35,6 +35,7 @@
#include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectexplorerconstants.h>
#include <qtsupport/qtsupportconstants.h> #include <qtsupport/qtsupportconstants.h>
#include <utils/fileutils.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <QCoreApplication> #include <QCoreApplication>
@@ -175,7 +176,7 @@ Core::GeneratedFiles TestWizard::generateFiles(const QWizard *w, QString *errorM
QTextStream proStr(&contents); QTextStream proStr(&contents);
QtProjectParameters::writeProFileHeader(proStr); QtProjectParameters::writeProFileHeader(proStr);
projectParams.writeProFile(proStr); projectParams.writeProFile(proStr);
proStr << "\n\nSOURCES += " << QFileInfo(sourceFilePath).fileName() << '\n' proStr << "\n\nSOURCES += " << Utils::FileName::fromString(sourceFilePath).fileName() << '\n'
<< "DEFINES += SRCDIR=\\\\\\\"$$PWD/\\\\\\\"\n"; << "DEFINES += SRCDIR=\\\\\\\"$$PWD/\\\\\\\"\n";
} }
profile.setContents(contents); profile.setContents(contents);

View File

@@ -31,6 +31,8 @@
#include "pluginpath.h" #include "pluginpath.h"
#include "pluginmanager.h" #include "pluginmanager.h"
#include <utils/fileutils.h>
#include <iplugin.h> #include <iplugin.h>
#include <QLibrary> #include <QLibrary>
#include <QPluginLoader> #include <QPluginLoader>
@@ -173,7 +175,7 @@ QStandardItem *PluginPath::createModelItem()
QStandardItem *failedCategory = 0; QStandardItem *failedCategory = 0;
const auto end = m_plugins.end(); const auto end = m_plugins.end();
for (auto it = m_plugins.begin(); it != end; ++it) { 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)) { if (instance(*it)) {
pluginItem->appendRow(new QStandardItem(QString::fromUtf8(it->instanceGuard->metaObject()->className()))); pluginItem->appendRow(new QStandardItem(QString::fromUtf8(it->instanceGuard->metaObject()->className())));
pathItem->appendRow(pluginItem); pathItem->appendRow(pluginItem);

View File

@@ -30,6 +30,9 @@
#include "widgetpluginpath.h" #include "widgetpluginpath.h"
#include <iwidgetplugin.h> #include <iwidgetplugin.h>
#include <utils/fileutils.h>
#include <QLibrary> #include <QLibrary>
#include <QPluginLoader> #include <QPluginLoader>
#include <QFileInfo> #include <QFileInfo>
@@ -192,7 +195,7 @@ QStandardItem *WidgetPluginPath::createModelItem()
QStandardItem *failedCategory = 0; QStandardItem *failedCategory = 0;
const auto end = m_plugins.end(); const auto end = m_plugins.end();
for (auto it = m_plugins.begin(); it != end; ++it) { 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)) { if (instance(*it)) {
pluginItem->appendRow(new QStandardItem(QString::fromUtf8(it->instanceGuard->metaObject()->className()))); pluginItem->appendRow(new QStandardItem(QString::fromUtf8(it->instanceGuard->metaObject()->className())));
pathItem->appendRow(pluginItem); pathItem->appendRow(pluginItem);

View File

@@ -35,7 +35,6 @@
//#include <qmljs/qmljsinterpreter.h> //#include <qmljs/qmljsinterpreter.h>
#include <qmljs/parser/qmljsast_p.h> #include <qmljs/parser/qmljsast_p.h>
#include <QFileInfo>
#include <QMutexLocker> #include <QMutexLocker>
using namespace QmlJSTools::Internal; using namespace QmlJSTools::Internal;
@@ -75,7 +74,7 @@ public:
if (!doc->componentName().isEmpty()) if (!doc->componentName().isEmpty())
m_documentContext = doc->componentName(); m_documentContext = doc->componentName();
else else
m_documentContext = QFileInfo(doc->fileName()).fileName(); m_documentContext = Utils::FileName::fromString(doc->fileName()).fileName();
accept(doc->ast(), m_documentContext); accept(doc->ast(), m_documentContext);
return m_entries; return m_entries;
} }

View File

@@ -31,6 +31,7 @@
#include "filefilteritems.h" #include "filefilteritems.h"
#include <utils/filesystemwatcher.h> #include <utils/filesystemwatcher.h>
#include <utils/fileutils.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <QDebug> #include <QDebug>
@@ -179,7 +180,7 @@ bool FileFilterBaseItem::matchesFile(const QString &filePath) const
return true; return true;
} }
const QString &fileName = QFileInfo(filePath).fileName(); const QString &fileName = Utils::FileName::fromString(filePath).fileName();
if (!fileMatches(fileName)) if (!fileMatches(fileName))
return false; return false;

View File

@@ -99,7 +99,7 @@ QString BarDescriptorDocument::defaultPath() const
QString BarDescriptorDocument::suggestedFileName() const QString BarDescriptorDocument::suggestedFileName() const
{ {
return filePath().toFileInfo().fileName(); return filePath().fileName();
} }
bool BarDescriptorDocument::shouldAutoSave() const bool BarDescriptorDocument::shouldAutoSave() const

View File

@@ -101,7 +101,7 @@ void BarDescriptorEditorAssetsWidget::addAsset(const QString &fullPath)
BarDescriptorAsset asset; BarDescriptorAsset asset;
asset.source = fullPath; asset.source = fullPath;
asset.destination = QFileInfo(fullPath).fileName(); asset.destination = Utils::FileName::fromString(fullPath).fileName();
asset.entry = false; asset.entry = false;
addAsset(asset); addAsset(asset);
} }

View File

@@ -111,11 +111,11 @@ void BarDescriptorEditorEntryPointWidget::updateWidgetValue(BarDescriptorDocumen
void BarDescriptorEditorEntryPointWidget::emitChanged(BarDescriptorDocument::Tag tag) void BarDescriptorEditorEntryPointWidget::emitChanged(BarDescriptorDocument::Tag tag)
{ {
if (tag == BarDescriptorDocument::icon) { 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) { } else if (tag == BarDescriptorDocument::splashScreens) {
QStringList list; QStringList list;
foreach (const QString &splashScreen, m_splashScreenModel->stringList()) foreach (const QString &splashScreen, m_splashScreenModel->stringList())
list << QFileInfo(splashScreen).fileName(); list << Utils::FileName::fromString(splashScreen).fileName();
emit changed(tag, list); emit changed(tag, list);
} else { } else {

View File

@@ -43,8 +43,6 @@
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/qtcprocess.h> #include <utils/qtcprocess.h>
#include <QFileInfo>
using namespace ProjectExplorer; using namespace ProjectExplorer;
using namespace Qnx; using namespace Qnx;
@@ -72,7 +70,7 @@ QnxAnalyzeSupport::QnxAnalyzeSupport(QnxRunConfiguration *runConfig,
ProjectExplorer::IDevice::ConstPtr dev = ProjectExplorer::DeviceKitInformation::device(runConfig->target()->kit()); ProjectExplorer::IDevice::ConstPtr dev = ProjectExplorer::DeviceKitInformation::device(runConfig->target()->kit());
QnxDeviceConfiguration::ConstPtr qnxDevice = dev.dynamicCast<const QnxDeviceConfiguration>(); 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); m_slog2Info = new Slog2InfoRunner(applicationId, qnxDevice, this);
connect(m_slog2Info, SIGNAL(output(QString,Utils::OutputFormat)), this, SLOT(showMessage(QString,Utils::OutputFormat))); connect(m_slog2Info, SIGNAL(output(QString,Utils::OutputFormat)), this, SLOT(showMessage(QString,Utils::OutputFormat)));
connect(runner, SIGNAL(remoteProcessStarted()), m_slog2Info, SLOT(start())); connect(runner, SIGNAL(remoteProcessStarted()), m_slog2Info, SLOT(start()));

View File

@@ -46,8 +46,6 @@
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/qtcprocess.h> #include <utils/qtcprocess.h>
#include <QFileInfo>
using namespace ProjectExplorer; using namespace ProjectExplorer;
using namespace RemoteLinux; using namespace RemoteLinux;
@@ -73,7 +71,7 @@ QnxDebugSupport::QnxDebugSupport(QnxRunConfiguration *runConfig, Debugger::Debug
connect(m_runControl, &Debugger::DebuggerRunControl::requestRemoteSetup, connect(m_runControl, &Debugger::DebuggerRunControl::requestRemoteSetup,
this, &QnxDebugSupport::handleAdapterSetupRequested); 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()); ProjectExplorer::IDevice::ConstPtr dev = ProjectExplorer::DeviceKitInformation::device(runConfig->target()->kit());
QnxDeviceConfiguration::ConstPtr qnxDevice = dev.dynamicCast<const QnxDeviceConfiguration>(); QnxDeviceConfiguration::ConstPtr qnxDevice = dev.dynamicCast<const QnxDeviceConfiguration>();

View File

@@ -39,8 +39,6 @@
#include <projectexplorer/runconfiguration.h> #include <projectexplorer/runconfiguration.h>
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
#include <QFileInfo>
using namespace Qnx; using namespace Qnx;
using namespace Qnx::Internal; using namespace Qnx::Internal;
using namespace RemoteLinux; using namespace RemoteLinux;
@@ -55,7 +53,7 @@ QnxRunControl::QnxRunControl(ProjectExplorer::RunConfiguration *runConfig)
QnxRunConfiguration *qnxRunConfig = qobject_cast<QnxRunConfiguration *>(runConfig); QnxRunConfiguration *qnxRunConfig = qobject_cast<QnxRunConfiguration *>(runConfig);
QTC_CHECK(qnxRunConfig); 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); m_slog2Info = new Slog2InfoRunner(applicationId, qnxDevice, this);
connect(m_slog2Info, SIGNAL(output(QString,Utils::OutputFormat)), this, SLOT(appendMessage(QString,Utils::OutputFormat))); connect(m_slog2Info, SIGNAL(output(QString,Utils::OutputFormat)), this, SLOT(appendMessage(QString,Utils::OutputFormat)));
connect(this, SIGNAL(started()), m_slog2Info, SLOT(start())); connect(this, SIGNAL(started()), m_slog2Info, SLOT(start()));

View File

@@ -30,12 +30,13 @@
#include "screenshotcropper.h" #include "screenshotcropper.h"
#include <utils/fileutils.h>
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <QXmlStreamReader> #include <QXmlStreamReader>
#include <QXmlStreamWriter> #include <QXmlStreamWriter>
#include <QDebug> #include <QDebug>
#include <QFile> #include <QFile>
#include <QFileInfo>
namespace QtSupport { namespace QtSupport {
namespace Internal { namespace Internal {
@@ -57,7 +58,7 @@ Q_GLOBAL_STATIC(AreasOfInterest, welcomeScreenAreas)
static inline QString fileNameForPath(const QString &path) 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) static QRect cropRectForAreaOfInterest(const QSize &imageSize, const QSize &cropSize, const QRect &areaOfInterest)

View File

@@ -36,7 +36,6 @@
#include <projectexplorer/deployablefile.h> #include <projectexplorer/deployablefile.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <QFileInfo>
#include <QString> #include <QString>
using namespace ProjectExplorer; using namespace ProjectExplorer;
@@ -115,7 +114,7 @@ void AbstractUploadAndInstallPackageService::doDeploy()
QTC_ASSERT(d->state == Inactive, return); QTC_ASSERT(d->state == Inactive, return);
d->state = Uploading; d->state = Uploading;
const QString fileName = QFileInfo(packageFilePath()).fileName(); const QString fileName = Utils::FileName::fromString(packageFilePath()).fileName();
const QString remoteFilePath = uploadDir() + QLatin1Char('/') + fileName; const QString remoteFilePath = uploadDir() + QLatin1Char('/') + fileName;
connect(d->uploader, SIGNAL(progress(QString)), SIGNAL(progressMessage(QString))); connect(d->uploader, SIGNAL(progress(QString)), SIGNAL(progressMessage(QString)));
connect(d->uploader, SIGNAL(uploadFinished(QString)), SLOT(handleUploadFinished(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.")); emit progressMessage(tr("Successfully uploaded package file."));
const QString remoteFilePath = uploadDir() + QLatin1Char('/') const QString remoteFilePath = uploadDir() + QLatin1Char('/')
+ QFileInfo(packageFilePath()).fileName(); + Utils::FileName::fromString(packageFilePath()).fileName();
d->state = Installing; d->state = Installing;
emit progressMessage(tr("Installing package to device...")); emit progressMessage(tr("Installing package to device..."));
connect(packageInstaller(), SIGNAL(stdoutData(QString)), SIGNAL(stdOutData(QString))); connect(packageInstaller(), SIGNAL(stdoutData(QString)), SIGNAL(stdOutData(QString)));

View File

@@ -256,7 +256,7 @@ bool ResourceTopLevelNode::removePrefix(const QString &prefix, const QString &la
ProjectExplorer::FolderNode::AddNewInformation ResourceTopLevelNode::addNewInformation(const QStringList &files, Node *context) const ProjectExplorer::FolderNode::AddNewInformation ResourceTopLevelNode::addNewInformation(const QStringList &files, Node *context) const
{ {
QString name = QCoreApplication::translate("ResourceTopLevelNode", "%1 Prefix: %2") QString name = QCoreApplication::translate("ResourceTopLevelNode", "%1 Prefix: %2")
.arg(QFileInfo(path()).fileName()) .arg(Utils::FileName::fromString(path()).fileName())
.arg(QLatin1Char('/')); .arg(QLatin1Char('/'));
int p = -1; 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 ProjectExplorer::FolderNode::AddNewInformation ResourceFolderNode::addNewInformation(const QStringList &files, Node *context) const
{ {
QString name = QCoreApplication::translate("ResourceTopLevelNode", "%1 Prefix: %2") QString name = QCoreApplication::translate("ResourceTopLevelNode", "%1 Prefix: %2")
.arg(QFileInfo(m_topLevelNode->path()).fileName()) .arg(Utils::FileName::fromString(m_topLevelNode->path()).fileName())
.arg(displayName()); .arg(displayName());
int p = -1; // never the default int p = -1; // never the default

View File

@@ -32,10 +32,10 @@
#include "textdocument.h" #include "textdocument.h"
#include <utils/algorithm.h> #include <utils/algorithm.h>
#include <utils/fileutils.h>
#include <utils/itemviews.h> #include <utils/itemviews.h>
#include <QDebug> #include <QDebug>
#include <QFileInfo>
#include <QTextCodec> #include <QTextCodec>
#include <QPushButton> #include <QPushButton>
#include <QScrollBar> #include <QScrollBar>
@@ -79,7 +79,7 @@ CodecSelector::CodecSelector(QWidget *parent, TextDocument *doc)
if (m_hasDecodingError) if (m_hasDecodingError)
decodingErrorHint = QLatin1Char('\n') + tr("The following encodings are likely to fit:"); decodingErrorHint = QLatin1Char('\n') + tr("The following encodings are likely to fit:");
m_label->setText(tr("Select encoding for \"%1\".%2") m_label->setText(tr("Select encoding for \"%1\".%2")
.arg(doc->filePath().toFileInfo().fileName()) .arg(doc->filePath().fileName())
.arg(decodingErrorHint)); .arg(decodingErrorHint));
m_listWidget = new CodecListWidget(this); m_listWidget = new CodecListWidget(this);

View File

@@ -32,12 +32,16 @@
#include "icodestylepreferencesfactory.h" #include "icodestylepreferencesfactory.h"
#include "icodestylepreferences.h" #include "icodestylepreferences.h"
#include "tabsettings.h" #include "tabsettings.h"
#include <utils/persistentsettings.h>
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <utils/fileutils.h>
#include <utils/persistentsettings.h>
#include <QMap> #include <QMap>
#include <QDir> #include <QDir>
#include <QDebug> #include <QDebug>
#include <QFileInfo>
using namespace TextEditor; using namespace TextEditor;
@@ -202,7 +206,7 @@ void CodeStylePool::removeCodeStyle(ICodeStylePreferences *codeStyle)
d->m_idToCodeStyle.remove(codeStyle->id()); d->m_idToCodeStyle.remove(codeStyle->id());
QDir dir(settingsDir()); QDir dir(settingsDir());
dir.remove(settingsPath(codeStyle->id()).toFileInfo().fileName()); dir.remove(settingsPath(codeStyle->id()).fileName());
delete codeStyle; delete codeStyle;
} }

View File

@@ -32,6 +32,7 @@
#include "texteditor.h" #include "texteditor.h"
#include <utils/filesearch.h> #include <utils/filesearch.h>
#include <utils/fileutils.h>
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <coreplugin/editormanager/ieditor.h> #include <coreplugin/editormanager/ieditor.h>
#include <coreplugin/editormanager/editormanager.h> #include <coreplugin/editormanager/editormanager.h>
@@ -78,7 +79,7 @@ QVariant FindInCurrentFile::additionalParameters() const
QString FindInCurrentFile::label() 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 QString FindInCurrentFile::toolTip() const

View File

@@ -31,13 +31,13 @@
#include "fontsettings.h" #include "fontsettings.h"
#include "fontsettingspage.h" #include "fontsettingspage.h"
#include <utils/fileutils.h>
#include <utils/hostosinfo.h> #include <utils/hostosinfo.h>
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <QCoreApplication> #include <QCoreApplication>
#include <QDebug> #include <QDebug>
#include <QFile> #include <QFile>
#include <QFileInfo>
#include <QFont> #include <QFont>
#include <QSettings> #include <QSettings>
#include <QTextCharFormat> #include <QTextCharFormat>
@@ -117,7 +117,7 @@ bool FontSettings::fromSettings(const QString &category,
// Load the selected color scheme // Load the selected color scheme
QString scheme = s->value(group + QLatin1String(schemeFileNameKey)).toString(); QString scheme = s->value(group + QLatin1String(schemeFileNameKey)).toString();
if (scheme.isEmpty() || !QFile::exists(scheme)) if (scheme.isEmpty() || !QFile::exists(scheme))
scheme = defaultSchemeFileName(QFileInfo(scheme).fileName()); scheme = defaultSchemeFileName(Utils::FileName::fromString(scheme).fileName());
loadColorScheme(scheme, descriptions); loadColorScheme(scheme, descriptions);
} else { } else {
// Load color scheme from ini file // Load color scheme from ini file

View File

@@ -34,6 +34,7 @@
#include "ui_fontsettingspage.h" #include "ui_fontsettingspage.h"
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <utils/fileutils.h>
#include <utils/stringutils.h> #include <utils/stringutils.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
@@ -562,7 +563,7 @@ void FontSettingsPage::refreshColorSchemeList()
int selected = 0; int selected = 0;
QStringList schemeList = styleDir.entryList(); QStringList schemeList = styleDir.entryList();
QString defaultScheme = QFileInfo(FontSettings::defaultSchemeFileName()).fileName(); QString defaultScheme = Utils::FileName::fromString(FontSettings::defaultSchemeFileName()).fileName();
if (schemeList.removeAll(defaultScheme)) if (schemeList.removeAll(defaultScheme))
schemeList.prepend(defaultScheme); schemeList.prepend(defaultScheme);
foreach (const QString &file, schemeList) { foreach (const QString &file, schemeList) {

View File

@@ -462,12 +462,12 @@ void MemcheckTool::engineStarting(const AnalyzerRunControl *engine)
const MemcheckRunControl *mEngine = dynamic_cast<const MemcheckRunControl *>(engine); const MemcheckRunControl *mEngine = dynamic_cast<const MemcheckRunControl *>(engine);
QTC_ASSERT(mEngine, return); 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")); m_errorView->setDefaultSuppressionFile(dir + name + QLatin1String(".supp"));
foreach (const QString &file, mEngine->suppressionFiles()) { 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->setToolTip(file);
action->setData(file); action->setData(file);
connect(action, SIGNAL(triggered(bool)), connect(action, SIGNAL(triggered(bool)),

View File

@@ -31,13 +31,13 @@
#include "valgrindprocess.h" #include "valgrindprocess.h"
#include <QDebug> #include <utils/fileutils.h>
#include <QEventLoop>
#include <QFileInfo>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/qtcprocess.h> #include <utils/qtcprocess.h>
#include <QDebug>
#include <QEventLoop>
namespace Valgrind { namespace Valgrind {
ValgrindProcess::ValgrindProcess(bool isLocal, const QSsh::SshConnectionParameters &sshParams, ValgrindProcess::ValgrindProcess(bool isLocal, const QSsh::SshConnectionParameters &sshParams,
@@ -282,7 +282,7 @@ void ValgrindProcess::remoteProcessStarted()
" | tail -n 1" // limit to single process " | tail -n 1" // limit to single process
// we pick the last one, first would be "bash -c ..." // we pick the last one, first would be "bash -c ..."
" | awk '{print $1;}'" // get pid " | 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()); m_remote.m_findPID = m_remote.m_connection->createRemoteProcess(cmd.toUtf8());
connect(m_remote.m_findPID.data(), SIGNAL(readyReadStandardError()), connect(m_remote.m_findPID.data(), SIGNAL(readyReadStandardError()),

View File

@@ -507,7 +507,7 @@ QString VcsBaseClient::vcsEditorTitle(const QString &vcsCmd, const QString &sour
const Utils::FileName binary = settings()->binaryPath(); const Utils::FileName binary = settings()->binaryPath();
return binary.toFileInfo().baseName() + return binary.toFileInfo().baseName() +
QLatin1Char(' ') + vcsCmd + QLatin1Char(' ') + QLatin1Char(' ') + vcsCmd + QLatin1Char(' ') +
QFileInfo(sourceId).fileName(); Utils::FileName::fromString(sourceId).fileName();
} }
VcsBaseEditorWidget *VcsBaseClient::createVcsEditor(Core::Id kind, QString title, VcsBaseEditorWidget *VcsBaseClient::createVcsEditor(Core::Id kind, QString title,

View File

@@ -851,7 +851,7 @@ void VcsBaseEditorWidget::slotPopulateDiffBrowser()
lastFileName = file; lastFileName = file;
// ignore any headers // ignore any headers
d->m_entrySections.push_back(d->m_entrySections.empty() ? 0 : lineNumber); d->m_entrySections.push_back(d->m_entrySections.empty() ? 0 : lineNumber);
entriesComboBox->addItem(QFileInfo(file).fileName()); entriesComboBox->addItem(Utils::FileName::fromString(file).fileName());
} }
} }
} }