From 82789cd9e72688b72add622f27598e9aad879af0 Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 29 Jul 2010 21:18:39 +0200 Subject: Bugfix in AddCoverDialog::AddCoverDialog mCurrentType wasn't initialized in AddCoverDialog constructor, so it ended up with a random number. Fortunately it was too big for a Pg::SmallInt and the db choked with the value being too big for a Pg::SmallInt. Fix: Connect QComboBox::currentIndexChanged(QString) first and then add items to the QComboBox. That triggers the SLOT and sets mCurrentType to the right value. --- seriestreewidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'seriestreewidget.cpp') diff --git a/seriestreewidget.cpp b/seriestreewidget.cpp index b5a48be..7e60c53 100644 --- a/seriestreewidget.cpp +++ b/seriestreewidget.cpp @@ -286,11 +286,11 @@ AddCoverDialog::AddCoverDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(par foreach(QString t, coverTypes.values()){ types << t; } + connect(mFileType, SIGNAL(currentIndexChanged(QString)), this, SLOT(typeChanged(QString))); mFileType->addItems(types); QHBoxLayout *typesLayout = new QHBoxLayout; typesLayout->setAlignment(Qt::AlignCenter); typesLayout->addWidget(mFileType); - connect(mFileType, SIGNAL(currentIndexChanged(QString)), this, SLOT(typeChanged(QString))); //buttons mOk = new QPushButton(tr("Ok")); -- cgit v1.2.3-70-g09d2