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
240e4ec4
Commit
240e4ec4
authored
Jul 15, 2012
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: PLModel: rework menu signaling to get rid of popup data storage in model
parent
d4a2b748
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
207 additions
and
182 deletions
+207
-182
modules/gui/qt4/components/playlist/playlist_model.cpp
modules/gui/qt4/components/playlist/playlist_model.cpp
+182
-163
modules/gui/qt4/components/playlist/playlist_model.hpp
modules/gui/qt4/components/playlist/playlist_model.hpp
+4
-18
modules/gui/qt4/components/playlist/vlc_model.hpp
modules/gui/qt4/components/playlist/vlc_model.hpp
+21
-1
No files found.
modules/gui/qt4/components/playlist/playlist_model.cpp
View file @
240e4ec4
This diff is collapsed.
Click to expand it.
modules/gui/qt4/components/playlist/playlist_model.hpp
View file @
240e4ec4
...
...
@@ -47,7 +47,6 @@
class
PLItem
;
class
PLSelector
;
class
PlMimeData
;
class
QSignalMapper
;
class
PLModel
:
public
VLCModel
{
...
...
@@ -128,6 +127,8 @@ public slots:
virtual
void
activateItem
(
const
QModelIndex
&
index
);
void
clearPlaylist
();
void
ensureArtRequested
(
const
QModelIndex
&
index
);
virtual
void
actionSlot
(
QAction
*
action
);
private:
/* General */
PLItem
*
rootItem
;
...
...
@@ -154,7 +155,7 @@ private:
return
static_cast
<
PLItem
*>
(
index
.
internalPointer
()
);
else
return
rootItem
;
}
QStringList
selectedURIs
();
QStringList
selectedURIs
(
QModelIndexList
*
);
QModelIndex
index
(
PLItem
*
,
const
int
c
)
const
;
bool
isCurrent
(
const
QModelIndex
&
index
)
const
;
bool
isParent
(
const
QModelIndex
&
index
,
const
QModelIndex
&
current
)
const
;
...
...
@@ -175,13 +176,7 @@ private:
void
dropMove
(
const
PlMimeData
*
data
,
PLItem
*
target
,
int
new_pos
);
/* */
void
sort
(
QModelIndex
rootIndex
,
const
int
column
,
Qt
::
SortOrder
order
);
/* Popup */
QModelIndex
popupLauncherIndex
;
QModelIndexList
current_selection
;
QMenu
*
sortingMenu
;
QSignalMapper
*
sortingMapper
;
void
sort
(
QModelIndex
caller
,
QModelIndex
rootIndex
,
const
int
column
,
Qt
::
SortOrder
order
);
/* Lookups */
PLItem
*
findById
(
PLItem
*
,
int
)
const
;
...
...
@@ -200,15 +195,6 @@ private:
QString
latestSearch
;
private
slots
:
void
popupPlay
();
void
popupDel
();
void
popupInfo
();
void
popupStream
();
void
popupSave
();
void
popupExplore
();
void
popupAddNode
();
void
popupAddToPlaylist
();
void
popupSort
(
int
column
);
void
processInputItemUpdate
(
input_item_t
*
);
void
processInputItemUpdate
(
input_thread_t
*
p_input
);
void
processItemRemoval
(
int
i_id
);
...
...
modules/gui/qt4/components/playlist/vlc_model.hpp
View file @
240e4ec4
...
...
@@ -37,7 +37,7 @@
#include <QPixmapCache>
#include <QSize>
#include <QAbstractItemModel>
class
QAction
;
class
VLCModel
:
public
QAbstractItemModel
{
...
...
@@ -60,6 +60,24 @@ public:
static
QPixmap
getArtPixmap
(
const
QModelIndex
&
index
,
const
QSize
&
size
);
static
QString
getArtUrl
(
const
QModelIndex
&
index
);
struct
actionsContainerType
{
enum
{
ACTION_PLAY
=
1
,
ACTION_INFO
,
ACTION_STREAM
,
ACTION_SAVE
,
ACTION_EXPLORE
,
ACTION_ADDTOPLAYLIST
,
ACTION_ADDNODE
,
ACTION_REMOVE
,
ACTION_SORT
}
action
;
QModelIndexList
indexes
;
/* for passing selection or caller index(es) */
int
column
;
/* for sorting */
};
static
int
columnToMeta
(
int
_column
)
{
int
meta
=
1
,
column
=
0
;
...
...
@@ -88,11 +106,13 @@ public:
public
slots
:
virtual
void
activateItem
(
const
QModelIndex
&
index
)
=
0
;
virtual
void
actionSlot
(
QAction
*
action
)
=
0
;
protected:
intf_thread_t
*
p_intf
;
};
Q_DECLARE_METATYPE
(
VLCModel
::
actionsContainerType
)
#endif
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