TaskList: Fix crash

Fix crash when a tasks-file with relative paths is reloaded after
its project was closed.

Change-Id: I3d0b6a3b459e391a3415d765941b2685e601b19f
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Tobias Hunger
2013-09-24 09:56:27 +02:00
parent 49d0789e64
commit 10e458d5d0
6 changed files with 24 additions and 27 deletions

View File

@@ -38,8 +38,7 @@ using namespace TaskList::Internal;
// TaskFile
// --------------------------------------------------------------------------
TaskFile::TaskFile(QObject *parent) : Core::IDocument(parent),
m_context(0)
TaskFile::TaskFile(QObject *parent) : Core::IDocument(parent)
{ }
TaskFile::~TaskFile()
@@ -101,16 +100,15 @@ bool TaskFile::reload(QString *errorString, ReloadFlag flag, ChangeType type)
bool TaskFile::open(QString *errorString, const QString &fileName)
{
setFilePath(fileName);
return TaskList::TaskListPlugin::loadFile(errorString, m_context, fileName);
return TaskList::TaskListPlugin::loadFile(errorString, m_baseDir, fileName);
}
ProjectExplorer::Project *TaskFile::context() const
QString TaskFile::baseDir() const
{
return m_context;
return m_baseDir;
}
void TaskFile::setContext(ProjectExplorer::Project *context)
void TaskFile::setBaseDir(const QString &base)
{
m_context = context;
m_baseDir = base;
}