fixed missing delete of Files delegate in channel model

This commit is contained in:
csoler 2020-08-15 21:11:11 +02:00
parent bb6706e996
commit dcbcc95e41
2 changed files with 3 additions and 1 deletions

View file

@ -245,7 +245,7 @@ GxsChannelPostsWidgetWithModel::GxsChannelPostsWidgetWithModel(const RsGxsGroupI
ui->channelPostFiles_TV->sortByColumn(0, Qt::AscendingOrder); ui->channelPostFiles_TV->sortByColumn(0, Qt::AscendingOrder);
ui->channelFiles_TV->setModel(mChannelFilesModel = new RsGxsChannelPostFilesModel()); ui->channelFiles_TV->setModel(mChannelFilesModel = new RsGxsChannelPostFilesModel());
ui->channelFiles_TV->setItemDelegate(new ChannelPostFilesDelegate()); ui->channelFiles_TV->setItemDelegate(mFilesDelegate = new ChannelPostFilesDelegate());
ui->channelFiles_TV->setPlaceholderText(tr("No files in the channel, or no channel selected")); ui->channelFiles_TV->setPlaceholderText(tr("No files in the channel, or no channel selected"));
ui->channelFiles_TV->setSortingEnabled(true); ui->channelFiles_TV->setSortingEnabled(true);
ui->channelFiles_TV->sortByColumn(0, Qt::AscendingOrder); ui->channelFiles_TV->sortByColumn(0, Qt::AscendingOrder);
@ -631,6 +631,7 @@ GxsChannelPostsWidgetWithModel::~GxsChannelPostsWidgetWithModel()
processSettings(false); processSettings(false);
delete(mAutoDownloadAction); delete(mAutoDownloadAction);
delete mFilesDelegate;
delete ui; delete ui;
} }

View file

@ -174,6 +174,7 @@ private:
RsGxsChannelPostFilesModel *mChannelPostFilesModel; RsGxsChannelPostFilesModel *mChannelPostFilesModel;
RsGxsChannelPostFilesModel *mChannelFilesModel; RsGxsChannelPostFilesModel *mChannelFilesModel;
ChannelPostDelegate *mChannelPostsDelegate; ChannelPostDelegate *mChannelPostsDelegate;
ChannelPostFilesDelegate *mFilesDelegate;
RsGxsMessageId mSelectedPost; RsGxsMessageId mSelectedPost;