diff --git a/3rdparty/qtsingleapplication/qtlocalpeer.cpp b/3rdparty/qtsingleapplication/qtlocalpeer.cpp index b3ddc73cd..360cd086f 100644 --- a/3rdparty/qtsingleapplication/qtlocalpeer.cpp +++ b/3rdparty/qtsingleapplication/qtlocalpeer.cpp @@ -108,7 +108,6 @@ bool QtLocalPeer::isClient() if (lockFile.isLocked()) return false; - //if (!lockFile.lock(QtLP_Private::QtLockedFile::WriteLock, false)) if (!lockFile.lock(QtLockedFile::WriteLock, false)) return true; diff --git a/3rdparty/qtsingleapplication/qtlockedfile_win.cpp b/3rdparty/qtsingleapplication/qtlockedfile_win.cpp index 5f5bda50f..e1a4e0c93 100644 --- a/3rdparty/qtsingleapplication/qtlockedfile_win.cpp +++ b/3rdparty/qtsingleapplication/qtlockedfile_win.cpp @@ -49,8 +49,7 @@ Qt::HANDLE QtLockedFile::getMutexHandle(int idx, bool doCreate) { if (mutexname.isEmpty()) { QFileInfo fi(*this); - mutexname = QString::fromLatin1(MUTEX_PREFIX) - + fi.absoluteFilePath().toLower(); + mutexname = QString::fromLatin1(MUTEX_PREFIX) + fi.absoluteFilePath().toLower(); } QString mname(mutexname); if (idx >= 0) @@ -151,8 +150,7 @@ bool QtLockedFile::lock(LockMode mode, bool block) rmutexes.append(mutex); } if (rmutexes.size()) { - DWORD res = WaitForMultipleObjects(rmutexes.size(), rmutexes.constData(), - TRUE, block ? INFINITE : 0); + DWORD res = WaitForMultipleObjects(rmutexes.size(), rmutexes.constData(), TRUE, block ? INFINITE : 0); if (res != WAIT_OBJECT_0 && res != WAIT_ABANDONED) { if (res != WAIT_TIMEOUT) qErrnoWarning("QtLockedFile::lock(): WaitForMultipleObjects failed"); diff --git a/README b/README index 5d786cc76..2fc49224a 100644 --- a/README +++ b/README @@ -2,23 +2,23 @@ Strawberry Music Player ======================= README -Strawberry is a modern audio player and music collection organiser. It was forked from Clementine in 2013, and has a diffrent goal. -It's written in C++ and Qt5 and runs on Linux. The name is inspired by the band Strawbs. -The main goal was to create a player for playing local music files that looked a bit more like Amarok 1.4 amd with advanced soundcard options. -You will find that Strawberry is lacking internet services and some other features found in Clementine. +Strawberry is a audio player and music collection organiser. It was forked from Clementine in 2013 with a diffrent goal. +It's written in C++ and Qt 5 and runs on Linux. The name is inspired by the band Strawbs. -Some differences between Strawberry and Clementine are: +Features: -- Status widget similar to context in Amarok 1.4 -- Settings have been reorganized -- Advanced backend settings with support for several backends and advanced options -- No Smart playlists, visualizations or cd ripping support -- No LastFM, podcast or internet features except for fetching album covers - -There are no plans to add internet streaming features, but if we would add something it has to be a service providing high quality audio and not low audio quality like Spotify. + * Play and organize music + * Edit tags on music files + * Album cover art from Lastfm, Musicbrainz, Discogs and Amazon + * Native desktop notifications + * Playlists in multiple formats + * Transfer music to iPod, iPhone, MTP or mass-storage USB player + * Support for multiple backends You can obtain and view the sourcecode on github at: https://github.com/jonaski/strawberry +It has so far been tested on Linux and cross compiled for Windows. I have not had a chance to test it on Mac OS X since I don't have a mac. + Requirements ------------ @@ -27,7 +27,7 @@ To build Strawberry from source you need the following installed on your system: * glib2, glib2-devel, git, cmake, make, gcc and gcc-c++ * protobuf and development packages -* boost development package +* boost development headers * The following Qt5 components are required with additional development packages: diff --git a/dist/strawberry.spec.in b/dist/strawberry.spec.in index 9da574d53..7439f19ad 100644 --- a/dist/strawberry.spec.in +++ b/dist/strawberry.spec.in @@ -80,7 +80,7 @@ Requires: gstreamer1.0(decoder-audio/x-wav) %endif %description -Strawberry is a modern audio player and music collection organiser. +Strawberry is a audio player and music collection organiser. It is a fork of Clementine. The name is inspired by the band Strawbs. Features: diff --git a/src/core/database.cpp b/src/core/database.cpp index 632687d42..9f02ea4bc 100644 --- a/src/core/database.cpp +++ b/src/core/database.cpp @@ -22,7 +22,6 @@ #include "database.h" #include "scopedtransaction.h" -#include "utilities.h" #include "core/application.h" #include "core/logging.h" #include "core/taskmanager.h" @@ -32,6 +31,7 @@ #include #include +#include #include #include #include @@ -225,7 +225,7 @@ Database::Database(Application *app, QObject *parent, const QString &database_na connection_id_ = sNextConnectionId++; } - directory_ = QDir::toNativeSeparators(Utilities::GetConfigPath(Utilities::Path_Root)); + directory_ = QDir::toNativeSeparators(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation)); QMutexLocker l(&mutex_); Connect(); diff --git a/src/core/main.cpp b/src/core/main.cpp index 099bb6a31..b99e8642a 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -120,8 +120,8 @@ int main(int argc, char* argv[]) { QCoreApplication::setOrganizationDomain("strawbs.org"); // This makes us show up nicely in gnome-volume-control -#if !GLIB_CHECK_VERSION(2, 36, 0) - g_type_init(); // Deprecated in glib 2.36.0 +#if !GLIB_CHECK_VERSION(2, 36, 0) // Deprecated in glib 2.36.0 + g_type_init(); #endif g_set_application_name(QCoreApplication::applicationName().toLocal8Bit()); @@ -156,7 +156,7 @@ int main(int argc, char* argv[]) { #ifdef Q_OS_DARWIN // Must happen after QCoreApplication::setOrganizationName(). - setenv("XDG_CONFIG_HOME", Utilities::GetConfigPath(Utilities::Path_Root).toLocal8Bit().constData(), 1); + setenv("XDG_CONFIG_HOME", QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation).toLocal8Bit().constData(), 1); #endif // Output the version, so when people attach log output to bug reports they don't have to tell us which version they're using. diff --git a/src/core/network.cpp b/src/core/network.cpp index 1a1a76ac7..326055c5f 100644 --- a/src/core/network.cpp +++ b/src/core/network.cpp @@ -23,13 +23,14 @@ #include "network.h" #include +#include #include #include #include #include #include "core/closure.h" -#include "utilities.h" +#include "core/logging.h" QMutex ThreadSafeNetworkDiskCache::sMutex; QNetworkDiskCache *ThreadSafeNetworkDiskCache::sCache = nullptr; @@ -39,7 +40,11 @@ ThreadSafeNetworkDiskCache::ThreadSafeNetworkDiskCache(QObject *parent) QMutexLocker l(&sMutex); if (!sCache) { sCache = new QNetworkDiskCache; - sCache->setCacheDirectory(Utilities::GetConfigPath(Utilities::Path_NetworkCache)); +#ifdef Q_OS_WIN32 + sCache->setCacheDirectory(QStandardPaths::writableLocation(QStandardPaths::TempLocation) + "/strawberry/networkcache"); +#else + sCache->setCacheDirectory(QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/networkcache"); +#endif } } @@ -93,18 +98,15 @@ QNetworkReply *NetworkAccessManager::createRequest(Operation op, const QNetworkR QByteArray user_agent = QString("%1 %2").arg(QCoreApplication::applicationName(), QCoreApplication::applicationVersion()).toUtf8(); if (request.hasRawHeader("User-Agent")) { - // Append the existing user-agent set by a client collection (such as - // libmygpo-qt). + // Append the existing user-agent set by a client collection (such as libmygpo-qt). user_agent += " " + request.rawHeader("User-Agent"); } QNetworkRequest new_request(request); new_request.setRawHeader("User-Agent", user_agent); - if (op == QNetworkAccessManager::PostOperation && - !new_request.header(QNetworkRequest::ContentTypeHeader).isValid()) { - new_request.setHeader(QNetworkRequest::ContentTypeHeader, - "application/x-www-form-urlencoded"); + if (op == QNetworkAccessManager::PostOperation && !new_request.header(QNetworkRequest::ContentTypeHeader).isValid()) { + new_request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded"); } // Prefer the cache unless the caller has changed the setting already diff --git a/src/core/utilities.cpp b/src/core/utilities.cpp index 62ab82990..2b88f5a78 100644 --- a/src/core/utilities.cpp +++ b/src/core/utilities.cpp @@ -87,8 +87,7 @@ QString PrettyTimeDelta(int seconds) { QString PrettyTime(int seconds) { - // last.fm sometimes gets the track length wrong, so you end up with - // negative times. + // last.fm sometimes gets the track length wrong, so you end up with negative times. seconds = qAbs(seconds); int hours = seconds / (60 * 60); @@ -181,9 +180,7 @@ quint64 FileSystemCapacity(const QString &path) { return quint64(fs_info.f_blocks) * quint64(fs_info.f_bsize); #elif defined(Q_OS_WIN32) _ULARGE_INTEGER ret; - if (GetDiskFreeSpaceEx( - QDir::toNativeSeparators(path).toLocal8Bit().constData(), nullptr, - &ret, nullptr) != 0) + if (GetDiskFreeSpaceEx(QDir::toNativeSeparators(path).toLocal8Bit().constData(), nullptr,&ret, nullptr) != 0) return ret.QuadPart; #endif @@ -199,9 +196,7 @@ quint64 FileSystemFreeSpace(const QString &path) { return quint64(fs_info.f_bavail) * quint64(fs_info.f_bsize); #elif defined(Q_OS_WIN32) _ULARGE_INTEGER ret; - if (GetDiskFreeSpaceEx( - QDir::toNativeSeparators(path).toLocal8Bit().constData(), &ret, - nullptr, nullptr) != 0) + if (GetDiskFreeSpaceEx(QDir::toNativeSeparators(path).toLocal8Bit().constData(), &ret, nullptr, nullptr) != 0) return ret.QuadPart; #endif @@ -346,66 +341,6 @@ QString ColorToRgba(const QColor &c) { } -QString GetConfigPath(ConfigPath config) { - - switch (config) { - - case Path_Root: { - if (Application::kIsPortable) { - return QString("%1/data").arg(QCoreApplication::applicationDirPath()); - } -#ifdef Q_OS_DARWIN - return mac::GetApplicationSupportPath() + "/strawberry"; -#else - return QString("%1/.config/strawberry").arg(QDir::homePath()); -#endif - } - break; - - case Path_CacheRoot: { - if (Application::kIsPortable) { - return GetConfigPath(Path_Root) + "/cache"; - } -#if defined(Q_OS_UNIX) && !defined(Q_OS_DARWIN) - char *xdg = getenv("XDG_CACHE_HOME"); - if (!xdg || !*xdg) { - return QString("%1/.cache/strawberry").arg(QDir::homePath()); - } - else { - return QString("%1/strawberry").arg(xdg); - } -#else - return GetConfigPath(Path_Root); -#endif - } - break; - - case Path_Icons: - return GetConfigPath(Path_Root) + "/customiconset"; - - case Path_AlbumCovers: - return GetConfigPath(Path_Root) + "/albumcovers"; - - case Path_NetworkCache: - return GetConfigPath(Path_CacheRoot) + "/networkcache"; - - case Path_GstreamerRegistry: - return GetConfigPath(Path_Root) + QString("/gst-registry-%1-bin").arg(QCoreApplication::applicationVersion()); - - case Path_DefaultMusicCollection: -#ifdef Q_OS_DARWIN - return mac::GetMusicDirectory(); -#else - return QDir::homePath(); -#endif - - default: - qFatal("%s", Q_FUNC_INFO); - return QString::null; - } - -} - #ifdef Q_OS_DARWIN qint32 GetMacVersion() { @@ -801,8 +736,7 @@ void SetEnv(const char *key, const QString &value) { void IncreaseFDLimit() { #ifdef Q_OS_DARWIN - // Bump the soft limit for the number of file descriptors from the default of 256 to - // the maximum (usually 10240). + // Bump the soft limit for the number of file descriptors from the default of 256 to the maximum (usually 10240). struct rlimit limit; getrlimit(RLIMIT_NOFILE, &limit); diff --git a/src/core/utilities.h b/src/core/utilities.h index 90b4ca828..54737c5e6 100644 --- a/src/core/utilities.h +++ b/src/core/utilities.h @@ -126,19 +126,6 @@ void SetEnv(const char *key, const QString &value); void IncreaseFDLimit(); void CheckPortable(); -enum ConfigPath { - Path_Root, - Path_Icons, - Path_AlbumCovers, - Path_NetworkCache, - Path_GstreamerRegistry, - Path_DefaultMusicCollection, - Path_LocalSpotifyBlob, - Path_MoodbarCache, - Path_CacheRoot, -}; -QString GetConfigPath(ConfigPath config); - // Returns the minor version of OS X (ie. 6 for Snow Leopard, 7 for Lion). qint32 GetMacVersion(); diff --git a/src/covermanager/albumcoverchoicecontroller.cpp b/src/covermanager/albumcoverchoicecontroller.cpp index 9825ccf64..9909562dd 100644 --- a/src/covermanager/albumcoverchoicecontroller.cpp +++ b/src/covermanager/albumcoverchoicecontroller.cpp @@ -97,7 +97,7 @@ QList AlbumCoverChoiceController::GetAllActions() { } QString AlbumCoverChoiceController::LoadCoverFromFile(Song *song) { - + QString cover = QFileDialog::getOpenFileName(this, tr("Load cover from disk"), GetInitialPathForFileDialog(*song, QString()), tr(kLoadImageFileFilter) + ";;" + tr(kAllFilesFilter)); if (cover.isNull()) return QString(); @@ -211,8 +211,7 @@ void AlbumCoverChoiceController::ShowCover(const Song &song) { // add (WxHpx) to the title before possibly resizing title_text += " (" + QString::number(label->pixmap()->width()) + "x" + QString::number(label->pixmap()->height()) + "px)"; - // if the cover is larger than the screen, resize the window - // 85% seems to be enough to account for title bar and taskbar etc. + // if the cover is larger than the screen, resize the window 85% seems to be enough to account for title bar and taskbar etc. QDesktopWidget desktop; int current_screen = desktop.screenNumber(this); int desktop_height = desktop.screenGeometry(current_screen).height(); @@ -222,15 +221,13 @@ void AlbumCoverChoiceController::ShowCover(const Song &song) { if (desktop_width < desktop_height) { const int new_width = (double)desktop_width * 0.95; if (new_width < label->pixmap()->width()) { - label->setPixmap( - label->pixmap()->scaledToWidth(new_width, Qt::SmoothTransformation)); + label->setPixmap(label->pixmap()->scaledToWidth(new_width, Qt::SmoothTransformation)); } } else { const int new_height = (double)desktop_height * 0.85; if (new_height < label->pixmap()->height()) { - label->setPixmap(label->pixmap()->scaledToHeight( - new_height, Qt::SmoothTransformation)); + label->setPixmap(label->pixmap()->scaledToHeight(new_height, Qt::SmoothTransformation)); } } diff --git a/src/covermanager/albumcoverloader.cpp b/src/covermanager/albumcoverloader.cpp index 65bf97eb2..a83a660e8 100644 --- a/src/covermanager/albumcoverloader.cpp +++ b/src/covermanager/albumcoverloader.cpp @@ -22,18 +22,22 @@ #include "albumcoverloader.h" -#include -#include #include +#include +#include +#include #include #include +#include +#include +#include +#include #include "config.h" #include "core/closure.h" #include "core/logging.h" #include "core/network.h" #include "core/tagreaderclient.h" -#include "core/utilities.h" AlbumCoverLoader::AlbumCoverLoader(QObject *parent) : QObject(parent), @@ -42,7 +46,7 @@ AlbumCoverLoader::AlbumCoverLoader(QObject *parent) network_(new NetworkAccessManager(this)){} QString AlbumCoverLoader::ImageCacheDir() { - return Utilities::GetConfigPath(Utilities::Path_AlbumCovers); + return QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + "/albumcovers"; } void AlbumCoverLoader::CancelTask(quint64 id) { @@ -128,7 +132,7 @@ void AlbumCoverLoader::ProcessTask(Task *task) { } void AlbumCoverLoader::NextState(Task *task) { - + if (task->state == State_TryingManual) { // Try the automatic one next task->state = State_TryingAuto; @@ -139,6 +143,7 @@ void AlbumCoverLoader::NextState(Task *task) { emit ImageLoaded(task->id, task->options.default_output_image_); emit ImageLoaded(task->id, task->options.default_output_image_, task->options.default_output_image_); } + } AlbumCoverLoader::TryLoadResult AlbumCoverLoader::TryLoadImage(const Task &task) { @@ -179,7 +184,7 @@ AlbumCoverLoader::TryLoadResult AlbumCoverLoader::TryLoadImage(const Task &task) QImage image(filename); return TryLoadResult(false, !image.isNull(), image.isNull() ? task.options.default_output_image_ : image); - + } void AlbumCoverLoader::RemoteFetchFinished(QNetworkReply *reply) { @@ -241,6 +246,7 @@ QImage AlbumCoverLoader::ScaleAndPad(const AlbumCoverLoaderOptions &options, con p.end(); return padded_image; + } QPixmap AlbumCoverLoader::TryLoadPixmap(const QString &automatic, const QString &manual, const QString &filename) { @@ -255,4 +261,5 @@ QPixmap AlbumCoverLoader::TryLoadPixmap(const QString &automatic, const QString ret.load(automatic); } return ret; + } diff --git a/src/covermanager/albumcovermanager.cpp b/src/covermanager/albumcovermanager.cpp index e521d4a02..ff0ccb30f 100644 --- a/src/covermanager/albumcovermanager.cpp +++ b/src/covermanager/albumcovermanager.cpp @@ -772,6 +772,7 @@ void AlbumCoverManager::SaveAndSetCover(QListWidgetItem *item, const QImage &ima quint64 id = app_->album_cover_loader()->LoadImageAsync(cover_loader_options_, QString(), path); item->setData(Role_PathManual, path); cover_loading_tasks_[id] = item; + } void AlbumCoverManager::ExportCovers() { diff --git a/src/dialogs/about.cpp b/src/dialogs/about.cpp index 2829a3471..8613434f4 100644 --- a/src/dialogs/about.cpp +++ b/src/dialogs/about.cpp @@ -64,8 +64,6 @@ About::About(QWidget *parent):QDialog(parent) { title_font.setPointSize(title_font.pointSize() + 4); ui_.title->setFont(title_font); - - ui_.text->setWordWrap(true); ui_.text->setText(MakeHtml()); @@ -76,17 +74,18 @@ About::About(QWidget *parent):QDialog(parent) { QString About::MakeHtml() const { QString ret = ""; - - ret = tr("

