aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2018-09-16 15:46:17 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2018-09-16 15:46:17 +0000
commit58ca82ebbd83ddcc1d2ff0f512327cdf45c999bf (patch)
tree045de00a580eba3a80087364b3fc36fc3726bb7c /src
parent8a988ef4cb2a8b78c43a0b8c76834cfc26f7ff0b (diff)
downloadqmmp-58ca82ebbd83ddcc1d2ff0f512327cdf45c999bf.tar.gz
qmmp-58ca82ebbd83ddcc1d2ff0f512327cdf45c999bf.tar.bz2
qmmp-58ca82ebbd83ddcc1d2ff0f512327cdf45c999bf.zip
added some functions, fixed segmentation fault
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@8299 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src')
-rw-r--r--src/qmmpui/covereditor.cpp5
-rw-r--r--src/qmmpui/covereditor_p.h1
-rw-r--r--src/qmmpui/detailsdialog.cpp32
3 files changed, 27 insertions, 11 deletions
diff --git a/src/qmmpui/covereditor.cpp b/src/qmmpui/covereditor.cpp
index 07241ffc9..cf17635ac 100644
--- a/src/qmmpui/covereditor.cpp
+++ b/src/qmmpui/covereditor.cpp
@@ -54,6 +54,11 @@ bool CoverEditor::isEditable() const
return m_editable;
}
+void CoverEditor::save()
+{
+
+}
+
void CoverEditor::on_sourceComboBox_activated(int index)
{
if(index == 0)
diff --git a/src/qmmpui/covereditor_p.h b/src/qmmpui/covereditor_p.h
index 9824fef40..4cf7f649f 100644
--- a/src/qmmpui/covereditor_p.h
+++ b/src/qmmpui/covereditor_p.h
@@ -40,6 +40,7 @@ public:
explicit CoverEditor(MetaDataModel *model, const QString &coverPath, QWidget *parent = 0);
bool isEditable() const;
+ void save();
private slots:
void on_sourceComboBox_activated(int index);
diff --git a/src/qmmpui/detailsdialog.cpp b/src/qmmpui/detailsdialog.cpp
index 6d34d1cb8..73c2db852 100644
--- a/src/qmmpui/detailsdialog.cpp
+++ b/src/qmmpui/detailsdialog.cpp
@@ -84,25 +84,35 @@ void DetailsDialog::on_buttonBox_clicked(QAbstractButton *button)
{
if(m_ui->buttonBox->standardButton(button) == QDialogButtonBox::Save)
{
- TagEditor *tab = qobject_cast<TagEditor *> (m_ui->tabWidget->currentWidget());
- if(tab)
- tab->save();
+ TagEditor *tagEditor = qobject_cast<TagEditor *>(m_ui->tabWidget->currentWidget());
+ CoverEditor *coverEditor = 0;
+ if(tagEditor)
+ tagEditor->save();
+ else if((coverEditor = qobject_cast<CoverEditor *>(m_ui->tabWidget->currentWidget())))
+ coverEditor->save();
}
else
- reject();
-
- //close all files before closing dialog
- if(m_metaDataModel)
{
- delete m_metaDataModel;
- m_metaDataModel = 0;
+ //close all files before closing dialog
+ if(m_metaDataModel)
+ {
+ delete m_metaDataModel;
+ m_metaDataModel = 0;
+ }
+ reject();
}
}
void DetailsDialog::on_tabWidget_currentChanged(int index)
{
- TagEditor *tab = qobject_cast<TagEditor *> (m_ui->tabWidget->widget(index));
- m_ui->buttonBox->button(QDialogButtonBox::Save)->setEnabled(tab && m_metaDataModel && !m_metaDataModel->isReadOnly());
+ TagEditor *tagEditor = qobject_cast<TagEditor *> (m_ui->tabWidget->widget(index));
+ CoverEditor *coverEditor = 0;
+ if(tagEditor)
+ m_ui->buttonBox->button(QDialogButtonBox::Save)->setEnabled(m_metaDataModel && !m_metaDataModel->isReadOnly());
+ else if((coverEditor = qobject_cast<CoverEditor *>(m_ui->tabWidget->currentWidget())))
+ m_ui->buttonBox->button(QDialogButtonBox::Save)->setEnabled(coverEditor->isEditable());
+ else
+ m_ui->buttonBox->button(QDialogButtonBox::Save)->setEnabled(false);
}
void DetailsDialog::on_prevButton_clicked()