diff --git a/README.md b/README.md index ae30a9ed7..fb492ecb3 100644 --- a/README.md +++ b/README.md @@ -72,5 +72,5 @@ Optional: sudo make install (dont change to the source directory, if you created the build directory inside the source directory type: cmake .. instead). - + diff --git a/data/schema/device-schema.sql b/data/schema/device-schema.sql index b2c8b0590..09594d074 100644 --- a/data/schema/device-schema.sql +++ b/data/schema/device-schema.sql @@ -57,7 +57,7 @@ CREATE TABLE device_%deviceid_songs ( effective_albumartist TEXT, effective_originalyear INTEGER NOT NULL DEFAULT 0, - + cue_path TEXT ); diff --git a/dist/debian/rules b/dist/debian/rules index 92826964c..d1485db7d 100755 --- a/dist/debian/rules +++ b/dist/debian/rules @@ -35,7 +35,7 @@ install: build dh_testroot dh_prep dh_installdirs - + make install binary-indep: install diff --git a/dist/scripts/gen-icons-resource.sh b/dist/scripts/gen-icons-resource.sh index 357dd2151..07830cc55 100755 --- a/dist/scripts/gen-icons-resource.sh +++ b/dist/scripts/gen-icons-resource.sh @@ -19,7 +19,7 @@ do echo "ERROR: Cannot dermine geometry for image: \"$i\"." continue fi - + # Geometry can be 563x144+0+0 or 75x98 # we need to get rid of the plus (+) and the x characters: w=`echo $g | sed 's/[^0-9]/ /g' | awk '{print $1}'` || exit 1 @@ -32,10 +32,10 @@ do echo "ERROR: Cannot dermine height for image: \"$x\"." continue fi - + for x in $sizes do - + dest="$x/$file" if [ -f $dest ]; then continue diff --git a/dist/windows/Capabilities.nsh b/dist/windows/Capabilities.nsh index 151d36ce2..13952b217 100644 --- a/dist/windows/Capabilities.nsh +++ b/dist/windows/Capabilities.nsh @@ -9,107 +9,107 @@ _____________________________________________________________________________ These functions register an application with Windows Vista's and Windows 7's Default Programs window. - + Usage: - + !include "Capabilities.nsh" !define CAPABILITIES_NAME "[program name]" !define CAPABILITIES_DESCRIPTION "[description]" !define CAPABILITIES_PROGID "[progid]" !define CAPABILITIES_PATH "[path]" ... - + During install, call ${RegisterCapabilities}, then use the other register macros to create file type, MIME, and protocol associations. - + During uninstall, call ${UnRegisterCapabilities} - + _______________________________________________________________________________ - + More information about Default Programs and Client Types can be found here: http://msdn.microsoft.com/en-us/library/cc144154(VS.85).aspx http://msdn.microsoft.com/en-us/library/cc144109(v=VS.85).aspx - + Defines: All defines not marked [optional] are required. - + CAPABILITIES_NAME The canonical name of the program. - + CAPABILITIES_LOCAL_NAME [optional] The localized name of the program as it appears in Default Programs. This should be in the format "@FilePath,-StringID" where FilePath is the path to a .dll or .exe file and StringID is the ID of a resource contained in the file. - + CAPABILITIES_DESCRIPTION The localized description shown in Default Programs. This can be either a string or in the same format as CAPABILITIES_LOCAL_NAME - + CAPABILITIES_PROGID An identifier used in file associations. Usually, this is the name of the program. This should not have any spaces in it. - + CAPABILITIES_PATH The location where capabilities info is stored in the registry. The "Capabilities" key will automatically be added. If the application is a client of some sort, (browser, email, media player, etc.) use "Software\Clients\[ClientType]\[ProgramName]". Otherwise, use "Software\[CompanyName]\[ProgramName]" or just "Software\[ProgramName]". - + CAPABILITIES_ICON [optional] The icon shown in Default Programs. This should be in the format "FilePath,IconIndex" where FilePath is the path to a file containing the icon. If IconIndex is positive, the number is used as the index of the zero-based array of icons stored in the file. If IconIndex is negative, the absolute value is used as a resource ID. - + CAPABILITIES_REINSTALL [optional] The command executed when a user uses Set Program Access and Computer Defaults to select this application as the default for its client type. This command should launch a program that associates the application with all the file and protocol types it can handle. - + CAPABILITIES_HIDE_ICONS [optional] The command executed when a user uses Set Program Access and Computer Defaults to disable access to this application. This command should launch a program that hides all shortcuts and access points to this application. It should also prevent the application from being run automatically and update the IconsVisible registry value to 0. - + CAPABILITIES_SHOW_ICONS [optional] The command executed when a user uses Set Program Access and Computer Defaults to enable access to this application. This command should launch a program that restores shortcuts and access points to the application, allows the program to run, and updates the IconsVisible registry value to 1. - - + + Macros: - + ${RegisterCapabilities} Registers the program with Default Programs. Call this once on install before using any other functions. - + ${UnRegisterCapabilities} Un-registers the program and all its associations. Call this once on uninstall to clean up all installed registry values. - + ${RegisterFileType} "[extension]" "[executable]" "[icon]" "[description]" Registers a file type with the program extension: The file extension to register (ex: .txt) executable: The executable that opens the file type icon: The icon shown for the file type description: Description for the file type shown in Explorer - + ${RegisterMediaType} "[extension]" "[executable]" "[icon]" "[description]" Registers a media file type with the program (has a "Play" command) (arguments are same as RegisterFileType) - + ${RegisterMimeType} "[mime type]" "[shortname]" "[clsid]" Registers a mime type with the program mime type: The MIME type to register (ex: audio/mp3) shortname: A short identifier for the type (ex: mp3) clsid: The CLSID of the program to handle files of this type - + ${RegisterProtocol} "[protocol]" "[executable]" "[icon]" "[description]" Registers a URL protocol with the program protocol: The protocol to register (ex: http) @@ -118,15 +118,15 @@ ${RegisterProtocol} "[protocol]" "[executable]" "[icon]" "[description]" ${UnRegisterFileType} "[extension]" Un-registers a previously registered file type extension: The file extension to un-register - + ${UnRegisterMimeType} "[mime type]" Un-registers a previously registered MEME type mime type: The MIME type to un-register - + ${UnRegisterProtocol} "[protocol]" Un-registers a previously registered URL protocol protocol: The URL protocol to un-register - + */ @@ -254,7 +254,7 @@ ${StrCase} !verbose push !verbose ${_Capabilities_VERBOSE} Push $0 - + !ifndef CAPABILITIES_PATH !error "CAPABILITIES_PATH not defined" !endif @@ -267,21 +267,21 @@ ${StrCase} !ifndef CAPABILITIES_DESCRIPTION !error "CAPABILITIES_DESCRIPTION not defined" !endif - + StrCpy $0 "${CAPABILITIES_PATH}\Capabilities" ; add the application to RegisteredApplications WriteRegStr HKLM "Software\RegisteredApplications" "${CAPABILITIES_NAME}" "$0" - + ; write application info WriteRegStr HKLM "${CAPABILITIES_PATH}" "" "${CAPABILITIES_NAME}" - + !ifdef CAPABILITIES_LOCAL_NAME WriteRegStr HKLM "${CAPABILITIES_PATH}" "LocalizedString" "${CAPABILITIES_LOCAL_NAME}" !endif !ifdef CAPABILITIES_ICON WriteRegStr HKLM "${CAPABILITIES_PATH}\DefaultIcon" "" "${CAPABILITIES_ICON}" !endif - + ; write installinfo if defined !ifdef CAPABILITIES_REINSTALL WriteRegStr HKLM "${CAPABILITIES_PATH}\InstallInfo" "ReinstallCommand" "${CAPABILITIES_REINSTALL}" @@ -294,7 +294,7 @@ ${StrCase} WriteRegStr HKLM "${CAPABILITIES_PATH}\InstallInfo" "ShowIconsCommand" "${CAPABILITIES_SHOW_ICONS}" WriteRegDWORD HKLM "${CAPABILITIES_PATH}\InstallInfo" "IconsVisible" 0x1 !endif - + ; write application capabilities info !ifdef CAPABILITIES_LOCAL_NAME WriteRegStr HKLM "$0" "ApplicationName" "${CAPABILITIES_LOCAL_NAME}" @@ -302,7 +302,7 @@ ${StrCase} WriteRegStr HKLM "$0" "ApplicationName" "${CAPABILITIES_NAME}" !endif WriteRegStr HKLM "$0" "ApplicationDescription" "${CAPABILITIES_DESCRIPTION}" - + Pop $0 !verbose pop !macroend @@ -322,7 +322,7 @@ ${StrCase} !define MacroID ${__LINE__} !verbose push !verbose ${_Capabilities_VERBOSE} - + Push $0 Push $1 @@ -330,43 +330,43 @@ ${StrCase} FileTypeLoop_${MacroID}: EnumRegValue $0 HKLM "${CAPABILITIES_PATH}\Capabilities\FileAssociations" 0 StrCmp $0 "" FileTypeDone_${MacroID} - + ReadRegStr $1 HKLM "${CAPABILITIES_PATH}\Capabilities\FileAssociations" "$0" DeleteRegKey HKCR $1 DeleteRegValue HKLM "${CAPABILITIES_PATH}\Capabilities\FileAssociations" "$0" Goto FileTypeLoop_${MacroID} FileTypeDone_${MacroID}: - + ; remove all MIME associations MimeTypeLoop_${MacroID}: EnumRegValue $0 HKLM "${CAPABILITIES_PATH}\Capabilities\MimeAssociations" 0 StrCmp $0 "" MimeTypeDone_${MacroID} - + ReadRegStr $1 HKLM "${CAPABILITIES_PATH}\Capabilities\MimeAssociations" "$0" DeleteRegKey HKCR "$1" DeleteRegValue HKLM "${CAPABILITIES_PATH}\Capabilities\MimeAssociations" "$0" Goto MimeTypeLoop_${MacroID} MimeTypeDone_${MacroID}: - + ; remove all protocol associations ProtocolLoop_${MacroID}: EnumRegValue $0 HKLM "${CAPABILITIES_PATH}\Capabilities\UrlAssociations" 0 StrCmp $0 "" ProtocolDone_${MacroID} - + ReadRegStr $1 HKLM "${CAPABILITIES_PATH}\Capabilities\UrlAssociations" "$0" DeleteRegKey HKCR "$1" DeleteRegValue HKLM "${CAPABILITIES_PATH}\Capabilities\UrlAssociations" "$0" Goto ProtocolLoop_${MacroID} ProtocolDone_${MacroID}: - - + + ; remove capabilities keys DeleteRegValue HKLM "Software\RegisteredApplications" "${CAPABILITIES_NAME}" DeleteRegKey HKLM ${CAPABILITIES_PATH} - + Pop $1 Pop $0 !verbose pop @@ -390,7 +390,7 @@ ${StrCase} !macro RegisterFileType_ !verbose push !verbose ${_Capabilities_VERBOSE} - + Exch $R3 ;ext Exch Exch $R2 ;exe @@ -405,10 +405,10 @@ ${StrCase} ; ex: .mp3 becomes ProgID.AssocFile.MP3 ${StrCase} $0 "$R3" "U" StrCpy $0 "${CAPABILITIES_PROGID}.AssocFile$0" - + ; link capabilities to association in classes root WriteRegStr HKLM "${CAPABILITIES_PATH}\Capabilities\FileAssociations" "$R3" "$0" - + ; write file association in classes root WriteRegStr HKCR "$0" "" "$R0" WriteRegStr HKCR "$0\DefaultIcon" "" "$R1" @@ -441,7 +441,7 @@ ${StrCase} !macro RegisterMediaType_ !verbose push !verbose ${_Capabilities_VERBOSE} - + Exch $R3 ;ext Exch Exch $R2 ;exe @@ -457,10 +457,10 @@ ${StrCase} ; ex: .mp3 becomes ProgID.AssocFile.MP3 ${StrCase} $0 "$R3" "U" StrCpy $0 "${CAPABILITIES_PROGID}.AssocFile$0" - + ; link capabilities to association in classes root WriteRegStr HKLM "${CAPABILITIES_PATH}\Capabilities\FileAssociations" "$R3" "$0" - + ; write file association in classes root WriteRegStr HKCR "$0" "" "$R0" WriteRegStr HKCR "$0\DefaultIcon" "" "$R1" @@ -495,24 +495,24 @@ ${StrCase} !macro RegisterMimeType_ !verbose push !verbose ${_Capabilities_VERBOSE} - + Exch $R2 ;mime Exch Exch $R1 ;shortname Exch Exch 2 Exch $R0 ;clsid - + Push $0 ; create an association name ; ex: audio/mp3 becomes ProgID.AssocMIME.MP3 ${StrCase} $0 "$R1" "U" StrCpy $0 "${CAPABILITIES_PROGID}.AssocMIME.$0" - + ; link capabilities to association in classes root WriteRegStr HKLM "${CAPABILITIES_PATH}\Capabilities\MimeAssociations" "$R2" "$0" - + ; write file association in classes root WriteRegStr HKCR "$0\CLSID" "" "$R0" @@ -538,7 +538,7 @@ ${StrCase} !macro RegisterProtocol_ !verbose push !verbose ${_Capabilities_VERBOSE} - + Exch $R3 ;protocol Exch Exch $R2 ;exe @@ -554,10 +554,10 @@ ${StrCase} ; ex: http becomes ProgID.AssocProtocol.HTTP ${StrCase} $0 "$R3" "U" StrCpy $0 "${CAPABILITIES_PROGID}.AssocProtocol.$0" - + ; link capabilities to association in classes root WriteRegStr HKLM "${CAPABILITIES_PATH}\Capabilities\UrlAssociations" "$R3" "$0" - + ; write file association in classes root WriteRegStr HKCR "$0" "" "$R0" WriteRegStr HKCR "$0\DefaultIcon" "" "$R1" @@ -592,14 +592,14 @@ ${StrCase} Exch $R0 ;ext Push $0 - + ReadRegStr $0 HKLM "${CAPABILITIES_PATH}\Capabilities\FileAssociations" "$R0" StrCmp $0 "" skip_${MacroID} - + DeleteRegKey HKCR "$0" DeleteRegValue HKLM "${CAPABILITIES_PATH}\Capabilities\FileAssociations" "$R0" skip_${MacroID}: - + Pop $0 Pop $R0 !verbose pop @@ -624,14 +624,14 @@ ${StrCase} Exch $R0 ;mime Push $0 - + ReadRegStr $0 HKLM "${CAPABILITIES_PATH}\Capabilities\MimeAssociations" "$R0" StrCmp $0 "" skip_${MacroID} - + DeleteRegKey HKCR "$0" DeleteRegValue HKLM "${CAPABILITIES_PATH}\Capabilities\MimeAssociations" "$R0" skip_${MacroID}: - + Pop $0 Pop $R0 !verbose pop @@ -656,14 +656,14 @@ ${StrCase} Exch $R0 ;protocol Push $0 - + ReadRegStr $0 HKLM "${CAPABILITIES_PATH}\Capabilities\UrlAssociations" "$R0" StrCmp $0 "" skip_${MacroID} - + DeleteRegKey HKCR "$0" DeleteRegValue HKLM "${CAPABILITIES_PATH}\Capabilities\UrlAssociations" "$R0" skip_${MacroID}: - + Pop $0 Pop $R0 !verbose pop diff --git a/dist/windows/strawberry-64.nsi.in b/dist/windows/strawberry-64.nsi.in index d3cc5e891..1267fb971 100644 --- a/dist/windows/strawberry-64.nsi.in +++ b/dist/windows/strawberry-64.nsi.in @@ -263,7 +263,7 @@ Section "Start menu items" startmenu CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}" CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME}.lnk" "$INSTDIR\strawberry.exe" CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Uninstall.lnk" "$INSTDIR\Uninstall.exe" - + SectionEnd Section "Uninstaller" @@ -289,7 +289,7 @@ Section "Uninstall" ;StrCmp $1 "-1" wooops ;StrCmp $0 "0" completed - + ;DetailPrint "Killing running strawberry.exe..." ;StrCpy $0 "strawberry.exe" diff --git a/dist/windows/strawberry-debug-64.nsi.in b/dist/windows/strawberry-debug-64.nsi.in index 9d6b37c89..5f0969100 100644 --- a/dist/windows/strawberry-debug-64.nsi.in +++ b/dist/windows/strawberry-debug-64.nsi.in @@ -295,7 +295,7 @@ Section "Start menu items" startmenu CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}" CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME}.lnk" "$INSTDIR\strawberry.exe" CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Uninstall.lnk" "$INSTDIR\Uninstall.exe" - + SectionEnd Section "Uninstaller" @@ -321,7 +321,7 @@ Section "Uninstall" ;StrCmp $1 "-1" wooops ;StrCmp $0 "0" completed - + ;DetailPrint "Killing running strawberry.exe..." ;StrCpy $0 "strawberry.exe" diff --git a/dist/windows/strawberry-debug.nsi.in b/dist/windows/strawberry-debug.nsi.in index dd046fea9..563fbf263 100644 --- a/dist/windows/strawberry-debug.nsi.in +++ b/dist/windows/strawberry-debug.nsi.in @@ -295,7 +295,7 @@ Section "Start menu items" startmenu CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}" CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME}.lnk" "$INSTDIR\strawberry.exe" CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Uninstall.lnk" "$INSTDIR\Uninstall.exe" - + SectionEnd Section "Uninstaller" @@ -321,7 +321,7 @@ Section "Uninstall" ;StrCmp $1 "-1" wooops ;StrCmp $0 "0" completed - + ;DetailPrint "Killing running strawberry.exe..." ;StrCpy $0 "strawberry.exe" diff --git a/dist/windows/strawberry.nsi.in b/dist/windows/strawberry.nsi.in index 0f8a95443..ea90486da 100644 --- a/dist/windows/strawberry.nsi.in +++ b/dist/windows/strawberry.nsi.in @@ -263,7 +263,7 @@ Section "Start menu items" startmenu CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}" CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME}.lnk" "$INSTDIR\strawberry.exe" CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Uninstall.lnk" "$INSTDIR\Uninstall.exe" - + SectionEnd Section "Uninstaller" @@ -289,7 +289,7 @@ Section "Uninstall" ;StrCmp $1 "-1" wooops ;StrCmp $0 "0" completed - + ;DetailPrint "Killing running strawberry.exe..." ;StrCpy $0 "strawberry.exe" diff --git a/ext/libstrawberry-common/core/logging.cpp b/ext/libstrawberry-common/core/logging.cpp index 058f5d8db..64a1146af 100644 --- a/ext/libstrawberry-common/core/logging.cpp +++ b/ext/libstrawberry-common/core/logging.cpp @@ -64,7 +64,7 @@ void GLog(const char *domain, int level, const char *message, void *user_data) { case G_LOG_LEVEL_DEBUG: default: qLog(Debug) << message; break; } - + } static void MessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &message) { @@ -93,7 +93,7 @@ static void MessageHandler(QtMsgType type, const QMessageLogContext &context, co } void Init() { - + delete sClassLevels; delete sNullDevice; diff --git a/ext/libstrawberry-tagreader/tagreader.cpp b/ext/libstrawberry-tagreader/tagreader.cpp index 36f4892f6..94669057d 100644 --- a/ext/libstrawberry-tagreader/tagreader.cpp +++ b/ext/libstrawberry-tagreader/tagreader.cpp @@ -269,7 +269,7 @@ void TagReader::ReadFile(const QString &filename, pb::tagreader::SongMetadata *s else if (TagLib::MP4::File *file = dynamic_cast(fileref->file())) { song->set_bitdepth(file->audioProperties()->bitsPerSample()); - + if (file->tag()) { TagLib::MP4::Tag *mp4_tag = file->tag(); const TagLib::MP4::ItemListMap& items = mp4_tag->itemListMap(); @@ -387,7 +387,7 @@ void TagReader::Decode(const TagLib::String &tag, const QTextCodec *codec, std:: } void TagReader::Decode(const QString &tag, const QTextCodec *codec, std::string *output) { - + if (!codec) { output->assign(DataCommaSizeFromQString(tag)); } @@ -399,10 +399,10 @@ void TagReader::Decode(const QString &tag, const QTextCodec *codec, std::string } void TagReader::ParseFMPSFrame(const QString &name, const QString &value, pb::tagreader::SongMetadata *song) const { - + qLog(Debug) << "Parsing FMPSFrame" << name << ", " << value; FMPSParser parser; - + if (!parser.Parse(value) || parser.is_empty()) return; QVariant var; @@ -426,7 +426,7 @@ void TagReader::ParseFMPSFrame(const QString &name, const QString &value, pb::ta } void TagReader::ParseOggTag(const TagLib::Ogg::FieldListMap &map, const QTextCodec *codec, QString *disc, QString *compilation, pb::tagreader::SongMetadata *song) const { - + if (!map["COMPOSER"].isEmpty()) Decode(map["COMPOSER"].front(), codec, song->mutable_composer()); if (!map["PERFORMER"].isEmpty()) Decode(map["PERFORMER"].front(), codec, song->mutable_performer()); if (!map["CONTENT GROUP"].isEmpty()) Decode(map["CONTENT GROUP"].front(), codec, song->mutable_grouping()); @@ -569,16 +569,16 @@ bool TagReader::SaveFile(const QString &filename, const pb::tagreader::SongMetad } void TagReader::SetUserTextFrame(const QString &description, const QString &value, TagLib::ID3v2::Tag *tag) const { - + const QByteArray descr_utf8(description.toUtf8()); const QByteArray value_utf8(value.toUtf8()); qLog(Debug) << "Setting FMPSFrame:" << description << ", " << value; SetUserTextFrame(std::string(descr_utf8.constData(), descr_utf8.length()), std::string(value_utf8.constData(), value_utf8.length()), tag); - + } void TagReader::SetUserTextFrame(const std::string &description, const std::string &value, TagLib::ID3v2::Tag *tag) const { - + const TagLib::String t_description = StdStringToTaglibString(description); // Remove the frame if it already exists TagLib::ID3v2::UserTextIdentificationFrame *frame = TagLib::ID3v2::UserTextIdentificationFrame::find(tag, t_description); @@ -596,13 +596,13 @@ void TagReader::SetUserTextFrame(const std::string &description, const std::stri } void TagReader::SetTextFrame(const char *id, const QString &value, TagLib::ID3v2::Tag *tag) const { - + const QByteArray utf8(value.toUtf8()); SetTextFrame(id, std::string(utf8.constData(), utf8.length()), tag); } void TagReader::SetTextFrame(const char *id, const std::string &value, TagLib::ID3v2::Tag *tag) const { - + TagLib::ByteVector id_vector(id); QVector frames_buffer; @@ -627,20 +627,20 @@ void TagReader::SetTextFrame(const char *id, const std::string &value, TagLib::I // add frame takes ownership and clears the memory tag->addFrame(frame); } - + } bool TagReader::IsMediaFile(const QString &filename) const { - + qLog(Debug) << "Checking for valid file" << filename; std::unique_ptr fileref(factory_->GetFileRef(filename)); return !fileref->isNull() && fileref->tag(); - + } QByteArray TagReader::LoadEmbeddedArt(const QString &filename) const { - + if (filename.isEmpty()) return QByteArray(); qLog(Debug) << "Loading art from" << filename; diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c552865e6..3a8c0efc3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -109,17 +109,17 @@ set(SOURCES core/windows7thumbbar.cpp core/screensaver.cpp core/scopedtransaction.cpp - + engine/enginetype.cpp engine/enginebase.cpp engine/enginedevice.cpp engine/devicefinder.cpp - + analyzer/fht.cpp analyzer/analyzerbase.cpp analyzer/analyzercontainer.cpp analyzer/blockanalyzer.cpp - + equalizer/equalizer.cpp equalizer/equalizerslider.cpp @@ -173,7 +173,7 @@ set(SOURCES playlistparsers/wplparser.cpp playlistparsers/xmlparser.cpp playlistparsers/xspfparser.cpp - + covermanager/albumcovermanager.cpp covermanager/albumcovermanagerlist.cpp covermanager/albumcoverloader.cpp @@ -244,10 +244,10 @@ set(SOURCES widgets/tracksliderpopup.cpp widgets/tracksliderslider.cpp widgets/loginstatewidget.cpp - + musicbrainz/acoustidclient.cpp musicbrainz/musicbrainzclient.cpp - + globalshortcuts/globalshortcutbackend.cpp globalshortcuts/globalshortcuts.cpp globalshortcuts/gnomeglobalshortcutbackend.cpp @@ -294,10 +294,10 @@ set(HEADERS analyzer/analyzerbase.h analyzer/analyzercontainer.h analyzer/blockanalyzer.h - + equalizer/equalizer.h equalizer/equalizerslider.h - + context/contextview.h context/contextalbumsmodel.h context/contextalbumsview.h @@ -341,7 +341,7 @@ set(HEADERS playlistparsers/playlistparser.h playlistparsers/plsparser.h playlistparsers/xspfparser.h - + covermanager/albumcovermanager.h covermanager/albumcovermanagerlist.h covermanager/albumcoverloader.h @@ -409,10 +409,10 @@ set(HEADERS widgets/tracksliderpopup.h widgets/tracksliderslider.h widgets/loginstatewidget.h - + musicbrainz/acoustidclient.h musicbrainz/musicbrainzclient.h - + globalshortcuts/globalshortcutbackend.h globalshortcuts/globalshortcuts.h globalshortcuts/gnomeglobalshortcutbackend.h @@ -479,7 +479,7 @@ set(UI widgets/osdpretty.ui widgets/fileview.ui widgets/loginstatewidget.ui - + globalshortcuts/globalshortcutgrabber.ui tidal/tidalsearchview.ui diff --git a/src/collection/collection.cpp b/src/collection/collection.cpp index 0e48366b4..bf7664e4b 100644 --- a/src/collection/collection.cpp +++ b/src/collection/collection.cpp @@ -69,7 +69,7 @@ SCollection::~SCollection() { } void SCollection::Init() { - + watcher_ = new CollectionWatcher; watcher_thread_ = new Thread(this); watcher_thread_->SetIoPriority(Utilities::IOPRIO_CLASS_IDLE); @@ -116,7 +116,7 @@ void SCollection::Stopped() { } void SCollection::CurrentSongChanged(const Song &song) { - + TagReaderReply *reply = nullptr; if (reply) { diff --git a/src/collection/collectionbackend.cpp b/src/collection/collectionbackend.cpp index 49ffdfe6f..1dff88c04 100644 --- a/src/collection/collectionbackend.cpp +++ b/src/collection/collectionbackend.cpp @@ -531,7 +531,7 @@ void CollectionBackend::MarkSongsUnavailable(const SongList &songs, bool unavail } QStringList CollectionBackend::GetAll(const QString &column, const QueryOptions &opt) { - + CollectionQuery query(opt); query.SetColumnSpec("DISTINCT " + column); query.AddCompilationRequirement(false); diff --git a/src/collection/collectionmodel.cpp b/src/collection/collectionmodel.cpp index 56d926d21..62138255b 100644 --- a/src/collection/collectionmodel.cpp +++ b/src/collection/collectionmodel.cpp @@ -329,10 +329,10 @@ QString CollectionModel::DividerKey(GroupBy type, CollectionItem *item) const { case GroupBy_Bitrate: return SortTextForNumber(item->metadata.bitrate()); - + case GroupBy_Samplerate: return SortTextForNumber(item->metadata.samplerate()); - + case GroupBy_Bitdepth: return SortTextForNumber(item->metadata.bitdepth()); @@ -374,11 +374,11 @@ QString CollectionModel::DividerDisplayText(GroupBy type, const QString &key) co case GroupBy_Bitrate: if (key == "000") return tr("Unknown"); return QString::number(key.toInt()); // To remove leading 0s - + case GroupBy_Samplerate: if (key == "000") return tr("Unknown"); return QString::number(key.toInt()); // To remove leading 0s - + case GroupBy_Bitdepth: if (key == "000") return tr("Unknown"); return QString::number(key.toInt()); // To remove leading 0s @@ -1125,13 +1125,13 @@ CollectionItem *CollectionModel::ItemFromSong(GroupBy type, bool signal, bool cr item->key = QString::number(bitrate); item->sort_text = SortTextForNumber(bitrate) + " "; break; - + case GroupBy_Samplerate: samplerate = qMax(0, s.samplerate()); item->key = QString::number(samplerate); item->sort_text = SortTextForNumber(samplerate) + " "; break; - + case GroupBy_Bitdepth: bitdepth = qMax(0, s.bitdepth()); item->key = QString::number(bitdepth); diff --git a/src/collection/collectionview.cpp b/src/collection/collectionview.cpp index 3bbdd8947..e1bc44b06 100644 --- a/src/collection/collectionview.cpp +++ b/src/collection/collectionview.cpp @@ -346,7 +346,7 @@ void CollectionView::ReloadSettings() { app_->collection_model()->set_pretty_covers(settings.value("pretty_covers", true).toBool()); app_->collection_model()->set_show_dividers(settings.value("show_dividers", true).toBool()); } - + settings.endGroup(); } @@ -371,7 +371,7 @@ void CollectionView::TotalSongCountUpdated(int count) { setCursor(Qt::PointingHandCursor); else unsetCursor(); - + emit TotalSongCountUpdated_(); } @@ -386,7 +386,7 @@ void CollectionView::TotalArtistCountUpdated(int count) { setCursor(Qt::PointingHandCursor); else unsetCursor(); - + emit TotalArtistCountUpdated_(); } @@ -401,7 +401,7 @@ void CollectionView::TotalAlbumCountUpdated(int count) { setCursor(Qt::PointingHandCursor); else unsetCursor(); - + emit TotalAlbumCountUpdated_(); } diff --git a/src/collection/collectionview.h b/src/collection/collectionview.h index 5d2291309..40a2943bc 100644 --- a/src/collection/collectionview.h +++ b/src/collection/collectionview.h @@ -84,7 +84,7 @@ class CollectionView : public AutoExpandingTreeView { // QTreeView void keyboardSearch(const QString &search); void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible); - + int TotalSongs(); int TotalArtists(); int TotalAlbums(); diff --git a/src/collection/sqlrow.h b/src/collection/sqlrow.h index 3c452e7e5..552dbf9cc 100644 --- a/src/collection/sqlrow.h +++ b/src/collection/sqlrow.h @@ -37,7 +37,7 @@ class SqlRow { SqlRow(const CollectionQuery &query); const QVariant &value(int i) const { return columns_[i]; } - + QList columns_; private: diff --git a/src/context/contextalbumsmodel.cpp b/src/context/contextalbumsmodel.cpp index 3ebd7f930..770bc9b6a 100644 --- a/src/context/contextalbumsmodel.cpp +++ b/src/context/contextalbumsmodel.cpp @@ -93,7 +93,7 @@ void ContextAlbumsModel::set_pretty_covers(bool use_pretty_covers) { use_pretty_covers_ = use_pretty_covers; Reset(); } - + } void ContextAlbumsModel::AddSongs(const SongList &songs) { diff --git a/src/context/contextalbumsview.cpp b/src/context/contextalbumsview.cpp index 4ba8c7265..823915aba 100644 --- a/src/context/contextalbumsview.cpp +++ b/src/context/contextalbumsview.cpp @@ -155,7 +155,7 @@ void ContextItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &o } bool ContextItemDelegate::helpEvent(QHelpEvent *event, QAbstractItemView *view, const QStyleOptionViewItem &option, const QModelIndex &index) { - + return true; Q_UNUSED(option); @@ -326,7 +326,7 @@ void ContextAlbumsView::ReloadSettings() { if (app_ && model_) { model_->set_pretty_covers(settings.value("pretty_covers", true).toBool()); } - + settings.endGroup(); } @@ -334,7 +334,7 @@ void ContextAlbumsView::ReloadSettings() { void ContextAlbumsView::SetApplication(Application *app) { app_ = app; - + model_ = new ContextAlbumsModel(app_->collection_backend(), app_, this); model_->Reset(); @@ -342,7 +342,7 @@ void ContextAlbumsView::SetApplication(Application *app) { connect(model_, SIGNAL(modelAboutToBeReset()), this, SLOT(SaveFocus())); connect(model_, SIGNAL(modelReset()), this, SLOT(RestoreFocus())); - + ReloadSettings(); } diff --git a/src/context/contextalbumsview.h b/src/context/contextalbumsview.h index 58fef9619..6127e8efe 100644 --- a/src/context/contextalbumsview.h +++ b/src/context/contextalbumsview.h @@ -78,7 +78,7 @@ class ContextAlbumsView : public AutoExpandingTreeView { // QTreeView void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible); - + ContextAlbumsModel *albums_model() { return model_; } public slots: @@ -146,9 +146,9 @@ signals: Song last_selected_song_; QString last_selected_container_; QSet last_selected_path_; - + ContextAlbumsModel *model_; - + }; #endif // CONTEXTALBUMSVIEW_H diff --git a/src/context/contextview.cpp b/src/context/contextview.cpp index b29425e64..43628d2cc 100644 --- a/src/context/contextview.cpp +++ b/src/context/contextview.cpp @@ -530,7 +530,7 @@ void ContextView::handlePaintEvent(QObject *object, QEvent *event) { if (object == ui_->label_play_album) { PaintEventAlbum(event); } - + return; } diff --git a/src/core/database.cpp b/src/core/database.cpp index 06af60dde..f30a34c8a 100644 --- a/src/core/database.cpp +++ b/src/core/database.cpp @@ -62,7 +62,7 @@ Database::Token::Token(const QString &token, int start, int end) : token(token), start_offset(start), end_offset(end) {} struct sqlite3_tokenizer_module { - + int iVersion; int (*xCreate)(int argc, /* Size of argv array */ const char *const *argv, /* Tokenizer argument strings */ @@ -106,7 +106,7 @@ int Database::FTSCreate(int argc, const char *const *argv, sqlite3_tokenizer **t } int Database::FTSDestroy(sqlite3_tokenizer *tokenizer) { - + UnicodeTokenizer *real_tokenizer = reinterpret_cast(tokenizer); delete real_tokenizer; return SQLITE_OK; @@ -460,7 +460,7 @@ void Database::UrlEncodeFilenameColumn(const QString &table, QSqlDatabase &db) { update.prepare(QString("UPDATE %1 SET filename=:filename WHERE ROWID=:id").arg(table)); select.exec(); if (CheckErrors(select)) return; - + while (select.next()) { const int rowid = select.value(0).toInt(); const QString filename = select.value(1).toString(); @@ -565,7 +565,7 @@ QStringList Database::SongsTables(QSqlDatabase &db, int schema_version) const { } bool Database::CheckErrors(const QSqlQuery &query) { - + QSqlError last_error = query.lastError(); if (last_error.isValid()) { qLog(Error) << "db error: " << last_error; diff --git a/src/core/mac_delegate.h b/src/core/mac_delegate.h index da6f69140..0ca0b2a0a 100644 --- a/src/core/mac_delegate.h +++ b/src/core/mac_delegate.h @@ -11,7 +11,7 @@ class PlatformInterface; NSMenu* dock_menu_; MacGlobalShortcutBackend* shortcut_handler_; SPMediaKeyTap* key_tap_; - + } - (id) initWithHandler: (PlatformInterface*)handler; diff --git a/src/core/macsystemtrayicon.mm b/src/core/macsystemtrayicon.mm index 36fd1751c..f59bcd1cc 100644 --- a/src/core/macsystemtrayicon.mm +++ b/src/core/macsystemtrayicon.mm @@ -17,7 +17,7 @@ * along with Strawberry. If not, see . * */ - + #include "config.h" #include "macsystemtrayicon.h" @@ -183,7 +183,7 @@ void MacSystemTrayIcon::SetupMenu(QAction* previous, QAction* play, QAction* sto SetupMenuItem(mute); p_->AddSeparator(); Q_UNUSED(quit); // Mac already has a Quit item. - + } void MacSystemTrayIcon::SetupMenuItem(QAction* action) { diff --git a/src/core/mainwindow.cpp b/src/core/mainwindow.cpp index d437035af..87b5bf746 100644 --- a/src/core/mainwindow.cpp +++ b/src/core/mainwindow.cpp @@ -280,7 +280,7 @@ MainWindow::MainWindow(Application *app, SystemTrayIcon *tray_icon, OSD *osd, co collection_sort_model_->setDynamicSortFilter(true); collection_sort_model_->setSortLocaleAware(true); collection_sort_model_->sort(0); - + qLog(Debug) << "Creating models finished"; connect(ui_->playlist, SIGNAL(ViewSelectionModelChanged()), SLOT(PlaylistViewSelectionModelChanged())); @@ -617,7 +617,7 @@ MainWindow::MainWindow(Application *app, SystemTrayIcon *tray_icon, OSD *osd, co connect(ui_->tabs, SIGNAL(ModeChanged(FancyTabWidget::Mode)), SLOT(SaveGeometry())); connect(ui_->tabs, SIGNAL(CurrentChanged(int)), SLOT(TabSwitched())); connect(ui_->tabs, SIGNAL(CurrentChanged(int)), SLOT(SaveGeometry())); - + // Context connect(app_->playlist_manager(), SIGNAL(CurrentSongChanged(Song)), context_view_, SLOT(SongChanged(Song))); connect(app_->player(), SIGNAL(PlaylistFinished()), context_view_, SLOT(Stopped())); @@ -841,7 +841,7 @@ void MainWindow::MediaStopped() { } void MainWindow::MediaPaused() { - + ui_->action_stop->setEnabled(true); ui_->action_stop_after_this_track->setEnabled(true); ui_->action_play_pause->setIcon(IconLoader::Load("media-play")); @@ -920,7 +920,7 @@ void MainWindow::resizeEvent(QResizeEvent *event) { } void MainWindow::TabSwitched() { - + if (ui_->tabs->currentIndex() > 0) ui_->widget_playing->SetEnabled(); else @@ -943,7 +943,7 @@ void MainWindow::SaveGeometry() { } void MainWindow::SavePlaybackStatus() { - + QSettings settings; settings.beginGroup("Player"); @@ -954,13 +954,13 @@ void MainWindow::SavePlaybackStatus() { else { settings.setValue("playback_position", 0); } - + settings.endGroup(); - + } void MainWindow::LoadPlaybackStatus() { - + QSettings settings; settings.beginGroup(BehaviourSettingsPage::kSettingsGroup); @@ -973,7 +973,7 @@ void MainWindow::LoadPlaybackStatus() { saved_playback_state_ = static_cast (settings.value("playback_state", Engine::Empty).toInt()); saved_playback_position_ = settings.value("playback_position", 0).toDouble(); settings.endGroup(); - + if (saved_playback_state_ == Engine::Empty || saved_playback_state_ == Engine::Idle) { return; } @@ -998,7 +998,7 @@ void MainWindow::ResumePlayback() { } void MainWindow::PlayIndex(const QModelIndex &index) { - + if (!index.isValid()) return; int row = index.row(); @@ -1043,7 +1043,7 @@ void MainWindow::VolumeWheelEvent(int delta) { } void MainWindow::ToggleShowHide() { - + if (settings_.value("hidden").toBool()) { show(); SetHiddenInTray(false); @@ -1119,7 +1119,7 @@ void MainWindow::Seeked(qlonglong microseconds) { } void MainWindow::UpdateTrackPosition() { - + // Track position in seconds //Playlist *playlist = app_->playlist_manager()->active(); @@ -1217,7 +1217,7 @@ void MainWindow::AddToPlaylist(QMimeData *data) { } void MainWindow::AddToPlaylist(QAction *action) { - + int destination = action->data().toInt(); PlaylistItemList items; @@ -1289,17 +1289,17 @@ void MainWindow::PlaylistRightClick(const QPoint &global_pos, const QModelIndex int not_in_queue = 0; int in_skipped = 0; int not_in_skipped = 0; - + for (const QModelIndex &index : selection) { - + all++; if (index.column() != 0) continue; - + selected++; - + PlaylistItemPtr item = app_->playlist_manager()->current()->item_at(index.row()); - + if (item->Metadata().has_cue()) { cue_selected = true; } @@ -1349,7 +1349,7 @@ void MainWindow::PlaylistRightClick(const QPoint &global_pos, const QModelIndex //qLog(Debug) << "selected" << selected; //qLog(Debug) << "in_queue" << in_queue << "not_in_queue" << not_in_queue; //qLog(Debug) << "in_skipped" << in_skipped << "not_in_skipped" << not_in_skipped; - + if (selected < 1) { playlist_queue_->setVisible(false); playlist_skip_->setVisible(false); @@ -1382,8 +1382,8 @@ void MainWindow::PlaylistRightClick(const QPoint &global_pos, const QModelIndex ui_->action_edit_value->setVisible(false); } else { - - + + Playlist::Column column = (Playlist::Column)index.column(); bool column_is_editable = Playlist::column_is_editable(column) && editable; @@ -1584,7 +1584,7 @@ void MainWindow::EditValue() { } void MainWindow::AddFile() { - + // Last used directory QString directory =settings_.value("add_media_path", QDir::currentPath()).toString(); @@ -2052,7 +2052,7 @@ SettingsDialog *MainWindow::CreateSettingsDialog() { } void MainWindow::EnsureSettingsDialogCreated() { - + //if (settings_dialog_) return; //settings_dialog_.reset(new SettingsDialog(app_)); @@ -2064,14 +2064,14 @@ void MainWindow::EnsureSettingsDialogCreated() { // Allows custom notification preview //connect(settings_dialog_.get(), SIGNAL(NotificationPreview(OSD::Behaviour,QString,QString)), SLOT(HandleNotificationPreview(OSD::Behaviour, QString, QString))); - + } void MainWindow::OpenSettingsDialog() { EnsureSettingsDialogCreated(); settings_dialog_->show(); - + } void MainWindow::OpenSettingsDialogAtPage(SettingsDialog::Page page) { @@ -2127,7 +2127,7 @@ void MainWindow::ShowErrorDialog(const QString &message) { } void MainWindow::CheckFullRescanRevisions() { - + int from = app_->database()->startup_schema_version(); int to = app_->database()->current_schema_version(); @@ -2169,7 +2169,7 @@ void MainWindow::ShowQueueManager() { } void MainWindow::PlaylistViewSelectionModelChanged() { - + connect(ui_->playlist->view()->selectionModel(),SIGNAL(currentChanged(QModelIndex, QModelIndex)), SLOT(PlaylistCurrentChanged(QModelIndex))); } @@ -2251,7 +2251,7 @@ void MainWindow::AutoCompleteTags() { } void MainWindow::AutoCompleteTagsAccepted() { - + for (PlaylistItemPtr item : autocomplete_tag_items_) { item->Reload(); } @@ -2389,7 +2389,7 @@ void MainWindow::AlbumArtLoaded(const Song &song, const QString&, const QImage & } void MainWindow::GetCoverAutomatically() { - + // Search for cover automatically? bool search = album_cover_choice_controller_->search_cover_auto_action()->isChecked() && diff --git a/src/core/mainwindow.h b/src/core/mainwindow.h index a4a6a26f1..a7c29f419 100644 --- a/src/core/mainwindow.h +++ b/src/core/mainwindow.h @@ -296,7 +296,7 @@ signals: // creates the icon by painting the full one depending on the current position QPixmap CreateOverlayedIcon(int position, int scrobble_point); - + void GetCoverAutomatically(); private: diff --git a/src/core/mergedproxymodel.cpp b/src/core/mergedproxymodel.cpp index 87de2a13d..4bf55c673 100644 --- a/src/core/mergedproxymodel.cpp +++ b/src/core/mergedproxymodel.cpp @@ -453,7 +453,7 @@ bool MergedProxyModel::dropMimeData(const QMimeData *data, Qt::DropAction action } QModelIndex MergedProxyModel::FindSourceParent(const QModelIndex &proxy_index) const { - + if (!proxy_index.isValid()) return QModelIndex(); QModelIndex source_index = mapToSource(proxy_index); @@ -463,7 +463,7 @@ QModelIndex MergedProxyModel::FindSourceParent(const QModelIndex &proxy_index) c } bool MergedProxyModel::canFetchMore(const QModelIndex &parent) const { - + QModelIndex source_index = mapToSource(parent); if (!source_index.isValid()) @@ -473,7 +473,7 @@ bool MergedProxyModel::canFetchMore(const QModelIndex &parent) const { } void MergedProxyModel::fetchMore(const QModelIndex &parent) { - + QModelIndex source_index = mapToSource(parent); if (!source_index.isValid()) diff --git a/src/core/mimedata.h b/src/core/mimedata.h index bf1b75aa3..8e26d3c5e 100644 --- a/src/core/mimedata.h +++ b/src/core/mimedata.h @@ -52,7 +52,7 @@ class MimeData : public QMimeData { // If this is set then the items are added to the queue after being inserted. bool enqueue_now_; - + // If this is set then the items are added to the beginning of the queue after being inserted. bool enqueue_next_now_; diff --git a/src/core/mpris2.cpp b/src/core/mpris2.cpp index 700f2b9ab..efbaddf7a 100644 --- a/src/core/mpris2.cpp +++ b/src/core/mpris2.cpp @@ -121,7 +121,7 @@ Mpris2::Mpris2(Application *app, QObject *parent) : QObject(parent), app_(app) { connect(app_->playlist_manager(), SIGNAL(CurrentSongChanged(Song)), SLOT(CurrentSongChanged(Song))); connect(app_->playlist_manager(), SIGNAL(PlaylistChanged(Playlist*)), SLOT(PlaylistChanged(Playlist*))); connect(app_->playlist_manager(), SIGNAL(CurrentChanged(Playlist*)), SLOT(PlaylistCollectionChanged(Playlist*))); - + } // when PlaylistManager gets it ready, we connect PlaylistSequence with this diff --git a/src/core/player.cpp b/src/core/player.cpp index 637245d16..6dca439e7 100644 --- a/src/core/player.cpp +++ b/src/core/player.cpp @@ -155,7 +155,7 @@ void Player::CreateEngine(Engine::EngineType enginetype) { } void Player::Init() { - + if (!engine_->Init()) { qFatal("Error initialising audio engine"); } analyzer_->SetEngine(engine_.get()); @@ -347,7 +347,7 @@ void Player::TrackEnded() { } void Player::PlayPause() { - + switch (engine_->state()) { case Engine::Paused: engine_->Unpause(); @@ -520,7 +520,7 @@ void Player::CurrentMetadataChanged(const Song &metadata) { } void Player::SeekTo(int seconds) { - + const qint64 length_nanosec = engine_->length_nanosec(); // If the length is 0 then either there is no song playing, or the song isn't seekable. @@ -724,7 +724,7 @@ void Player::RegisterUrlHandler(UrlHandler *handler) { url_handlers_.insert(scheme, handler); connect(handler, SIGNAL(destroyed(QObject*)), SLOT(UrlHandlerDestroyed(QObject*))); connect(handler, SIGNAL(AsyncLoadComplete(UrlHandler::LoadResult)), SLOT(HandleLoadResult(UrlHandler::LoadResult))); - + } void Player::UnregisterUrlHandler(UrlHandler *handler) { diff --git a/src/core/qtsystemtrayicon.cpp b/src/core/qtsystemtrayicon.cpp index bd556844e..939f9f958 100644 --- a/src/core/qtsystemtrayicon.cpp +++ b/src/core/qtsystemtrayicon.cpp @@ -78,7 +78,7 @@ QtSystemTrayIcon::~QtSystemTrayIcon() { } bool QtSystemTrayIcon::eventFilter(QObject *object, QEvent *event) { - + if (QObject::eventFilter(object, event)) return true; if (object != tray_) return false; @@ -135,7 +135,7 @@ void QtSystemTrayIcon::SetupMenu(QAction *previous, QAction *play, QAction *stop } void QtSystemTrayIcon::Clicked(QSystemTrayIcon::ActivationReason reason) { - + switch (reason) { case QSystemTrayIcon::DoubleClick: case QSystemTrayIcon::Trigger: diff --git a/src/core/song.cpp b/src/core/song.cpp index 02be9859f..36ae8e855 100644 --- a/src/core/song.cpp +++ b/src/core/song.cpp @@ -1051,7 +1051,7 @@ void Song::BindToQuery(QSqlQuery *query) const { query->bindValue(":mtime", notnullintval(d->mtime_)); query->bindValue(":ctime", notnullintval(d->ctime_)); query->bindValue(":unavailable", d->unavailable_ ? 1 : 0); - + query->bindValue(":playcount", d->playcount_); query->bindValue(":skipcount", d->skipcount_); query->bindValue(":lastplayed", intval(d->lastplayed_)); @@ -1060,13 +1060,13 @@ void Song::BindToQuery(QSqlQuery *query) const { query->bindValue(":compilation_on", d->compilation_on_ ? 1 : 0); query->bindValue(":compilation_off", d->compilation_off_ ? 1 : 0); query->bindValue(":compilation_effective", is_compilation() ? 1 : 0); - + query->bindValue(":art_automatic", d->art_automatic_); query->bindValue(":art_manual", d->art_manual_); query->bindValue(":effective_albumartist", this->effective_albumartist()); query->bindValue(":effective_originalyear", intval(this->effective_originalyear())); - + query->bindValue(":cue_path", d->cue_path_); #undef intval diff --git a/src/core/song.h b/src/core/song.h index 191065a3e..8c91f1690 100644 --- a/src/core/song.h +++ b/src/core/song.h @@ -82,7 +82,7 @@ class Song { static const QString kManuallyUnsetCover; static const QString kEmbeddedCover; - + static const QRegExp kCoverRemoveDisc; static QString JoinSpec(const QString &table); @@ -214,18 +214,18 @@ class Song { const QString &art_automatic() const; const QString &art_manual() const; - + const QString &cue_path() const; bool has_cue() const; - + const QString &effective_album() const; int effective_originalyear() const; const QString &effective_albumartist() const; - + bool is_collection_song() const; bool is_stream() const; bool is_cdda() const; - + // Playlist views are special because you don't want to fill in album artists automatically for compilations, but you do for normal albums: const QString &playlist_albumartist() const; @@ -248,7 +248,7 @@ class Song { QString PrettyYear() const; QString TitleWithCompilationArtist() const; - + QString SampleRateBitDepthToText() const; // Setters @@ -292,7 +292,7 @@ class Song { void set_mtime(int v); void set_ctime(int v); void set_unavailable(bool v); - + void set_playcount(int v); void set_skipcount(int v); void set_lastplayed(int v); @@ -300,12 +300,12 @@ class Song { void set_compilation_detected(bool v); void set_compilation_on(bool v); void set_compilation_off(bool v); - + void set_art_automatic(const QString &v); void set_art_manual(const QString &v); void set_cue_path(const QString &v); - + void set_image(const QImage &i); // Comparison functions diff --git a/src/core/songloader.cpp b/src/core/songloader.cpp index 4cf15da4e..24f545fac 100644 --- a/src/core/songloader.cpp +++ b/src/core/songloader.cpp @@ -96,7 +96,7 @@ SongLoader::SongLoader(CollectionBackendInterface *collection, const Player *pla timeout_timer_->setSingleShot(true); connect(timeout_timer_, SIGNAL(timeout()), SLOT(Timeout())); - + } SongLoader::~SongLoader() { @@ -520,7 +520,7 @@ GstBusSyncReply SongLoader::BusCallbackSync(GstBus *, GstMessage *msg, gpointer #ifdef HAVE_GSTREAMER void SongLoader::ErrorMessageReceived(GstMessage *msg) { - + if (state_ == Finished) return; GError *error; diff --git a/src/core/tagreaderclient.cpp b/src/core/tagreaderclient.cpp index 93a63896a..c10f56d20 100644 --- a/src/core/tagreaderclient.cpp +++ b/src/core/tagreaderclient.cpp @@ -55,7 +55,7 @@ void TagReaderClient::WorkerFailedToStart() { } TagReaderReply *TagReaderClient::ReadFile(const QString &filename) { - + pb::tagreader::Message message; pb::tagreader::ReadFileRequest *req = message.mutable_read_file_request(); @@ -78,7 +78,7 @@ TagReaderReply *TagReaderClient::SaveFile(const QString &filename, const Song &m } TagReaderReply *TagReaderClient::IsMediaFile(const QString &filename) { - + pb::tagreader::Message message; pb::tagreader::IsMediaFileRequest *req = message.mutable_is_media_file_request(); @@ -89,7 +89,7 @@ TagReaderReply *TagReaderClient::IsMediaFile(const QString &filename) { } TagReaderReply *TagReaderClient::LoadEmbeddedArt(const QString &filename) { - + pb::tagreader::Message message; pb::tagreader::LoadEmbeddedArtRequest *req = message.mutable_load_embedded_art_request(); @@ -100,7 +100,7 @@ TagReaderReply *TagReaderClient::LoadEmbeddedArt(const QString &filename) { } void TagReaderClient::ReadFileBlocking(const QString &filename, Song *song) { - + Q_ASSERT(QThread::currentThread() != thread()); TagReaderReply *reply = ReadFile(filename); @@ -112,7 +112,7 @@ void TagReaderClient::ReadFileBlocking(const QString &filename, Song *song) { } bool TagReaderClient::SaveFileBlocking(const QString &filename, const Song &metadata) { - + Q_ASSERT(QThread::currentThread() != thread()); bool ret = false; @@ -128,7 +128,7 @@ bool TagReaderClient::SaveFileBlocking(const QString &filename, const Song &meta } bool TagReaderClient::IsMediaFileBlocking(const QString &filename) { - + Q_ASSERT(QThread::currentThread() != thread()); bool ret = false; @@ -144,7 +144,7 @@ bool TagReaderClient::IsMediaFileBlocking(const QString &filename) { } QImage TagReaderClient::LoadEmbeddedArtBlocking(const QString &filename) { - + Q_ASSERT(QThread::currentThread() != thread()); QImage ret; diff --git a/src/core/utilities.cpp b/src/core/utilities.cpp index 05e3f94ea..6f395152f 100644 --- a/src/core/utilities.cpp +++ b/src/core/utilities.cpp @@ -298,7 +298,7 @@ bool RemoveRecursive(const QString &path) { } bool CopyRecursive(const QString &source, const QString &destination) { - + // Make the destination directory QString dir_name = source.section('/', -1, -1); QString dest_path = destination + "/" + dir_name; @@ -323,7 +323,7 @@ bool CopyRecursive(const QString &source, const QString &destination) { } bool Copy(QIODevice *source, QIODevice *destination) { - + if (!source->open(QIODevice::ReadOnly)) return false; if (!destination->open(QIODevice::WriteOnly)) return false; @@ -493,7 +493,7 @@ QByteArray Sha1CoverHash(const QString &artist, const QString &album) { QCryptographicHash hash(QCryptographicHash::Sha1); hash.addData(artist.toLower().toUtf8().constData()); hash.addData(album.toLower().toUtf8().constData()); - + //qLog(Debug) << artist << album << hash.result(); return hash.result(); diff --git a/src/covermanager/albumcoverchoicecontroller.cpp b/src/covermanager/albumcoverchoicecontroller.cpp index 9a0c7bf0d..7a1128ced 100644 --- a/src/covermanager/albumcoverchoicecontroller.cpp +++ b/src/covermanager/albumcoverchoicecontroller.cpp @@ -143,7 +143,7 @@ void AlbumCoverChoiceController::SaveCoverToFile(const Song &song, const QImage } QString AlbumCoverChoiceController::GetInitialPathForFileDialog(const Song &song, const QString &filename) { - + // Art automatic is first to show user which cover the album may be using now; // The song is using it if there's no manual path but we cannot use manual path here because it can contain cached paths if (!song.art_automatic().isEmpty() && !song.has_embedded_cover()) { @@ -162,7 +162,7 @@ QString AlbumCoverChoiceController::GetInitialPathForFileDialog(const Song &song } QString AlbumCoverChoiceController::LoadCoverFromURL(Song *song) { - + if (!cover_from_url_dialog_) { cover_from_url_dialog_ = new CoverFromURLDialog(this); } QImage image = cover_from_url_dialog_->Exec(); @@ -174,7 +174,7 @@ QString AlbumCoverChoiceController::LoadCoverFromURL(Song *song) { return cover; } else { return QString(); } - + } QString AlbumCoverChoiceController::SearchForCover(Song *song) { @@ -192,7 +192,7 @@ QString AlbumCoverChoiceController::SearchForCover(Song *song) { return cover; } else { return QString(); } - + } QString AlbumCoverChoiceController::UnsetCover(Song *song) { diff --git a/src/covermanager/albumcoverfetcher.h b/src/covermanager/albumcoverfetcher.h index 8709dbff3..e28a64dbf 100644 --- a/src/covermanager/albumcoverfetcher.h +++ b/src/covermanager/albumcoverfetcher.h @@ -112,7 +112,7 @@ signals: QHash active_requests_; QTimer *request_starter_; - + }; #endif // ALBUMCOVERFETCHER_H diff --git a/src/covermanager/albumcoverfetchersearch.h b/src/covermanager/albumcoverfetchersearch.h index 7d5e19eb3..c4f81f7c2 100644 --- a/src/covermanager/albumcoverfetchersearch.h +++ b/src/covermanager/albumcoverfetchersearch.h @@ -102,7 +102,7 @@ class AlbumCoverFetcherSearch : public QObject { QNetworkAccessManager *network_; bool cancel_requested_; - + }; #endif // ALBUMCOVERFETCHERSEARCH_H diff --git a/src/covermanager/albumcoverloader.cpp b/src/covermanager/albumcoverloader.cpp index 8c4cd9634..4a1ec4dbf 100644 --- a/src/covermanager/albumcoverloader.cpp +++ b/src/covermanager/albumcoverloader.cpp @@ -56,7 +56,7 @@ QString AlbumCoverLoader::ImageCacheDir() { } void AlbumCoverLoader::CancelTask(quint64 id) { - + QMutexLocker l(&mutex_); for (QQueue::iterator it = tasks_.begin(); it != tasks_.end(); ++it) { if (it->id == id) { @@ -67,7 +67,7 @@ void AlbumCoverLoader::CancelTask(quint64 id) { } void AlbumCoverLoader::CancelTasks(const QSet &ids) { - + QMutexLocker l(&mutex_); for (QQueue::iterator it = tasks_.begin(); it != tasks_.end();) { if (ids.contains(it->id)) { @@ -226,7 +226,7 @@ void AlbumCoverLoader::RemoteFetchFinished(QNetworkReply *reply) { } NextState(&task); - + } QImage AlbumCoverLoader::ScaleAndPad(const AlbumCoverLoaderOptions &options, const QImage &image) { diff --git a/src/covermanager/albumcovermanager.cpp b/src/covermanager/albumcovermanager.cpp index f5090aee7..ddf7abf0c 100644 --- a/src/covermanager/albumcovermanager.cpp +++ b/src/covermanager/albumcovermanager.cpp @@ -266,7 +266,7 @@ void AlbumCoverManager::CancelRequests() { abort_progress_->hide(); statusBar()->clearMessage(); EnableCoversButtons(); - + } static bool CompareNocase(const QString &left, const QString &right) { @@ -292,7 +292,7 @@ void AlbumCoverManager::Reset() { if (artist.isEmpty()) continue; new QListWidgetItem(artist_icon_, artist, ui_->artists, Specific_Artist); } - + } void AlbumCoverManager::EnableCoversButtons() { @@ -375,7 +375,7 @@ void AlbumCoverManager::CoverImageLoaded(quint64 id, const QImage &image) { } void AlbumCoverManager::UpdateFilter() { - + const QString filter = ui_->filter->text().toLower(); const bool hide_with_covers = filter_without_covers_->isChecked(); const bool hide_without_covers = filter_with_covers_->isChecked(); @@ -479,7 +479,7 @@ void AlbumCoverManager::AlbumCoverFetched(quint64 id, const QImage &image, const } void AlbumCoverManager::UpdateStatusText() { - + QString message = tr("Got %1 covers out of %2 (%3 failed)") .arg(fetch_statistics_.chosen_images_) .arg(jobs_) @@ -540,7 +540,7 @@ Song AlbumCoverManager::GetFirstSelectedAsSong() { } Song AlbumCoverManager::ItemAsSong(QListWidgetItem *item) { - + Song result; QString title = item->data(Role_AlbumName).toString(); @@ -569,7 +569,7 @@ Song AlbumCoverManager::ItemAsSong(QListWidgetItem *item) { } void AlbumCoverManager::ShowCover() { - + Song song = GetSingleSelectionAsSong(); if (!song.is_valid()) return; @@ -592,15 +592,15 @@ void AlbumCoverManager::FetchSingleCover() { } void AlbumCoverManager::UpdateCoverInList(QListWidgetItem *item, const QString &cover) { - + quint64 id = app_->album_cover_loader()->LoadImageAsync(cover_loader_options_, QString(), cover); item->setData(Role_PathManual, cover); cover_loading_tasks_[id] = item; - + } void AlbumCoverManager::LoadCoverFromFile() { - + Song song = GetSingleSelectionAsSong(); if (!song.is_valid()) return; @@ -611,7 +611,7 @@ void AlbumCoverManager::LoadCoverFromFile() { if (!cover.isEmpty()) { UpdateCoverInList(item, cover); } - + } void AlbumCoverManager::SaveCoverToFile() { @@ -638,7 +638,7 @@ void AlbumCoverManager::SaveCoverToFile() { } album_cover_choice_controller_->SaveCoverToFile(song, image); - + } void AlbumCoverManager::LoadCoverFromURL() { @@ -676,11 +676,11 @@ void AlbumCoverManager::SearchForCover() { UpdateCoverInList(current, cover); } - + } void AlbumCoverManager::UnsetCover() { - + Song song = GetFirstSelectedAsSong(); if (!song.is_valid()) return; @@ -699,11 +699,11 @@ void AlbumCoverManager::UnsetCover() { album_cover_choice_controller_->SaveCover(¤t_song, cover); } } - + } SongList AlbumCoverManager::GetSongsInAlbum(const QModelIndex &index) const { - + SongList ret; CollectionQuery q; @@ -731,7 +731,7 @@ SongList AlbumCoverManager::GetSongsInAlbum(const QModelIndex &index) const { ret << song; } return ret; - + } SongList AlbumCoverManager::GetSongsInAlbums(const QModelIndexList &indexes) const { @@ -741,7 +741,7 @@ SongList AlbumCoverManager::GetSongsInAlbums(const QModelIndexList &indexes) con ret << GetSongsInAlbum(index); } return ret; - + } SongMimeData *AlbumCoverManager::GetMimeDataForAlbums(const QModelIndexList &indexes) const { @@ -781,7 +781,7 @@ void AlbumCoverManager::LoadSelectedToPlaylist() { } void AlbumCoverManager::SaveAndSetCover(QListWidgetItem *item, const QImage &image) { - + const QString artist = item->data(Role_ArtistName).toString(); const QString albumartist = item->data(Role_AlbumArtistName).toString(); const QString album = item->data(Role_AlbumName).toString(); @@ -799,7 +799,7 @@ void AlbumCoverManager::SaveAndSetCover(QListWidgetItem *item, const QImage &ima } void AlbumCoverManager::ExportCovers() { - + AlbumCoverExport::DialogResult result = cover_export_->Exec(); if (result.cancelled_) { @@ -838,7 +838,7 @@ void AlbumCoverManager::ExportCovers() { } void AlbumCoverManager::UpdateExportStatus(int exported, int skipped, int max) { - + progress_bar_->setValue(exported); QString message = tr("Exported %1 covers out of %2 (%3 skipped)") diff --git a/src/covermanager/amazoncoverprovider.cpp b/src/covermanager/amazoncoverprovider.cpp index 2c5470a34..4a134599c 100644 --- a/src/covermanager/amazoncoverprovider.cpp +++ b/src/covermanager/amazoncoverprovider.cpp @@ -55,13 +55,13 @@ const char *AmazonCoverProvider::kSecretAccessKeyB64 = "TjFZU3F2c2hJZDVtUGxKVW1K AmazonCoverProvider::AmazonCoverProvider(QObject *parent) : CoverProvider("Amazon", true, parent), network_(new NetworkAccessManager(this)) {} bool AmazonCoverProvider::StartSearch(const QString &artist, const QString &album, int id) { - + typedef QPair Arg; typedef QList ArgList; typedef QPair EncodedArg; typedef QList EncodedArgList; - + // Must be sorted by parameter name ArgList args = ArgList() << Arg("AWSAccessKeyId", QByteArray::fromBase64(kAccessKeyB64)) @@ -108,9 +108,9 @@ void AmazonCoverProvider::QueryError(QNetworkReply::NetworkError error, QNetwork } void AmazonCoverProvider::QueryFinished(QNetworkReply *reply, int id) { - + reply->deleteLater(); - + QString data(reply->readAll()); CoverSearchResults results; diff --git a/src/covermanager/discogscoverprovider.cpp b/src/covermanager/discogscoverprovider.cpp index 8719c8b4d..e157e2ee6 100644 --- a/src/covermanager/discogscoverprovider.cpp +++ b/src/covermanager/discogscoverprovider.cpp @@ -91,11 +91,11 @@ bool DiscogsCoverProvider::StartRelease(DiscogsCoverSearchContext *s_ctx, int r_ SendReleaseRequest(s_ctx, r_ctx); return true; - + } void DiscogsCoverProvider::SendSearchRequest(DiscogsCoverSearchContext *s_ctx) { - + typedef QPair Arg; typedef QList ArgList; @@ -187,7 +187,7 @@ void DiscogsCoverProvider::HandleSearchReply(QNetworkReply *reply, int s_id) { return; } DiscogsCoverSearchContext *s_ctx = requests_search_.value(s_id); - + QJsonDocument json_doc = QJsonDocument::fromJson(reply->readAll()); if ((json_doc.isNull()) || (!json_doc.isObject())) { qLog(Error) << "Discogs: Failed to create JSON doc."; @@ -210,7 +210,7 @@ void DiscogsCoverProvider::HandleSearchReply(QNetworkReply *reply, int s_id) { EndSearch(s_ctx); return; } - + QVariantList results = reply_map["results"].toList(); int i = 0; @@ -245,7 +245,7 @@ void DiscogsCoverProvider::HandleReleaseReply(QNetworkReply *reply, int s_id, in return; } DiscogsCoverSearchContext *s_ctx = requests_search_.value(s_id); - + QJsonDocument json_doc = QJsonDocument::fromJson(reply->readAll()); if ((json_doc.isNull()) || (!json_doc.isObject())) { qLog(Error) << "Discogs: Failed to create JSON doc."; @@ -275,7 +275,7 @@ void DiscogsCoverProvider::HandleReleaseReply(QNetworkReply *reply, int s_id, in QVariantMap result_map = result.toMap(); CoverSearchResult cover_result; cover_result.description = s_ctx->title; - + if (result_map.contains("type")) { QString type = result_map["type"].toString(); if (type != "primary") continue; @@ -324,11 +324,11 @@ void DiscogsCoverProvider::ReleaseRequestError(QNetworkReply::NetworkError error void DiscogsCoverProvider::EndSearch(DiscogsCoverSearchContext *s_ctx, DiscogsCoverReleaseContext *r_ctx) { delete requests_release_.take(r_ctx->id); - + s_ctx->r_count--; - + //qLog(Debug) << "r_count: " << s_ctx->r_count; - + if (s_ctx->r_count <= 0) EndSearch(s_ctx); } diff --git a/src/covermanager/discogscoverprovider.h b/src/covermanager/discogscoverprovider.h index 54fa561c5..18cbdb5bd 100644 --- a/src/covermanager/discogscoverprovider.h +++ b/src/covermanager/discogscoverprovider.h @@ -69,7 +69,7 @@ class DiscogsCoverProvider : public CoverProvider { explicit DiscogsCoverProvider(QObject *parent = nullptr); bool StartSearch(const QString &artist, const QString &album, int s_id); - + void CancelSearch(int id); private slots: diff --git a/src/covermanager/lastfmcompat.cpp b/src/covermanager/lastfmcompat.cpp index f06d2b84d..9adb9ffef 100644 --- a/src/covermanager/lastfmcompat.cpp +++ b/src/covermanager/lastfmcompat.cpp @@ -47,7 +47,7 @@ bool ParseQuery(const QByteArray &data, XmlQuery *query, bool *connection_proble } bool ParseUserList(QNetworkReply *reply, QList *users) { - + lastfm::XmlQuery lfm; if (!lfm.parse(reply->readAll())) { return false; diff --git a/src/covermanager/lastfmcoverprovider.cpp b/src/covermanager/lastfmcoverprovider.cpp index 7d7bb3d5f..9448b1598 100644 --- a/src/covermanager/lastfmcoverprovider.cpp +++ b/src/covermanager/lastfmcoverprovider.cpp @@ -45,7 +45,7 @@ LastFmCoverProvider::LastFmCoverProvider(QObject *parent) : CoverProvider("last. } bool LastFmCoverProvider::StartSearch(const QString &artist, const QString &album, int id) { - + QMap params; params["method"] = "album.search"; params["album"] = album + " " + artist; diff --git a/src/device/giolister.cpp b/src/device/giolister.cpp index 99b00cdc0..f730d552e 100644 --- a/src/device/giolister.cpp +++ b/src/device/giolister.cpp @@ -213,7 +213,7 @@ QList GioLister::MakeDeviceUrls(const QString &id) { } ret << MakeUrlFromLocalPath(mount_point); - + return ret; } diff --git a/src/device/gpoddevice.cpp b/src/device/gpoddevice.cpp index 487a1e353..50e3710ce 100644 --- a/src/device/gpoddevice.cpp +++ b/src/device/gpoddevice.cpp @@ -222,7 +222,7 @@ bool GPodDevice::RemoveTrackFromITunesDb(const QString &path, const QString &rel itdb_track_remove(track); return true; - + } bool GPodDevice::DeleteFromStorage(const DeleteJob &job) { diff --git a/src/dialogs/about.cpp b/src/dialogs/about.cpp index 02c8fd2cc..43c107335 100644 --- a/src/dialogs/about.cpp +++ b/src/dialogs/about.cpp @@ -71,7 +71,7 @@ About::About(QWidget *parent):QDialog(parent) { << Person("Tyler Rhodes", "tyler.s.rhodes@gmail.com"); QString Title("About Strawberry"); - + QFont title_font; title_font.setBold(true); title_font.setPointSize(title_font.pointSize() + 4); diff --git a/src/dialogs/console.cpp b/src/dialogs/console.cpp index 91ba9044e..b1f0f0931 100644 --- a/src/dialogs/console.cpp +++ b/src/dialogs/console.cpp @@ -40,7 +40,7 @@ #include "core/database.h" Console::Console(Application *app, QWidget *parent) : QDialog(parent), app_(app) { - + ui_.setupUi(this); connect(ui_.run, SIGNAL(clicked()), SLOT(RunQuery())); diff --git a/src/dialogs/edittagdialog.cpp b/src/dialogs/edittagdialog.cpp index 9391d7b5d..6a6047c22 100644 --- a/src/dialogs/edittagdialog.cpp +++ b/src/dialogs/edittagdialog.cpp @@ -230,7 +230,7 @@ EditTagDialog::EditTagDialog(Application *app, QWidget *parent) new TagCompleter(app_->collection_backend(), Playlist::Column_Composer, ui_->composer); new TagCompleter(app_->collection_backend(), Playlist::Column_Performer, ui_->performer); new TagCompleter(app_->collection_backend(), Playlist::Column_Grouping, ui_->grouping); - + } EditTagDialog::~EditTagDialog() { @@ -238,7 +238,7 @@ EditTagDialog::~EditTagDialog() { } bool EditTagDialog::SetLoading(const QString &message) { - + const bool loading = !message.isEmpty(); if (loading == loading_) return false; loading_ = loading; @@ -256,7 +256,7 @@ bool EditTagDialog::SetLoading(const QString &message) { } QList EditTagDialog::LoadData(const SongList &songs) const { - + QList ret; for (const Song &song : songs) { @@ -276,7 +276,7 @@ QList EditTagDialog::LoadData(const SongList &songs) const } void EditTagDialog::SetSongs(const SongList &s, const PlaylistItemList &items) { - + // Show the loading indicator if (!SetLoading(tr("Loading tracks") + "...")) return; @@ -327,7 +327,7 @@ void EditTagDialog::SetSongListVisibility(bool visible) { } QVariant EditTagDialog::Data::value(const Song &song, const QString &id) { - + if (id == "title") return song.title(); if (id == "artist") return song.artist(); if (id == "album") return song.album(); @@ -382,7 +382,7 @@ bool EditTagDialog::IsValueModified(const QModelIndexList &sel, const QString &i } void EditTagDialog::InitFieldValue(const FieldData &field, const QModelIndexList &sel) { - + const bool varies = DoesValueVary(sel, field.id_); // const bool modified = IsValueModified(sel, field.id_); @@ -402,7 +402,7 @@ void EditTagDialog::InitFieldValue(const FieldData &field, const QModelIndexList } void EditTagDialog::UpdateFieldValue(const FieldData &field, const QModelIndexList &sel) { - + // Get the value from the field QVariant value; if (ExtendedEditor *editor = dynamic_cast(field.editor_)) { @@ -436,7 +436,7 @@ void EditTagDialog::UpdateModifiedField(const FieldData &field, const QModelInde } void EditTagDialog::ResetFieldValue(const FieldData &field, const QModelIndexList &sel) { - + // Reset each selected song for (const QModelIndex &i : sel) { Data &data = data_[i.row()]; @@ -449,7 +449,7 @@ void EditTagDialog::ResetFieldValue(const FieldData &field, const QModelIndexLis } void EditTagDialog::SelectionChanged() { - + const QModelIndexList sel = ui_->song_list->selectionModel()->selectedIndexes(); if (sel.isEmpty()) return; @@ -470,7 +470,7 @@ void EditTagDialog::SelectionChanged() { } void EditTagDialog::UpdateUI(const QModelIndexList &sel){ - + ignore_edits_ = true; for (const FieldData &field : fields_) { InitFieldValue(field, sel); @@ -484,7 +484,7 @@ static void SetText(QLabel *label, int value, const QString &suffix, const QStri } static void SetDate(QLabel *label, uint time) { - + if (time == std::numeric_limits::max()) { // -1 label->setText(QObject::tr("Unknown")); } @@ -548,11 +548,11 @@ void EditTagDialog::UpdateSummaryTab(const Song &song) { ui_->filename->setText(song.url().toString()); album_cover_choice_controller_->search_for_cover_action()->setEnabled(app_->cover_providers()->HasAnyProviders()); - + } void EditTagDialog::UpdateStatisticsTab(const Song &song) { - + ui_->playcount->setText(QString::number(qMax(0, song.playcount()))); ui_->skipcount->setText(QString::number(qMax(0, song.skipcount()))); @@ -561,7 +561,7 @@ void EditTagDialog::UpdateStatisticsTab(const Song &song) { } void EditTagDialog::ArtLoaded(quint64 id, const QImage &scaled, const QImage &original) { - + if (id == cover_art_id_) { ui_->art->setPixmap(QPixmap::fromImage(scaled)); original_ = original; @@ -570,7 +570,7 @@ void EditTagDialog::ArtLoaded(quint64 id, const QImage &scaled, const QImage &or } void EditTagDialog::FieldValueEdited() { - + if (ignore_edits_) return; const QModelIndexList sel = ui_->song_list->selectionModel()->selectedIndexes(); @@ -590,7 +590,7 @@ void EditTagDialog::FieldValueEdited() { } void EditTagDialog::ResetField() { - + const QModelIndexList sel = ui_->song_list->selectionModel()->selectedIndexes(); if (sel.isEmpty()) return; @@ -610,7 +610,7 @@ void EditTagDialog::ResetField() { } Song *EditTagDialog::GetFirstSelected() { - + const QModelIndexList sel = ui_->song_list->selectionModel()->selectedIndexes(); if (sel.isEmpty()) return nullptr; return &data_[sel.first().row()].original_; @@ -618,7 +618,7 @@ Song *EditTagDialog::GetFirstSelected() { } void EditTagDialog::LoadCoverFromFile() { - + Song *song = GetFirstSelected(); if (!song) return; @@ -631,7 +631,7 @@ void EditTagDialog::LoadCoverFromFile() { } void EditTagDialog::SaveCoverToFile() { - + Song *song = GetFirstSelected(); if (!song) return; @@ -652,7 +652,7 @@ void EditTagDialog::LoadCoverFromURL() { } void EditTagDialog::SearchForCover() { - + Song *song = GetFirstSelected(); if (!song) return; @@ -664,7 +664,7 @@ void EditTagDialog::SearchForCover() { } void EditTagDialog::UnsetCover() { - + Song *song = GetFirstSelected(); if (!song) return; @@ -675,7 +675,7 @@ void EditTagDialog::UnsetCover() { } void EditTagDialog::ShowCover() { - + Song *song = GetFirstSelected(); if (!song) { return; @@ -685,7 +685,7 @@ void EditTagDialog::ShowCover() { } void EditTagDialog::UpdateCoverOf(const Song &selected, const QModelIndexList &sel, const QString &cover) { - + if (!selected.is_valid() || selected.id() == -1) return; UpdateSummaryTab(selected); @@ -700,11 +700,11 @@ void EditTagDialog::UpdateCoverOf(const Song &selected, const QModelIndexList &s other_song->set_art_manual(cover); } } - + } void EditTagDialog::NextSong() { - + if (ui_->song_list->count() == 0) { return; } @@ -714,7 +714,7 @@ void EditTagDialog::NextSong() { } void EditTagDialog::PreviousSong() { - + if (ui_->song_list->count() == 0) { return; } @@ -730,7 +730,7 @@ void EditTagDialog::ButtonClicked(QAbstractButton *button) { } void EditTagDialog::SaveData(const QList &data) { - + for (int i = 0; i < data.count(); ++i) { const Data &ref = data[i]; if (ref.current_.IsMetadataEqual(ref.original_)) continue; @@ -742,7 +742,7 @@ void EditTagDialog::SaveData(const QList &data) { } void EditTagDialog::accept() { - + // Show the loading indicator if (!SetLoading(tr("Saving tracks") + "...")) return; @@ -752,14 +752,14 @@ void EditTagDialog::accept() { } void EditTagDialog::AcceptFinished() { - + if (!SetLoading(QString())) return; QDialog::accept(); } bool EditTagDialog::eventFilter(QObject *o, QEvent *e) { - + if (o == ui_->art) { switch (e->type()) { case QEvent::MouseButtonRelease: @@ -795,7 +795,7 @@ bool EditTagDialog::eventFilter(QObject *o, QEvent *e) { } void EditTagDialog::showEvent(QShowEvent *e) { - + // Set the dialog's height to the smallest possible resize(width(), sizeHint().height()); @@ -808,7 +808,7 @@ void EditTagDialog::showEvent(QShowEvent *e) { } void EditTagDialog::hideEvent(QHideEvent *e) { - + // Save the current tab QSettings s; s.beginGroup(kSettingsGroup); @@ -818,7 +818,7 @@ void EditTagDialog::hideEvent(QHideEvent *e) { } void EditTagDialog::ResetPlayCounts() { - + const QModelIndexList sel = ui_->song_list->selectionModel()->selectedIndexes(); if (sel.isEmpty()) return; @@ -839,7 +839,7 @@ void EditTagDialog::ResetPlayCounts() { #if defined(HAVE_GSTREAMER) && defined(HAVE_CHROMAPRINT) void EditTagDialog::FetchTag() { - + const QModelIndexList sel = ui_->song_list->selectionModel()->selectedIndexes(); SongList songs; @@ -863,7 +863,7 @@ void EditTagDialog::FetchTag() { } void EditTagDialog::FetchTagSongChosen(const Song &original_song, const Song &new_metadata) { - + const QString filename = original_song.url().toLocalFile(); // Find the song with this filename diff --git a/src/engine/enginebase.h b/src/engine/enginebase.h index 22e7d4ca0..ef7aedc1f 100644 --- a/src/engine/enginebase.h +++ b/src/engine/enginebase.h @@ -79,7 +79,7 @@ public: virtual qint64 position_nanosec() const = 0; virtual qint64 length_nanosec() const = 0; - + virtual const Scope &scope(int chunk_length) { return scope_; } // Sets new values for the beginning and end markers of the currently playing song. @@ -106,7 +106,7 @@ public slots: protected: void EmitAboutToEnd(); - + public: // Simple accessors @@ -200,7 +200,7 @@ protected: private: bool about_to_end_emitted_; Q_DISABLE_COPY(Base); - + }; struct SimpleMetaBundle { diff --git a/src/engine/enginedevice.h b/src/engine/enginedevice.h index a1655b114..3cc5312a1 100644 --- a/src/engine/enginedevice.h +++ b/src/engine/enginedevice.h @@ -37,12 +37,12 @@ class EngineDevice : public QObject { ~EngineDevice(); void Init(); - + QList device_finders_; - + private: QString output_; - + }; #endif // ENGINEDEVICE_H diff --git a/src/engine/enginetype.cpp b/src/engine/enginetype.cpp index 6d60547e9..718a77ba6 100644 --- a/src/engine/enginetype.cpp +++ b/src/engine/enginetype.cpp @@ -45,7 +45,7 @@ QString EngineName(Engine::EngineType enginetype) { default: return QString("None"); } } - + QString EngineDescription(Engine::EngineType enginetype) { switch (enginetype) { case Engine::Xine: return QString("Xine"); @@ -54,7 +54,7 @@ QString EngineDescription(Engine::EngineType enginetype) { case Engine::VLC: return QString("VLC"); case Engine::None: default: return QString("None"); - + } } diff --git a/src/engine/enginetype.h b/src/engine/enginetype.h index f57b3deee..71435eea5 100644 --- a/src/engine/enginetype.h +++ b/src/engine/enginetype.h @@ -26,7 +26,7 @@ #include namespace Engine { - + enum EngineType { None, GStreamer, diff --git a/src/engine/gstengine.cpp b/src/engine/gstengine.cpp index 568010796..a27df2526 100644 --- a/src/engine/gstengine.cpp +++ b/src/engine/gstengine.cpp @@ -127,7 +127,7 @@ GstEngine::~GstEngine() { } bool GstEngine::Init() { - + SetEnvironment(); initialising_ = QtConcurrent::run(this, &GstEngine::InitialiseGStreamer); diff --git a/src/engine/gstenginepipeline.cpp b/src/engine/gstenginepipeline.cpp index 42e7c0811..cfdcd3fb1 100644 --- a/src/engine/gstenginepipeline.cpp +++ b/src/engine/gstenginepipeline.cpp @@ -398,7 +398,7 @@ bool GstEnginePipeline::InitFromUrl(const QByteArray &media_url, const QUrl orig } GstEnginePipeline::~GstEnginePipeline() { - + if (pipeline_) { gst_bus_set_sync_handler(gst_pipeline_get_bus(GST_PIPELINE(pipeline_)), nullptr, nullptr, nullptr); g_source_remove(bus_cb_id_); @@ -517,7 +517,7 @@ void GstEnginePipeline::StreamStartMessageReceived() { } void GstEnginePipeline::TaskEnterCallback(GstTask *, GThread *, gpointer) { - + // Bump the priority of the thread only on OS X #ifdef Q_OS_MACOS @@ -527,7 +527,7 @@ void GstEnginePipeline::TaskEnterCallback(GstTask *, GThread *, gpointer) { param.sched_priority = 99; pthread_setschedparam(pthread_self(), SCHED_RR, ¶m); #endif - + } void GstEnginePipeline::ElementMessageReceived(GstMessage *msg) { @@ -834,7 +834,7 @@ GstPadProbeReturn GstEnginePipeline::EventHandoffCallback(GstPad*, GstPadProbeIn void GstEnginePipeline::AboutToFinishCallback(GstPlayBin *bin, gpointer self) { GstEnginePipeline* instance = reinterpret_cast(self); - + if (instance->has_next_valid_url() && !instance->next_uri_set_) { // Set the next uri. When the current song ends it will be played automatically and a STREAM_START message is send to the bus. // When the next uri is not playable an error message is send when the pipeline goes to PLAY (or PAUSE) state or immediately if it is currently in PLAY state. @@ -911,7 +911,7 @@ QFuture GstEnginePipeline::SetState(GstState state) { } bool GstEnginePipeline::Seek(qint64 nanosec) { - + if (ignore_next_seek_) { ignore_next_seek_ = false; return true; @@ -937,14 +937,14 @@ bool GstEnginePipeline::Seek(qint64 nanosec) { } void GstEnginePipeline::SetEqualizerEnabled(bool enabled) { - + eq_enabled_ = enabled; UpdateEqualizer(); } void GstEnginePipeline::SetEqualizerParams(int preamp, const QList& band_gains) { - + eq_preamp_ = preamp; eq_band_gains_ = band_gains; UpdateEqualizer(); @@ -952,14 +952,14 @@ void GstEnginePipeline::SetEqualizerParams(int preamp, const QList& band_ga } void GstEnginePipeline::SetStereoBalance(float value) { - + stereo_balance_ = value; UpdateStereoBalance(); } void GstEnginePipeline::UpdateEqualizer() { - + if (!equalizer_ || !equalizer_preamp_) return; // Update band gains diff --git a/src/engine/gstenginepipeline.h b/src/engine/gstenginepipeline.h index dbbd124fb..d07737996 100644 --- a/src/engine/gstenginepipeline.h +++ b/src/engine/gstenginepipeline.h @@ -208,7 +208,7 @@ signals: bool buffering_; bool mono_playback_; - + // These get called when there is a new audio buffer available QList buffer_consumers_; QMutex buffer_consumers_mutex_; diff --git a/src/engine/phononengine.h b/src/engine/phononengine.h index 233bfeb87..96d508e72 100644 --- a/src/engine/phononengine.h +++ b/src/engine/phononengine.h @@ -43,7 +43,7 @@ class PhononEngine : public Engine::Base { ~PhononEngine(); bool Init(); - + OutputDetailsList GetOutputsList() const; bool CanDecode(const QUrl &url); @@ -62,7 +62,7 @@ class PhononEngine : public Engine::Base { qint64 position_nanosec() const; qint64 length_nanosec() const; - + QString DefaultOutput() { return ""; } bool ValidOutput(const QString &output); bool CustomDeviceSupport(const QString &output); diff --git a/src/engine/vlcengine.cpp b/src/engine/vlcengine.cpp index c590ea38b..6e3e88906 100644 --- a/src/engine/vlcengine.cpp +++ b/src/engine/vlcengine.cpp @@ -49,7 +49,7 @@ VLCEngine::VLCEngine(TaskManager *task_manager) } VLCEngine::~VLCEngine() { - + libvlc_media_player_stop(player_); libvlc_media_player_release(player_); libvlc_release(instance_); @@ -275,7 +275,7 @@ uint VLCEngine::length() const { } bool VLCEngine::CanDecode(const QUrl &url) { - + // TODO return true; } @@ -291,7 +291,7 @@ void VLCEngine::AttachCallback(libvlc_event_manager_t *em, libvlc_event_type_t t } void VLCEngine::StateChangedCallback(const libvlc_event_t *e, void *data) { - + VLCEngine *engine = reinterpret_cast(data); switch (e->type) { diff --git a/src/engine/xineengine.h b/src/engine/xineengine.h index 6ff3fc5bf..eb9e6dfbe 100644 --- a/src/engine/xineengine.h +++ b/src/engine/xineengine.h @@ -138,10 +138,10 @@ class XineEngine : public Engine::Base { void Cleanup(); bool EnsureStream(); void SetDevice(); - + uint length() const; uint position() const; - + bool MetaDataForUrl(const QUrl &url, Engine::SimpleMetaBundle &b); bool GetAudioCDContents(const QString &device, QList &urls); bool FlushBuffer(); diff --git a/src/globalshortcuts/globalshortcutgrabber.mm b/src/globalshortcuts/globalshortcutgrabber.mm index 290f13dc9..0c2635ee1 100644 --- a/src/globalshortcuts/globalshortcutgrabber.mm +++ b/src/globalshortcuts/globalshortcutgrabber.mm @@ -17,7 +17,7 @@ * along with Strawberry. If not, see . * */ - + #include "config.h" #include "globalshortcutgrabber.h" diff --git a/src/globalshortcuts/macglobalshortcutbackend.mm b/src/globalshortcuts/macglobalshortcutbackend.mm index 4f9b9b123..481f45cda 100644 --- a/src/globalshortcuts/macglobalshortcutbackend.mm +++ b/src/globalshortcuts/macglobalshortcutbackend.mm @@ -17,7 +17,7 @@ * along with Strawberry. If not, see . * */ - + #include "config.h" #include "macglobalshortcutbackend.h" diff --git a/src/lyrics/auddlyricsprovider.cpp b/src/lyrics/auddlyricsprovider.cpp index ebe281e06..238b3b916 100644 --- a/src/lyrics/auddlyricsprovider.cpp +++ b/src/lyrics/auddlyricsprovider.cpp @@ -89,7 +89,7 @@ void AuddLyricsProvider::CancelSearch(quint64 id) { } void AuddLyricsProvider::HandleSearchReply(QNetworkReply *reply, quint64 id, const QString artist, const QString title) { - + reply->deleteLater(); QJsonArray json_result = ExtractResult(reply, id); diff --git a/src/lyrics/auddlyricsprovider.h b/src/lyrics/auddlyricsprovider.h index 9ee82ab38..1405cf12b 100644 --- a/src/lyrics/auddlyricsprovider.h +++ b/src/lyrics/auddlyricsprovider.h @@ -52,7 +52,7 @@ class AuddLyricsProvider : public LyricsProvider { static const int kMaxLength; QNetworkAccessManager *network_; void Error(quint64 id, QString error, QVariant debug = QVariant()); - + QJsonObject ExtractJsonObj(QNetworkReply *reply, quint64 id); QJsonArray ExtractResult(QNetworkReply *reply, quint64 id); diff --git a/src/lyrics/lyricsfetcher.h b/src/lyrics/lyricsfetcher.h index 7db0365ad..ef8627c71 100644 --- a/src/lyrics/lyricsfetcher.h +++ b/src/lyrics/lyricsfetcher.h @@ -89,7 +89,7 @@ signals: QHash active_requests_; QTimer *request_starter_; - + }; #endif // LYRICSFETCHER_H diff --git a/src/lyrics/lyricsfetchersearch.h b/src/lyrics/lyricsfetchersearch.h index 4c0b1db30..a1cd3c96a 100644 --- a/src/lyrics/lyricsfetchersearch.h +++ b/src/lyrics/lyricsfetchersearch.h @@ -63,7 +63,7 @@ class LyricsFetcherSearch : public QObject { LyricsSearchResults results_; QMap pending_requests_; bool cancel_requested_; - + }; #endif // LYRICSFETCHERSEARCH_H diff --git a/src/playlist/playlist.cpp b/src/playlist/playlist.cpp index 529f7e2a8..542f70fb2 100644 --- a/src/playlist/playlist.cpp +++ b/src/playlist/playlist.cpp @@ -150,7 +150,7 @@ Playlist::Playlist(PlaylistBackend *backend, TaskManager *task_manager, Collecti connect(queue_, SIGNAL(layoutChanged()), SLOT(QueueLayoutChanged())); column_alignments_ = PlaylistView::DefaultColumnAlignment(); - + } Playlist::~Playlist() { @@ -466,7 +466,7 @@ int Playlist::NextVirtualIndex(int i, bool ignore_repeat_track) const { } int Playlist::PreviousVirtualIndex(int i, bool ignore_repeat_track) const { - + PlaylistSequence::RepeatMode repeat_mode = playlist_sequence_->repeat_mode(); PlaylistSequence::ShuffleMode shuffle_mode = playlist_sequence_->shuffle_mode(); bool album_only = repeat_mode == PlaylistSequence::Repeat_Album || shuffle_mode == PlaylistSequence::Shuffle_InsideAlbum; @@ -504,7 +504,7 @@ int Playlist::PreviousVirtualIndex(int i, bool ignore_repeat_track) const { } int Playlist::next_row(bool ignore_repeat_track) const { - + // Any queued items take priority if (!queue_->is_empty()) { return queue_->PeekNext(); @@ -532,7 +532,7 @@ int Playlist::next_row(bool ignore_repeat_track) const { if (next_virtual_index < 0 || next_virtual_index >= virtual_items_.count()) return -1; return virtual_items_[next_virtual_index]; - + } int Playlist::previous_row(bool ignore_repeat_track) const { @@ -559,11 +559,11 @@ int Playlist::previous_row(bool ignore_repeat_track) const { if (prev_virtual_index < 0) return -1; return virtual_items_[prev_virtual_index]; - + } void Playlist::set_current_row(int i, bool is_stopping) { - + QModelIndex old_current_item_index = current_item_index_; ClearStreamMetadata(); @@ -620,7 +620,7 @@ Qt::ItemFlags Playlist::flags(const QModelIndex &index) const { if (index.isValid()) return flags | Qt::ItemIsDragEnabled; return Qt::ItemIsDropEnabled; - + } QStringList Playlist::mimeTypes() const { @@ -640,7 +640,7 @@ bool Playlist::dropMimeData(const QMimeData *data, Qt::DropAction action, int ro bool play_now = false; bool enqueue_now = false; bool enqueue_next_now = false; - + if (const MimeData *mime_data = qobject_cast(data)) { if (mime_data->clear_first_) { Clear(); @@ -727,12 +727,12 @@ bool Playlist::dropMimeData(const QMimeData *data, Qt::DropAction action, int ro } void Playlist::InsertUrls(const QList &urls, int pos, bool play_now, bool enqueue, bool enqueue_next) { - + SongLoaderInserter *inserter = new SongLoaderInserter(task_manager_, collection_, backend_->app()->player()); connect(inserter, SIGNAL(Error(QString)), SIGNAL(Error(QString))); inserter->Load(this, pos, play_now, enqueue, urls); - + } void Playlist::MoveItemWithoutUndo(int source, int dest) { @@ -740,7 +740,7 @@ void Playlist::MoveItemWithoutUndo(int source, int dest) { } void Playlist::MoveItemsWithoutUndo(const QList &source_rows, int pos) { - + layoutAboutToBeChanged(); PlaylistItemList moved_items; @@ -836,11 +836,11 @@ void Playlist::MoveItemsWithoutUndo(int start, const QList &dest_rows) { layoutChanged(); Save(); - + } void Playlist::InsertItems(const PlaylistItemList &itemsIn, int pos, bool play_now, bool enqueue, bool enqueue_next) { - + if (itemsIn.isEmpty()) return; @@ -895,7 +895,7 @@ void Playlist::InsertItems(const PlaylistItemList &itemsIn, int pos, bool play_n } if (play_now) emit PlayRequested(index(start, 0)); - + } void Playlist::InsertItemsWithoutUndo(const PlaylistItemList &items, int pos, bool enqueue) { @@ -936,7 +936,7 @@ void Playlist::InsertItemsWithoutUndo(const PlaylistItemList &items, int pos, bo Save(); ReshuffleIndices(); - + } void Playlist::InsertCollectionItems(const SongList &songs, int pos, bool play_now, bool enqueue, bool enqueue_next) { @@ -1030,7 +1030,7 @@ void Playlist::UpdateItems(const SongList &songs) { } QMimeData *Playlist::mimeData(const QModelIndexList &indexes) const { - + if (indexes.isEmpty()) return nullptr; // We only want one index per row, but we can't just take column 0 because the user might have hidden it. @@ -1169,9 +1169,9 @@ QString Playlist::column_name(Column column) { } QString Playlist::abbreviated_column_name(Column column) { - + const QString &column_name = Playlist::column_name(column); - + switch (column) { case Column_Disc: case Column_PlayCount: @@ -1186,7 +1186,7 @@ QString Playlist::abbreviated_column_name(Column column) { } void Playlist::sort(int column, Qt::SortOrder order) { - + if (ignore_sorting_) return; PlaylistItemList new_items(items_); @@ -1244,7 +1244,7 @@ void Playlist::Paused() { SetCurrentIsPaused(true); } void Playlist::Stopped() { SetCurrentIsPaused(false); } void Playlist::SetCurrentIsPaused(bool paused) { - + if (paused == current_is_paused_) return; current_is_paused_ = paused; @@ -1265,7 +1265,7 @@ void Playlist::Save() const { //} void Playlist::Restore() { - + if (!backend_) return; items_.clear(); @@ -1476,7 +1476,7 @@ void Playlist::SetStreamMetadata(const QUrl &url, const Song &song) { } void Playlist::ClearStreamMetadata() { - + if (!current_item()) return; current_item()->ClearTemporaryMetadata(); @@ -1532,7 +1532,7 @@ void Playlist::Clear() { } Save(); - + } void Playlist::RemoveItemsNotInQueue() { @@ -1562,10 +1562,11 @@ void Playlist::RemoveItemsNotInQueue() { RemoveItemsWithoutUndo(start, count); start++; } + } void Playlist::ReloadItems(const QList &rows) { - + for (int row : rows) { PlaylistItemPtr item = item_at(row); @@ -1580,6 +1581,7 @@ void Playlist::ReloadItems(const QList &rows) { } Save(); + } void Playlist::AddSongInsertVetoListener(SongInsertVetoListener *listener) { @@ -1597,7 +1599,7 @@ void Playlist::SongInsertVetoListenerDestroyed() { } void Playlist::Shuffle() { - + PlaylistItemList new_items(items_); int begin = 0; @@ -1610,22 +1612,23 @@ void Playlist::Shuffle() { } undo_stack_->push(new PlaylistUndoCommands::ShuffleItems(this, new_items)); + } namespace { bool AlbumShuffleComparator(const QMap &album_key_positions, const QMap &album_keys, int left, int right) { - + const int left_pos = album_key_positions[album_keys[left]]; const int right_pos = album_key_positions[album_keys[right]]; if (left_pos == right_pos) return left < right; return left_pos < right_pos; - + } } void Playlist::ReshuffleIndices() { - + if (!playlist_sequence_) { return; } @@ -1833,7 +1836,7 @@ struct SongSimilarEqual { }; void Playlist::RemoveDuplicateSongs() { - + QList rows_to_remove; unordered_map unique_songs; @@ -1864,11 +1867,11 @@ void Playlist::RemoveDuplicateSongs() { } removeRows(rows_to_remove); - + } void Playlist::RemoveUnavailableSongs() { - + QList rows_to_remove; for (int row = 0; row < items_.count(); ++row) { PlaylistItemPtr item = items_[row]; @@ -1881,11 +1884,11 @@ void Playlist::RemoveUnavailableSongs() { } removeRows(rows_to_remove); - + } bool Playlist::ApplyValidityOnCurrentSong(const QUrl &url, bool valid) { - + PlaylistItemPtr current = current_item(); if (current) { @@ -1917,12 +1920,12 @@ void Playlist::SetColumnAlignment(const ColumnAlignmentMap &alignment) { } void Playlist::SkipTracks(const QModelIndexList &source_indexes) { - + for (const QModelIndex &source_index : source_indexes) { PlaylistItemPtr track_to_skip = item_at(source_index.row()); track_to_skip->SetShouldSkip(!((track_to_skip)->GetShouldSkip())); emit dataChanged(source_index, source_index); } - + } diff --git a/src/playlist/playlistbackend.cpp b/src/playlist/playlistbackend.cpp index fa6429ada..39ec1654b 100644 --- a/src/playlist/playlistbackend.cpp +++ b/src/playlist/playlistbackend.cpp @@ -71,7 +71,7 @@ PlaylistBackend::PlaylistList PlaylistBackend::GetAllFavoritePlaylists() { } PlaylistBackend::PlaylistList PlaylistBackend::GetPlaylists(GetPlaylistsFlags flags) { - + QMutexLocker l(db_->Mutex()); QSqlDatabase db(db_->Connect()); @@ -210,15 +210,15 @@ PlaylistItemPtr PlaylistBackend::NewPlaylistItemFromQuery(const SqlRow &row, std } Song PlaylistBackend::NewSongFromQuery(const SqlRow &row, std::shared_ptr state) { - + return NewPlaylistItemFromQuery(row, state)->Metadata(); - + } // If song had a CUE and the CUE still exists, the metadata from it will be applied here. PlaylistItemPtr PlaylistBackend::RestoreCueData(PlaylistItemPtr item, std::shared_ptr state) { - + // We need collection to run a CueParser; also, this method applies only to file-type PlaylistItems if (item->source() != Song::Source_LocalFile) return item; @@ -310,7 +310,7 @@ void PlaylistBackend::SavePlaylist(int playlist, const PlaylistItemList &items, } int PlaylistBackend::CreatePlaylist(const QString &name, const QString &special_type) { - + QMutexLocker l(db_->Mutex()); QSqlDatabase db(db_->Connect()); @@ -326,7 +326,7 @@ int PlaylistBackend::CreatePlaylist(const QString &name, const QString &special_ } void PlaylistBackend::RemovePlaylist(int id) { - + QMutexLocker l(db_->Mutex()); QSqlDatabase db(db_->Connect()); QSqlQuery delete_playlist(db); @@ -350,7 +350,7 @@ void PlaylistBackend::RemovePlaylist(int id) { } void PlaylistBackend::RenamePlaylist(int id, const QString &new_name) { - + QMutexLocker l(db_->Mutex()); QSqlDatabase db(db_->Connect()); QSqlQuery q(db); @@ -378,7 +378,7 @@ void PlaylistBackend::FavoritePlaylist(int id, bool is_favorite) { } void PlaylistBackend::SetPlaylistOrder(const QList &ids) { - + QMutexLocker l(db_->Mutex()); QSqlDatabase db(db_->Connect()); ScopedTransaction transaction(&db); diff --git a/src/playlist/playlistcontainer.cpp b/src/playlist/playlistcontainer.cpp index c6e394603..6eccb7ed1 100644 --- a/src/playlist/playlistcontainer.cpp +++ b/src/playlist/playlistcontainer.cpp @@ -287,7 +287,7 @@ void PlaylistContainer::PlaylistRenamed(int id, const QString &new_name) { void PlaylistContainer::NewPlaylist() { manager_->New(tr("Playlist")); } void PlaylistContainer::LoadPlaylist() { - + QString filename = settings_.value("last_load_playlist").toString(); filename = QFileDialog::getOpenFileName(this, tr("Load playlist"), filename, manager_->parser()->filters()); @@ -323,7 +323,7 @@ void PlaylistContainer::GoToPreviousPlaylistTab() { } void PlaylistContainer::Save() { - + if (starting_up_) return; settings_.setValue("current_playlist", ui_->tab_bar->current_id()); diff --git a/src/playlist/playlistlistmodel.cpp b/src/playlist/playlistlistmodel.cpp index 147d7850e..2e98d6833 100644 --- a/src/playlist/playlistlistmodel.cpp +++ b/src/playlist/playlistlistmodel.cpp @@ -33,11 +33,11 @@ #include "playlistlistmodel.h" PlaylistListModel::PlaylistListModel(QObject *parent) : QStandardItemModel(parent), dropping_rows_(false) { - + connect(this, SIGNAL(dataChanged(QModelIndex, QModelIndex)), SLOT(RowsChanged(QModelIndex, QModelIndex))); connect(this, SIGNAL(rowsAboutToBeRemoved(QModelIndex, int, int)), SLOT(RowsAboutToBeRemoved(QModelIndex, int, int))); connect(this, SIGNAL(rowsInserted(QModelIndex, int, int)), SLOT(RowsInserted(QModelIndex, int, int))); - + } void PlaylistListModel::SetIcons(const QIcon &playlist_icon, const QIcon &folder_icon) { diff --git a/src/playlist/playlistmanager.cpp b/src/playlist/playlistmanager.cpp index bdff988d6..7db6ad707 100644 --- a/src/playlist/playlistmanager.cpp +++ b/src/playlist/playlistmanager.cpp @@ -149,7 +149,7 @@ Playlist *PlaylistManager::AddPlaylist(int id, const QString &name, const QStrin } void PlaylistManager::New(const QString &name, const SongList &songs, const QString &special_type) { - + if (name.isNull()) return; int id = playlist_backend_->CreatePlaylist(name, special_type); @@ -169,7 +169,7 @@ void PlaylistManager::New(const QString &name, const SongList &songs, const QStr } void PlaylistManager::Load(const QString &filename) { - + QFileInfo info(filename); int id = playlist_backend_->CreatePlaylist(info.baseName(), QString()); diff --git a/src/playlist/playlistundocommands.h b/src/playlist/playlistundocommands.h index 9c046eb78..d925999a5 100644 --- a/src/playlist/playlistundocommands.h +++ b/src/playlist/playlistundocommands.h @@ -119,7 +119,7 @@ namespace PlaylistUndoCommands { //int column_; //Qt::SortOrder order_; }; - + class ShuffleItems : public ReOrderItems { public: ShuffleItems(Playlist *playlist, const PlaylistItemList &new_items); diff --git a/src/playlist/playlistview.cpp b/src/playlist/playlistview.cpp index 5fe5cec2f..6efd38bea 100644 --- a/src/playlist/playlistview.cpp +++ b/src/playlist/playlistview.cpp @@ -683,16 +683,16 @@ void PlaylistView::mouseMoveEvent(QMouseEvent *event) { void PlaylistView::leaveEvent(QEvent *e) { QTreeView::leaveEvent(e); - + } void PlaylistView::mousePressEvent(QMouseEvent *event) { - + if (editTriggers() & QAbstractItemView::NoEditTriggers) { QTreeView::mousePressEvent(event); return; } - + QTreeView::mousePressEvent(event); inhibit_autoscroll_ = true; @@ -701,7 +701,7 @@ void PlaylistView::mousePressEvent(QMouseEvent *event) { } void PlaylistView::scrollContentsBy(int dx, int dy) { - + if (dx) { InvalidateCachedCurrentPixmap(); } @@ -987,7 +987,7 @@ void PlaylistView::ReloadSettings() { // We change properties only if they have actually changed, to avoid to call set_background_image when it is not needed, // as this will cause the fading animation to start again. // This also avoid to do useless "force_background_redraw". - + if (!background_initialized_ || background_image_filename != background_image_filename_ || background_type != background_image_type_ || blur_radius_ != blur_radius || opacity_level_ != opacity_level) { background_initialized_ = true; // Store background properties @@ -1019,7 +1019,7 @@ void PlaylistView::ReloadSettings() { setEditTriggers(editTriggers() & ~QAbstractItemView::SelectedClicked); else setEditTriggers(editTriggers() | QAbstractItemView::SelectedClicked); - + s.endGroup(); } @@ -1037,11 +1037,11 @@ void PlaylistView::SaveSettings() { s.beginGroup(AppearanceSettingsPage::kSettingsGroup); s.setValue(kSettingBackgroundImageType, background_image_type_); s.endGroup(); - + s.beginGroup(Playlist::kSettingsGroup); s.setValue("column_alignments", QVariant::fromValue(column_alignment_)); s.endGroup(); - + } void PlaylistView::StretchChanged(bool stretch) { @@ -1152,7 +1152,7 @@ void PlaylistView::CurrentSongChanged(const Song &song, const QString &uri, cons } void PlaylistView::set_background_image(const QImage &image) { - + // Save previous image, for fading previous_background_image_ = cached_scaled_background_image_; diff --git a/src/playlistparsers/cueparser.cpp b/src/playlistparsers/cueparser.cpp index b4394e51b..f77488f06 100644 --- a/src/playlistparsers/cueparser.cpp +++ b/src/playlistparsers/cueparser.cpp @@ -135,7 +135,7 @@ SongList CueParser::Load(QIODevice *device, const QString &playlist_path, const // REM DATE } else if (line_value.toLower() == kDate) { date = splitted[2]; - + // REM DISC } else if (line_value.toLower() == kDisc) { disc = splitted[2]; @@ -303,7 +303,7 @@ bool CueParser::UpdateSong(const CueEntry &entry, const QString &next_index, Son song->set_genre(entry.genre); song->set_year(entry.date.toInt()); song->set_disc(entry.disc.toInt()); - + return true; } @@ -329,7 +329,7 @@ bool CueParser::UpdateLastSong(const CueEntry &entry, Song *song) const { song->set_year(entry.date.toInt()); song->set_composer(entry.PrettyComposer()); song->set_disc(entry.disc.toInt()); - + // We don't do anything with the end here because it's already set to the end of the media file (if it exists) song->set_beginning_nanosec(beginning); diff --git a/src/playlistparsers/cueparser.h b/src/playlistparsers/cueparser.h index 9b1b52a8e..59946f6fc 100644 --- a/src/playlistparsers/cueparser.h +++ b/src/playlistparsers/cueparser.h @@ -59,7 +59,7 @@ class CueParser : public ParserBase { static const char *kGenre; static const char *kDate; static const char *kDisc; - + CueParser(CollectionBackendInterface *library, QObject *parent = nullptr); QString name() const { return "CUE"; } diff --git a/src/settings/backendsettingspage.h b/src/settings/backendsettingspage.h index 09b07fb58..d50b83598 100644 --- a/src/settings/backendsettingspage.h +++ b/src/settings/backendsettingspage.h @@ -47,7 +47,7 @@ class BackendSettingsPage : public SettingsPage { public: BackendSettingsPage(SettingsDialog *dialog); ~BackendSettingsPage(); - + static const char *kSettingsGroup; void Load(); diff --git a/src/settings/behavioursettingspage.cpp b/src/settings/behavioursettingspage.cpp index 5e987ad2f..2bf75b4c2 100644 --- a/src/settings/behavioursettingspage.cpp +++ b/src/settings/behavioursettingspage.cpp @@ -101,7 +101,7 @@ void BehaviourSettingsPage::Load() { } void BehaviourSettingsPage::Save() { - + QSettings s; MainWindow::StartupBehaviour behaviour = MainWindow::Startup_Remember; @@ -120,7 +120,7 @@ void BehaviourSettingsPage::Save() { } void BehaviourSettingsPage::ShowTrayIconToggled(bool on) { - + ui_->radiobutton_alwayshide->setEnabled(on); if (!on && ui_->radiobutton_alwayshide->isChecked()) ui_->radiobutton_remember->setChecked(true); ui_->checkbox_keeprunning->setEnabled(on); diff --git a/src/settings/playlistsettingspage.cpp b/src/settings/playlistsettingspage.cpp index a76b03259..82a00b00c 100644 --- a/src/settings/playlistsettingspage.cpp +++ b/src/settings/playlistsettingspage.cpp @@ -40,7 +40,7 @@ class SettingsDialog; const char *PlaylistSettingsPage::kSettingsGroup = "Playlist"; PlaylistSettingsPage::PlaylistSettingsPage(SettingsDialog* dialog) : SettingsPage(dialog), ui_(new Ui_PlaylistSettingsPage) { - + ui_->setupUi(this); setWindowIcon(IconLoader::Load("document-new")); @@ -91,13 +91,13 @@ void PlaylistSettingsPage::Load() { ui_->checkbox_warncloseplaylist->setChecked(s.value("warn_close_playlist", true).toBool()); ui_->checkbox_editmetadatainline->setChecked(s.value("editmetadatainline", false).toBool()); ui_->checkbox_writemetadata->setChecked(s.value(Playlist::kWriteMetadata, false).toBool()); - + s.endGroup(); - + } void PlaylistSettingsPage::Save() { - + QSettings s; MainWindow::AddBehaviour doubleclick_addmode = MainWindow::AddBehaviour(ui_->combobox_doubleclickaddmode->itemData(ui_->combobox_doubleclickaddmode->currentIndex()).toInt()); diff --git a/src/settings/shortcutssettingspage.cpp b/src/settings/shortcutssettingspage.cpp index 6ba6564af..ded21cb7c 100644 --- a/src/settings/shortcutssettingspage.cpp +++ b/src/settings/shortcutssettingspage.cpp @@ -178,7 +178,7 @@ void GlobalShortcutsSettingsPage::DefaultClicked() { } void GlobalShortcutsSettingsPage::ChangeClicked() { - + GlobalShortcuts *manager = dialog()->global_shortcuts_manager(); manager->Unregister(); QKeySequence key = grabber_->GetKey(shortcuts_[current_id_].s.action->text()); @@ -197,7 +197,7 @@ void GlobalShortcutsSettingsPage::ChangeClicked() { } void GlobalShortcutsSettingsPage::OpenGnomeKeybindingProperties() { - + if (!QProcess::startDetached("gnome-keybinding-properties")) { if (!QProcess::startDetached("gnome-control-center", QStringList() << "keyboard")) { QMessageBox::warning(this, "Error", diff --git a/src/tidal/tidalsearch.h b/src/tidal/tidalsearch.h index fa211e614..8d2b05cf9 100644 --- a/src/tidal/tidalsearch.h +++ b/src/tidal/tidalsearch.h @@ -52,7 +52,7 @@ class TidalSearch : public QObject { QString pixmap_cache_key_; }; typedef QList ResultList; - + static const int kDelayedSearchTimeoutMs; static const int kMaxResultsPerEmission; @@ -81,7 +81,7 @@ class TidalSearch : public QObject { void ArtLoaded(int id, const QPixmap &pixmap); void ArtLoaded(int id, const QImage &image); - + protected: struct PendingState { diff --git a/src/tidal/tidalsearchview.h b/src/tidal/tidalsearchview.h index ce88b5f96..2341e35de 100644 --- a/src/tidal/tidalsearchview.h +++ b/src/tidal/tidalsearchview.h @@ -133,7 +133,7 @@ signals: QIcon search_icon_; QIcon warning_icon_; - + TidalSettingsPage::SearchBy searchby_; bool error_; diff --git a/src/tidal/tidalurlhandler.h b/src/tidal/tidalurlhandler.h index 811980442..a7c771e9d 100644 --- a/src/tidal/tidalurlhandler.h +++ b/src/tidal/tidalurlhandler.h @@ -41,7 +41,7 @@ class TidalUrlHandler : public UrlHandler { LoadResult StartLoading(const QUrl &url); void CancelTask(); - + private slots: void GetStreamURLFinished(QUrl url, Song::FileType filetype); diff --git a/src/widgets/linetextedit.cpp b/src/widgets/linetextedit.cpp index 3d073b879..57d993b76 100644 --- a/src/widgets/linetextedit.cpp +++ b/src/widgets/linetextedit.cpp @@ -2,17 +2,17 @@ Strawberry Music Player This file was part of Clementine. Copyright 2010, David Sansome - + Strawberry is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + Strawberry is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with Strawberry. If not, see . diff --git a/src/widgets/linetextedit.h b/src/widgets/linetextedit.h index b047ce27b..94529d550 100644 --- a/src/widgets/linetextedit.h +++ b/src/widgets/linetextedit.h @@ -2,17 +2,17 @@ Strawberry Music Player This file was part of Clementine. Copyright 2010, David Sansome - + Strawberry is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + Strawberry is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with Strawberry. If not, see . diff --git a/src/widgets/playingwidget.cpp b/src/widgets/playingwidget.cpp index 3ff9d7419..87636ff15 100644 --- a/src/widgets/playingwidget.cpp +++ b/src/widgets/playingwidget.cpp @@ -228,11 +228,11 @@ void PlayingWidget::SetMode(int mode) { s.beginGroup(kSettingsGroup); s.setValue("mode", mode_); s.endGroup(); - + } void PlayingWidget::FitCoverWidth(bool fit) { - + fit_width_ = fit; UpdateHeight(); update(); @@ -335,7 +335,7 @@ void PlayingWidget::SetHeight(int height) { timeline_show_hide_->toggleDirection(); } } - + } void PlayingWidget::UpdateHeight() { @@ -439,7 +439,7 @@ void PlayingWidget::DrawContents(QPainter *p) { break; } - + } void PlayingWidget::FadePreviousTrack(qreal value) { @@ -456,7 +456,7 @@ void PlayingWidget::FadePreviousTrack(qreal value) { } void PlayingWidget::resizeEvent(QResizeEvent* e) { - + //if (visible_ && e->oldSize() != e->size()) { if (e->oldSize() != e->size()) { if (mode_ == LargeSongDetails) { @@ -464,7 +464,7 @@ void PlayingWidget::resizeEvent(QResizeEvent* e) { UpdateDetailsText(); } } - + } void PlayingWidget::contextMenuEvent(QContextMenuEvent* e) { diff --git a/src/widgets/sliderwidget.cpp b/src/widgets/sliderwidget.cpp index 4db58f4d1..bdc7eeb13 100644 --- a/src/widgets/sliderwidget.cpp +++ b/src/widgets/sliderwidget.cpp @@ -353,7 +353,7 @@ QPixmap Amarok::VolumeSlider::drawVolumePixmap () const { QPainter painter(&pixmap); QPen pen(palette().color(QPalette::WindowText), 0.3, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin); painter.setPen(pen); - + painter.setRenderHint(QPainter::Antialiasing); painter.setRenderHint(QPainter::SmoothPixmapTransform); // Draw volume control pixmap @@ -375,7 +375,7 @@ void Amarok::VolumeSlider::drawVolumeSliderHandle() { QImage pixmapHandleGlow_image(pixmapHandleGlow.size(), QImage::Format_ARGB32_Premultiplied); QPainter painter(&pixmapHandleGlow_image); - + painter.setRenderHint(QPainter::Antialiasing); painter.setRenderHint(QPainter::SmoothPixmapTransform); @@ -383,7 +383,7 @@ void Amarok::VolumeSlider::drawVolumeSliderHandle() { painter.fillRect(pixmapHandleGlow_image.rect(), QBrush(palette().color(QPalette::Highlight))); painter.setCompositionMode(QPainter::CompositionMode_DestinationIn); painter.drawImage(0, 0, pixmapHandleGlow); - + // Overlay the volume slider handle image painter.setCompositionMode(QPainter::CompositionMode_SourceAtop); painter.drawImage(0, 0, pixmapHandle);