Version %1

").arg(QCoreApplication::applicationVersion()); - + + ret = tr("

Version %1

").arg(QCoreApplication::applicationVersion()); + ret += tr("

"); - ret += tr("Strawberry is a fork of Clementine created in 2013, it's written in C++ and Qt5. So far it works on Linux, it is currently untested on Mac OS X and Windows.
"); - ret += tr("The main goal was to create a player for playing local music files that looked a bit more like Amarok 1.4."); + + ret += tr("Strawberry is a audio player and music collection organiser.
"); + ret += tr("It is a fork of Clementine. The name is inspired by the band Strawbs."); ret += tr("

"); //ret += tr("

%2

%3:").arg(kUrl, kUrl, tr("Authors")); - ret += QString("

%1").arg(tr("Authors")); + ret += QString("

%1").arg(tr("Strawberry Authors")); for (const Person &person : authors_) { ret += "
" + MakeHtml(person); diff --git a/src/engine/gstengine.cpp b/src/engine/gstengine.cpp index 31a382d50..266ba9280 100644 --- a/src/engine/gstengine.cpp +++ b/src/engine/gstengine.cpp @@ -33,14 +33,15 @@ #include #include -#include -#include -#include -#include #include -#include -#include +#include #include +#include +#include +#include +#include +#include +#include #include "enginetype.h" #include "enginebase.h" @@ -169,7 +170,7 @@ void GstEngine::SetEnvironment() { #endif #if defined(Q_OS_WIN32) || defined(Q_OS_DARWIN) - registry_filename = Utilities::GetConfigPath(Utilities::Path_GstreamerRegistry); + registry_filename = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + QString("/gst-registry-%1-bin").arg(QCoreApplication::applicationVersion()); #endif if (!scanner_path.isEmpty()) Utilities::SetEnv("GST_PLUGIN_SCANNER", scanner_path); @@ -750,7 +751,7 @@ void GstEngine::NewMetaData(int pipeline_id, const Engine::SimpleMetaBundle &bun emit MetaData(bundle); } -GstElement *GstEngine::CreateElement(const QString &factoryName, GstElement *bin) { +GstElement *GstEngine::CreateElement(const QString &factoryName, GstElement *bin, bool showerror) { // Make a unique name QString name = factoryName + "-" + QString::number(next_element_id_++); @@ -758,7 +759,7 @@ GstElement *GstEngine::CreateElement(const QString &factoryName, GstElement *bin GstElement *element = gst_element_factory_make(factoryName.toUtf8().constData(), name.toUtf8().constData()); if (!element) { - emit Error(QString("GStreamer could not create the element: %1. Please make sure that you have installed all necessary GStreamer plugins").arg(factoryName)); + if (showerror) emit Error(QString("GStreamer could not create the element: %1. Please make sure that you have installed all necessary GStreamer plugins").arg(factoryName)); gst_object_unref(GST_OBJECT(bin)); return nullptr; } diff --git a/src/engine/gstengine.h b/src/engine/gstengine.h index 39417550f..d1c2e0f4c 100644 --- a/src/engine/gstengine.h +++ b/src/engine/gstengine.h @@ -85,7 +85,7 @@ class GstEngine : public Engine::Base, public BufferConsumer { static bool ALSADeviceSupport(const QString &name); - GstElement *CreateElement(const QString &factoryName, GstElement *bin = 0); + GstElement *CreateElement(const QString &factoryName, GstElement *bin = 0, bool showerror = true); // BufferConsumer void ConsumeBuffer(GstBuffer *buffer, int pipeline_id); diff --git a/src/engine/gstenginepipeline.cpp b/src/engine/gstenginepipeline.cpp index c0f1f7cd9..56170a397 100644 --- a/src/engine/gstenginepipeline.cpp +++ b/src/engine/gstenginepipeline.cpp @@ -230,7 +230,7 @@ bool GstEnginePipeline::InitAudioBin() { audio_queue = engine_->CreateElement("queue", audiobin_); equalizer_preamp_ = engine_->CreateElement("volume", audiobin_); equalizer_ = engine_->CreateElement("equalizer-nbands", audiobin_); - stereo_panorama_ = engine_->CreateElement("audiopanorama", audiobin_); + stereo_panorama_ = engine_->CreateElement("audiopanorama", audiobin_, false); volume_ = engine_->CreateElement("volume", audiobin_); audioscale_ = engine_->CreateElement("audioresample", audiobin_); convert = engine_->CreateElement("audioconvert", audiobin_); diff --git a/src/playlist/playlistbackend.h b/src/playlist/playlistbackend.h index 8b16ff994..a439c59e6 100644 --- a/src/playlist/playlistbackend.h +++ b/src/playlist/playlistbackend.h @@ -47,9 +47,6 @@ class PlaylistBackend : public QObject { QString ui_path; bool favorite; int last_played; - - // Special playlists have different behaviour, eg. the "spotify-search" - // type has a spotify search box at the top, replacing the ordinary filter. QString special_type; }; typedef QList PlaylistList; diff --git a/src/settings/backendsettingspage.cpp b/src/settings/backendsettingspage.cpp index 4bc09bc0c..c0f667791 100644 --- a/src/settings/backendsettingspage.cpp +++ b/src/settings/backendsettingspage.cpp @@ -84,7 +84,7 @@ void BackendSettingsPage::Load() { configloaded_ = false; engineloaded_ = Engine::None; - Engine::EngineType enginetype = Engine::EngineTypeFromName(s_.value("engine", EngineText_Xine).toString()); + Engine::EngineType enginetype = Engine::EngineTypeFromName(s_.value("engine", EngineText_GStreamer).toString()); ui_->combobox_engine->clear(); #ifdef HAVE_XINE @@ -116,7 +116,7 @@ void BackendSettingsPage::Load() { ui_->checkbox_replaygaincompression->setChecked(s_.value("rgcompression", true).toBool()); //if (dialog()->app()->player()->engine()->state() != Engine::Empty) ui_->combobox_engine->setEnabled(false); - + #ifdef Q_OS_WIN32 ui_->combobox_engine->setEnabled(false); #endif diff --git a/src/settings/collectionsettingspage.cpp b/src/settings/collectionsettingspage.cpp index 188ee78b6..5e1549c7c 100644 --- a/src/settings/collectionsettingspage.cpp +++ b/src/settings/collectionsettingspage.cpp @@ -22,16 +22,15 @@ #include #include -#include #include #include +#include #include "collectionsettingspage.h" #include "ui_collectionsettingspage.h" #include "settings/settingsdialog.h" #include "core/application.h" -#include "core/utilities.h" #include "core/iconloader.h" #include "playlist/playlistdelegates.h" @@ -65,7 +64,7 @@ void CollectionSettingsPage::Add() { QSettings settings; settings.beginGroup(kSettingsGroup); - QString path(settings.value("last_path", Utilities::GetConfigPath(Utilities::Path_DefaultMusicCollection)).toString()); + QString path(settings.value("last_path", QStandardPaths::writableLocation(QStandardPaths::MusicLocation)).toString()); path = QFileDialog::getExistingDirectory(this, tr("Add directory..."), path); if (!path.isNull()) { diff --git a/src/widgets/playingwidget.cpp b/src/widgets/playingwidget.cpp index c6932a226..636ca68e2 100644 --- a/src/widgets/playingwidget.cpp +++ b/src/widgets/playingwidget.cpp @@ -77,16 +77,12 @@ PlayingWidget::PlayingWidget(QWidget *parent) details_(new QTextDocument(this)), previous_track_opacity_(0.0), downloading_covers_(false) { - - enabled_ = false; - visible_ = false; - active_ = false; // Load settings QSettings s; s.beginGroup(kSettingsGroup); mode_ = Mode(s.value("mode", LargeSongDetails).toInt()); - album_cover_choice_controller_->search_cover_auto_action()->setChecked(s.value("search_for_cover_auto", false).toBool()); + album_cover_choice_controller_->search_cover_auto_action()->setChecked(s.value("search_for_cover_auto", true).toBool()); fit_width_ = s.value("fit_cover_width", false).toBool(); // Accept drops for setting album art @@ -141,7 +137,7 @@ PlayingWidget::PlayingWidget(QWidget *parent) "}"); details_->setHtml(QString("



