2 Copyright 2007-2008 by Robert Knight <robertknight@gmail.com>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 #include "ViewProperties.h"
25 using namespace Konsole
;
27 QHash
<int,ViewProperties
*> ViewProperties::_viewProperties
;
28 QString
ViewProperties::_mimeType
= "application/x-konsole-view-id";
30 ViewProperties::ViewProperties(QObject
* parent
)
36 ViewProperties::~ViewProperties()
38 _viewProperties
.remove(_id
);
40 ViewProperties
* ViewProperties::propertiesById(int id
)
42 return _viewProperties
[id
];
44 KUrl
ViewProperties::url() const
48 QString
ViewProperties::currentDir() const
52 void ViewProperties::fireActivity()
57 void ViewProperties::rename()
61 void ViewProperties::setTitle(const QString
& title
)
63 if ( title
!= _title
)
66 emit
titleChanged(this);
69 void ViewProperties::setIcon(const QIcon
& icon
)
71 // the icon's cache key is used to determine whether this icon is the same
72 // as the old one. if so no signal is emitted.
74 if ( icon
.cacheKey() != _icon
.cacheKey() )
77 emit
iconChanged(this);
80 void ViewProperties::setIdentifier(int id
)
82 if (_viewProperties
.contains(_id
))
83 _viewProperties
.remove(_id
);
87 _viewProperties
.insert(id
,this);
89 QString
ViewProperties::title() const
93 QIcon
ViewProperties::icon() const
97 int ViewProperties::identifier() const
101 #include "ViewProperties.moc"