Commit 36f3090c authored by Ludovic Fauvet's avatar Ludovic Fauvet

Ignore temporary and vim swap files

Code cleanup
parent b25c744a
......@@ -6,3 +6,5 @@ Makefile*
*.pro.user
moc_*.cpp
ui_*.h
.*.swp
*~
......@@ -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 );
......
......@@ -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;
}
......@@ -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 */
/*****************************************************************************
* 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 );
}
/*****************************************************************************
* 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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment