• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • applications API Reference
  • KDE Home
  • Contact Us
 

Konsole

  • kde-4.14
  • applications
  • konsole
  • src
ViewProperties.cpp
Go to the documentation of this file.
1 /*
2  Copyright 2007-2008 by Robert Knight <robertknight@gmail.com>
3 
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.
8 
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.
13 
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
17  02110-1301 USA.
18 */
19 
20 // Own
21 #include "ViewProperties.h"
22 
23 using Konsole::ViewProperties;
24 
25 QHash<int, ViewProperties*> ViewProperties::_viewProperties;
26 QString ViewProperties::_mimeType = "application/x-konsole-view-id";
27 
28 ViewProperties::ViewProperties(QObject* parent)
29  : QObject(parent)
30  , _id(0)
31 {
32 }
33 
34 ViewProperties::~ViewProperties()
35 {
36  _viewProperties.remove(_id);
37 }
38 ViewProperties* ViewProperties::propertiesById(int id)
39 {
40  return _viewProperties[id];
41 }
42 KUrl ViewProperties::url() const
43 {
44  return KUrl();
45 }
46 QString ViewProperties::currentDir() const
47 {
48  return QString();
49 }
50 void ViewProperties::fireActivity()
51 {
52  emit activity(this);
53 }
54 
55 void ViewProperties::rename()
56 {
57 }
58 
59 void ViewProperties::setTitle(const QString& title)
60 {
61  if (title != _title) {
62  _title = title;
63  emit titleChanged(this);
64  }
65 }
66 void ViewProperties::setIcon(const QIcon& icon)
67 {
68  // the icon's cache key is used to determine whether this icon is the same
69  // as the old one. if so no signal is emitted.
70 
71  if (icon.cacheKey() != _icon.cacheKey()) {
72  _icon = icon;
73  emit iconChanged(this);
74  }
75 }
76 void ViewProperties::setIdentifier(int id)
77 {
78  if (_viewProperties.contains(_id))
79  _viewProperties.remove(_id);
80 
81  _id = id;
82 
83  _viewProperties.insert(id, this);
84 }
85 QString ViewProperties::title() const
86 {
87  return _title;
88 }
89 QIcon ViewProperties::icon() const
90 {
91  return _icon;
92 }
93 int ViewProperties::identifier() const
94 {
95  return _id;
96 }
97 #include "ViewProperties.moc"
QIcon::cacheKey
qint64 cacheKey() const
Konsole::ViewProperties::title
QString title() const
Returns the title associated with a view.
Definition: ViewProperties.cpp:85
Konsole::ViewProperties::setIdentifier
void setIdentifier(int id)
Subclasses may call this method to change the identifier.
Definition: ViewProperties.cpp:76
Konsole::ViewProperties::rename
virtual void rename()
Requests the renaming of this view.
Definition: ViewProperties.cpp:55
Konsole::ViewProperties::setTitle
void setTitle(const QString &title)
Subclasses may call this method to change the title.
Definition: ViewProperties.cpp:59
Konsole::ViewProperties::setIcon
void setIcon(const QIcon &icon)
Subclasses may call this method to change the icon.
Definition: ViewProperties.cpp:66
Konsole::ViewProperties::titleChanged
void titleChanged(ViewProperties *properties)
Emitted when the title for a view changes.
Konsole::ViewProperties::iconChanged
void iconChanged(ViewProperties *properties)
Emitted when the icon for a view changes.
Konsole::ViewProperties::~ViewProperties
virtual ~ViewProperties()
Definition: ViewProperties.cpp:34
QHash
QObject
Konsole::ViewProperties::currentDir
virtual QString currentDir() const
Returns the current directory associated with a view.
Definition: ViewProperties.cpp:46
Konsole::ViewProperties::fireActivity
void fireActivity()
Emits the activity() signal.
Definition: ViewProperties.cpp:50
QString
Konsole::ViewProperties
Encapsulates user-visible information about the terminal session currently being displayed in a view...
Definition: ViewProperties.h:44
Konsole::ViewProperties::propertiesById
static ViewProperties * propertiesById(int id)
Finds a ViewProperties instance given its numeric identifier.
Definition: ViewProperties.cpp:38
Konsole::ViewProperties::identifier
int identifier() const
A unique identifier associated with this ViewProperties instance.
Definition: ViewProperties.cpp:93
Konsole::ViewProperties::activity
void activity(ViewProperties *item)
Emitted when activity has occurred in this view.
ViewProperties.h
Konsole::ViewProperties::url
virtual KUrl url() const
Returns the URL current associated with a view.
Definition: ViewProperties.cpp:42
QIcon
Konsole::ViewProperties::icon
QIcon icon() const
Returns the icon associated with a view.
Definition: ViewProperties.cpp:89
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:27 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Konsole

Skip menu "Konsole"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

applications API Reference

Skip menu "applications API Reference"
  •   kate
  •       kate
  •   KTextEditor
  •   Kate
  • Konsole

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal