Commit f6cf8896 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix some double free on exit, remember display setting for asset info box

parent ff4c122b
......@@ -24,8 +24,8 @@
AbstractTreeModel::AbstractTreeModel(QObject *parent)
: QAbstractItemModel(parent)
, rootItem(new TreeItem(QList<QVariant>(), this))
{
rootItem = new TreeItem(QList<QVariant>(), this);
}
AbstractTreeModel::~AbstractTreeModel()
......
......@@ -21,6 +21,7 @@
#include "assetlistwidget.hpp"
#include "assets/assetlist/view/qmltypes/asseticonprovider.hpp"
#include "kdenlivesettings.h"
#include <KDeclarative/KDeclarative>
#include <QQmlContext>
......@@ -80,3 +81,14 @@ void AssetListWidget::activate(const QModelIndex &ix)
emit activateAsset(data);
}
bool AssetListWidget::showDescription() const
{
return KdenliveSettings::showeffectinfo();
}
void AssetListWidget::setShowDescription(bool show)
{
KdenliveSettings::setShoweffectinfo(show);
emit showDescriptionChanged();
}
......@@ -35,6 +35,9 @@
class AssetListWidget : public QQuickWidget
{
Q_OBJECT
/* @brief Should the descriptive info box be displayed
*/
Q_PROPERTY(bool showDescription READ showDescription WRITE setShowDescription NOTIFY showDescriptionChanged)
public:
AssetListWidget(QWidget *parent = Q_NULLPTR);
......@@ -55,6 +58,8 @@ public:
Q_INVOKABLE QVariantMap getMimeData(const QString &assetId) const;
Q_INVOKABLE void activate(const QModelIndex &ix);
Q_INVOKABLE bool showDescription() const;
Q_INVOKABLE void setShowDescription(bool);
protected:
void setup();
......@@ -64,6 +69,7 @@ protected:
signals:
void activateAsset(const QVariantMap data);
void showDescriptionChanged();
};
#endif
......@@ -142,13 +142,14 @@ Rectangle {
implicitHeight: 40
iconName: "help-about"
checkable:true
checked: true
tooltip: i18n('Show/hide description of the ') + assetType()
onCheckedChanged:{
assetlist.showDescription = checked
if (!checked) {
assetDescription.visible = false
}
}
Component.onCompleted: checked = assetlist.showDescription
}
}
......
......@@ -705,7 +705,7 @@ Bin::Bin(QWidget *parent)
m_propertiesPanel = new QScrollArea(this);
m_propertiesPanel->setFrameShape(QFrame::NoFrame);
// Info widget for failed jobs, other errors
m_infoMessage = new BinMessageWidget;
m_infoMessage = new BinMessageWidget(this);
m_layout->addWidget(m_infoMessage);
m_infoMessage->setCloseButtonVisible(false);
connect(m_infoMessage, &KMessageWidget::linkActivated, this, &Bin::slotShowJobLog);
......@@ -723,8 +723,6 @@ Bin::~Bin()
m_proxyModel->selectionModel()->blockSignals(true);
setEnabled(false);
abortOperations();
delete m_infoMessage;
delete m_propertiesPanel;
}
QDockWidget *Bin::clipPropertiesDock()
......
......@@ -40,7 +40,6 @@ ProjectItemModel::ProjectItemModel(Bin *bin, QObject *parent)
ProjectItemModel::~ProjectItemModel()
{
delete rootItem;
}
int ProjectItemModel::mapToColumn(int column) const
......
......@@ -206,7 +206,7 @@ void MainWindow::init()
new RenderingAdaptor(this);
QString defaultProfile = KdenliveSettings::default_profile();
KdenliveSettings::setCurrent_profile(defaultProfile.isEmpty() ? ProjectManager::getDefaultProjectFormat() : defaultProfile);
m_commandStack = new QUndoGroup(this);
m_commandStack = new QUndoGroup();
// If using a custom profile, make sure the file exists or fallback to default
if (KdenliveSettings::current_profile().startsWith(QLatin1Char('/')) && !QFile::exists(KdenliveSettings::current_profile())) {
......
Supports Markdown
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