Core: Use FileName for file path in IDocument

Change-Id: I85f7398aee59d0d36f0e5c3bf88ff3c96002e394
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
Orgad Shaneh
2014-12-21 21:54:30 +02:00
committed by Orgad Shaneh
parent 9c1b28fec2
commit c6a983d271
123 changed files with 327 additions and 324 deletions

View File

@@ -85,7 +85,7 @@ void CMakeEditor::finalizeInitialization()
info.setCustomButtonInfo(tr("Build now"), [document]() {
foreach (Project *p, SessionManager::projects()) {
if (CMakeProject *cmakeProject = qobject_cast<CMakeProject *>(p)) {
if (cmakeProject->isProjectFile(document->filePath())) {
if (cmakeProject->isProjectFile(document->filePath().toString())) {
ProjectExplorerPlugin::buildProject(cmakeProject);
break;
}
@@ -212,7 +212,7 @@ CMakeEditorWidget::Link CMakeEditorWidget::findLinkAt(const QTextCursor &cursor,
// TODO: Resolve variables
QDir dir(QFileInfo(textDocument()->filePath()).absolutePath());
QDir dir(textDocument()->filePath().toFileInfo().absolutePath());
QString fileName = dir.filePath(buffer);
QFileInfo fi(fileName);
if (fi.exists()) {
@@ -252,14 +252,12 @@ CMakeDocument::CMakeDocument()
QString CMakeDocument::defaultPath() const
{
QFileInfo fi(filePath());
return fi.absolutePath();
return filePath().toFileInfo().absolutePath();
}
QString CMakeDocument::suggestedFileName() const
{
QFileInfo fi(filePath());
return fi.fileName();
return filePath().toFileInfo().fileName();
}
//

View File

@@ -233,7 +233,7 @@ bool CMakeProject::parseCMakeLists()
CMakeBuildConfiguration *activeBC = static_cast<CMakeBuildConfiguration *>(activeTarget()->activeBuildConfiguration());
foreach (Core::IDocument *document, Core::DocumentModel::openedDocuments())
if (isProjectFile(document->filePath()))
if (isProjectFile(document->filePath().toString()))
document->infoBar()->removeInfo("CMakeEditor.RunCMake");
// Find cbp file
@@ -741,7 +741,7 @@ CMakeFile::CMakeFile(CMakeProject *parent, QString fileName)
{
setId("Cmake.ProjectFile");
setMimeType(QLatin1String(Constants::CMAKEPROJECTMIMETYPE));
setFilePath(fileName);
setFilePath(Utils::FileName::fromString(fileName));
}
bool CMakeFile::save(QString *errorString, const QString &fileName, bool autoSave)