1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-17 12:02:48 +01:00

Ran 'make format' on my patch.

This commit is contained in:
Gavin Howard 2014-08-18 09:56:01 -06:00
parent d8ba0c4f91
commit f41bebbeb2
6 changed files with 29 additions and 31 deletions

View File

@ -1101,9 +1101,8 @@ void Playlist::InsertInternetItems(const InternetModel* model,
switch (item.data(InternetModel::Role_PlayBehaviour).toInt()) {
case InternetModel::PlayBehaviour_SingleItem:
playlist_items << shared_ptr<PlaylistItem>(new InternetPlaylistItem(
model->ServiceForIndex(item),
item.data(InternetModel::Role_SongMetadata)
.value<Song>()));
model->ServiceForIndex(item),
item.data(InternetModel::Role_SongMetadata).value<Song>()));
break;
case InternetModel::PlayBehaviour_UseSongLoader:
@ -1126,7 +1125,7 @@ void Playlist::InsertInternetItems(InternetService* service,
PlaylistItemList playlist_items;
for (const Song& song : songs) {
playlist_items << shared_ptr<PlaylistItem>(
new InternetPlaylistItem(service, song));
new InternetPlaylistItem(service, song));
}
InsertItems(playlist_items, pos, play_now, enqueue);
@ -1406,10 +1405,10 @@ void Playlist::ReOrderWithoutUndo(const PlaylistItemList& new_items) {
new_rows[new_items[i].get()] = i;
}
for (const QModelIndex& idx: persistentIndexList()) {
for (const QModelIndex& idx : persistentIndexList()) {
const PlaylistItem* item = old_items[idx.row()].get();
changePersistentIndex(
idx, index(new_rows[item], idx.column(), idx.parent()));
changePersistentIndex(idx,
index(new_rows[item], idx.column(), idx.parent()));
}
layoutChanged();

View File

@ -111,13 +111,13 @@ PlaylistContainer::PlaylistContainer(QWidget* parent)
PlaylistContainer::~PlaylistContainer() { delete ui_; }
void PlaylistContainer::ReloadSettings() {
bool show_menu = settings_.value(Playlist::kQuickChangeMenu, true).toBool();
ui_->line->setVisible(show_menu);
ui_->file_path_label->setVisible(show_menu);
ui_->file_path_box->setVisible(show_menu);
int value = settings_.value(Playlist::kPathType, Playlist::Path_Automatic).toInt();
int value =
settings_.value(Playlist::kPathType, Playlist::Path_Automatic).toInt();
Playlist::Path path = static_cast<Playlist::Path>(value);
switch (path) {
case Playlist::Path_Automatic:
@ -392,14 +392,15 @@ void PlaylistContainer::UpdateNoMatchesLabel() {
QString text;
if (has_rows && !has_results) {
if (ui_->filter->text().trimmed().compare("the answer to life the universe "
"and everything",
Qt::CaseInsensitive) == 0) {
if (ui_->filter->text().trimmed().compare(
"the answer to life the universe "
"and everything",
Qt::CaseInsensitive) == 0) {
text = "42";
} else {
text =
tr("No matches found. Clear the search box to show the whole playlist "
"again.");
text = tr(
"No matches found. Clear the search box to show the whole playlist "
"again.");
}
}

View File

@ -88,7 +88,6 @@ Song ParserBase::LoadSong(const QString& filename_or_url, qint64 beginning,
QString ParserBase::URLOrRelativeFilename(const QUrl& url,
const QDir& dir) const {
if (url.scheme() != "file") return url.toString();
QSettings s;

View File

@ -136,8 +136,8 @@ void XSPFParser::Save(const SongList& songs, QIODevice* device,
"duration", QString::number(song.length_nanosec() / kNsecPerMsec));
}
QString art =
song.art_manual().isEmpty() ? song.art_automatic() : song.art_manual();
QString art = song.art_manual().isEmpty() ? song.art_automatic()
: song.art_manual();
// Ignore images that are in our resource bundle.
if (!art.startsWith(":") && !art.isEmpty()) {
QString art_filename;
@ -151,7 +151,7 @@ void XSPFParser::Save(const SongList& songs, QIODevice* device,
// Make this filename relative to the directory we're saving the
// playlist.
QUrl url = QUrl(art_filename);
url.setScheme("file"); // Need to explicitly set this.
url.setScheme("file"); // Need to explicitly set this.
art_filename = URLOrRelativeFilename(url, dir).toUtf8();
} else {
// Just use whatever URL was in the Song.
@ -161,7 +161,6 @@ void XSPFParser::Save(const SongList& songs, QIODevice* device,
writer.writeTextElement("image", art_filename);
}
}
}
writer.writeEndDocument();
}

View File

@ -134,9 +134,9 @@ void BehaviourSettingsPage::Load() {
ui_->b_click_edit_inline_->setChecked(
s.value("click_edit_inline", true).toBool());
Playlist::Path path = Playlist::Path(s.value(Playlist::kPathType,
Playlist::Path_Automatic).toInt());
switch(path) {
Playlist::Path path = Playlist::Path(
s.value(Playlist::kPathType, Playlist::Path_Automatic).toInt());
switch (path) {
case Playlist::Path_Automatic:
ui_->b_automatic_path->setChecked(true);
break;
@ -147,8 +147,10 @@ void BehaviourSettingsPage::Load() {
ui_->b_relative_path->setChecked(true);
break;
}
ui_->b_write_metadata->setChecked(s.value(Playlist::kWriteMetadata, true).toBool());
ui_->b_quickchange_menu->setChecked(s.value(Playlist::kQuickChangeMenu, false).toBool());
ui_->b_write_metadata->setChecked(
s.value(Playlist::kWriteMetadata, true).toBool());
ui_->b_quickchange_menu->setChecked(
s.value(Playlist::kQuickChangeMenu, false).toBool());
s.endGroup();
s.beginGroup(PlaylistTabBar::kSettingsGroup);
@ -181,11 +183,9 @@ void BehaviourSettingsPage::Save() {
Playlist::Path path = Playlist::Path_Automatic;
if (ui_->b_automatic_path->isChecked()) {
path = Playlist::Path_Automatic;
}
else if (ui_->b_absolute_path->isChecked()) {
} else if (ui_->b_absolute_path->isChecked()) {
path = Playlist::Path_Absolute;
}
else if (ui_->b_relative_path->isChecked()) {
} else if (ui_->b_relative_path->isChecked()) {
path = Playlist::Path_Relative;
}

View File

@ -161,8 +161,8 @@ const char* MainWindow::kSettingsGroup = "MainWindow";
const char* MainWindow::kAllFilesFilterSpec = QT_TR_NOOP("All Files (*)");
namespace {
const int kTrackSliderUpdateTimeMs = 40;
const int kTrackPositionUpdateTimeMs = 1000;
const int kTrackSliderUpdateTimeMs = 40;
const int kTrackPositionUpdateTimeMs = 1000;
}
MainWindow::MainWindow(Application* app, SystemTrayIcon* tray_icon, OSD* osd,