Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
VideoLAN
VLMC
Commits
36f3090c
Commit
36f3090c
authored
Mar 26, 2009
by
Ludovic Fauvet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ignore temporary and vim swap files
Code cleanup
parent
b25c744a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
45 additions
and
17 deletions
+45
-17
.gitignore
.gitignore
+2
-0
src/gui/LibraryWidget.cpp
src/gui/LibraryWidget.cpp
+2
-2
src/gui/ListViewMediaItem.cpp
src/gui/ListViewMediaItem.cpp
+4
-4
src/gui/ListViewMediaItem.h
src/gui/ListViewMediaItem.h
+6
-2
src/gui/MediaListWidget.cpp
src/gui/MediaListWidget.cpp
+27
-5
src/gui/MediaListWidget.h
src/gui/MediaListWidget.h
+4
-4
No files found.
.gitignore
View file @
36f3090c
...
...
@@ -6,3 +6,5 @@ Makefile*
*.pro.user
moc_*.cpp
ui_*.h
.*.swp
*~
src/gui/LibraryWidget.cpp
View file @
36f3090c
...
...
@@ -66,7 +66,7 @@ bool LibraryWidget::removeMedia(ListViewMediaItem* item)
{
if
(
m_medias
->
contains
(
item
)
)
{
switch
(
item
->
fileType
)
switch
(
item
->
fileType
()
)
{
case
ListViewMediaItem
::
Audio
:
this
->
m_ui
.
listWidgetAudio
->
removeItemWidget
(
item
);
...
...
@@ -93,7 +93,7 @@ ListViewMediaItem* LibraryWidget::insertNewMediaFromFileDialog( Q
ListViewMediaItem
*
item
=
NULL
;
foreach
(
item
,
*
m_medias
)
{
if
(
item
->
fileInfo
->
absoluteFilePath
()
==
fileName
)
if
(
item
->
fileInfo
()
->
absoluteFilePath
()
==
fileName
)
return
item
;
}
QFileInfo
*
fileInfo
=
new
QFileInfo
(
fileName
);
...
...
src/gui/ListViewMediaItem.cpp
View file @
36f3090c
...
...
@@ -24,12 +24,12 @@
ListViewMediaItem
::
ListViewMediaItem
(
QFileInfo
*
fInfo
,
ListViewMediaItem
::
fType
fType
,
QListWidget
*
parent
,
int
type
)
:
QListWidgetItem
(
parent
,
type
)
{
fileInfo
=
fInfo
;
fileType
=
fType
;
setText
(
fileInfo
->
baseName
()
);
m_
fileInfo
=
fInfo
;
m_
fileType
=
fType
;
setText
(
m_
fileInfo
->
baseName
()
);
}
ListViewMediaItem
::~
ListViewMediaItem
()
{
delete
this
->
fileInfo
;
delete
m_
fileInfo
;
}
src/gui/ListViewMediaItem.h
View file @
36f3090c
...
...
@@ -38,8 +38,12 @@ public:
ListViewMediaItem
(
QFileInfo
*
fileInfo
,
ListViewMediaItem
::
fType
fType
,
QListWidget
*
parent
=
0
,
int
type
=
Type
);
virtual
~
ListViewMediaItem
();
QFileInfo
*
fileInfo
;
ListViewMediaItem
::
fType
fileType
;
QFileInfo
*
fileInfo
()
{
return
m_fileInfo
;
}
ListViewMediaItem
::
fType
fileType
()
{
return
m_fileType
;
}
private:
QFileInfo
*
m_fileInfo
;
ListViewMediaItem
::
fType
m_fileType
;
};
#endif
/* !LISTVIEWMEDIAITEM_H */
src/gui/MediaListWidget.cpp
View file @
36f3090c
/*****************************************************************************
* MediaListWidget.cpp: Multimedia list widget
*****************************************************************************
* Copyright (C) 2008-2009 the VLMC team
*
* Authors: Christophe Courtaut <christophe.courtaut@gmail.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include "MediaListWidget.h"
...
...
@@ -28,9 +49,10 @@ void MediaListWidget::mouseMoveEvent( QMouseEvent* event )
<
QApplication
::
startDragDistance
()
)
return
;
QMimeData
*
mimeData
=
new
QMimeData
;
mimeData
->
setText
(
(
(
ListViewMediaItem
*
)(
currentItem
()
))
->
fileInfo
->
absoluteFilePath
()
);
QDrag
*
drag
=
new
QDrag
(
this
);
drag
->
setMimeData
(
mimeData
);
drag
->
exec
(
Qt
::
CopyAction
|
Qt
::
MoveAction
,
Qt
::
CopyAction
);
QMimeData
*
mimeData
=
new
QMimeData
;
mimeData
->
setText
(
(
(
ListViewMediaItem
*
)(
currentItem
()
)
)
->
fileInfo
()
->
absoluteFilePath
()
);
QDrag
*
drag
=
new
QDrag
(
this
);
drag
->
setMimeData
(
mimeData
);
drag
->
exec
(
Qt
::
CopyAction
|
Qt
::
MoveAction
,
Qt
::
CopyAction
);
}
src/gui/MediaListWidget.h
View file @
36f3090c
/*****************************************************************************
*
LibraryWidget.h: VLMC library widget header
*
MediaListWidget.cpp: Multimedia list widget
*****************************************************************************
* Copyright (C) 2008-2009 the VLMC team
*
...
...
@@ -36,13 +36,13 @@ class MediaListWidget : public QListWidget
Q_OBJECT
public:
MediaListWidget
(
QWidget
*
parent
=
0
);
void
setType
(
QString
fileType
);
void
setType
(
QString
fileType
);
protected:
virtual
void
mousePressEvent
(
QMouseEvent
*
event
);
virtual
void
mouseMoveEvent
(
QMouseEvent
*
event
);
private:
QString
m_Type
;
QPoint
m_dragStartPos
;
QString
m_Type
;
QPoint
m_dragStartPos
;
};
#endif // MEDIALISTWIDGET_H
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