Commit 4af2956d authored by camilo higuita's avatar camilo higuita

Merge branch 'master' of invent.kde.org:kde/vvave

parents 235c616b 33bd3374
mauikit/
3rdparty/kirigami/
3rdparty/mauikit/
3rdparty/breeze-icons/
3rdparty/openssl/
.directory
......
......@@ -11,11 +11,11 @@
#include "services/local/player.h"
#ifdef STATIC_KIRIGAMI
#include "./3rdparty/kirigami/src/kirigamiplugin.h"
#include "3rdparty/kirigami/src/kirigamiplugin.h"
#endif
#ifdef STATIC_MAUIKIT
#include "./mauikit/src/mauikit.h"
#include "3rdparty/mauikit/src/mauikit.h"
#endif
#ifdef Q_OS_ANDROID
......
......@@ -152,12 +152,12 @@ Maui.ApplicationWindow
/* UI */
// accentColor: babeColor
// accentColor: babeColor
// headBarFGColor: altColorText
// headBarBGColor: "#212121"
// altColorText: darkTextColor
// headBar.spacing: space.big
// headBar.spacing: space.big
headBar.middleContent : Kirigami.ActionToolBar
{
display: isWide ? ToolButton.TextBesideIcon : ToolButton.IconOnly
......@@ -219,7 +219,7 @@ Maui.ApplicationWindow
checkable: false
checked: currentView === viewsIndex.artists
icon.name: "view-media-artist"
Kirigami.Theme.textColor: currentView === viewsIndex.artists ? babeColor : altColorText
// Kirigami.Theme.textColor: currentView === viewsIndex.artists ? babeColor : altColorText
onTriggered: currentView = viewsIndex.artists
// colorScheme.highlightColor: babeColor
// showIndicator: true
......@@ -296,11 +296,11 @@ Maui.ApplicationWindow
}
}
// Kirigami.Separator
// {
// Layout.fillWidth: true
//// color: borderColor
// }
// Kirigami.Separator
// {
// Layout.fillWidth: true
//// color: borderColor
// }
Maui.ToolBar
{
......@@ -308,16 +308,16 @@ Maui.ApplicationWindow
Layout.fillWidth: true
position: ToolBar.Footer
leftContent: ToolButton
{
icon.name: "headphones"
visible: _drawer.modal
checked: _drawer.visible
icon.color: _drawer.visible ? babeColor : textColor
onClicked: _drawer.visible = !_drawer.visible
Kirigami.Theme.highlightColor: babeColor
// text: qsTr("Now")
}
// leftContent: ToolButton
// {
// icon.name: "headphones"
// visible: _drawer.modal
// checked: _drawer.visible
// icon.color: _drawer.visible ? babeColor : Kirigami.Theme.textColor
// onClicked: _drawer.visible = !_drawer.visible
// Kirigami.Theme.highlightColor: babeColor
// // text: qsTr("Now")
// }
middleContent: [
ToolButton
......@@ -325,18 +325,18 @@ Maui.ApplicationWindow
id: babeBtnIcon
icon.name: "love"
enabled: currentTrackIndex >= 0
icon.color: currentBabe ? babeColor : textColor
icon.color: currentBabe ? babeColor : Kirigami.Theme.textColor
onClicked: if (!mainlistEmpty)
{
mainPlaylist.list.fav(currentTrackIndex, !(mainPlaylist.list.get(currentTrackIndex).fav == "1"))
currentBabe = mainPlaylist.list.get(currentTrackIndex).fav == "1"
}
{
mainPlaylist.list.fav(currentTrackIndex, !(mainPlaylist.list.get(currentTrackIndex).fav == "1"))
currentBabe = mainPlaylist.list.get(currentTrackIndex).fav == "1"
}
},
ToolButton
{
icon.name: "media-skip-backward"
icon.color: textColor
icon.color: Kirigami.Theme.textColor
onClicked: Player.previousTrack()
onPressAndHold: Player.playAt(prevTrackIndex)
},
......@@ -345,7 +345,7 @@ Maui.ApplicationWindow
{
id: playIcon
enabled: currentTrackIndex >= 0
icon.color: textColor
icon.color: Kirigami.Theme.textColor
icon.name: isPlaying ? "media-playback-pause" : "media-playback-start"
onClicked: player.playing = !player.playing
},
......@@ -353,7 +353,7 @@ Maui.ApplicationWindow
ToolButton
{
id: nextBtn
icon.color: textColor
icon.color: Kirigami.Theme.textColor
icon.name: "media-skip-forward"
onClicked: Player.nextTrack()
onPressAndHold: Player.playAt(Player.shuffle())
......@@ -606,7 +606,7 @@ Maui.ApplicationWindow
text: infoMsg
horizontalAlignment: Qt.AlignHCenter
verticalAlignment: Qt.AlignVCenter
color: textColor
color: Kirigami.Theme.textColor
SequentialAnimation
{
......@@ -625,7 +625,7 @@ Maui.ApplicationWindow
target: infoTxt
property: "color"
easing.type: Easing.InOutQuad
to: textColor
to: Kirigami.Theme.textColor
duration: 500
}
}
......@@ -645,6 +645,12 @@ Maui.ApplicationWindow
modal: !isWide
handleVisible: false
closePolicy: Popup.NoAutoClose
handleClosedIcon.source: "headphones"
handleOpenIcon.source: "headphones"
handleOpenIcon.color: babeColor
handleClosedIcon.color: babeColor
contentItem: MainPlaylist
{
id: mainPlaylist
......@@ -953,44 +959,44 @@ Maui.ApplicationWindow
Layout.bottomMargin: space.big
onIconClicked: _contextMenu.popup()
onExitClicked: clear()
// Kirigami.Theme.backgroundColor: "#212121"
// Kirigami.Theme.backgroundColor: "#212121"
// model: BaseModel
// {
// list: _selectionBarModelList
// }
// model: BaseModel
// {
// list: _selectionBarModelList
// }
// Tracks
// {
// id: _selectionBarModelList
// }
// Tracks
// {
// id: _selectionBarModelList
// }
SelectionBarMenu
{
id: _contextMenu
}
// function append(item)
// {
// _selectionBar.append(item)
// function append(item)
// {
// _selectionBar.append(item)
//// if(selectedPaths.indexOf(item.path) < 0)
//// {
//// selectedItems.push(item)
//// selectedPaths.push(item.path)
//// if(selectedPaths.indexOf(item.path) < 0)
//// {
//// selectedItems.push(item)
//// selectedPaths.push(item.path)
//// // for(var i = 0; i < selectionList.count ; i++ )
//// // if(selectionList.model.get(i).path === item.path)
//// // {
//// // selectionList.model.remove(i)
//// // return
//// // }
//// // for(var i = 0; i < selectionList.count ; i++ )
//// // if(selectionList.model.get(i).path === item.path)
//// // {
//// // selectionList.model.remove(i)
//// // return
//// // }
//// selectionList.model.list.append(item)
//// selectionList.positionViewAtEnd()
//// selectionList.model.list.append(item)
//// selectionList.positionViewAtEnd()
//// }
// }
//// }
// }
}
}
......@@ -1022,10 +1028,10 @@ Maui.ApplicationWindow
{
target: vvave
// onRefreshTables: H.refreshCollection(size)
// onRefreshTracks: H.refreshTracks()
// onRefreshAlbums: H.refreshAlbums()
// onRefreshArtists: H.refreshArtists()
// onRefreshTables: H.refreshCollection(size)
// onRefreshTracks: H.refreshTracks()
// onRefreshAlbums: H.refreshAlbums()
// onRefreshArtists: H.refreshArtists()
// onCoverReady:
// {
......
......@@ -107,7 +107,7 @@ void AlbumsModel::setList()
//get albums data with modifier for missing images for artworks
this->list = this->db->getDBData(m_Query, [&](FMH::MODEL &item)
{
if(!item[FMH::MODEL_KEY::ARTWORK].isEmpty() && !FMH::fileExists(item[FMH::MODEL_KEY::ARTWORK]))
if(!item[FMH::MODEL_KEY::ARTWORK].isEmpty() && !FMH::fileExists(QUrl::fromLocalFile(item[FMH::MODEL_KEY::ARTWORK])))
{
this->db->removeArtwork(FMH::MODEL_NAME[static_cast<FMH::MODEL_KEY>(this->query)], FM::toMap(item));
item[FMH::MODEL_KEY::ARTWORK] = "";
......
......@@ -28,10 +28,10 @@ Cloud::Cloud(QObject *parent) : BaseList (parent)
newItem[FMH::MODEL_KEY::FAV] = QString("0");
newItem[FMH::MODEL_KEY::RATE] = QString("0");
newItem[FMH::MODEL_KEY::URL] = FMH::fileExists(thumbnail)? thumbnail : item[FMH::MODEL_KEY::URL];
newItem[FMH::MODEL_KEY::SOURCE] = FMH::fileExists(thumbnail)? thumbnail : item[FMH::MODEL_KEY::PATH];
newItem[FMH::MODEL_KEY::URL] = FMH::fileExists(QUrl::fromLocalFile(thumbnail))? thumbnail : item[FMH::MODEL_KEY::URL];
newItem[FMH::MODEL_KEY::SOURCE] = FMH::fileExists(QUrl::fromLocalFile(thumbnail))? thumbnail : item[FMH::MODEL_KEY::PATH];
if(FMH::fileExists(thumbnail))
if(FMH::fileExists(QUrl::fromLocalFile(thumbnail)))
{
qDebug()<< "file exists:" << thumbnail;
TagInfo info;
......@@ -61,10 +61,10 @@ Cloud::Cloud(QObject *parent) : BaseList (parent)
newItem[FMH::MODEL_KEY::FAV] = QString("0");
newItem[FMH::MODEL_KEY::RATE] = QString("0");
newItem[FMH::MODEL_KEY::URL] = FMH::fileExists(thumbnail)? thumbnail : item[FMH::MODEL_KEY::URL];
newItem[FMH::MODEL_KEY::SOURCE] = FMH::fileExists(thumbnail)? thumbnail : item[FMH::MODEL_KEY::PATH];
newItem[FMH::MODEL_KEY::URL] = FMH::fileExists(QUrl::fromLocalFile(thumbnail))? thumbnail : item[FMH::MODEL_KEY::URL];
newItem[FMH::MODEL_KEY::SOURCE] = FMH::fileExists(QUrl::fromLocalFile(thumbnail))? thumbnail : item[FMH::MODEL_KEY::PATH];
if(FMH::fileExists(thumbnail))
if(FMH::fileExists(QUrl::fromLocalFile(thumbnail)))
{
qDebug()<< "file exists:" << thumbnail;
TagInfo info;
......@@ -122,12 +122,12 @@ void Cloud::formatList()
item[FMH::MODEL_KEY::FAV] = QString("0");
item[FMH::MODEL_KEY::RATE] = QString("0");
item[FMH::MODEL_KEY::URL] = FMH::fileExists(thumbnail)? thumbnail : item[FMH::MODEL_KEY::URL];
item[FMH::MODEL_KEY::SOURCE] = FMH::fileExists(thumbnail)? thumbnail : item[FMH::MODEL_KEY::PATH];
item[FMH::MODEL_KEY::URL] = FMH::fileExists(QUrl::fromLocalFile(thumbnail))? thumbnail : item[FMH::MODEL_KEY::URL];
item[FMH::MODEL_KEY::SOURCE] = FMH::fileExists(QUrl::fromLocalFile(thumbnail))? thumbnail : item[FMH::MODEL_KEY::PATH];
qDebug()<< "CLOUD FILE" << thumbnail;
if(FMH::fileExists(thumbnail))
if(FMH::fileExists(QUrl::fromLocalFile(thumbnail)))
{
qDebug()<< "file exists:" << thumbnail;
TagInfo info;
......
......@@ -3,6 +3,7 @@
#include <QObject>
#include <QDirIterator>
#include <QUrl>
#include "../services/local/taginfo.h"
#include "../db/collectionDB.h"
#include "utils/bae.h"
......@@ -12,7 +13,7 @@ namespace FLoader
inline QStringList getPathContents(QStringList &urls, const QString &path)
{
if(!FMH::fileExists(path))
if(!FMH::fileExists(QUrl::fromLocalFile(path)))
return urls;
if (QFileInfo(path).isDir())
......@@ -35,7 +36,7 @@ inline uint getTracks(const QStringList& paths)
const auto urls = std::accumulate(paths.begin(), paths.end(), QStringList(), getPathContents);
for(const auto &path : paths)
if(FMH::fileExists(path))
if(FMH::fileExists(QUrl::fromLocalFile(path)))
db->addFolder(path);
uint newTracks = 0;
......
......@@ -8,7 +8,7 @@ function playTrack(index)
if(typeof(currentTrack) === "undefined") return
if(Maui.FM.fileExists(currentTrack.url))
if(Maui.FM.fileExists("file://" + currentTrack.url))
{
player.url = currentTrack.url;
player.playing = true
......
......@@ -392,7 +392,7 @@ inline QString fixString (const QString &str)
inline bool fileExists(const QString &url)
{
return FMH::fileExists(url);
return FMH::fileExists(QUrl::fromLocalFile(url));
}
inline BAE::TABLE albumType(const FMH::MODEL &albumMap)
......
......@@ -125,7 +125,7 @@ ItemDelegate
width: img.adapt ? img.width : Math.min(img.width, img.height)
height: img.adapt ? img.height : width
radius: albumRadius
border.color: borderColor
// border.color: borderColor
}
}
}
......
This diff is collapsed.
......@@ -17,7 +17,7 @@ Menu
property int rate : 0
property bool fav : false
property string starColor : "#FFC107"
property string starReg : textColor
property string starReg : Kirigami.Theme.textColor
property string starIcon: "draw-star"
signal removeClicked()
......@@ -139,7 +139,7 @@ Menu
MenuItem
{
text: qsTr("Remove")
Kirigami.Theme.textColor: dangerColor
Kirigami.Theme.textColor: Kirigami.Theme.negativeTextColor
onTriggered:
{
removeClicked()
......
......@@ -26,7 +26,7 @@ Item
height: recSize
color: vvave.moodColor(0)
radius: recRadius
border.color: altColor
border.color: color
border.width: 1
}
......@@ -46,7 +46,7 @@ Item
height: recSize
color: vvave.moodColor(1)
radius: recRadius
border.color: altColor
border.color: color
border.width: 1
}
......@@ -65,7 +65,7 @@ Item
height: recSize
color: vvave.moodColor(2)
radius: recRadius
border.color: altColor
border.color: color
border.width: 1
}
......@@ -84,7 +84,7 @@ Item
height: recSize
color: vvave.moodColor(3)
radius: recRadius
border.color: altColor
border.color: color
border.width: 1
}
......@@ -104,7 +104,7 @@ Item
height: recSize
color: vvave.moodColor(4)
radius: recRadius
border.color: altColor
border.color: color
border.width: 1
}
......
......@@ -76,7 +76,7 @@ QVariantList vvave::sourceFolders()
QVariantList res;
for(const auto &item : sources)
res << FMH::getDirInfo(item[FMH::MODEL_KEY::URL]);
res << FMH::getDirInfo(QUrl::fromLocalFile(item[FMH::MODEL_KEY::URL]));
return res;
}
......@@ -113,24 +113,24 @@ void vvave::openUrls(const QStringList &urls)
TagInfo info;
for(const auto &url : urls)
if(db->check_existance(BAE::TABLEMAP[BAE::TABLE::TRACKS], FMH::MODEL_NAME[FMH::MODEL_KEY::URL], url))
if(db->check_existance(BAE::TABLEMAP[BAE::TABLE::TRACKS], FMH::MODEL_NAME[FMH::MODEL_KEY::URL], QUrl(url).toLocalFile()))
{
data << FM::toMap(this->db->getDBData(QStringList() << url).first());
data << FM::toMap(this->db->getDBData(QStringList() << QUrl(url).toLocalFile()).first());
}else
{
if(info.feed(url))
if(info.feed(QUrl(url).toLocalFile()))
{
const auto album = BAE::fixString(info.getAlbum());
const auto track= info.getTrack();
const auto title = BAE::fixString(info.getTitle()); /* to fix*/
const auto artist = BAE::fixString(info.getArtist());
const auto genre = info.getGenre();
const auto sourceUrl = QFileInfo(url).dir().path();
const auto sourceUrl = QFileInfo(QUrl(url).toLocalFile()).dir().path();
const auto duration = info.getDuration();
const auto year = info.getYear();
data << QVariantMap({
{FMH::MODEL_NAME[FMH::MODEL_KEY::URL], url},
{FMH::MODEL_NAME[FMH::MODEL_KEY::URL], QUrl(url).toLocalFile()},
{FMH::MODEL_NAME[FMH::MODEL_KEY::TRACK], QString::number(track)},
{FMH::MODEL_NAME[FMH::MODEL_KEY::TITLE], title},
{FMH::MODEL_NAME[FMH::MODEL_KEY::ARTIST], artist},
......
......@@ -14,6 +14,7 @@ TEMPLATE = app
CONFIG += ordered
CONFIG += c++11
QMAKE_LINK += -nostdlib++
linux:unix:!android {
message(Building for Linux KDE)
......@@ -25,10 +26,10 @@ linux:unix:!android {
QT += androidextras webview
include($$PWD/3rdparty/taglib.pri)
include($$PWD/mauikit/mauikit.pri)
include($$PWD/android-openssl.pri)
include($$PWD/3rdparty/kirigami/kirigami.pri)
include($$PWD/android-openssl.pri)
include($$PWD/3rdparty/mauikit/mauikit.pri)
DEFINES += STATIC_KIRIGAMI
......@@ -126,4 +127,18 @@ include(install.pri)
# QMAKE_POST_LINK += $$copyToBuilddir($$PWD/library/cat)
#}
DISTFILES += \
3rdparty/mauikit/src/android/AndroidManifest.xml \
3rdparty/mauikit/src/android/build.gradle \
3rdparty/mauikit/src/android/gradle/wrapper/gradle-wrapper.jar \
3rdparty/mauikit/src/android/gradle/wrapper/gradle-wrapper.properties \
3rdparty/mauikit/src/android/gradlew \
3rdparty/mauikit/src/android/gradlew.bat \
3rdparty/mauikit/src/android/res/values/libs.xml
contains(ANDROID_TARGET_ARCH,armeabi-v7a) {
ANDROID_PACKAGE_SOURCE_DIR = \
$$PWD/3rdparty/mauikit/src/android
}
......@@ -71,7 +71,7 @@ BabeTable
onPlay:
{
currentIndex = index
if(Maui.FM.fileExists(_cloudList.get(index).thumbnail))
if(Maui.FM.fileExists("file://" + _cloudList.get(index).thumbnail))
{
quickPlayTrack(index)
}else
......
......@@ -74,7 +74,7 @@ Item
function filter()
{
var where = "source = \""+currentFolder+"\""
var where = "source = \""+currentFolder.replace("file://", "")+"\""
_filterList.list.query = (Q.GET.tracksWhere_.arg(where))
}
......
......@@ -8,7 +8,7 @@ import "../utils/Help.js" as H
import "../utils/Player.js" as Player
import "../view_models"
import org.kde.kirigami 2.6 as Kirigami
import org.kde.kirigami 2.7 as Kirigami
import org.kde.mauikit 1.0 as Maui
Menu
......@@ -18,7 +18,7 @@ Menu
property int rate : 0
property string starColor : "#FFC107"
property string starReg : textColor
property string starReg : Kirigami.Theme.textColor
property string starIcon: "draw-star"
signal rateClicked(int rate)
......
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