aboutsummaryrefslogtreecommitdiff
path: root/src/qmmpui/tageditor.cpp
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2016-06-03 19:38:50 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2016-06-03 19:38:50 +0000
commit20df5b7da360da16017fd81634c6ac9d2f9b4b1e (patch)
tree7f64d306546eedc4d489ff66154ea83a042705f2 /src/qmmpui/tageditor.cpp
parent05960e955b0cbaabfc21eb8ec69973ad00663cc1 (diff)
downloadqmmp-20df5b7da360da16017fd81634c6ac9d2f9b4b1e.tar.gz
qmmp-20df5b7da360da16017fd81634c6ac9d2f9b4b1e.tar.bz2
qmmp-20df5b7da360da16017fd81634c6ac9d2f9b4b1e.zip
fixed disc number parsing
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@6433 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/qmmpui/tageditor.cpp')
-rw-r--r--src/qmmpui/tageditor.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/qmmpui/tageditor.cpp b/src/qmmpui/tageditor.cpp
index 1e53d6eae..e35590e75 100644
--- a/src/qmmpui/tageditor.cpp
+++ b/src/qmmpui/tageditor.cpp
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2009-2014 by Ilya Kotov *
+ * Copyright (C) 2009-2016 by Ilya Kotov *
* forkotov02@hotmail.ru *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -26,6 +26,7 @@ TagEditor::TagEditor(TagModel *tagModel, QWidget *parent) : QWidget(parent), m_u
{
m_ui->setupUi(this);
m_tagModel = tagModel;
+ m_discs = -1;
//check available keys
m_ui->titleLineEdit->setEnabled(m_tagModel->keys().contains(Qmmp::TITLE));
m_ui->artistLineEdit->setEnabled(m_tagModel->keys().contains(Qmmp::ARTIST));
@@ -59,7 +60,10 @@ void TagEditor::save()
m_tagModel->setValue(Qmmp::COMPOSER, m_ui->composerLineEdit->text());
m_tagModel->setValue(Qmmp::GENRE, m_ui->genreLineEdit->text());
m_tagModel->setValue(Qmmp::COMMENT, m_ui->commentBrowser->toPlainText ());
- m_tagModel->setValue(Qmmp::DISCNUMBER, m_ui->discSpinBox->value());
+ if(m_discs < 0)
+ m_tagModel->setValue(Qmmp::DISCNUMBER, m_ui->discSpinBox->value());
+ else
+ m_tagModel->setValue(Qmmp::DISCNUMBER, QString("%1/%2").arg(m_ui->discSpinBox->value()).arg(m_discs));
m_tagModel->setValue(Qmmp::YEAR, m_ui->yearSpinBox->value());
m_tagModel->setValue(Qmmp::TRACK, m_ui->trackSpinBox->value());
}
@@ -81,7 +85,14 @@ void TagEditor::readTag()
m_ui->composerLineEdit->setText(m_tagModel->value(Qmmp::COMPOSER));
m_ui->genreLineEdit->setText(m_tagModel->value(Qmmp::GENRE));
m_ui->commentBrowser->setText(m_tagModel->value(Qmmp::COMMENT));
- m_ui->discSpinBox->setValue(m_tagModel->value(Qmmp::DISCNUMBER).toInt());
+ if(m_tagModel->value(Qmmp::DISCNUMBER).contains("/"))
+ {
+ m_ui->discSpinBox->setValue(m_tagModel->value(Qmmp::DISCNUMBER).section("/",0,0).toInt());
+ m_discs = m_tagModel->value(Qmmp::DISCNUMBER).section("/",1,1).toInt();
+ m_ui->discSpinBox->setSuffix(QString("/%1").arg(m_discs));
+ }
+ else
+ m_ui->discSpinBox->setValue(m_tagModel->value(Qmmp::DISCNUMBER).toInt());
m_ui->yearSpinBox->setValue(m_tagModel->value(Qmmp::YEAR).toInt());
m_ui->trackSpinBox->setValue(m_tagModel->value(Qmmp::TRACK).toInt());
}