summaryrefslogtreecommitdiff
path: root/src/plugins/qnx
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2014-12-21 21:54:30 +0200
committerOrgad Shaneh <orgads@gmail.com>2015-01-12 10:23:37 +0100
commitc6a983d27179ebd26e692918e58d44aa77fc7f8a (patch)
tree6ef23b30a2e6c4a29c14acbb824e38bae026acdb /src/plugins/qnx
parent9c1b28fec265054ba4a9c13093ebcfc0f5b4c723 (diff)
downloadqt-creator-c6a983d27179ebd26e692918e58d44aa77fc7f8a.tar.gz
Core: Use FileName for file path in IDocument
Change-Id: I85f7398aee59d0d36f0e5c3bf88ff3c96002e394 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Diffstat (limited to 'src/plugins/qnx')
-rw-r--r--src/plugins/qnx/bardescriptordocument.cpp12
-rw-r--r--src/plugins/qnx/bardescriptoreditor.cpp2
-rw-r--r--src/plugins/qnx/bardescriptoreditorwidget.cpp4
-rw-r--r--src/plugins/qnx/bardescriptoreditorwidget.h2
-rw-r--r--src/plugins/qnx/bardescriptorfilenodemanager.cpp2
5 files changed, 10 insertions, 12 deletions
diff --git a/src/plugins/qnx/bardescriptordocument.cpp b/src/plugins/qnx/bardescriptordocument.cpp
index bb53862c5c..263556eded 100644
--- a/src/plugins/qnx/bardescriptordocument.cpp
+++ b/src/plugins/qnx/bardescriptordocument.cpp
@@ -68,7 +68,7 @@ bool BarDescriptorDocument::open(QString *errorString, const QString &fileName)
if (read(fileName, &contents, errorString) != Utils::TextFileFormat::ReadSuccess)
return false;
- setFilePath(fileName);
+ setFilePath(Utils::FileName::fromString(fileName));
const bool result = loadContent(contents, false);
@@ -83,7 +83,7 @@ bool BarDescriptorDocument::save(QString *errorString, const QString &fn, bool a
QTC_ASSERT(!autoSave, return false);
QTC_ASSERT(fn.isEmpty(), return false);
- const bool result = write(filePath(), xmlSource(), errorString);
+ const bool result = write(filePath().toString(), xmlSource(), errorString);
if (!result)
return false;
@@ -94,14 +94,12 @@ bool BarDescriptorDocument::save(QString *errorString, const QString &fn, bool a
QString BarDescriptorDocument::defaultPath() const
{
- QFileInfo fi(filePath());
- return fi.absolutePath();
+ return filePath().toFileInfo().absolutePath();
}
QString BarDescriptorDocument::suggestedFileName() const
{
- QFileInfo fi(filePath());
- return fi.fileName();
+ return filePath().toFileInfo().fileName();
}
bool BarDescriptorDocument::shouldAutoSave() const
@@ -135,7 +133,7 @@ bool BarDescriptorDocument::reload(QString *errorString, Core::IDocument::Reload
if (flag == Core::IDocument::FlagIgnore)
return true;
- return open(errorString, filePath());
+ return open(errorString, filePath().toString());
}
QString BarDescriptorDocument::xmlSource() const
diff --git a/src/plugins/qnx/bardescriptoreditor.cpp b/src/plugins/qnx/bardescriptoreditor.cpp
index 188ef97158..b6d6ff81ba 100644
--- a/src/plugins/qnx/bardescriptoreditor.cpp
+++ b/src/plugins/qnx/bardescriptoreditor.cpp
@@ -112,7 +112,7 @@ bool BarDescriptorEditor::open(QString *errorString, const QString &fileName, co
if (result) {
BarDescriptorEditorWidget *editorWidget = qobject_cast<BarDescriptorEditorWidget *>(widget());
QTC_ASSERT(editorWidget, return false);
- editorWidget->setFilePath(fileName);
+ editorWidget->setFilePath(Utils::FileName::fromString(fileName));
}
return result;
diff --git a/src/plugins/qnx/bardescriptoreditorwidget.cpp b/src/plugins/qnx/bardescriptoreditorwidget.cpp
index 525fb1f57f..d0de2eef49 100644
--- a/src/plugins/qnx/bardescriptoreditorwidget.cpp
+++ b/src/plugins/qnx/bardescriptoreditorwidget.cpp
@@ -192,7 +192,7 @@ TextEditor::TextEditorWidget *BarDescriptorEditorWidget::sourceWidget() const
return m_xmlSourceWidget;
}
-void BarDescriptorEditorWidget::setFilePath(const QString &filePath)
+void BarDescriptorEditorWidget::setFilePath(const Utils::FileName &filePath)
{
Core::IDocument *doc = m_xmlSourceWidget->textDocument();
if (doc)
@@ -211,7 +211,7 @@ void BarDescriptorEditorWidget::updateDocumentContent()
if (!result) {
ProjectExplorer::TaskHub::addTask(ProjectExplorer::Task::Error, errorMsg, Constants::QNX_TASK_CATEGORY_BARDESCRIPTOR,
- Utils::FileName::fromString(barDescriptorDocument()->filePath()), errorLine);
+ Utils::FileName::fromString(barDescriptorDocument()->filePath().toString()), errorLine);
ProjectExplorer::TaskHub::requestPopup();
}
}
diff --git a/src/plugins/qnx/bardescriptoreditorwidget.h b/src/plugins/qnx/bardescriptoreditorwidget.h
index dd893d0374..95fd4fe101 100644
--- a/src/plugins/qnx/bardescriptoreditorwidget.h
+++ b/src/plugins/qnx/bardescriptoreditorwidget.h
@@ -64,7 +64,7 @@ public:
TextEditor::TextEditorWidget *sourceWidget() const;
- void setFilePath(const QString &filePath);
+ void setFilePath(const Utils::FileName &filePath);
signals:
void changed(BarDescriptorDocument::Tag tag, const QVariant &value);
diff --git a/src/plugins/qnx/bardescriptorfilenodemanager.cpp b/src/plugins/qnx/bardescriptorfilenodemanager.cpp
index 008241f236..0d47584e70 100644
--- a/src/plugins/qnx/bardescriptorfilenodemanager.cpp
+++ b/src/plugins/qnx/bardescriptorfilenodemanager.cpp
@@ -170,7 +170,7 @@ void BarDescriptorFileNodeManager::updateBarDescriptorNodes(ProjectExplorer::Pro
Core::MessageManager::write(tr("Cannot save bar descriptor file: %1").arg(errorMessage));
continue;
} else {
- oldDocument->setFilePath(package.appDescriptorPath());
+ oldDocument->setFilePath(Utils::FileName::fromString(package.appDescriptorPath()));
if (!oldDocument->reload(&errorMessage, Core::IDocument::FlagReload, Core::IDocument::TypeContents))
Core::MessageManager::write(tr("Cannot reload bar descriptor file: %1").arg(errorMessage));