[gnome-music] Reduce code of ArtistAlbumWidget
- From: Seif Lotfy <seiflotfy src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music] Reduce code of ArtistAlbumWidget
- Date: Mon, 22 Apr 2013 16:03:39 +0000 (UTC)
commit 42af913792cdb6c5fc04ed81db429472ebfb86cd
Author: Seif Lotfy <seif lotfy com>
Date: Mon Apr 22 18:03:21 2013 +0200
Reduce code of ArtistAlbumWidget
src/widgets.js | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
---
diff --git a/src/widgets.js b/src/widgets.js
index f7d4947..acb049e 100644
--- a/src/widgets.js
+++ b/src/widgets.js
@@ -314,16 +314,10 @@ const ArtistAlbumWidget = new Lang.Class({
ui.get_object("num").set_text(this.songs.length.toString());
if (track.get_title() != null)
ui.get_object("title").set_text(track.get_title());
- //var songWidget = ui.get_object("duration").set_text(track.get_title());
- if (this.songs.length == 1) {
- this.ui.get_object("grid1").add(songWidget);
- }
- else {
- var i = this.songs.length - 1;
- this.ui.get_object("grid1").attach(songWidget,
- parseInt(i/(this.tracks.length/2)),
- parseInt((i)%(this.tracks.length/2)), 1, 1)
- }
+ var i = this.songs.length - 1;
+ this.ui.get_object("grid1").attach(songWidget,
+ parseInt(i/(this.tracks.length/2)),
+ parseInt((i)%(this.tracks.length/2)), 1, 1);
this.ui.get_object("grid1").show_all();
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]