Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
berryFileEditorInput.cpp
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #include "berryFileEditorInput.h"
14 
15 #include <QIcon>
16 
17 namespace berry {
18 
20  : m_Path(path)
21 {
22 
23 }
24 
25 QString FileEditorInput::GetPath() const
26 {
27  return m_Path.absolutePath();
28 }
29 
31 {
32  return m_Path.exists();
33 }
34 
35 QString FileEditorInput::GetName() const
36 {
37  return m_Path.fileName();
38 }
39 
41 {
42  return m_Path.absolutePath();
43 }
44 
46 {
47  return QIcon();
48 }
49 
51 {
52  return nullptr;
53 }
54 
55 Object* FileEditorInput::GetAdapter(const QString& /*adapterType*/) const
56 {
57  return nullptr;
58 }
59 
60 bool FileEditorInput::operator==(const Object* o) const
61 {
62  if (const IPathEditorInput* other = dynamic_cast<const IPathEditorInput*>(o))
63  {
64  return other->GetPath() == this->GetPath();
65  }
66  return false;
67 }
68 
69 }
70 
bool operator==(const Object *o) const override
QString GetPath() const override
Light weight base class for most BlueBerry classes.
Definition: berryObject.h:72
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