diff --git a/Sync/mysql.cpp b/Sync/mysql.cpp index 25e7dcf..ef5608e 100644 --- a/Sync/mysql.cpp +++ b/Sync/mysql.cpp @@ -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 " <qyery->lastError(); #endif + Q_UNUSED(qyery); } int MySql::save(const SongStorage &song){ diff --git a/Sync/song.cpp b/Sync/song.cpp index 53ac7e2..8e9a42e 100644 --- a/Sync/song.cpp +++ b/Sync/song.cpp @@ -2,6 +2,7 @@ #include #include #include +#include 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(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(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(song) = *this; + + song = *this; QFile f(url.toLocalFile()); diff --git a/installer/packages/SoundBand/snap/gui/QtDeployer.desktop b/installer/packages/SoundBand/snap/gui/SoundBand.desktop similarity index 87% rename from installer/packages/SoundBand/snap/gui/QtDeployer.desktop rename to installer/packages/SoundBand/snap/gui/SoundBand.desktop index b56dffa..f808841 100644 --- a/installer/packages/SoundBand/snap/gui/QtDeployer.desktop +++ b/installer/packages/SoundBand/snap/gui/SoundBand.desktop @@ -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 diff --git a/tests/tests.pro b/tests/tests.pro index cd0fc5c..2bb9002 100644 --- a/tests/tests.pro +++ b/tests/tests.pro @@ -18,3 +18,4 @@ RESOURCES += \ include($$PWD/../deploy.pri) include($$PWD/../Sync/Sync.pri) +include('$$PWD/../QuasarAppLib/QuasarLib.pri');