Merge pull request #6492 from jbroadus/fix-smartplaylist-crash
Fix smartplaylist crash
This commit is contained in:
commit
e6e8090371
|
@ -62,8 +62,8 @@ const char* PlaylistView::kSettingBackgroundImageFilename =
|
|||
const int PlaylistView::kDefaultBlurRadius = 0;
|
||||
const int PlaylistView::kDefaultOpacityLevel = 40;
|
||||
|
||||
PlaylistProxyStyle::PlaylistProxyStyle(QStyle* base)
|
||||
: QProxyStyle(base), common_style_(new QCommonStyle) {}
|
||||
PlaylistProxyStyle::PlaylistProxyStyle()
|
||||
: QProxyStyle(), common_style_(new QCommonStyle) {}
|
||||
|
||||
void PlaylistProxyStyle::drawControl(ControlElement element,
|
||||
const QStyleOption* option,
|
||||
|
@ -107,7 +107,7 @@ void PlaylistProxyStyle::drawPrimitive(PrimitiveElement element,
|
|||
PlaylistView::PlaylistView(QWidget* parent)
|
||||
: QTreeView(parent),
|
||||
app_(nullptr),
|
||||
style_(new PlaylistProxyStyle(style())),
|
||||
style_(new PlaylistProxyStyle),
|
||||
playlist_(nullptr),
|
||||
header_(new PlaylistHeader(Qt::Horizontal, this, this)),
|
||||
setting_initial_header_layout_(false),
|
||||
|
|
|
@ -44,7 +44,7 @@ class QTimeLine;
|
|||
// This class is used by the global search view as well.
|
||||
class PlaylistProxyStyle : public QProxyStyle {
|
||||
public:
|
||||
PlaylistProxyStyle(QStyle* base);
|
||||
PlaylistProxyStyle();
|
||||
void drawControl(ControlElement element, const QStyleOption* option,
|
||||
QPainter* painter, const QWidget* widget) const;
|
||||
void drawPrimitive(PrimitiveElement element, const QStyleOption* option,
|
||||
|
|
|
@ -15,10 +15,11 @@
|
|||
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "core/logging.h"
|
||||
#include "querywizardplugin.h"
|
||||
#include "ui_wizardfinishpage.h"
|
||||
#include "wizard.h"
|
||||
#include "wizardplugin.h"
|
||||
#include "ui_wizardfinishpage.h"
|
||||
|
||||
#include <QLabel>
|
||||
#include <QRadioButton>
|
||||
|
@ -106,6 +107,11 @@ void Wizard::SetGenerator(GeneratorPtr gen) {
|
|||
finish_page_->ui_->name->setText(gen->name());
|
||||
finish_page_->ui_->dynamic->setChecked(gen->is_dynamic());
|
||||
|
||||
if (type_index_ == -1) {
|
||||
qLog(Error) << "Plugin was not found for generator type" << gen->type();
|
||||
return;
|
||||
}
|
||||
|
||||
// Tell the plugin to load
|
||||
plugins_[type_index_]->SetGenerator(gen);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue