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
c875b9ea
Commit
c875b9ea
authored
Jan 18, 2014
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: ExtensionsModel: do DI
parent
4d756c68
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
9 deletions
+7
-9
modules/gui/qt4/dialogs/plugins.cpp
modules/gui/qt4/dialogs/plugins.cpp
+4
-6
modules/gui/qt4/dialogs/plugins.hpp
modules/gui/qt4/dialogs/plugins.hpp
+3
-3
No files found.
modules/gui/qt4/dialogs/plugins.cpp
View file @
c875b9ea
...
...
@@ -227,7 +227,8 @@ ExtensionTab::ExtensionTab( intf_thread_t *p_intf_ )
extList
->
setSelectionMode
(
QAbstractItemView
::
SingleSelection
);
// Model
ExtensionListModel
*
model
=
new
ExtensionListModel
(
extList
,
p_intf
);
ExtensionListModel
*
model
=
new
ExtensionListModel
(
extList
,
ExtensionsManager
::
getInstance
(
p_intf
)
);
extList
->
setModel
(
model
);
// Buttons' layout
...
...
@@ -336,11 +337,10 @@ QVariant ExtensionListModel::ExtensionCopy::data( int role ) const
/* Extensions list model for the QListView */
ExtensionListModel
::
ExtensionListModel
(
QObject
*
parent
,
intf_thread_t
*
intf
)
:
QAbstractListModel
(
parent
),
p_intf
(
intf
)
ExtensionListModel
::
ExtensionListModel
(
QObject
*
parent
,
ExtensionsManager
*
EM_
)
:
QAbstractListModel
(
parent
),
EM
(
EM_
)
{
// Connect to ExtensionsManager::extensionsUpdated()
ExtensionsManager
*
EM
=
ExtensionsManager
::
getInstance
(
p_intf
);
CONNECT
(
EM
,
extensionsUpdated
(),
this
,
updateList
()
);
// Load extensions now if not already loaded
...
...
@@ -366,7 +366,6 @@ void ExtensionListModel::updateList()
}
// Find new extensions
ExtensionsManager
*
EM
=
ExtensionsManager
::
getInstance
(
p_intf
);
extensions_manager_t
*
p_mgr
=
EM
->
getManager
();
if
(
!
p_mgr
)
return
;
...
...
@@ -388,7 +387,6 @@ void ExtensionListModel::updateList()
int
ExtensionListModel
::
rowCount
(
const
QModelIndex
&
)
const
{
int
count
=
0
;
ExtensionsManager
*
EM
=
ExtensionsManager
::
getInstance
(
p_intf
);
extensions_manager_t
*
p_mgr
=
EM
->
getManager
();
if
(
!
p_mgr
)
return
0
;
...
...
modules/gui/qt4/dialogs/plugins.hpp
View file @
c875b9ea
...
...
@@ -49,7 +49,7 @@ class ExtensionTab;
class
ExtensionListItem
;
class
SearchLineEdit
;
class
ExtensionCopy
;
class
ExtensionsManager
;
class
PluginDialog
:
public
QVLCFrame
,
public
Singleton
<
PluginDialog
>
{
...
...
@@ -146,7 +146,7 @@ public:
QPixmap
*
icon
;
};
ExtensionListModel
(
QObject
*
parent
,
intf_thread_t
*
p_intf
);
ExtensionListModel
(
QObject
*
parent
,
ExtensionsManager
*
EM
);
virtual
~
ExtensionListModel
();
enum
...
...
@@ -168,7 +168,7 @@ private slots:
private:
intf_thread_t
*
p_intf
;
ExtensionsManager
*
EM
;
QList
<
ExtensionCopy
*>
extensions
;
};
...
...
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