Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
60bba9e0
Commit
60bba9e0
authored
Nov 02, 2008
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
QT|bookmarks: use hh:mm:ss as time default format.
parent
b6366fc0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
4 deletions
+26
-4
modules/gui/qt4/dialogs/bookmarks.cpp
modules/gui/qt4/dialogs/bookmarks.cpp
+26
-4
No files found.
modules/gui/qt4/dialogs/bookmarks.cpp
View file @
60bba9e0
...
...
@@ -125,7 +125,12 @@ void BookmarksDialog::update()
QStringList
row
;
row
<<
QString
(
pp_bookmarks
[
i
]
->
psz_name
);
row
<<
QString
(
"%1"
).
arg
(
pp_bookmarks
[
i
]
->
i_byte_offset
);
row
<<
QString
(
"%1"
).
arg
(
pp_bookmarks
[
i
]
->
i_time_offset
/
1000000
);
int
total
=
pp_bookmarks
[
i
]
->
i_time_offset
/
1000000
;
int
hour
=
total
/
(
60
*
60
);
int
min
=
(
total
-
hour
*
60
*
60
)
/
60
;
int
sec
=
total
-
hour
*
60
*
60
-
min
*
60
;
QString
str
;
row
<<
str
.
sprintf
(
"%02d:%02d:%02d"
,
hour
,
min
,
sec
);
QTreeWidgetItem
*
item
=
new
QTreeWidgetItem
(
bookmarksList
,
row
);
item
->
setFlags
(
Qt
::
ItemIsSelectable
|
Qt
::
ItemIsEditable
|
Qt
::
ItemIsUserCheckable
|
Qt
::
ItemIsEnabled
);
...
...
@@ -183,6 +188,7 @@ void BookmarksDialog::clear()
void
BookmarksDialog
::
edit
(
QTreeWidgetItem
*
item
,
int
column
)
{
QStringList
fields
;
// We can only edit a item if it is the last item selected
if
(
bookmarksList
->
selectedItems
().
isEmpty
()
||
bookmarksList
->
selectedItems
().
last
()
!=
item
)
...
...
@@ -205,7 +211,7 @@ void BookmarksDialog::edit( QTreeWidgetItem *item, int column )
return
;
if
(
i_edit
>=
i_bookmarks
)
return
;
goto
clear
;
// We modify the seekpoint
p_seekpoint
=
pp_bookmarks
[
i_edit
];
...
...
@@ -217,7 +223,20 @@ void BookmarksDialog::edit( QTreeWidgetItem *item, int column )
else
if
(
column
==
1
)
p_seekpoint
->
i_byte_offset
=
atoi
(
qtu
(
item
->
text
(
column
)
)
);
else
if
(
column
==
2
)
p_seekpoint
->
i_time_offset
=
1000000
*
atoll
(
qtu
(
item
->
text
(
column
)
)
);
{
fields
=
item
->
text
(
column
).
split
(
":"
,
QString
::
SkipEmptyParts
);
if
(
fields
.
size
()
==
1
)
p_seekpoint
->
i_time_offset
=
1000000
*
(
fields
[
0
].
toInt
()
);
else
if
(
fields
.
size
()
==
2
)
p_seekpoint
->
i_time_offset
=
1000000
*
(
fields
[
0
].
toInt
()
*
60
+
fields
[
1
].
toInt
()
);
else
if
(
fields
.
size
()
==
3
)
p_seekpoint
->
i_time_offset
=
1000000
*
(
fields
[
0
].
toInt
()
*
3600
+
fields
[
1
].
toInt
()
*
60
+
fields
[
2
].
toInt
()
);
else
{
msg_Err
(
p_intf
,
"Invalid string format for time"
);
goto
clear
;
}
}
// Send the modification
if
(
input_Control
(
p_input
,
INPUT_CHANGE_BOOKMARK
,
p_seekpoint
,
i_edit
)
!=
...
...
@@ -230,7 +249,10 @@ void BookmarksDialog::edit( QTreeWidgetItem *item, int column )
// Clear the bookmark list
clear:
for
(
int
i
=
0
;
i
<
i_bookmarks
;
i
++
)
vlc_seekpoint_Delete
(
pp_bookmarks
[
i
]
);
{
if
(
p_seekpoint
!=
pp_bookmarks
[
i
]
)
vlc_seekpoint_Delete
(
pp_bookmarks
[
i
]
);
}
free
(
pp_bookmarks
);
}
...
...
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