Skip to content

Commit

Permalink
0.1.4 release
Browse files Browse the repository at this point in the history
  • Loading branch information
jsmolka committed May 27, 2018
1 parent a6e83ed commit 225fe72
Show file tree
Hide file tree
Showing 13 changed files with 66 additions and 66 deletions.
2 changes: 1 addition & 1 deletion egg-player.pri
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
RC_ICONS = resource/images/egg/egg.ico

VERSION = 0.1.3.14
VERSION = 0.1.4.0

QMAKE_TARGET = Egg Player
QMAKE_TARGET_PRODUCT = Egg Player
Expand Down
1 change: 1 addition & 0 deletions src/core/cache.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class Cache
bool insertCover(Audio *audio, int size = 200);

bool contains(Audio *audio);

QPixmap cover(Audio *audio, int size = 200);

private:
Expand Down
66 changes: 33 additions & 33 deletions src/core/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ void Config::App::setFontSize(double size)
*/
double Config::App::fontSize()
{
return app()["fontSize"].toDouble();
return app().value("fontSize").toDouble();
}

/*
Expand All @@ -37,7 +37,7 @@ void Config::App::setLog(bool log)
*/
bool Config::App::log()
{
return app()["log"].toBool();
return app().value("log").toBool();
}

/*
Expand All @@ -57,7 +57,7 @@ void Config::Bar::setGrooveHeight(int height)
*/
int Config::Bar::grooveHeight()
{
return makeEven(scale(bar()["grooveHeight"].toInt()));
return makeEven(scale(bar().value("grooveHeight").toInt()));
}

/*
Expand All @@ -77,7 +77,7 @@ void Config::Bar::setHandleSize(int size)
*/
int Config::Bar::handleSize()
{
return makeEven(scale(bar()["handleSize"].toInt()));
return makeEven(scale(bar().value("handleSize").toInt()));
}

/*
Expand All @@ -97,7 +97,7 @@ void Config::Bar::setHeight(int height)
*/
int Config::Bar::height()
{
return makeEven(scale(bar()["height"].toInt()));
return makeEven(scale(bar().value("height").toInt()));
}

/*
Expand All @@ -117,7 +117,7 @@ void Config::Bar::setIconSize(int size)
*/
int Config::Bar::iconSize()
{
return makeEven(scale(bar()["iconSize"].toInt()));
return makeEven(scale(bar().value("iconSize").toInt()));
}

/*
Expand All @@ -137,7 +137,7 @@ void Config::Bar::setMargin(int margin)
*/
int Config::Bar::margin()
{
return scale(bar()["margin"].toInt());
return scale(bar().value("margin").toInt());
}

/*
Expand All @@ -157,7 +157,7 @@ void Config::Bar::setSpacing(int spacing)
*/
int Config::Bar::spacing()
{
return scale(bar()["spacing"].toInt());
return scale(bar().value("spacing").toInt());
}

/*
Expand Down Expand Up @@ -187,7 +187,7 @@ void Config::Bar::setTimeWidth(int width)
*/
int Config::Bar::timeWidth()
{
return scale(bar()["timeWidth"].toInt());
return scale(bar().value("timeWidth").toInt());
}

/*
Expand All @@ -207,7 +207,7 @@ void Config::Bar::setTrackWidth(int width)
*/
int Config::Bar::trackWidth()
{
return scale(bar()["trackWidth"].toInt());
return scale(bar().value("trackWidth").toInt());
}

/*
Expand All @@ -227,7 +227,7 @@ void Config::Library::setCellPadding(int padding)
*/
int Config::Library::cellPadding()
{
return scale(library()["cellPadding"].toInt());
return scale(library().value("cellPadding").toInt());
}

/*
Expand All @@ -247,7 +247,7 @@ void Config::Library::setItemHeight(int height)
*/
int Config::Library::itemHeight()
{
return scale(library()["itemHeight"].toInt());
return scale(library().value("itemHeight").toInt());
}

/*
Expand All @@ -272,7 +272,7 @@ void Config::Library::setPaths(const StringList &paths)
StringList Config::Library::paths()
{
StringList list;
for (const QJsonValue &element : library()["paths"].toArray())
for (const QJsonValue &element : library().value("paths").toArray())
list << element.toString();

return list;
Expand All @@ -295,7 +295,7 @@ void Config::Library::setScrollBarWidth(int width)
*/
int Config::Library::scrollBarWidth()
{
return scale(library()["scrollBarWidth"].toInt());
return scale(library().value("scrollBarWidth").toInt());
}

/*
Expand All @@ -315,7 +315,7 @@ void Config::Player::setLoop(bool loop)
*/
bool Config::Player::loop()
{
return player()["loop"].toBool();
return player().value("loop").toBool();
}

/*
Expand All @@ -335,7 +335,7 @@ void Config::Player::setShuffle(bool shuffle)
*/
bool Config::Player::shuffle()
{
return player()["shuffle"].toBool();
return player().value("shuffle").toBool();
}

/*
Expand All @@ -355,7 +355,7 @@ void Config::Player::setVolume(int volume)
*/
int Config::Player::volume()
{
return player()["volume"].toInt();
return player().value("volume").toInt();
}

/*
Expand All @@ -375,7 +375,7 @@ void Config::Shortcut::setNext(const QString &shortcut)
*/
QString Config::Shortcut::next()
{
return shortcut()["next"].toString();
return shortcut().value("next").toString();
}

/*
Expand All @@ -395,7 +395,7 @@ void Config::Shortcut::setPlayPause(const QString &shortcut)
*/
QString Config::Shortcut::playPause()
{
return shortcut()["playPause"].toString();
return shortcut().value("playPause").toString();
}

