Skip to content

Commit

Permalink
refactor: Optimize playlist backup module[077812]
Browse files Browse the repository at this point in the history
  • Loading branch information
Greedysky committed Oct 18, 2024
1 parent a84058e commit de94acc
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,13 @@ MusicPlaylistBackupWidget::MusicPlaylistBackupWidget(QWidget *parent)
restoreButton->setFocusPolicy(Qt::NoFocus);
#endif

initialize();

connect(exportButton, SIGNAL(clicked()), SLOT(exportButtonClicked()));
connect(restoreButton, SIGNAL(clicked()), SLOT(restoreButtonClicked()));
connect(m_dateBox, SIGNAL(currentTextChanged(QString)), SLOT(currentDateChanged(QString)));
connect(m_timeBox, SIGNAL(currentIndexChanged(int)), SLOT(currentTimeChanged(int)));
connect(m_listWidget, SIGNAL(currentRowChanged(int)), SLOT(currentItemChanged(int)));

initialize();
}

MusicPlaylistBackupWidget::~MusicPlaylistBackupWidget()
Expand Down Expand Up @@ -296,7 +296,7 @@ void MusicPlaylistBackupWidget::currentDateChanged(const QString &text)
m_timeBox->addItem(TTKDateTime::format(fin.baseName().toULongLong(), TTK_TIMES_FORMAT), fin.baseName());
}

currentTimeChanged(0);
m_listWidget->setCurrentRow(0);
}

void MusicPlaylistBackupWidget::currentTimeChanged(int index)
Expand Down Expand Up @@ -329,7 +329,7 @@ void MusicPlaylistBackupWidget::currentTimeChanged(int index)
m_listWidget->addItem(it);
}

currentItemChanged(0);
m_listWidget->setCurrentRow(0);
}

void MusicPlaylistBackupWidget::currentItemChanged(int index)
Expand Down Expand Up @@ -358,5 +358,4 @@ void MusicPlaylistBackupWidget::initialize()
}

m_dateBox->addItems(dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Time | QDir::Reversed));
currentDateChanged(m_dateBox->currentText());
}

0 comments on commit de94acc

Please sign in to comment.