Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
f66b2c98
Commit
f66b2c98
authored
Mar 05, 2011
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: EPGItem: simplify setters
parent
b8635eb0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
35 deletions
+15
-35
modules/gui/qt4/components/epg/EPGEvent.hpp
modules/gui/qt4/components/epg/EPGEvent.hpp
+2
-1
modules/gui/qt4/components/epg/EPGItem.cpp
modules/gui/qt4/components/epg/EPGItem.cpp
+9
-24
modules/gui/qt4/components/epg/EPGItem.hpp
modules/gui/qt4/components/epg/EPGItem.hpp
+3
-5
modules/gui/qt4/components/epg/EPGView.cpp
modules/gui/qt4/components/epg/EPGView.cpp
+1
-5
No files found.
modules/gui/qt4/components/epg/EPGEvent.hpp
View file @
f66b2c98
...
...
@@ -32,7 +32,7 @@ class EPGEvent
{
public:
EPGEvent
(
const
QString
&
eventName
)
:
current
(
false
),
updated
(
true
),
item
(
NULL
)
:
current
(
false
),
updated
(
true
),
simultaneous
(
false
),
item
(
NULL
)
{
name
=
eventName
;
}
...
...
@@ -62,6 +62,7 @@ public:
QString
channelName
;
bool
current
;
bool
updated
;
bool
simultaneous
;
EPGItem
*
item
;
};
...
...
modules/gui/qt4/components/epg/EPGItem.cpp
View file @
f66b2c98
...
...
@@ -40,7 +40,6 @@ EPGItem::EPGItem( EPGView *view )
:
m_view
(
view
)
{
m_current
=
false
;
m_boundingRect
.
setHeight
(
TRACKS_HEIGHT
);
setFlags
(
QGraphicsItem
::
ItemIsSelectable
|
QGraphicsItem
::
ItemIsFocusable
);
setAcceptHoverEvents
(
true
);
...
...
@@ -137,10 +136,17 @@ void EPGItem::setChannelNb( int channelNb )
updatePos
();
}
void
EPGItem
::
set
Start
(
const
QDateTime
&
star
t
)
void
EPGItem
::
set
Data
(
EPGEvent
*
even
t
)
{
m_start
=
start
;
m_start
=
event
->
start
;
m_name
=
event
->
name
;
m_description
=
event
->
description
;
m_shortDescription
=
event
->
shortDescription
;
m_current
=
event
->
current
;
m_simultaneous
=
event
->
simultaneous
;
setDuration
(
event
->
duration
);
updatePos
();
setToolTip
(
m_name
);
}
void
EPGItem
::
setDuration
(
int
duration
)
...
...
@@ -149,27 +155,6 @@ void EPGItem::setDuration( int duration )
m_boundingRect
.
setWidth
(
duration
);
}
void
EPGItem
::
setName
(
const
QString
&
name
)
{
m_name
=
name
;
setToolTip
(
m_name
);
}
void
EPGItem
::
setDescription
(
const
QString
&
description
)
{
m_description
=
description
;
}
void
EPGItem
::
setShortDescription
(
const
QString
&
shortDescription
)
{
m_shortDescription
=
shortDescription
;
}
void
EPGItem
::
setCurrent
(
bool
current
)
{
m_current
=
current
;
}
void
EPGItem
::
updatePos
()
{
int
x
=
m_view
->
startTime
().
secsTo
(
m_start
);
...
...
modules/gui/qt4/components/epg/EPGItem.hpp
View file @
f66b2c98
...
...
@@ -31,6 +31,7 @@ class QString;
class
QDateTime
;
class
EPGView
;
class
EPGEvent
;
class
EPGItem
:
public
QGraphicsItem
{
...
...
@@ -46,13 +47,9 @@ public:
int
duration
()
const
;
int
getChannelNb
()
const
;
void
setData
(
EPGEvent
*
);
void
setChannelNb
(
int
channelNb
);
void
setStart
(
const
QDateTime
&
start
);
void
setDuration
(
int
duration
);
void
setName
(
const
QString
&
name
);
void
setDescription
(
const
QString
&
description
);
void
setShortDescription
(
const
QString
&
shortDescription
);
void
setCurrent
(
bool
current
);
void
updatePos
();
protected:
...
...
@@ -70,6 +67,7 @@ private:
QString
m_description
;
QString
m_shortDescription
;
bool
m_current
;
bool
m_simultaneous
;
};
#endif // EPGITEM_H
modules/gui/qt4/components/epg/EPGView.cpp
View file @
f66b2c98
...
...
@@ -92,13 +92,9 @@ void EPGView::addEvent( EPGEvent* event )
m_channels
.
append
(
event
->
channelName
);
EPGItem
*
item
=
new
EPGItem
(
this
);
item
->
setData
(
event
);
item
->
setChannelNb
(
m_channels
.
indexOf
(
event
->
channelName
)
);
item
->
setStart
(
event
->
start
);
item
->
setDuration
(
event
->
duration
);
item
->
setName
(
event
->
name
);
item
->
setDescription
(
event
->
description
);
item
->
setShortDescription
(
event
->
shortDescription
);
item
->
setCurrent
(
event
->
current
);
event
->
item
=
item
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment