Commit 8b98c854 authored by Ramon Buldó's avatar Ramon Buldó
Browse files

Fix segfault when closing msm after opening a kernel changelog

parent 04ed92a4
......@@ -22,7 +22,6 @@
#include "ui_PageKernel.h"
#include "delegates/KernelListViewDelegate.h"
#include "dialogs/KernelInfoDialog.h"
#include "dialogs/applydialog.h"
#include <QtCore/QProcess>
......@@ -31,7 +30,8 @@
PageKernel::PageKernel(QWidget *parent) :
PageWidget(parent),
ui(new Ui::PageKernel),
kernelModel(new KernelModel)
kernelModel(new KernelModel),
kernelInfoDialog(new KernelInfoDialog)
{
ui->setupUi(this);
setTitel(tr("Kernel"));
......@@ -140,12 +140,11 @@ void PageKernel::removeKernel(const QModelIndex &index)
void PageKernel::infoButtonClicked(const QModelIndex &index)
{
KernelInfoDialog dialog(this);
QString package = qvariant_cast<QString>(index.data(KernelModel::PackageRole));
QString majorVersion = qvariant_cast<QString>(index.data(KernelModel::MajorVersionRole));
QString minorVersion = qvariant_cast<QString>(index.data(KernelModel::MinorVersionRole));
QString title = QString(tr("Linux %1.%2 changelog")).arg(majorVersion, minorVersion);
dialog.setWindowTitle(title);
dialog.setPackage(package);
dialog.exec();
kernelInfoDialog->setWindowTitle(title);
kernelInfoDialog->setPackage(package);
kernelInfoDialog->exec();
}
......@@ -23,6 +23,7 @@
#include "models/KernelModel.h"
#include "widgets/PageWidget.h"
#include "dialogs/KernelInfoDialog.h"
namespace Ui {
class PageKernel;
......@@ -44,6 +45,7 @@ public slots:
private:
Ui::PageKernel *ui;
KernelModel *kernelModel;
KernelInfoDialog *kernelInfoDialog;
void installKernel(const QModelIndex &index);
void removeKernel(const QModelIndex &index);
};
......
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