Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
VideoLAN
VLMC
Commits
b3a50081
Commit
b3a50081
authored
Feb 19, 2010
by
Hugo Beauzee-Luyssen
Browse files
Fix minor bugs
parent
5bd86267
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/Gui/import/ImportController.cpp
View file @
b3a50081
...
...
@@ -105,11 +105,6 @@ ImportController::ImportController(QWidget *parent) :
m_mediaListController
,
SLOT
(
clipAdded
(
Clip
*
)
)
);
//StackViewController
connect
(
m_stackNav
,
SIGNAL
(
previousButtonPushed
()
),
this
,
SLOT
(
restoreContext
()
)
);
connect
(
Library
::
getInstance
(),
SIGNAL
(
progressDialogMax
(
int
)
),
this
,
SLOT
(
progressDialogMax
(
int
)
)
);
connect
(
Library
::
getInstance
(),
SIGNAL
(
progressDialogValue
(
int
)
),
this
,
SLOT
(
progressDialogValue
(
int
)
)
);
}
ImportController
::~
ImportController
()
...
...
@@ -239,6 +234,13 @@ ImportController::forwardButtonClicked()
{
QModelIndex
index
=
m_ui
->
treeView
->
selectionModel
()
->
currentIndex
();
QString
filePath
=
m_filesModel
->
fileInfo
(
index
).
filePath
();
foreach
(
Media
*
media
,
m_temporaryMedias
.
values
()
)
if
(
media
->
getFileInfo
()
->
filePath
()
==
filePath
)
return
;
if
(
Library
::
getInstance
()
->
mediaAlreadyLoaded
(
filePath
)
==
true
)
return
;
Media
*
media
=
new
Media
(
filePath
);
connect
(
media
,
SIGNAL
(
metaDataComputed
(
Media
*
)
),
this
,
SLOT
(
updateMediaRequested
(
Media
*
)
)
);
...
...
@@ -287,6 +289,7 @@ ImportController::accept()
collapseAllButCurrentPath
();
foreach
(
Media
*
media
,
m_temporaryMedias
.
values
()
)
Library
::
getInstance
()
->
addMedia
(
media
);
m_temporaryMedias
.
clear
();
done
(
Accepted
);
}
...
...
@@ -316,8 +319,9 @@ ImportController::collapseAllButCurrentPath()
void
ImportController
::
mediaDeletion
(
const
QUuid
&
uuid
)
{
Library
::
getInstance
()
->
deleteMedia
(
uuid
);
m_mediaListController
->
removeMedia
(
uuid
);
if
(
m_temporaryMedias
.
contains
(
uuid
)
==
true
)
delete
m_temporaryMedias
.
take
(
uuid
);
if
(
uuid
==
m_currentUuid
)
{
...
...
src/Library/Library.cpp
View file @
b3a50081
...
...
@@ -108,8 +108,7 @@ Library::addMedia( const QFileInfo& fileInfo, const QString& uuid )
foreach
(
Media
*
it
,
m_medias
.
values
()
)
{
if
(
it
->
getFileInfo
()
->
filePath
()
==
media
->
getFileInfo
()
->
filePath
()
)
if
(
it
->
getFileInfo
()
->
filePath
()
==
media
->
getFileInfo
()
->
filePath
()
)
{
delete
media
;
return
;
...
...
src/Library/Library.h
View file @
b3a50081
...
...
@@ -113,17 +113,18 @@ public:
*/
void
addMedia
(
Media
*
media
);
/**
* \brief Check if a file has already been loaded into library.
* \param fileInfo The file infos
* \return true if the file is already loaded, false otherwhise
*/
bool
mediaAlreadyLoaded
(
const
QFileInfo
&
fileInfo
);
private:
/**
* \brief Library Object Constructor
*/
Library
();
/**
* \brief Tells the media has already been loaded into library or not
* \param fileInfo The files info of the media file
* \return true if the media is already loaded, false otherwhise
*/
bool
mediaAlreadyLoaded
(
const
QFileInfo
&
fileInfo
);
/**
* \brief This method is used to load a media directly from it's
* path, with a specified UUID.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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