Commit 52bdc6d3 authored by camilo higuita's avatar camilo higuita

now start working on the plasmo efforts

parent 2ea2c8bd
...@@ -385,7 +385,7 @@ Maui.ApplicationWindow ...@@ -385,7 +385,7 @@ Maui.ApplicationWindow
// } // }
// }, // },
Maui.MenuItem MenuItem
{ {
text: qsTr("Folders") text: qsTr("Folders")
icon.name: "folder" icon.name: "folder"
...@@ -404,7 +404,7 @@ Maui.ApplicationWindow ...@@ -404,7 +404,7 @@ Maui.ApplicationWindow
// } // }
// }, // },
Maui.MenuItem MenuItem
{ {
text: qsTr("YouTube") text: qsTr("YouTube")
icon.name: "internet-services" icon.name: "internet-services"
...@@ -437,14 +437,14 @@ Maui.ApplicationWindow ...@@ -437,14 +437,14 @@ Maui.ApplicationWindow
MenuSeparator{}, MenuSeparator{},
Maui.MenuItem MenuItem
{ {
text: qsTr("Sources...") text: qsTr("Sources...")
icon.name: "folder-add" icon.name: "folder-add"
onTriggered: sourcesDialog.open() onTriggered: sourcesDialog.open()
}, },
Maui.MenuItem MenuItem
{ {
text: qsTr("Open...") text: qsTr("Open...")
icon.name: "folder-add" icon.name: "folder-add"
...@@ -457,31 +457,31 @@ Maui.ApplicationWindow ...@@ -457,31 +457,31 @@ Maui.ApplicationWindow
vvave.openUrls(paths) vvave.openUrls(paths)
}) })
} }
} }/*,
// Maui.Menu Menu
// { {
// title: qsTr("Collection") title: qsTr("Collection")
// // icon.name: "settings-configure" // icon.name: "settings-configure"
// Maui.MenuItem MenuItem
// { {
// text: qsTr("Re-Scan") text: qsTr("Re-Scan")
// onTriggered: bae.refreshCollection(); onTriggered: bae.refreshCollection();
// } }
// Maui.MenuItem MenuItem
// { {
// text: qsTr("Refresh...") text: qsTr("Refresh...")
// onTriggered: H.refreshCollection(); onTriggered: H.refreshCollection();
// } }
// Maui.MenuItem MenuItem
// { {
// text: qsTr("Clean") text: qsTr("Clean")
// onTriggered: bae.removeMissingTracks(); onTriggered: bae.removeMissingTracks();
// } }
// }, }*/
// Maui.Menu // Maui.Menu
// { // {
......
...@@ -124,7 +124,7 @@ void AlbumsModel::fetchInformation() ...@@ -124,7 +124,7 @@ void AlbumsModel::fetchInformation()
QObject::connect(watcher, &QFutureWatcher<void>::finished, QObject::connect(watcher, &QFutureWatcher<void>::finished,
watcher, &QFutureWatcher<void>::deleteLater); watcher, &QFutureWatcher<void>::deleteLater);
auto func = [=]() auto func = [&]()
{ {
QList<PULPO::REQUEST> requests; QList<PULPO::REQUEST> requests;
int index = -1; int index = -1;
...@@ -136,7 +136,7 @@ void AlbumsModel::fetchInformation() ...@@ -136,7 +136,7 @@ void AlbumsModel::fetchInformation()
if(BAE::artworkCache(album, FMH::MODEL_KEY::ALBUM)) if(BAE::artworkCache(album, FMH::MODEL_KEY::ALBUM))
{ {
db->insertArtwork(album); this->db->insertArtwork(album);
emit this->updateModel(index, {FMH::MODEL_KEY::ARTWORK}); emit this->updateModel(index, {FMH::MODEL_KEY::ARTWORK});
continue; continue;
} }
...@@ -182,26 +182,25 @@ void AlbumsModel::fetchInformation() ...@@ -182,26 +182,25 @@ void AlbumsModel::fetchInformation()
Pulpo pulpo; Pulpo pulpo;
QEventLoop loop; QEventLoop loop;
QObject::connect(&pulpo, &Pulpo::finished, &loop, &QEventLoop::quit); QObject::connect(&pulpo, &Pulpo::finished, &loop, &QEventLoop::quit);
// bool stop = false; bool stop = false;
// QObject::connect(this, &AlbumsModel::destroyed, [&]() QObject::connect(this, &AlbumsModel::destroyed, [&stop]()
// { {
// qDebug()<< stop << &stop; qDebug()<< stop << &stop;
// stop = true; stop = true;
// qDebug()<< stop << &stop; qDebug()<< stop << &stop;
// }); });
for(const auto &req : requests) for(const auto &req : requests)
{ {
pulpo.request(req); pulpo.request(req);
loop.exec(); loop.exec();
// if(stop) if(stop)
// { {
// loop.quit(); loop.quit();
// return; return;
// } }
} }
}; };
......
...@@ -62,7 +62,7 @@ void Pulpo::start() ...@@ -62,7 +62,7 @@ void Pulpo::start()
case SERVICES::LastFm: case SERVICES::LastFm:
{ {
auto lastfm = new class lastfm(); auto lastfm = new class lastfm();
connect(lastfm, &lastfm::responseReady,[=](PULPO::REQUEST request, PULPO::RESPONSES responses) connect(lastfm, &lastfm::responseReady,[&, lastfm = std::move(lastfm)](PULPO::REQUEST request, PULPO::RESPONSES responses)
{ {
this->passSignal(request, responses); this->passSignal(request, responses);
lastfm->deleteLater(); lastfm->deleteLater();
...@@ -76,13 +76,11 @@ void Pulpo::start() ...@@ -76,13 +76,11 @@ void Pulpo::start()
} }
} }
void Pulpo::passSignal(REQUEST request, RESPONSES responses) void Pulpo::passSignal(const REQUEST &request, const RESPONSES &responses)
{ {
if(request.callback) if(request.callback)
request.callback(request, responses); request.callback(request, responses);
else else
emit this->infoReady(request, responses); emit this->infoReady(request, responses);
emit this->finished(); emit this->finished();
} }
...@@ -31,7 +31,7 @@ private: ...@@ -31,7 +31,7 @@ private:
PULPO::REQUEST req; PULPO::REQUEST req;
void passSignal(PULPO::REQUEST request, PULPO::RESPONSES responses); void passSignal(const REQUEST &request, const RESPONSES &responses);
signals: signals:
void infoReady(PULPO::REQUEST request, PULPO::RESPONSES responses); void infoReady(PULPO::REQUEST request, PULPO::RESPONSES responses);
......
...@@ -32,7 +32,7 @@ void Service::retrieve(const QString &url, const QMap<QString, QString> &headers ...@@ -32,7 +32,7 @@ void Service::retrieve(const QString &url, const QMap<QString, QString> &headers
if(!url.isEmpty()) if(!url.isEmpty())
{ {
auto downloader = new FMH::Downloader; auto downloader = new FMH::Downloader;
connect(downloader, &FMH::Downloader::dataReady, [=](QByteArray array) connect(downloader, &FMH::Downloader::dataReady, [&, downloader = std::move(downloader)](QByteArray array)
{ {
// qDebug()<< "DATA READY << " << array; // qDebug()<< "DATA READY << " << array;
emit this->arrayReady(array); emit this->arrayReady(array);
......
...@@ -110,16 +110,14 @@ void lastfm::parseArtist(const QByteArray &array) ...@@ -110,16 +110,14 @@ void lastfm::parseArtist(const QByteArray &array)
if (n.isElement()) if (n.isElement())
{ {
//Here retrieve the artist image //Here retrieve the artist image
if(n.nodeName() == "image" && n.hasAttributes()) if(n.nodeName() == "image" && n.hasAttributes())
{ {
if(this->request.info.contains(INFO::ARTWORK)) if(this->request.info.contains(INFO::ARTWORK))
{ {
auto imgSize = n.attributes().namedItem("size").nodeValue(); const auto imgSize = n.attributes().namedItem("size").nodeValue();
if (imgSize == "large" && n.isElement()) if (imgSize == "large" && n.isElement())
{ {
auto artistArt_url = n.toElement().text(); const auto artistArt_url = n.toElement().text();
this->responses << PULPO::RESPONSE {CONTEXT::IMAGE, artistArt_url}; this->responses << PULPO::RESPONSE {CONTEXT::IMAGE, artistArt_url};
if(this->request.info.size() == 1) break; if(this->request.info.size() == 1) break;
...@@ -262,11 +260,11 @@ void lastfm::parseAlbum(const QByteArray &array) ...@@ -262,11 +260,11 @@ void lastfm::parseAlbum(const QByteArray &array)
{ {
if(this->request.info.contains(INFO::ARTWORK)) if(this->request.info.contains(INFO::ARTWORK))
{ {
auto imgSize = n.attributes().namedItem("size").nodeValue(); const auto imgSize = n.attributes().namedItem("size").nodeValue();
if (imgSize == "large" && n.isElement()) if (imgSize == "large" && n.isElement())
{ {
auto albumArt_url = n.toElement().text(); const auto albumArt_url = n.toElement().text();
this->responses << PULPO::RESPONSE {CONTEXT::IMAGE, albumArt_url}; this->responses << PULPO::RESPONSE {CONTEXT::IMAGE, albumArt_url};
if(this->request.info.size() == 1) break; if(this->request.info.size() == 1) break;
...@@ -281,7 +279,7 @@ void lastfm::parseAlbum(const QByteArray &array) ...@@ -281,7 +279,7 @@ void lastfm::parseAlbum(const QByteArray &array)
{ {
if(this->request.info.contains(INFO::WIKI)) if(this->request.info.contains(INFO::WIKI))
{ {
auto albumWiki = n.childNodes().item(1).toElement().text(); const auto albumWiki = n.childNodes().item(1).toElement().text();
//qDebug()<<"Fetching AlbumWiki LastFm[]"; //qDebug()<<"Fetching AlbumWiki LastFm[]";
this->responses << PULPO::RESPONSE {CONTEXT::WIKI, albumWiki}; this->responses << PULPO::RESPONSE {CONTEXT::WIKI, albumWiki};
......
...@@ -101,7 +101,7 @@ QString Linking::getDeviceName() ...@@ -101,7 +101,7 @@ QString Linking::getDeviceName()
void Linking::ask(int code, QString msg) void Linking::ask(int code, QString msg)
{ {
bDebug::Instance()->msg("Sending msg to server: "+QString::number(code)+" :: "+ msg); // bDebug::Instance()->msg("Sending msg to server: "+QString::number(code)+" :: "+ msg);
client.sendTextMessage(stringify(packResponse(static_cast<LINK::CODE>(code), msg))); client.sendTextMessage(stringify(packResponse(static_cast<LINK::CODE>(code), msg)));
} }
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include "youtubedl.h" #include "youtubedl.h"
#include "../../pulpo/pulpo.h" #include "../../pulpo/pulpo.h"
#include "../../db/collectionDB.h" #include "../../db/collectionDB.h"
#include "../../utils/babeconsole.h" //#include "../../utils/babeconsole.h"
#if (defined (Q_OS_LINUX) && !defined (Q_OS_ANDROID)) #if (defined (Q_OS_LINUX) && !defined (Q_OS_ANDROID))
#include "kde/notify.h" #include "kde/notify.h"
...@@ -54,7 +54,7 @@ void youtubedl::fetch(const QString &json) ...@@ -54,7 +54,7 @@ void youtubedl::fetch(const QString &json)
auto playlist = data.value("playlist").toString().trimmed(); auto playlist = data.value("playlist").toString().trimmed();
auto page = data.value("page").toString().replace('"',"").trimmed(); auto page = data.value("page").toString().replace('"',"").trimmed();
bDebug::Instance()->msg("Fetching from Youtube: "+id+" "+title+" "+artist); // bDebug::Instance()->msg("Fetching from Youtube: "+id+" "+title+" "+artist);
FMH::MODEL infoMap; FMH::MODEL infoMap;
infoMap.insert(FMH::MODEL_KEY::TITLE, title); infoMap.insert(FMH::MODEL_KEY::TITLE, title);
...@@ -86,7 +86,7 @@ void youtubedl::fetch(const QString &json) ...@@ -86,7 +86,7 @@ void youtubedl::fetch(const QString &json)
auto command = ydl; auto command = ydl;
command = command.replace("$$$",infoMap[FMH::MODEL_KEY::ID])+" "+infoMap[FMH::MODEL_KEY::ID]; command = command.replace("$$$",infoMap[FMH::MODEL_KEY::ID])+" "+infoMap[FMH::MODEL_KEY::ID];
bDebug::Instance()->msg(command); // bDebug::Instance()->msg(command);
process->start(command); process->start(command);
} }
} }
......
...@@ -57,9 +57,6 @@ SOURCES += main.cpp \ ...@@ -57,9 +57,6 @@ SOURCES += main.cpp \
services/local/socket.cpp \ services/local/socket.cpp \
services/web/youtube.cpp \ services/web/youtube.cpp \
vvave.cpp \ vvave.cpp \
db/conthread.cpp \
services/web/babeit.cpp \
utils/babeconsole.cpp \
services/local/youtubedl.cpp \ services/local/youtubedl.cpp \
services/local/linking.cpp \ services/local/linking.cpp \
services/web/Spotify/spotify.cpp \ services/web/Spotify/spotify.cpp \
...@@ -90,10 +87,6 @@ HEADERS += \ ...@@ -90,10 +87,6 @@ HEADERS += \
services/local/socket.h \ services/local/socket.h \
services/web/youtube.h \ services/web/youtube.h \
vvave.h \ vvave.h \
db/conthread.h \
services/web/babeit.h \
utils/babeconsole.h \
utils/singleton.h \
services/local/youtubedl.h \ services/local/youtubedl.h \
services/local/linking.h \ services/local/linking.h \
services/web/Spotify/spotify.h \ services/web/Spotify/spotify.h \
......
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