Commit 4b333cf6 authored by Andrea Scarpino's avatar Andrea Scarpino

Switch back to ChartLyrics to release on Harbour

parent dd496c12
......@@ -6,15 +6,15 @@ SOURCES += \
src/main.cpp \
src/lyricsmanager.cpp \
src/lyric.cpp \
src/lyricswikiapi.cpp
# src/chartlyricsapi.cpp
src/chartlyricsapi.cpp
# src/lyricswikiapi.cpp
HEADERS += \
src/lyricsmanager.h \
src/lyric_p.h \
src/lyric.h \
src/lyricswikiapi.h
# src/chartlyricsapi.h
src/chartlyricsapi.h
# src/lyricswikiapi.h
OTHER_FILES += \
qml/cover/CoverPage.qml \
......@@ -30,7 +30,7 @@ CONFIG += sailfishapp_i18n
TRANSLATIONS += translations/harbour-lyrics-it.ts
# LyricsWiki
QT += webkitwidgets
# QT += webkitwidgets
# ChartLyrics
#QT += xml
QT += xml
......@@ -59,6 +59,7 @@ Page {
onClicked: {
artist.text = "";
artist.forceActiveFocus();
song.text = "";
songText.text = "";
}
......
* Wed Jul 01 2015 Andrea Scarpino <me@andreascarpino.it> 0.2-1
* Sat Jul 04 2015 Andrea Scarpino <me@andreascarpino.it> 0.2-1
- Switch to LyricsWiki.
* Sat Jul 04 2015 Andrea Scarpino <me@andreascarpino.it> 0.1.1-1
- Landscape support.
- Provides search action by pressing enter.
......
......@@ -13,7 +13,7 @@ Name: harbour-lyrics
%{!?qtc_make:%define qtc_make make}
%{?qtc_builddir:%define _builddir %qtc_builddir}
Summary: Music lyrics application
Version: 0.2
Version: 0.1.1
Release: 1
Group: Qt/Qt
License: MIT
......@@ -25,7 +25,7 @@ BuildRequires: pkgconfig(sailfishapp) >= 1.0.2
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Qml)
BuildRequires: pkgconfig(Qt5Quick)
BuildRequires: pkgconfig(Qt5WebKitWidgets)
BuildRequires: pkgconfig(Qt5Xml)
BuildRequires: desktop-file-utils
%description
......
Name: harbour-lyrics
Summary: Music lyrics application
Version: 0.2
Version: 0.1.1
Release: 1
# The contents of the Group field should be one of the groups listed here:
# http://gitorious.org/meego-developer-tools/spectacle/blobs/master/data/GROUPS
......@@ -25,8 +25,8 @@ PkgConfigBR:
- Qt5Core
- Qt5Qml
- Qt5Quick
- Qt5WebKitWidgets # LyricsWiki
# - Qt5Xml # ChartLyrics
- Qt5Xml # ChartLyrics
# - Qt5WebKitWidgets # LyricsWiki
# Build dependencies without a pkgconfig setup can be listed here
# PkgBR:
......
......@@ -68,7 +68,7 @@ void ChartLyricsAPI::onGetLyricResult()
QNetworkReply* reply = qobject_cast<QNetworkReply*>(QObject::sender());
bool found = false;
Lyric* lyric;
Lyric* lyric = 0;
if (reply->error() != QNetworkReply::NoError) {
qCritical() << "Cannot fetch lyric";
......@@ -77,8 +77,6 @@ void ChartLyricsAPI::onGetLyricResult()
QString errorMsg;
xml.setContent(reply->readAll(), &errorMsg);
if (errorMsg.isEmpty()) {
qDebug() << "Got lyric:\n" << xml.toString();
QDomNodeList results = xml.elementsByTagName(QStringLiteral("GetLyricResult"));
if (!results.isEmpty()) {
QDomNode res = results.at(0);
......@@ -89,6 +87,8 @@ void ChartLyricsAPI::onGetLyricResult()
const QString text = res.namedItem(QStringLiteral("Lyric")).toElement().text();
if (!text.isEmpty()) {
qDebug() << "Got lyric text";
lyric->setText(text);
found = true;
}
......
......@@ -37,8 +37,8 @@ LyricsManager::~LyricsManager()
void LyricsManager::search(const QString &artist, const QString &song)
{
qDebug() << "Querying LyricsWiki";
api.getLyricBypassApi(artist, song);
qDebug() << "Querying ChartLyricsWiki";
api.getLyric(artist, song);
connect(&api, SIGNAL(lyricFetched(Lyric*,bool)), this, SIGNAL(searchResult(Lyric*,bool)));
}
......@@ -28,7 +28,7 @@
#include <QObject>
#include <QString>
#include "lyricswikiapi.h"
#include "chartlyricsapi.h"
#include "lyric.h"
class LyricsManager : public QObject
......@@ -44,7 +44,7 @@ Q_SIGNALS:
void searchResult(Lyric *lyric, const bool &found);
private:
LyricsWikiAPI api;
ChartLyricsAPI api;
};
......
......@@ -9,22 +9,22 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="74"/>
<location filename="../qml/pages/MainPage.qml" line="75"/>
<source>Lyrics</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="81"/>
<location filename="../qml/pages/MainPage.qml" line="82"/>
<source>Artist</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="90"/>
<location filename="../qml/pages/MainPage.qml" line="91"/>
<source>Song</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="104"/>
<location filename="../qml/pages/MainPage.qml" line="105"/>
<source>Search</source>
<translation type="unfinished"></translation>
</message>
......
......@@ -9,22 +9,22 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="74"/>
<location filename="../qml/pages/MainPage.qml" line="75"/>
<source>Lyrics</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="81"/>
<location filename="../qml/pages/MainPage.qml" line="82"/>
<source>Artist</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="90"/>
<location filename="../qml/pages/MainPage.qml" line="91"/>
<source>Song</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="104"/>
<location filename="../qml/pages/MainPage.qml" line="105"/>
<source>Search</source>
<translation type="unfinished"></translation>
</message>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment