Commit c5702117 authored by Halla Rempt's avatar Halla Rempt
Browse files

Fix crash on importing a palette

CCBUG:454949
parent d1dd249f
Pipeline #191435 canceled with stage
......@@ -133,7 +133,7 @@ KoColorSetSP KisPaletteEditor::importPalette()
dialog.setCaption(i18n("Import Palette"));
dialog.setDefaultDir(QDir::homePath());
dialog.setMimeTypeFilters(QStringList() << "krita/x-colorset" << "application/x-gimp-color-palette");
dialog.setMimeTypeFilters(QStringList() << "application/x-krita-palette" << "application/x-gimp-color-palette");
QString filename = dialog.filename();
if (filename.isEmpty()) {
......
......@@ -432,6 +432,7 @@ void KoFileDialog::setMimeTypeFilters(const QStringList &mimeTypeList, QString d
}
Q_ASSERT(!description.isEmpty());
Q_ASSERT(!suffixes.isEmpty());
FilterData filterData {};
filterData.descriptionOnly = description;
......
......@@ -209,7 +209,9 @@ void PaletteDockerDock::slotRemovePalette(KoColorSetSP cs)
void PaletteDockerDock::slotImportPalette()
{
KoColorSetSP palette = m_paletteEditor->importPalette();
m_paletteChooser->setCurrentItem(palette);
if (palette) {
m_paletteChooser->setCurrentItem(palette);
}
}
void PaletteDockerDock::slotExportPalette(KoColorSetSP palette)
......
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