4
0
mirror of https://github.com/QuasarApp/SoundBand.git synced 2025-05-06 20:19:33 +00:00

added new desktop file for snap and fix tests dependeses

This commit is contained in:
Andrei Yankovich 2018-10-03 12:14:11 +03:00
parent 0953e4289f
commit cb6affd1fa
4 changed files with 16 additions and 10 deletions
Sync
installer/packages/SoundBand/snap/gui
tests

@ -160,10 +160,11 @@ bool MySql::saveToStorage(QUrl &url, const Song &song) const{
}
void MySql::sqlErrorLog(const QString &qyery)const{
void MySql::sqlErrorLog(const QString &qyery) const{
#ifdef QT_DEBUG
qDebug()<< qyery << ": fail:\n " <<this->qyery->lastError();
#endif
Q_UNUSED(qyery);
}
int MySql::save(const SongStorage &song){

@ -2,6 +2,7 @@
#include <QStringList>
#include <QRegularExpression>
#include <QFile>
#include <QFileInfo>
static const QStringList ValidSongs = {".mp3", ".wav", ".ogg"};
SongHeader::SongHeader()
@ -13,9 +14,9 @@ SongHeader::SongHeader()
}
bool SongHeader::getName(QString & name, const QUrl &url) const {
if(url.isLocalFile() && url.isValid()){
if(url.isLocalFile() && url.isValid()) {
QFileInfo info(url.fileName());
name = url.fileName();
name = name.right(name.lastIndexOf(QRegularExpression("[\\\/]")));
return true;
}
@ -29,7 +30,7 @@ bool SongHeader::getSize(int & size, const QUrl &url) const {
if(!f.exists()){
return false;
}
size = f.size();
size = static_cast<int>(f.size());
return true;
}
@ -127,7 +128,7 @@ SongStorage::SongStorage(const QUrl& from)
}
QFile f(from.toLocalFile());
this->size = f.size();
this->size = static_cast<int>(f.size());
f.close();
this->id = -1;
@ -155,12 +156,15 @@ SongStorage::~SongStorage(){
url.clear();
}
QMediaContent SongStorage::toMedia()const{
QMediaContent SongStorage::toMedia()const {
return QMediaContent(url);
}
bool SongStorage::toSong(Song& song)const{
song = (*((SongHeader*)this));
bool SongStorage::toSong(Song& song)const {
// song = (*((SongHeader*)this));
// static_cast<SongHeader>(song) = *this;
song = *this;
QFile f(url.toLocalFile());

@ -2,13 +2,13 @@
Version=1.0
Name=SoundBand
Comment=Mobile and desktop song sync audio player. working on wifi.
Exec=sound-band
Exec=soundband
Icon=/snap/soundband/current/meta/gui/icon.png
Terminal=false
Type=Application
Categories=utils;Application;
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=sound-band
X-GNOME-Bugzilla-Product=soundband
X-GNOME-Bugzilla-Component=General
X-GNOME-Bugzilla-Version=1.0
StartupNotify=true

@ -18,3 +18,4 @@ RESOURCES += \
include($$PWD/../deploy.pri)
include($$PWD/../Sync/Sync.pri)
include('$$PWD/../QuasarAppLib/QuasarLib.pri');