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
d73b1440
Commit
d73b1440
authored
Feb 19, 2010
by
Hugo Beauzee-Luyssen
Browse files
Fixing directory import.
parent
e5579874
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/Gui/import/ImportController.cpp
View file @
d73b1440
...
...
@@ -206,10 +206,10 @@ ImportController::setUIMetaData( Media* media )
}
else
{
m_ui
->
durationValueLabel
->
setText
(
"--:--:--"
);
m_ui
->
nameValueLabel
->
setText
(
"none"
);
m_ui
->
resolutionValueLabel
->
setText
(
"-- x --"
);
m_ui
->
fpsValueLabel
->
setText
(
"--"
);
m_ui
->
durationValueLabel
->
setText
(
"--:--:--"
);
m_ui
->
nameValueLabel
->
setText
(
"none"
);
m_ui
->
resolutionValueLabel
->
setText
(
"-- x --"
);
m_ui
->
fpsValueLabel
->
setText
(
"--"
);
}
}
...
...
@@ -230,11 +230,8 @@ ImportController::setUIMetaData( Clip* clip )
}
void
ImportController
::
forwardButtonClicked
(
)
ImportController
::
importMedia
(
const
QString
&
filePath
)
{
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
;
...
...
@@ -251,6 +248,43 @@ ImportController::forwardButtonClicked()
m_mediaListController
->
addMedia
(
media
);
}
void
ImportController
::
importDir
(
const
QString
&
path
)
{
QDir
dir
(
path
);
QFileInfoList
files
=
dir
.
entryInfoList
(
QDir
::
NoDotAndDotDot
|
QDir
::
Readable
|
QDir
::
AllEntries
);
foreach
(
QFileInfo
fInfo
,
files
)
{
if
(
fInfo
.
isDir
()
==
true
)
importDir
(
fInfo
.
absolutePath
()
);
else
{
QString
ext
=
fInfo
.
suffix
();
if
(
Media
::
AudioExtensions
.
contains
(
ext
)
||
Media
::
VideoExtensions
.
contains
(
ext
)
||
Media
::
ImageExtensions
.
contains
(
ext
)
)
{
importMedia
(
fInfo
.
absoluteFilePath
()
);
}
}
}
}
void
ImportController
::
forwardButtonClicked
()
{
QModelIndex
index
=
m_ui
->
treeView
->
selectionModel
()
->
currentIndex
();
QString
filePath
=
m_filesModel
->
fileInfo
(
index
).
filePath
();
if
(
!
m_filesModel
->
isDir
(
index
)
)
importMedia
(
filePath
);
else
importDir
(
filePath
);
}
void
ImportController
::
treeViewClicked
(
const
QModelIndex
&
index
)
{
...
...
@@ -267,8 +301,7 @@ ImportController::treeViewClicked( const QModelIndex& index )
void
ImportController
::
treeViewDoubleClicked
(
const
QModelIndex
&
index
)
{
if
(
!
m_filesModel
->
isDir
(
index
)
)
forwardButtonClicked
();
forwardButtonClicked
();
}
void
...
...
src/Gui/import/ImportController.h
View file @
d73b1440
...
...
@@ -69,13 +69,15 @@ class ImportController : public QDialog
void
restoreCurrentPath
();
void
collapseAllButCurrentPath
();
void
deleteTemporaryMedias
();
void
importMedia
(
const
QString
&
filePath
);
void
importDir
(
const
QString
&
path
);
Ui
::
ImportController
*
m_ui
;
PreviewWidget
*
m_preview
;
StackViewController
*
m_stackNav
;
TagWidget
*
m_tag
;
ImportMediaListController
*
m_mediaListController
;
ImportMediaListController
*
m_clipListController
;
QDirModel
*
m_filesModel
;
QDirModel
*
m_filesModel
;
QFileSystemWatcher
*
m_fsWatcher
;
QString
m_currentlyWatchedDir
;
QUuid
m_currentUuid
;
...
...
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