Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Kdenlive
Commits
301cfeb8
Commit
301cfeb8
authored
Apr 03, 2021
by
Julius Künzel
Browse files
Archive import: Fix dialog, allow *.zip
CCBUG: 386398
Related to
#973
parent
68e559ec
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/project/dialogs/archivewidget.cpp
View file @
301cfeb8
...
...
@@ -250,6 +250,8 @@ ArchiveWidget::ArchiveWidget(QUrl url, QWidget *parent)
proxy_only
->
setHidden
(
true
);
project_files
->
setHidden
(
true
);
files_list
->
setHidden
(
true
);
timeline_archive
->
setHidden
(
true
);
compression_type
->
setHidden
(
true
);
label
->
setText
(
i18n
(
"Extract to"
));
setWindowTitle
(
i18n
(
"Open Archived Project"
));
archive_url
->
setUrl
(
QUrl
::
fromLocalFile
(
QDir
::
homePath
()));
...
...
@@ -282,7 +284,14 @@ void ArchiveWidget::slotJobResult(bool success, const QString &text)
void
ArchiveWidget
::
openArchiveForExtraction
()
{
emit
showMessage
(
QStringLiteral
(
"system-run"
),
i18n
(
"Opening archive..."
));
m_extractArchive
=
new
KTar
(
m_extractUrl
.
toLocalFile
());
QMimeDatabase
db
;
QMimeType
mime
=
db
.
mimeTypeForUrl
(
m_extractUrl
);
if
(
mime
.
inherits
(
QStringLiteral
(
"application/x-compressed-tar"
)))
{
m_extractArchive
=
new
KTar
(
m_extractUrl
.
toLocalFile
());
}
else
{
m_extractArchive
=
new
KZip
(
m_extractUrl
.
toLocalFile
());
}
if
(
!
m_extractArchive
->
isOpen
()
&&
!
m_extractArchive
->
open
(
QIODevice
::
ReadOnly
))
{
emit
showMessage
(
QStringLiteral
(
"dialog-close"
),
i18n
(
"Cannot open archive file:
\n
%1"
,
m_extractUrl
.
toLocalFile
()));
groupBox
->
setEnabled
(
false
);
...
...
src/project/projectmanager.cpp
View file @
301cfeb8
...
...
@@ -56,7 +56,7 @@ the Free Software Foundation, either version 3 of the License, or
static
QString
getProjectNameFilters
(
bool
ark
=
true
)
{
auto
filter
=
i18n
(
"Kdenlive project (*.kdenlive)"
);
if
(
ark
)
{
filter
.
append
(
";;"
+
i18n
(
"Archived project (*.tar.gz)"
));
filter
.
append
(
";;"
+
i18n
(
"Archived project (*.tar.gz
*.zip
)"
));
}
return
filter
;
}
...
...
@@ -484,7 +484,7 @@ void ProjectManager::openFile(const QUrl &url)
QMimeDatabase
db
;
// Make sure the url is a Kdenlive project file
QMimeType
mime
=
db
.
mimeTypeForUrl
(
url
);
if
(
mime
.
inherits
(
QStringLiteral
(
"application/x-compressed-tar"
)))
{
if
(
mime
.
inherits
(
QStringLiteral
(
"application/x-compressed-tar"
))
||
mime
.
inherits
(
QStringLiteral
(
"application/zip"
))
)
{
// Opening a compressed project file, we need to process it
// qCDebug(KDENLIVE_LOG)<<"Opening archive, processing";
QPointer
<
ArchiveWidget
>
ar
=
new
ArchiveWidget
(
url
);
...
...
Eugen Mohr
@emohr
mentioned in issue
#973
·
Apr 25, 2021
mentioned in issue
#973
mentioned in issue #973
Toggle commit list
Write
Preview
Supports
Markdown
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