Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
d1902eb8
Commit
d1902eb8
authored
Jan 11, 2012
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4: restore search in SD
Close #5545
parent
cedc46ea
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
7 deletions
+20
-7
modules/gui/qt4/components/playlist/selector.cpp
modules/gui/qt4/components/playlist/selector.cpp
+9
-1
modules/gui/qt4/components/playlist/selector.hpp
modules/gui/qt4/components/playlist/selector.hpp
+3
-2
modules/gui/qt4/components/playlist/standardpanel.cpp
modules/gui/qt4/components/playlist/standardpanel.cpp
+8
-4
No files found.
modules/gui/qt4/components/playlist/selector.cpp
View file @
d1902eb8
...
...
@@ -278,7 +278,14 @@ void PLSelector::setSource( QTreeWidgetItem *item )
QString
qs
=
item
->
data
(
0
,
NAME_ROLE
).
toString
();
sd_loaded
=
playlist_IsServicesDiscoveryLoaded
(
THEPL
,
qtu
(
qs
)
);
if
(
!
sd_loaded
)
{
playlist_ServicesDiscoveryAdd
(
THEPL
,
qtu
(
qs
)
);
services_discovery_descriptor_t
*
p_test
=
new
services_discovery_descriptor_t
;
playlist_ServicesDiscoveryControl
(
THEPL
,
qtu
(
qs
),
SD_CMD_DESCRIPTOR
,
p_test
);
if
(
p_test
->
i_capabilities
&
SD_CAP_SEARCH
)
item
->
setData
(
0
,
CAP_SEARCH_ROLE
,
true
);
}
}
#ifdef MEDIA_LIBRARY
else
if
(
i_type
==
SQL_ML_TYPE
)
...
...
@@ -528,10 +535,11 @@ void PLSelector::drawBranches ( QPainter * painter, const QRect & rect, const QM
QStyle
::
PE_IndicatorArrowRight
,
&
option
,
painter
);
}
void
PLSelector
::
getCurrent
SelectedItem
(
int
*
type
,
QString
*
string
)
void
PLSelector
::
getCurrent
ItemInfos
(
int
*
type
,
bool
*
can_delay_search
,
QString
*
string
)
{
*
type
=
currentItem
()
->
data
(
0
,
TYPE_ROLE
).
toInt
();
*
string
=
currentItem
()
->
data
(
0
,
NAME_ROLE
).
toString
();
*
can_delay_search
=
currentItem
()
->
data
(
0
,
CAP_SEARCH_ROLE
).
toBool
();
}
int
PLSelector
::
getCurrentItemCategory
()
...
...
modules/gui/qt4/components/playlist/selector.hpp
View file @
d1902eb8
...
...
@@ -60,7 +60,8 @@ enum {
PL_ITEM_ROLE
,
//playlist_item_t*
PL_ITEM_ID_ROLE
,
//playlist_item_t->i_id
IN_ITEM_ROLE
,
//input_item_t->i_id
SPECIAL_ROLE
//SpecialData
SPECIAL_ROLE
,
//SpecialData
CAP_SEARCH_ROLE
,
};
enum
ItemAction
{
...
...
@@ -116,7 +117,7 @@ public:
PLSelector
(
QWidget
*
p
,
intf_thread_t
*
_p_intf
);
virtual
~
PLSelector
();
void
getCurrent
SelectedItem
(
int
*
type
,
QString
*
name
);
void
getCurrent
ItemInfos
(
int
*
type
,
bool
*
delayedSearch
,
QString
*
name
);
int
getCurrentItemCategory
();
protected:
...
...
modules/gui/qt4/components/playlist/standardpanel.cpp
View file @
d1902eb8
...
...
@@ -151,8 +151,10 @@ void StandardPLPanel::search( const QString& searchText )
{
int
type
;
QString
name
;
p_selector
->
getCurrentSelectedItem
(
&
type
,
&
name
);
if
(
type
!=
SD_TYPE
)
bool
can_search
;
p_selector
->
getCurrentItemInfos
(
&
type
,
&
can_search
,
&
name
);
if
(
type
!=
SD_TYPE
||
!
can_search
)
{
bool
flat
=
(
currentView
==
iconView
||
currentView
==
listView
||
...
...
@@ -167,10 +169,12 @@ void StandardPLPanel::searchDelayed( const QString& searchText )
{
int
type
;
QString
name
;
p_selector
->
getCurrentSelectedItem
(
&
type
,
&
name
);
bool
can_search
;
p_selector
->
getCurrentItemInfos
(
&
type
,
&
can_search
,
&
name
);
if
(
type
==
SD_TYPE
)
if
(
type
==
SD_TYPE
&&
can_search
)
{
msg_Err
(
p_intf
,
"SEARCHING DELAYED"
);
if
(
!
name
.
isEmpty
()
&&
!
searchText
.
isEmpty
()
)
playlist_ServicesDiscoveryControl
(
THEPL
,
qtu
(
name
),
SD_CMD_SEARCH
,
qtu
(
searchText
)
);
...
...
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