Commit f68a43d0 authored by Albert Astals Cid's avatar Albert Astals Cid
Browse files

Merge remote-tracking branch 'origin/release/20.12'

parents 00b3aa16 e1161211
......@@ -37,19 +37,7 @@ bool K3b::VideoDvdDoc::newDocument()
if( K3b::DataDoc::newDocument() ) {
// K3b::DataDoc::newDocument already deleted m_videoTsDir (again: bad design!)
m_videoTsDir = new K3b::DirItem( "VIDEO_TS" );
m_videoTsDir->setRemoveable(false);
m_videoTsDir->setRenameable(false);
m_videoTsDir->setMoveable(false);
m_videoTsDir->setHideable(false);
root()->addDataItem( m_videoTsDir );
K3b::DirItem* audioTsDir = new K3b::DirItem( "AUDIO_TS" );
audioTsDir->setRemoveable(false);
audioTsDir->setRenameable(false);
audioTsDir->setMoveable(false);
audioTsDir->setHideable(false);
root()->addDataItem( audioTsDir );
addAudioVideoTsDirs();
setMultiSessionMode( NONE );
......@@ -61,6 +49,39 @@ bool K3b::VideoDvdDoc::newDocument()
return false;
}
void K3b::VideoDvdDoc::clear()
{
bool addTsDirs = false;
if (m_videoTsDir) {
// K3b::DataDoc::clear() needs the items to be removeable or clear loops forever
// so change them to removeable if they exist, so they can be deleted and add them back again later
m_videoTsDir->setRemoveable(true);
m_audioTsDir->setRemoveable(true);
addTsDirs = true;
}
K3b::DataDoc::clear();
if (addTsDirs) {
addAudioVideoTsDirs();
}
}
void K3b::VideoDvdDoc::addAudioVideoTsDirs()
{
m_videoTsDir = new K3b::DirItem( "VIDEO_TS" );
m_videoTsDir->setRemoveable(false);
m_videoTsDir->setRenameable(false);
m_videoTsDir->setMoveable(false);
m_videoTsDir->setHideable(false);
root()->addDataItem( m_videoTsDir );
m_audioTsDir = new K3b::DirItem( "AUDIO_TS" );
m_audioTsDir->setRemoveable(false);
m_audioTsDir->setRenameable(false);
m_audioTsDir->setMoveable(false);
m_audioTsDir->setHideable(false);
root()->addDataItem( m_audioTsDir );
}
K3b::BurnJob* K3b::VideoDvdDoc::newBurnJob( K3b::JobHandler* hdl, QObject* parent )
{
......
......@@ -33,6 +33,7 @@ namespace K3b {
BurnJob* newBurnJob( JobHandler* hdl, QObject* parent ) override;
bool newDocument() override;
void clear() override;
DirItem* videoTsDir() const { return m_videoTsDir; }
......@@ -40,7 +41,10 @@ namespace K3b {
bool saveDocumentData(QDomElement*) override;
private:
DirItem* m_videoTsDir;
void addAudioVideoTsDirs();
DirItem* m_videoTsDir = nullptr;
DirItem* m_audioTsDir = nullptr;
};
}
......
......@@ -15,7 +15,6 @@
<comment xml:lang="fr">Projet K3b</comment>
<comment xml:lang="ia">Projecto K3b</comment>
<comment xml:lang="it">Progetto K3b</comment>
<comment xml:lang="lt">K3b projektas</comment>
<comment xml:lang="nl">K3b-project</comment>
<comment xml:lang="nn">K3b-prosjekt</comment>
<comment xml:lang="pl">Projekt K3b</comment>
......
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