")); } - + UpdateHeight(); connect(album_cover_choice_controller_, SIGNAL(AutomaticCoverSearchDone()), this, SLOT(AutomaticCoverSearchDone())); @@ -161,21 +157,21 @@ void PlayingWidget::SetApplication(Application *app) { } void PlayingWidget::CreateModeAction(Mode mode, const QString &text, QActionGroup *group, QSignalMapper* mapper) { - + QAction* action = new QAction(text, group); action->setCheckable(true); mapper->setMapping(action, mode); connect(action, SIGNAL(triggered()), mapper, SLOT(map())); if (mode == mode_) action->setChecked(true); - + } void PlayingWidget::set_ideal_height(int height) { - + small_ideal_height_ = height; UpdateHeight(); - + } QSize PlayingWidget::sizeHint() const { @@ -473,7 +469,6 @@ void PlayingWidget::SearchCoverAutomatically() { s.beginGroup(kSettingsGroup); s.setValue("search_for_cover_auto", album_cover_choice_controller_->search_cover_auto_action()->isChecked()); - // Search for cover automatically? GetCoverAutomatically(); } diff --git a/src/widgets/statusview.cpp b/src/widgets/statusview.cpp index dc636005c..0fc7928ca 100644 --- a/src/widgets/statusview.cpp +++ b/src/widgets/statusview.cpp @@ -106,6 +106,12 @@ StatusView::StatusView(CollectionViewContainer *collectionviewcontainer, QWidget NoSong(); AddActions(); + // Load settings + QSettings s; + s.beginGroup(kSettingsGroup); + album_cover_choice_controller_->search_cover_auto_action()->setChecked(s.value("search_for_cover_auto", true).toBool()); + s.endGroup(); + } StatusView::~StatusView() { @@ -620,7 +626,6 @@ void StatusView::SearchCoverAutomatically() { s.beginGroup(kSettingsGroup); s.setValue("search_for_cover_auto", album_cover_choice_controller_->search_cover_auto_action()->isChecked()); - // Search for cover automatically? GetCoverAutomatically(); }