diff options
author | Tobias Hunger <tobias.hunger@digia.com> | 2014-04-29 13:39:45 +0200 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@digia.com> | 2014-04-29 13:41:19 +0200 |
commit | 891eaf25239162b90aa01f47a9b8e9cf7a2f785e (patch) | |
tree | 519f45b0ada85205617a85831722bf63152d5872 /src/plugins/tasklist | |
parent | 399f49cca221701f2f860dab43bc638d2ce9294f (diff) |
TaskList: Do not open the same file several times
This avoids having the issue repeated if you repeatedly opened
the same file.
Change-Id: I998a00b4351ff760a4384dc89a3a7ce94d713500
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Diffstat (limited to 'src/plugins/tasklist')
-rw-r--r-- | src/plugins/tasklist/taskfilefactory.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/tasklist/taskfilefactory.cpp b/src/plugins/tasklist/taskfilefactory.cpp index a902449257..b0bbb394e0 100644 --- a/src/plugins/tasklist/taskfilefactory.cpp +++ b/src/plugins/tasklist/taskfilefactory.cpp @@ -60,6 +60,11 @@ Core::IDocument *TaskFileFactory::open(const QString &fileName) Core::IDocument *TaskFileFactory::open(const QString &base, const QString &fileName) { + foreach (TaskFile *doc, m_openFiles) { + if (doc->filePath() == fileName) + return doc; + } + TaskFile *file = new TaskFile(this); file->setBaseDir(base); |