diff --git a/qml/AboutPage.qml b/qml/AboutPage.qml index e44d455..75f0e2c 100644 --- a/qml/AboutPage.qml +++ b/qml/AboutPage.qml @@ -1,5 +1,5 @@ -import QtQuick 2.3 -import QtQuick.Controls 1.2 +import QtQuick 2.4 +import QtQuick.Controls 1.3 import QtQuick.Layouts 1.1 import com.iktwo.components 1.0 diff --git a/qml/Arrow.qml b/qml/Arrow.qml index 2d9c1a1..34acc10 100644 --- a/qml/Arrow.qml +++ b/qml/Arrow.qml @@ -1,4 +1,4 @@ -import QtQuick 2.3 +import QtQuick 2.4 Item { height: 100 diff --git a/qml/FakeMainPage.qml b/qml/FakeMainPage.qml index d54c3ab..bb222c9 100644 --- a/qml/FakeMainPage.qml +++ b/qml/FakeMainPage.qml @@ -1,6 +1,5 @@ -import QtQuick 2.3 -import com.iktwo.components 1.0 -import QtQuick.Controls 1.2 +import QtQuick 2.4 +import QtQuick.Controls 1.3 import QtQuick.Layouts 1.1 import com.iktwo.components 1.0 @@ -51,20 +50,17 @@ Item { ListElement { name: "Arrullo De Estrellas"; artist: "Zoé" - length: "4:14"; comment: "Bonita canción que me hace pensar en ti.." - code: ""; url: "xxx" + length: "4:14"; code: ""; url: "xxx" } ListElement { name: "Goodbye Lovers and Friends"; artist: "Franz Ferdinand" - length: "4:34"; comment: "I love this song!" - code: ""; url: "xxx" + length: "4:34"; code: ""; url: "xxx" } ListElement { name: "Addicted to you"; artist: "Avicii" - length: "3:24"; comment: "I am addicted to you" - code: ""; url: "xxx" + length: "3:24"; code: ""; url: "xxx" } } diff --git a/qml/FakePlaybackControls.qml b/qml/FakePlaybackControls.qml index 59318bf..033fd80 100644 --- a/qml/FakePlaybackControls.qml +++ b/qml/FakePlaybackControls.qml @@ -1,6 +1,6 @@ -import QtQuick 2.3 -import QtQuick.Controls 1.2 -import QtQuick.Controls.Styles 1.1 +import QtQuick 2.4 +import QtQuick.Controls 1.3 +import QtQuick.Controls.Styles 1.3 import QtQuick.Layouts 1.1 import QtMultimedia 5.1 import com.iktwo.components 1.0 diff --git a/qml/FakeSearchPage.qml b/qml/FakeSearchPage.qml index 8d2ce68..7bb40d8 100644 --- a/qml/FakeSearchPage.qml +++ b/qml/FakeSearchPage.qml @@ -1,7 +1,7 @@ -import QtQuick 2.3 +import QtQuick 2.4 +import QtQuick.Controls 1.3 +import QtQuick.Controls.Styles 1.3 import com.iktwo.components 1.0 -import QtQuick.Controls 1.2 -import QtQuick.Controls.Styles 1.2 Page { id: root diff --git a/qml/ImageButton.qml b/qml/ImageButton.qml index 54e1938..bc76dd0 100644 --- a/qml/ImageButton.qml +++ b/qml/ImageButton.qml @@ -1,4 +1,4 @@ -import QtQuick 2.3 +import QtQuick 2.4 Item { id: root diff --git a/qml/MainPage.qml b/qml/MainPage.qml index fecb126..76202df 100644 --- a/qml/MainPage.qml +++ b/qml/MainPage.qml @@ -1,5 +1,5 @@ -import QtQuick 2.3 -import QtQuick.Controls 1.1 +import QtQuick 2.4 +import QtQuick.Controls 1.3 import QtQuick.Layouts 1.1 import QtMultimedia 5.2 import com.iktwo.components 1.0 @@ -92,12 +92,12 @@ Page { if (index < playlist.count - 1) { /// Will copy next item data, no need to change index - playbackControls.song = playlist.get(index + 1).name + " - " + playlist.get(index + 1).comment + "" + playbackControls.song = playlist.get(index + 1).name + " - " + playlist.get(index + 1).artist + "" audioElement.source = playlist.get(index + 1).url audioElement.play() } else if (index - 1 >= 0) { /// Will copy previous item data, update index to -1 - playbackControls.song = playlist.get(index - 1).name + " - " + playlist.get(index - 1).comment + "" + playbackControls.song = playlist.get(index - 1).name + " - " + playlist.get(index - 1).artist + "" audioElement.source = playlist.get(index - 1).url audioElement.index = audioElement.index - 1 audioElement.play() @@ -141,8 +141,4 @@ Page { wrapMode: "Wrap" elide: "ElideRight" } - - //Component.onCompleted: playlist.append({"name" : "First Song", - //"artist" : "First Group", "length" : "3:31", "comment" : "this is a test", - //"code" : "XASDDASD", "url": "invalid", "picture": "crazytest"}) } diff --git a/qml/PlaybackControls.qml b/qml/PlaybackControls.qml index 9200f0e..66fab7d 100644 --- a/qml/PlaybackControls.qml +++ b/qml/PlaybackControls.qml @@ -1,8 +1,8 @@ -import QtQuick 2.3 -import QtQuick.Controls 1.2 -import QtQuick.Controls.Styles 1.1 +import QtQuick 2.4 +import QtQuick.Controls 1.3 +import QtQuick.Controls.Styles 1.3 import QtQuick.Layouts 1.1 -import QtMultimedia 5.1 +import QtMultimedia 5.2 import com.iktwo.components 1.0 import "components/style.js" as Style diff --git a/qml/PlaylistDelegate.qml b/qml/PlaylistDelegate.qml index 7bdcf39..02721de 100644 --- a/qml/PlaylistDelegate.qml +++ b/qml/PlaylistDelegate.qml @@ -1,5 +1,5 @@ -import QtQuick 2.3 -import QtQuick.Controls 1.2 +import QtQuick 2.4 +import QtQuick.Controls 1.3 import com.iktwo.components 1.0 import "components" as ThisComponents import "components/style.js" as Style @@ -75,7 +75,7 @@ Item { elide: Text.ElideRight color: Style.TEXT_SECONDARY_COLOR_DARK - text: model.length + " - " + model.comment + "" + text: model.length width: parent.width renderType: Text.NativeRendering } diff --git a/qml/ReviewDialog.qml b/qml/ReviewDialog.qml index a603890..72f7745 100644 --- a/qml/ReviewDialog.qml +++ b/qml/ReviewDialog.qml @@ -1,4 +1,4 @@ -import QtQuick 2.3 +import QtQuick 2.4 import com.iktwo.components 1.0 Dialog { diff --git a/qml/SearchPage.qml b/qml/SearchPage.qml index 2a1ecce..120516e 100644 --- a/qml/SearchPage.qml +++ b/qml/SearchPage.qml @@ -1,6 +1,6 @@ -import QtQuick 2.3 -import QtQuick.Controls 1.2 -import QtQuick.Controls.Styles 1.2 +import QtQuick 2.4 +import QtQuick.Controls 1.3 +import QtQuick.Controls.Styles 1.3 import com.iktwo.components 1.0 Page { @@ -187,7 +187,6 @@ Page { playlist.append({ "name" : model.name, "artist" : model.artist, "length" : model.length, - "comment" : model.comment, "code" : model.code, "url": model.url, "picture": model.picture }) diff --git a/qml/SongDelegate.qml b/qml/SongDelegate.qml index 71a42ca..fe33e1e 100644 --- a/qml/SongDelegate.qml +++ b/qml/SongDelegate.qml @@ -1,6 +1,6 @@ -import QtQuick 2.3 -import QtQuick.Controls 1.2 -import QtQuick.Controls.Styles 1.1 +import QtQuick 2.4 +import QtQuick.Controls 1.3 +import QtQuick.Controls.Styles 1.3 import QtQuick.Layouts 1.1 import com.iktwo.components 1.0 import "components" as ThisComponents @@ -97,7 +97,7 @@ Item { elide: Text.ElideRight color: Style.TEXT_SECONDARY_COLOR_DARK - text: model.length + (model.comment !== "" && model.length !== "" ? " - " : "") + model.comment + text: model.artist width: parent.width renderType: Text.NativeRendering maximumLineCount: 1 @@ -124,9 +124,9 @@ Item { color: Style.TEXT_COLOR_LIGHT elide: Text.ElideRight - text: model.kbps + "kbps " //+ model.hits renderType: Text.NativeRendering maximumLineCount: 1 + text: model.kbps + "kbps" } } } @@ -140,9 +140,9 @@ Item { elide: Text.ElideRight color: Style.TEXT_SECONDARY_COLOR_DARK - text: "▶ " + model.hits width: parent.width renderType: Text.NativeRendering + text: model.length } } diff --git a/qml/TutorialPage.qml b/qml/TutorialPage.qml index cfc2030..2fa07cf 100644 --- a/qml/TutorialPage.qml +++ b/qml/TutorialPage.qml @@ -1,5 +1,5 @@ -import QtQuick 2.3 -import QtQuick.Controls 1.2 +import QtQuick 2.4 +import QtQuick.Controls 1.3 import com.iktwo.components 1.0 Page { diff --git a/qml/main.qml b/qml/main.qml index 9ade852..9030e53 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -1,7 +1,7 @@ -import QtQuick 2.3 -import QtQuick.Controls 1.2 +import QtQuick 2.4 +import QtQuick.Controls 1.3 import QtQuick.Window 2.1 -import QtMultimedia 5.1 +import QtMultimedia 5.2 import com.iktwo.components 1.0 import "." @@ -29,7 +29,7 @@ ApplicationWindow { else audio.index = 0 - playbackControls.song = playlist.get(audio.index).name + " - " + playlist.get(audio.index).comment + "" + playbackControls.song = playlist.get(audio.index).name + " - " + playlist.get(audio.index).artist + "" audio.source = playlist.get(audio.index).url audio.play() } @@ -40,7 +40,7 @@ ApplicationWindow { else audio.index = playlist.count - 1 - playbackControls.song = playlist.get(audio.index).name + " - " + playlist.get(audio.index).comment + "" + playbackControls.song = playlist.get(audio.index).name + " - " + playlist.get(audio.index).artist + "" audio.source = playlist.get(audio.index).url audio.play() } @@ -122,7 +122,7 @@ ApplicationWindow { onRowsInserted: { // If new item is first on list, play it if (count === 1) { - playbackControls.song = playlist.get(audio.index).name + " - " + playlist.get(audio.index).comment + "" + playbackControls.song = playlist.get(audio.index).name + " - " + playlist.get(audio.index).artist + "" audio.source = playlist.get(audio.index).url audio.play() } else if (audio.status == Audio.EndOfMedia) { diff --git a/qml/testModels/TestSearchModel.qml b/qml/testModels/TestSearchModel.qml index ea97e0d..0fcd07b 100644 --- a/qml/testModels/TestSearchModel.qml +++ b/qml/testModels/TestSearchModel.qml @@ -2,58 +2,52 @@ import QtQuick 2.3 ListModel { id: testModel + ListElement { name: "Labios Rotos" artist: "Zoe" picture: "zoe" length: "3:40" - comment: "Bonita canción" kbps: 192 - hits: 11500 } + ListElement { name: "Yesterday" artist: "The Beatles" picture: "beatles" length: "2:58" - comment: "The yellow submarine!" kbps: 128 - hits: 25800 } + ListElement { name: "Another one bites the dust" artist: "Queen" picture: "queen" length: "3:14" - comment: "We are the champions my friend!" kbps: 320 - hits: 23160 } + ListElement { name: "hips don't lie" artist: "Shakira" picture: "shakira" length: "3:22" - comment: "Waka waka!" kbps: 98 - hits: 18231 } + ListElement { name: "Hotel Room Service" artist: "Pitbull" picture: "pitbull" length: "4:15" - comment: "Ya tu sabe!" kbps: 64 - hits: 10100 } + ListElement { name: "Song Name" artist: "Fake" picture: "crazystuff" length: "3:10" - comment: "This a long useful comment" kbps: 64 - hits: 158 } } diff --git a/src/downloader.cpp b/src/downloader.cpp index 37d0438..071c7aa 100644 --- a/src/downloader.cpp +++ b/src/downloader.cpp @@ -97,7 +97,7 @@ void Downloader::downloadFinished(QNetworkReply *reply) // if (!reply->url().toString().startsWith("http://www.goear.com/action/sound/get/")) - // qDebug() << reply->url().toString() << "Downloaded"; + // qDebug() << reply->url().toString() << "Downloaded"; QVariant redir = reply->attribute(QNetworkRequest::RedirectionTargetAttribute); @@ -199,31 +199,37 @@ void Downloader::downloadFinished(QNetworkReply *reply) songs = songs.mid(termEnds); - searchTerm = "\">"; - closingTerm = ""; + searchTerm = "