/*
Expand All @@ -415,7 +415,7 @@ void Config::Shortcut::setPrevious(const QString &shortcut)
*/
QString Config::Shortcut::previous()
{
return shortcut()["previous"].toString();
return shortcut().value("previous").toString();
}

/*
Expand All @@ -435,7 +435,7 @@ void Config::Shortcut::setVolumeDown(const QString &shortcut)
*/
QString Config::Shortcut::volumeDown()
{
return shortcut()["volumeDown"].toString();
return shortcut().value("volumeDown").toString();
}

/*
Expand All @@ -455,7 +455,7 @@ void Config::Shortcut::setVolumeUp(const QString &shortcut)
*/
QString Config::Shortcut::volumeUp()
{
return shortcut()["volumeUp"].toString();
return shortcut().value("volumeUp").toString();
}

/*
Expand All @@ -464,11 +464,11 @@ QString Config::Shortcut::volumeUp()
void Config::saveObjects()
{
QJsonObject object = _json.object();
object["app"] = _app;
object["bar"] = _bar;
object["library"] = _library;
object["player"] = _player;
object["shortcut"] = _shortcut;
object.insert("app", _app);
object.insert("bar", _bar);
object.insert("library", _library);
object.insert("player", _player);
object.insert("shortcut", _shortcut);
_json.setObject(object);
}

Expand All @@ -478,11 +478,11 @@ void Config::saveObjects()
void Config::loadObjects()
{
QJsonObject object = _json.object();
_app = object["app"].toObject();
_bar = object["bar"].toObject();
_library = object["library"].toObject();
_player = object["player"].toObject();
_shortcut = object["shortcut"].toObject();
_app = object.value("app").toObject();
_bar = object.value("bar").toObject();
_library = object.value("library").toObject();
_player = object.value("player").toObject();
_shortcut = object.value("shortcut").toObject();
}

/*
Expand Down Expand Up @@ -590,7 +590,7 @@ QJsonObject & Config::shortcut()
*/
void Config::setValue(QJsonObject &object, const QString &key, const QJsonValue &value)
{
object[key] = value;
object.insert(key, value);
save();
}

Expand Down
16 changes: 8 additions & 8 deletions src/core/library.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ Library * Library::instance()
}

/*
* Setter for sorted property.
* Setter for sorted property. Setting this value does not sort the library. It
* is meant to be set before the load function gets called.
*
* :param sorted: sorted
*/
Expand Down Expand Up @@ -81,10 +82,9 @@ Audios Library::audios() const
}

/*
* Loads the library for multiple paths by creating audio builder threads. It
* checks if the paths have already been loaded and ignores them if they have.
* This function should not be called twice because it might create database
* problems.
* Loads the library in the background by creating an audio loader thread. If
* this function gets called mulitple times for the same paths it will have no
* effect.
*
* :param paths: paths
*/
Expand All @@ -95,7 +95,7 @@ void Library::load(const StringList &paths)
}

/*
* Inserts an audio into the library. Depeding on the sorted propery it will be
* Inserts an audio into the library. If the sorted property is true, it will be
* inserted binary.
*
* :param audio: audio
Expand All @@ -119,8 +119,8 @@ void Library::onAudioLoaderFinished()

/*
* Gets the lower bound for an audio using a binary search like approach. This
* function is used insead of std::lower_bound because it has a better
* complexity and returns an index instead.
* function is being used insead of std::lower_bound because it has a better
* complexity and returns an index instead of an iterator.
*
* :param audio: audio
*/
Expand Down
4 changes: 0 additions & 4 deletions src/core/threading/cachebuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,13 @@ void CacheBuilder::setAudios(const Audios &audios)
/*
* Loads audio covers.
*/
#include <QDebug>
void CacheBuilder::run()
{
Cache cache;
for (Audio *audio : m_audios)
{
if (isAbort())
{
qDebug() << "aborted :|";
return;
}

if (!cache.contains(audio))
cache.insertCover(audio);
Expand Down
2 changes: 1 addition & 1 deletion src/ui/components/rowhoverdelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RowHoverDelegate::RowHoverDelegate(QTableWidget *table, QObject *parent) :
pm_table(static_cast<TableWidget *>(table)),
m_row(-1)
{
connect(pm_table, SIGNAL(rowChanged(int)), this, SLOT(onRowChanged(int)));
connect(pm_table, SIGNAL(hoverRowChanged(int)), this, SLOT(onRowChanged(int)));
}

/*
Expand Down
2 changes: 1 addition & 1 deletion src/ui/components/rowhoverdelegate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class TableWidget : public QTableWidget
Q_OBJECT

signals:
void rowChanged(int);
void hoverRowChanged(int);
};

class RowHoverDelegate : public QStyledItemDelegate
Expand Down
4 changes: 3 additions & 1 deletion src/ui/musicbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,10 @@ ClickableSlider * MusicBar::volumeSlider()
/*
* Paint event for custom css.
*/
void MusicBar::paintEvent(QPaintEvent *)
void MusicBar::paintEvent(QPaintEvent *event)
{
Q_UNUSED(event);

QStyleOption option;
option.init(this);
QPainter painter(this);
Expand Down
2 changes: 1 addition & 1 deletion src/ui/musicbar.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class MusicBar : public QWidget
ClickableSlider * volumeSlider();

protected:
void paintEvent(QPaintEvent *);
void paintEvent(QPaintEvent *event);

private slots:
void onPlayerAudioChanged(Audio *audio);
Expand Down
Loading

0 comments on commit 225fe72

Please sign in to comment.