Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
berryFileEditorInput.cpp
Go to the documentation of this file.
1 /*===================================================================
2 
3 BlueBerry Platform
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #include "berryFileEditorInput.h"
18 
19 #include <QIcon>
20 
21 namespace berry {
22 
24  : m_Path(path)
25 {
26 
27 }
28 
29 QString FileEditorInput::GetPath() const
30 {
31  return m_Path.absolutePath();
32 }
33 
35 {
36  return m_Path.exists();
37 }
38 
39 QString FileEditorInput::GetName() const
40 {
41  return m_Path.fileName();
42 }
43 
45 {
46  return m_Path.absolutePath();
47 }
48 
50 {
51  return QIcon();
52 }
53 
55 {
56  return nullptr;
57 }
58 
59 Object* FileEditorInput::GetAdapter(const QString& /*adapterType*/) const
60 {
61  return nullptr;
62 }
63 
64 bool FileEditorInput::operator==(const Object* o) const
65 {
66  if (const IPathEditorInput* other = dynamic_cast<const IPathEditorInput*>(o))
67  {
68  return other->GetPath() == this->GetPath();
69  }
70  return false;
71 }
72 
73 }
74 
bool operator==(const Object *o) const override
QString GetPath() const override
Light weight base class for most BlueBerry classes.
Definition: berryObject.h:78
bool Exists() const override
QString GetToolTipText() const override
QString GetName() const override
FileEditorInput(const QString &path)
QIcon GetIcon() const override
const IPersistableElement * GetPersistable() const override