Remove whitespaces

This commit is contained in:
Jonas Kvinge 2018-10-02 00:38:52 +02:00
parent 2883ef840e
commit db035351be
88 changed files with 414 additions and 411 deletions

View File

@ -72,5 +72,5 @@ Optional:
sudo make install sudo make install
(dont change to the source directory, if you created the build directory inside the source directory type: cmake .. instead). (dont change to the source directory, if you created the build directory inside the source directory type: cmake .. instead).

View File

@ -57,7 +57,7 @@ CREATE TABLE device_%deviceid_songs (
effective_albumartist TEXT, effective_albumartist TEXT,
effective_originalyear INTEGER NOT NULL DEFAULT 0, effective_originalyear INTEGER NOT NULL DEFAULT 0,
cue_path TEXT cue_path TEXT
); );

2
dist/debian/rules vendored
View File

@ -35,7 +35,7 @@ install: build
dh_testroot dh_testroot
dh_prep dh_prep
dh_installdirs dh_installdirs
make install make install
binary-indep: install binary-indep: install

View File

@ -19,7 +19,7 @@ do
echo "ERROR: Cannot dermine geometry for image: \"$i\"." echo "ERROR: Cannot dermine geometry for image: \"$i\"."
continue continue
fi fi
# Geometry can be 563x144+0+0 or 75x98 # Geometry can be 563x144+0+0 or 75x98
# we need to get rid of the plus (+) and the x characters: # 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 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\"." echo "ERROR: Cannot dermine height for image: \"$x\"."
continue continue
fi fi
for x in $sizes for x in $sizes
do do
dest="$x/$file" dest="$x/$file"
if [ -f $dest ]; then if [ -f $dest ]; then
continue continue

View File

@ -9,107 +9,107 @@ _____________________________________________________________________________
These functions register an application with Windows Vista's and Windows 7's These functions register an application with Windows Vista's and Windows 7's
Default Programs window. Default Programs window.
Usage: Usage:
!include "Capabilities.nsh" !include "Capabilities.nsh"
!define CAPABILITIES_NAME "[program name]" !define CAPABILITIES_NAME "[program name]"
!define CAPABILITIES_DESCRIPTION "[description]" !define CAPABILITIES_DESCRIPTION "[description]"
!define CAPABILITIES_PROGID "[progid]" !define CAPABILITIES_PROGID "[progid]"
!define CAPABILITIES_PATH "[path]" !define CAPABILITIES_PATH "[path]"
... ...
During install, call ${RegisterCapabilities}, then use the other register During install, call ${RegisterCapabilities}, then use the other register
macros to create file type, MIME, and protocol associations. macros to create file type, MIME, and protocol associations.
During uninstall, call ${UnRegisterCapabilities} During uninstall, call ${UnRegisterCapabilities}
_______________________________________________________________________________ _______________________________________________________________________________
More information about Default Programs and Client Types can be found here: 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/cc144154(VS.85).aspx
http://msdn.microsoft.com/en-us/library/cc144109(v=VS.85).aspx http://msdn.microsoft.com/en-us/library/cc144109(v=VS.85).aspx
Defines: All defines not marked [optional] are required. Defines: All defines not marked [optional] are required.
CAPABILITIES_NAME CAPABILITIES_NAME
The canonical name of the program. The canonical name of the program.
CAPABILITIES_LOCAL_NAME [optional] CAPABILITIES_LOCAL_NAME [optional]
The localized name of the program as it appears in Default Programs. The localized name of the program as it appears in Default Programs.
This should be in the format "@FilePath,-StringID" where FilePath is the 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 path to a .dll or .exe file and StringID is the ID of a resource contained
in the file. in the file.
CAPABILITIES_DESCRIPTION CAPABILITIES_DESCRIPTION
The localized description shown in Default Programs. This can be either a The localized description shown in Default Programs. This can be either a
string or in the same format as CAPABILITIES_LOCAL_NAME string or in the same format as CAPABILITIES_LOCAL_NAME
CAPABILITIES_PROGID CAPABILITIES_PROGID
An identifier used in file associations. Usually, this is the name of the An identifier used in file associations. Usually, this is the name of the
program. This should not have any spaces in it. program. This should not have any spaces in it.
CAPABILITIES_PATH CAPABILITIES_PATH
The location where capabilities info is stored in the registry. The location where capabilities info is stored in the registry.
The "Capabilities" key will automatically be added. If the application is The "Capabilities" key will automatically be added. If the application is
a client of some sort, (browser, email, media player, etc.) use a client of some sort, (browser, email, media player, etc.) use
"Software\Clients\[ClientType]\[ProgramName]". Otherwise, use "Software\Clients\[ClientType]\[ProgramName]". Otherwise, use
"Software\[CompanyName]\[ProgramName]" or just "Software\[ProgramName]". "Software\[CompanyName]\[ProgramName]" or just "Software\[ProgramName]".
CAPABILITIES_ICON [optional] CAPABILITIES_ICON [optional]
The icon shown in Default Programs. This should be in the format The icon shown in Default Programs. This should be in the format
"FilePath,IconIndex" where FilePath is the path to a file containing the "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 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, zero-based array of icons stored in the file. If IconIndex is negative,
the absolute value is used as a resource ID. the absolute value is used as a resource ID.
CAPABILITIES_REINSTALL [optional] CAPABILITIES_REINSTALL [optional]
The command executed when a user uses Set Program Access and Computer The command executed when a user uses Set Program Access and Computer
Defaults to select this application as the default for its client type. Defaults to select this application as the default for its client type.
This command should launch a program that associates the application with This command should launch a program that associates the application with
all the file and protocol types it can handle. all the file and protocol types it can handle.
CAPABILITIES_HIDE_ICONS [optional] CAPABILITIES_HIDE_ICONS [optional]
The command executed when a user uses Set Program Access and Computer The command executed when a user uses Set Program Access and Computer
Defaults to disable access to this application. This command should launch Defaults to disable access to this application. This command should launch
a program that hides all shortcuts and access points to this application. a program that hides all shortcuts and access points to this application.
It should also prevent the application from being run automatically and It should also prevent the application from being run automatically and
update the IconsVisible registry value to 0. update the IconsVisible registry value to 0.
CAPABILITIES_SHOW_ICONS [optional] CAPABILITIES_SHOW_ICONS [optional]
The command executed when a user uses Set Program Access and Computer The command executed when a user uses Set Program Access and Computer
Defaults to enable access to this application. This command should launch Defaults to enable access to this application. This command should launch
a program that restores shortcuts and access points to the application, a program that restores shortcuts and access points to the application,
allows the program to run, and updates the IconsVisible registry value to 1. allows the program to run, and updates the IconsVisible registry value to 1.
Macros: Macros:
${RegisterCapabilities} ${RegisterCapabilities}
Registers the program with Default Programs. Call this once on install Registers the program with Default Programs. Call this once on install
before using any other functions. before using any other functions.
${UnRegisterCapabilities} ${UnRegisterCapabilities}
Un-registers the program and all its associations. Call this once on Un-registers the program and all its associations. Call this once on
uninstall to clean up all installed registry values. uninstall to clean up all installed registry values.
${RegisterFileType} "[extension]" "[executable]" "[icon]" "[description]" ${RegisterFileType} "[extension]" "[executable]" "[icon]" "[description]"
Registers a file type with the program Registers a file type with the program
extension: The file extension to register (ex: .txt) extension: The file extension to register (ex: .txt)
executable: The executable that opens the file type executable: The executable that opens the file type
icon: The icon shown for the file type icon: The icon shown for the file type
description: Description for the file type shown in Explorer description: Description for the file type shown in Explorer
${RegisterMediaType} "[extension]" "[executable]" "[icon]" "[description]" ${RegisterMediaType} "[extension]" "[executable]" "[icon]" "[description]"
Registers a media file type with the program (has a "Play" command) Registers a media file type with the program (has a "Play" command)
(arguments are same as RegisterFileType) (arguments are same as RegisterFileType)
${RegisterMimeType} "[mime type]" "[shortname]" "[clsid]" ${RegisterMimeType} "[mime type]" "[shortname]" "[clsid]"
Registers a mime type with the program Registers a mime type with the program
mime type: The MIME type to register (ex: audio/mp3) mime type: The MIME type to register (ex: audio/mp3)
shortname: A short identifier for the type (ex: mp3) shortname: A short identifier for the type (ex: mp3)
clsid: The CLSID of the program to handle files of this type clsid: The CLSID of the program to handle files of this type
${RegisterProtocol} "[protocol]" "[executable]" "[icon]" "[description]" ${RegisterProtocol} "[protocol]" "[executable]" "[icon]" "[description]"
Registers a URL protocol with the program Registers a URL protocol with the program
protocol: The protocol to register (ex: http) protocol: The protocol to register (ex: http)
@ -118,15 +118,15 @@ ${RegisterProtocol} "[protocol]" "[executable]" "[icon]" "[description]"
${UnRegisterFileType} "[extension]" ${UnRegisterFileType} "[extension]"
Un-registers a previously registered file type Un-registers a previously registered file type
extension: The file extension to un-register extension: The file extension to un-register
${UnRegisterMimeType} "[mime type]" ${UnRegisterMimeType} "[mime type]"
Un-registers a previously registered MEME type Un-registers a previously registered MEME type
mime type: The MIME type to un-register mime type: The MIME type to un-register
${UnRegisterProtocol} "[protocol]" ${UnRegisterProtocol} "[protocol]"
Un-registers a previously registered URL protocol Un-registers a previously registered URL protocol
protocol: The URL protocol to un-register protocol: The URL protocol to un-register
*/ */
@ -254,7 +254,7 @@ ${StrCase}
!verbose push !verbose push
!verbose ${_Capabilities_VERBOSE} !verbose ${_Capabilities_VERBOSE}
Push $0 Push $0
!ifndef CAPABILITIES_PATH !ifndef CAPABILITIES_PATH
!error "CAPABILITIES_PATH not defined" !error "CAPABILITIES_PATH not defined"
!endif !endif
@ -267,21 +267,21 @@ ${StrCase}
!ifndef CAPABILITIES_DESCRIPTION !ifndef CAPABILITIES_DESCRIPTION
!error "CAPABILITIES_DESCRIPTION not defined" !error "CAPABILITIES_DESCRIPTION not defined"
!endif !endif
StrCpy $0 "${CAPABILITIES_PATH}\Capabilities" StrCpy $0 "${CAPABILITIES_PATH}\Capabilities"
; add the application to RegisteredApplications ; add the application to RegisteredApplications
WriteRegStr HKLM "Software\RegisteredApplications" "${CAPABILITIES_NAME}" "$0" WriteRegStr HKLM "Software\RegisteredApplications" "${CAPABILITIES_NAME}" "$0"
; write application info ; write application info
WriteRegStr HKLM "${CAPABILITIES_PATH}" "" "${CAPABILITIES_NAME}" WriteRegStr HKLM "${CAPABILITIES_PATH}" "" "${CAPABILITIES_NAME}"
!ifdef CAPABILITIES_LOCAL_NAME !ifdef CAPABILITIES_LOCAL_NAME
WriteRegStr HKLM "${CAPABILITIES_PATH}" "LocalizedString" "${CAPABILITIES_LOCAL_NAME}" WriteRegStr HKLM "${CAPABILITIES_PATH}" "LocalizedString" "${CAPABILITIES_LOCAL_NAME}"
!endif !endif
!ifdef CAPABILITIES_ICON !ifdef CAPABILITIES_ICON
WriteRegStr HKLM "${CAPABILITIES_PATH}\DefaultIcon" "" "${CAPABILITIES_ICON}" WriteRegStr HKLM "${CAPABILITIES_PATH}\DefaultIcon" "" "${CAPABILITIES_ICON}"
!endif !endif
; write installinfo if defined ; write installinfo if defined
!ifdef CAPABILITIES_REINSTALL !ifdef CAPABILITIES_REINSTALL
WriteRegStr HKLM "${CAPABILITIES_PATH}\InstallInfo" "ReinstallCommand" "${CAPABILITIES_REINSTALL}" WriteRegStr HKLM "${CAPABILITIES_PATH}\InstallInfo" "ReinstallCommand" "${CAPABILITIES_REINSTALL}"
@ -294,7 +294,7 @@ ${StrCase}
WriteRegStr HKLM "${CAPABILITIES_PATH}\InstallInfo" "ShowIconsCommand" "${CAPABILITIES_SHOW_ICONS}" WriteRegStr HKLM "${CAPABILITIES_PATH}\InstallInfo" "ShowIconsCommand" "${CAPABILITIES_SHOW_ICONS}"
WriteRegDWORD HKLM "${CAPABILITIES_PATH}\InstallInfo" "IconsVisible" 0x1 WriteRegDWORD HKLM "${CAPABILITIES_PATH}\InstallInfo" "IconsVisible" 0x1
!endif !endif
; write application capabilities info ; write application capabilities info
!ifdef CAPABILITIES_LOCAL_NAME !ifdef CAPABILITIES_LOCAL_NAME
WriteRegStr HKLM "$0" "ApplicationName" "${CAPABILITIES_LOCAL_NAME}" WriteRegStr HKLM "$0" "ApplicationName" "${CAPABILITIES_LOCAL_NAME}"
@ -302,7 +302,7 @@ ${StrCase}
WriteRegStr HKLM "$0" "ApplicationName" "${CAPABILITIES_NAME}" WriteRegStr HKLM "$0" "ApplicationName" "${CAPABILITIES_NAME}"
!endif !endif
WriteRegStr HKLM "$0" "ApplicationDescription" "${CAPABILITIES_DESCRIPTION}" WriteRegStr HKLM "$0" "ApplicationDescription" "${CAPABILITIES_DESCRIPTION}"
Pop $0 Pop $0
!verbose pop !verbose pop
!macroend !macroend
@ -322,7 +322,7 @@ ${StrCase}
!define MacroID ${__LINE__} !define MacroID ${__LINE__}
!verbose push !verbose push
!verbose ${_Capabilities_VERBOSE} !verbose ${_Capabilities_VERBOSE}
Push $0 Push $0
Push $1 Push $1
@ -330,43 +330,43 @@ ${StrCase}
FileTypeLoop_${MacroID}: FileTypeLoop_${MacroID}:
EnumRegValue $0 HKLM "${CAPABILITIES_PATH}\Capabilities\FileAssociations" 0 EnumRegValue $0 HKLM "${CAPABILITIES_PATH}\Capabilities\FileAssociations" 0
StrCmp $0 "" FileTypeDone_${MacroID} StrCmp $0 "" FileTypeDone_${MacroID}
ReadRegStr $1 HKLM "${CAPABILITIES_PATH}\Capabilities\FileAssociations" "$0" ReadRegStr $1 HKLM "${CAPABILITIES_PATH}\Capabilities\FileAssociations" "$0"
DeleteRegKey HKCR $1 DeleteRegKey HKCR $1
DeleteRegValue HKLM "${CAPABILITIES_PATH}\Capabilities\FileAssociations" "$0" DeleteRegValue HKLM "${CAPABILITIES_PATH}\Capabilities\FileAssociations" "$0"
Goto FileTypeLoop_${MacroID} Goto FileTypeLoop_${MacroID}
FileTypeDone_${MacroID}: FileTypeDone_${MacroID}:
; remove all MIME associations ; remove all MIME associations
MimeTypeLoop_${MacroID}: MimeTypeLoop_${MacroID}:
EnumRegValue $0 HKLM "${CAPABILITIES_PATH}\Capabilities\MimeAssociations" 0 EnumRegValue $0 HKLM "${CAPABILITIES_PATH}\Capabilities\MimeAssociations" 0
StrCmp $0 "" MimeTypeDone_${MacroID} StrCmp $0 "" MimeTypeDone_${MacroID}
ReadRegStr $1 HKLM "${CAPABILITIES_PATH}\Capabilities\MimeAssociations" "$0" ReadRegStr $1 HKLM "${CAPABILITIES_PATH}\Capabilities\MimeAssociations" "$0"
DeleteRegKey HKCR "$1" DeleteRegKey HKCR "$1"
DeleteRegValue HKLM "${CAPABILITIES_PATH}\Capabilities\MimeAssociations" "$0" DeleteRegValue HKLM "${CAPABILITIES_PATH}\Capabilities\MimeAssociations" "$0"
Goto MimeTypeLoop_${MacroID} Goto MimeTypeLoop_${MacroID}
MimeTypeDone_${MacroID}: MimeTypeDone_${MacroID}:
; remove all protocol associations ; remove all protocol associations
ProtocolLoop_${MacroID}: ProtocolLoop_${MacroID}:
EnumRegValue $0 HKLM "${CAPABILITIES_PATH}\Capabilities\UrlAssociations" 0 EnumRegValue $0 HKLM "${CAPABILITIES_PATH}\Capabilities\UrlAssociations" 0
StrCmp $0 "" ProtocolDone_${MacroID} StrCmp $0 "" ProtocolDone_${MacroID}
ReadRegStr $1 HKLM "${CAPABILITIES_PATH}\Capabilities\UrlAssociations" "$0" ReadRegStr $1 HKLM "${CAPABILITIES_PATH}\Capabilities\UrlAssociations" "$0"
DeleteRegKey HKCR "$1" DeleteRegKey HKCR "$1"
DeleteRegValue HKLM "${CAPABILITIES_PATH}\Capabilities\UrlAssociations" "$0" DeleteRegValue HKLM "${CAPABILITIES_PATH}\Capabilities\UrlAssociations" "$0"
Goto ProtocolLoop_${MacroID} Goto ProtocolLoop_${MacroID}
ProtocolDone_${MacroID}: ProtocolDone_${MacroID}:
; remove capabilities keys ; remove capabilities keys
DeleteRegValue HKLM "Software\RegisteredApplications" "${CAPABILITIES_NAME}" DeleteRegValue HKLM "Software\RegisteredApplications" "${CAPABILITIES_NAME}"
DeleteRegKey HKLM ${CAPABILITIES_PATH} DeleteRegKey HKLM ${CAPABILITIES_PATH}
Pop $1 Pop $1
Pop $0 Pop $0
!verbose pop !verbose pop
@ -390,7 +390,7 @@ ${StrCase}
!macro RegisterFileType_ !macro RegisterFileType_
!verbose push !verbose push
!verbose ${_Capabilities_VERBOSE} !verbose ${_Capabilities_VERBOSE}
Exch $R3 ;ext Exch $R3 ;ext
Exch Exch
Exch $R2 ;exe Exch $R2 ;exe
@ -405,10 +405,10 @@ ${StrCase}
; ex: .mp3 becomes ProgID.AssocFile.MP3 ; ex: .mp3 becomes ProgID.AssocFile.MP3
${StrCase} $0 "$R3" "U" ${StrCase} $0 "$R3" "U"
StrCpy $0 "${CAPABILITIES_PROGID}.AssocFile$0" StrCpy $0 "${CAPABILITIES_PROGID}.AssocFile$0"
; link capabilities to association in classes root ; link capabilities to association in classes root
WriteRegStr HKLM "${CAPABILITIES_PATH}\Capabilities\FileAssociations" "$R3" "$0" WriteRegStr HKLM "${CAPABILITIES_PATH}\Capabilities\FileAssociations" "$R3" "$0"
; write file association in classes root ; write file association in classes root
WriteRegStr HKCR "$0" "" "$R0" WriteRegStr HKCR "$0" "" "$R0"
WriteRegStr HKCR "$0\DefaultIcon" "" "$R1" WriteRegStr HKCR "$0\DefaultIcon" "" "$R1"
@ -441,7 +441,7 @@ ${StrCase}
!macro RegisterMediaType_ !macro RegisterMediaType_
!verbose push !verbose push
!verbose ${_Capabilities_VERBOSE} !verbose ${_Capabilities_VERBOSE}
Exch $R3 ;ext Exch $R3 ;ext
Exch Exch
Exch $R2 ;exe Exch $R2 ;exe
@ -457,10 +457,10 @@ ${StrCase}
; ex: .mp3 becomes ProgID.AssocFile.MP3 ; ex: .mp3 becomes ProgID.AssocFile.MP3
${StrCase} $0 "$R3" "U" ${StrCase} $0 "$R3" "U"
StrCpy $0 "${CAPABILITIES_PROGID}.AssocFile$0" StrCpy $0 "${CAPABILITIES_PROGID}.AssocFile$0"
; link capabilities to association in classes root ; link capabilities to association in classes root
WriteRegStr HKLM "${CAPABILITIES_PATH}\Capabilities\FileAssociations" "$R3" "$0" WriteRegStr HKLM "${CAPABILITIES_PATH}\Capabilities\FileAssociations" "$R3" "$0"
; write file association in classes root ; write file association in classes root
WriteRegStr HKCR "$0" "" "$R0" WriteRegStr HKCR "$0" "" "$R0"
WriteRegStr HKCR "$0\DefaultIcon" "" "$R1" WriteRegStr HKCR "$0\DefaultIcon" "" "$R1"
@ -495,24 +495,24 @@ ${StrCase}
!macro RegisterMimeType_ !macro RegisterMimeType_
!verbose push !verbose push
!verbose ${_Capabilities_VERBOSE} !verbose ${_Capabilities_VERBOSE}
Exch $R2 ;mime Exch $R2 ;mime
Exch Exch
Exch $R1 ;shortname Exch $R1 ;shortname
Exch Exch
Exch 2 Exch 2
Exch $R0 ;clsid Exch $R0 ;clsid
Push $0 Push $0
; create an association name ; create an association name
; ex: audio/mp3 becomes ProgID.AssocMIME.MP3 ; ex: audio/mp3 becomes ProgID.AssocMIME.MP3
${StrCase} $0 "$R1" "U" ${StrCase} $0 "$R1" "U"
StrCpy $0 "${CAPABILITIES_PROGID}.AssocMIME.$0" StrCpy $0 "${CAPABILITIES_PROGID}.AssocMIME.$0"
; link capabilities to association in classes root ; link capabilities to association in classes root
WriteRegStr HKLM "${CAPABILITIES_PATH}\Capabilities\MimeAssociations" "$R2" "$0" WriteRegStr HKLM "${CAPABILITIES_PATH}\Capabilities\MimeAssociations" "$R2" "$0"
; write file association in classes root ; write file association in classes root
WriteRegStr HKCR "$0\CLSID" "" "$R0" WriteRegStr HKCR "$0\CLSID" "" "$R0"
@ -538,7 +538,7 @@ ${StrCase}
!macro RegisterProtocol_ !macro RegisterProtocol_
!verbose push !verbose push
!verbose ${_Capabilities_VERBOSE} !verbose ${_Capabilities_VERBOSE}
Exch $R3 ;protocol Exch $R3 ;protocol
Exch Exch
Exch $R2 ;exe Exch $R2 ;exe
@ -554,10 +554,10 @@ ${StrCase}
; ex: http becomes ProgID.AssocProtocol.HTTP ; ex: http becomes ProgID.AssocProtocol.HTTP
${StrCase} $0 "$R3" "U" ${StrCase} $0 "$R3" "U"
StrCpy $0 "${CAPABILITIES_PROGID}.AssocProtocol.$0" StrCpy $0 "${CAPABILITIES_PROGID}.AssocProtocol.$0"
; link capabilities to association in classes root ; link capabilities to association in classes root
WriteRegStr HKLM "${CAPABILITIES_PATH}\Capabilities\UrlAssociations" "$R3" "$0" WriteRegStr HKLM "${CAPABILITIES_PATH}\Capabilities\UrlAssociations" "$R3" "$0"
; write file association in classes root ; write file association in classes root
WriteRegStr HKCR "$0" "" "$R0" WriteRegStr HKCR "$0" "" "$R0"
WriteRegStr HKCR "$0\DefaultIcon" "" "$R1" WriteRegStr HKCR "$0\DefaultIcon" "" "$R1"
@ -592,14 +592,14 @@ ${StrCase}
Exch $R0 ;ext Exch $R0 ;ext
Push $0 Push $0
ReadRegStr $0 HKLM "${CAPABILITIES_PATH}\Capabilities\FileAssociations" "$R0" ReadRegStr $0 HKLM "${CAPABILITIES_PATH}\Capabilities\FileAssociations" "$R0"
StrCmp $0 "" skip_${MacroID} StrCmp $0 "" skip_${MacroID}
DeleteRegKey HKCR "$0" DeleteRegKey HKCR "$0"
DeleteRegValue HKLM "${CAPABILITIES_PATH}\Capabilities\FileAssociations" "$R0" DeleteRegValue HKLM "${CAPABILITIES_PATH}\Capabilities\FileAssociations" "$R0"
skip_${MacroID}: skip_${MacroID}:
Pop $0 Pop $0
Pop $R0 Pop $R0
!verbose pop !verbose pop
@ -624,14 +624,14 @@ ${StrCase}
Exch $R0 ;mime Exch $R0 ;mime
Push $0 Push $0
ReadRegStr $0 HKLM "${CAPABILITIES_PATH}\Capabilities\MimeAssociations" "$R0" ReadRegStr $0 HKLM "${CAPABILITIES_PATH}\Capabilities\MimeAssociations" "$R0"
StrCmp $0 "" skip_${MacroID} StrCmp $0 "" skip_${MacroID}
DeleteRegKey HKCR "$0" DeleteRegKey HKCR "$0"
DeleteRegValue HKLM "${CAPABILITIES_PATH}\Capabilities\MimeAssociations" "$R0" DeleteRegValue HKLM "${CAPABILITIES_PATH}\Capabilities\MimeAssociations" "$R0"
skip_${MacroID}: skip_${MacroID}:
Pop $0 Pop $0
Pop $R0 Pop $R0
!verbose pop !verbose pop
@ -656,14 +656,14 @@ ${StrCase}
Exch $R0 ;protocol Exch $R0 ;protocol
Push $0 Push $0
ReadRegStr $0 HKLM "${CAPABILITIES_PATH}\Capabilities\UrlAssociations" "$R0" ReadRegStr $0 HKLM "${CAPABILITIES_PATH}\Capabilities\UrlAssociations" "$R0"
StrCmp $0 "" skip_${MacroID} StrCmp $0 "" skip_${MacroID}
DeleteRegKey HKCR "$0" DeleteRegKey HKCR "$0"
DeleteRegValue HKLM "${CAPABILITIES_PATH}\Capabilities\UrlAssociations" "$R0" DeleteRegValue HKLM "${CAPABILITIES_PATH}\Capabilities\UrlAssociations" "$R0"
skip_${MacroID}: skip_${MacroID}:
Pop $0 Pop $0
Pop $R0 Pop $R0
!verbose pop !verbose pop

View File

@ -263,7 +263,7 @@ Section "Start menu items" startmenu
CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}" CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}"
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME}.lnk" "$INSTDIR\strawberry.exe" CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME}.lnk" "$INSTDIR\strawberry.exe"
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Uninstall.lnk" "$INSTDIR\Uninstall.exe" CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
SectionEnd SectionEnd
Section "Uninstaller" Section "Uninstaller"
@ -289,7 +289,7 @@ Section "Uninstall"
;StrCmp $1 "-1" wooops ;StrCmp $1 "-1" wooops
;StrCmp $0 "0" completed ;StrCmp $0 "0" completed
;DetailPrint "Killing running strawberry.exe..." ;DetailPrint "Killing running strawberry.exe..."
;StrCpy $0 "strawberry.exe" ;StrCpy $0 "strawberry.exe"

View File

@ -295,7 +295,7 @@ Section "Start menu items" startmenu
CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}" CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}"
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME}.lnk" "$INSTDIR\strawberry.exe" CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME}.lnk" "$INSTDIR\strawberry.exe"
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Uninstall.lnk" "$INSTDIR\Uninstall.exe" CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
SectionEnd SectionEnd
Section "Uninstaller" Section "Uninstaller"
@ -321,7 +321,7 @@ Section "Uninstall"
;StrCmp $1 "-1" wooops ;StrCmp $1 "-1" wooops
;StrCmp $0 "0" completed ;StrCmp $0 "0" completed
;DetailPrint "Killing running strawberry.exe..." ;DetailPrint "Killing running strawberry.exe..."
;StrCpy $0 "strawberry.exe" ;StrCpy $0 "strawberry.exe"

View File

@ -295,7 +295,7 @@ Section "Start menu items" startmenu
CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}" CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}"
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME}.lnk" "$INSTDIR\strawberry.exe" CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME}.lnk" "$INSTDIR\strawberry.exe"
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Uninstall.lnk" "$INSTDIR\Uninstall.exe" CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
SectionEnd SectionEnd
Section "Uninstaller" Section "Uninstaller"
@ -321,7 +321,7 @@ Section "Uninstall"
;StrCmp $1 "-1" wooops ;StrCmp $1 "-1" wooops
;StrCmp $0 "0" completed ;StrCmp $0 "0" completed
;DetailPrint "Killing running strawberry.exe..." ;DetailPrint "Killing running strawberry.exe..."
;StrCpy $0 "strawberry.exe" ;StrCpy $0 "strawberry.exe"

View File

@ -263,7 +263,7 @@ Section "Start menu items" startmenu
CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}" CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}"
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME}.lnk" "$INSTDIR\strawberry.exe" CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME}.lnk" "$INSTDIR\strawberry.exe"
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Uninstall.lnk" "$INSTDIR\Uninstall.exe" CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
SectionEnd SectionEnd
Section "Uninstaller" Section "Uninstaller"
@ -289,7 +289,7 @@ Section "Uninstall"
;StrCmp $1 "-1" wooops ;StrCmp $1 "-1" wooops
;StrCmp $0 "0" completed ;StrCmp $0 "0" completed
;DetailPrint "Killing running strawberry.exe..." ;DetailPrint "Killing running strawberry.exe..."
;StrCpy $0 "strawberry.exe" ;StrCpy $0 "strawberry.exe"

View File

@ -64,7 +64,7 @@ void GLog(const char *domain, int level, const char *message, void *user_data) {
case G_LOG_LEVEL_DEBUG: case G_LOG_LEVEL_DEBUG:
default: qLog(Debug) << message; break; default: qLog(Debug) << message; break;
} }
} }
static void MessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &message) { 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() { void Init() {
delete sClassLevels; delete sClassLevels;
delete sNullDevice; delete sNullDevice;

View File

@ -269,7 +269,7 @@ void TagReader::ReadFile(const QString &filename, pb::tagreader::SongMetadata *s
else if (TagLib::MP4::File *file = dynamic_cast<TagLib::MP4::File*>(fileref->file())) { else if (TagLib::MP4::File *file = dynamic_cast<TagLib::MP4::File*>(fileref->file())) {
song->set_bitdepth(file->audioProperties()->bitsPerSample()); song->set_bitdepth(file->audioProperties()->bitsPerSample());
if (file->tag()) { if (file->tag()) {
TagLib::MP4::Tag *mp4_tag = file->tag(); TagLib::MP4::Tag *mp4_tag = file->tag();
const TagLib::MP4::ItemListMap& items = mp4_tag->itemListMap(); 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) { void TagReader::Decode(const QString &tag, const QTextCodec *codec, std::string *output) {
if (!codec) { if (!codec) {
output->assign(DataCommaSizeFromQString(tag)); 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 { void TagReader::ParseFMPSFrame(const QString &name, const QString &value, pb::tagreader::SongMetadata *song) const {
qLog(Debug) << "Parsing FMPSFrame" << name << ", " << value; qLog(Debug) << "Parsing FMPSFrame" << name << ", " << value;
FMPSParser parser; FMPSParser parser;
if (!parser.Parse(value) || parser.is_empty()) return; if (!parser.Parse(value) || parser.is_empty()) return;
QVariant var; 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 { 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["COMPOSER"].isEmpty()) Decode(map["COMPOSER"].front(), codec, song->mutable_composer());
if (!map["PERFORMER"].isEmpty()) Decode(map["PERFORMER"].front(), codec, song->mutable_performer()); 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()); 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 { void TagReader::SetUserTextFrame(const QString &description, const QString &value, TagLib::ID3v2::Tag *tag) const {
const QByteArray descr_utf8(description.toUtf8()); const QByteArray descr_utf8(description.toUtf8());
const QByteArray value_utf8(value.toUtf8()); const QByteArray value_utf8(value.toUtf8());
qLog(Debug) << "Setting FMPSFrame:" << description << ", " << value; qLog(Debug) << "Setting FMPSFrame:" << description << ", " << value;
SetUserTextFrame(std::string(descr_utf8.constData(), descr_utf8.length()), std::string(value_utf8.constData(), value_utf8.length()), tag); 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 { void TagReader::SetUserTextFrame(const std::string &description, const std::string &value, TagLib::ID3v2::Tag *tag) const {
const TagLib::String t_description = StdStringToTaglibString(description); const TagLib::String t_description = StdStringToTaglibString(description);
// Remove the frame if it already exists // Remove the frame if it already exists
TagLib::ID3v2::UserTextIdentificationFrame *frame = TagLib::ID3v2::UserTextIdentificationFrame::find(tag, t_description); 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 { void TagReader::SetTextFrame(const char *id, const QString &value, TagLib::ID3v2::Tag *tag) const {
const QByteArray utf8(value.toUtf8()); const QByteArray utf8(value.toUtf8());
SetTextFrame(id, std::string(utf8.constData(), utf8.length()), tag); SetTextFrame(id, std::string(utf8.constData(), utf8.length()), tag);
} }
void TagReader::SetTextFrame(const char *id, const std::string &value, TagLib::ID3v2::Tag *tag) const { void TagReader::SetTextFrame(const char *id, const std::string &value, TagLib::ID3v2::Tag *tag) const {
TagLib::ByteVector id_vector(id); TagLib::ByteVector id_vector(id);
QVector<TagLib::ByteVector> frames_buffer; QVector<TagLib::ByteVector> 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 // add frame takes ownership and clears the memory
tag->addFrame(frame); tag->addFrame(frame);
} }
} }
bool TagReader::IsMediaFile(const QString &filename) const { bool TagReader::IsMediaFile(const QString &filename) const {
qLog(Debug) << "Checking for valid file" << filename; qLog(Debug) << "Checking for valid file" << filename;
std::unique_ptr<TagLib::FileRef> fileref(factory_->GetFileRef(filename)); std::unique_ptr<TagLib::FileRef> fileref(factory_->GetFileRef(filename));
return !fileref->isNull() && fileref->tag(); return !fileref->isNull() && fileref->tag();
} }
QByteArray TagReader::LoadEmbeddedArt(const QString &filename) const { QByteArray TagReader::LoadEmbeddedArt(const QString &filename) const {
if (filename.isEmpty()) return QByteArray(); if (filename.isEmpty()) return QByteArray();
qLog(Debug) << "Loading art from" << filename; qLog(Debug) << "Loading art from" << filename;

View File

@ -109,17 +109,17 @@ set(SOURCES
core/windows7thumbbar.cpp core/windows7thumbbar.cpp
core/screensaver.cpp core/screensaver.cpp
core/scopedtransaction.cpp core/scopedtransaction.cpp
engine/enginetype.cpp engine/enginetype.cpp
engine/enginebase.cpp engine/enginebase.cpp
engine/enginedevice.cpp engine/enginedevice.cpp
engine/devicefinder.cpp engine/devicefinder.cpp
analyzer/fht.cpp analyzer/fht.cpp
analyzer/analyzerbase.cpp analyzer/analyzerbase.cpp
analyzer/analyzercontainer.cpp analyzer/analyzercontainer.cpp
analyzer/blockanalyzer.cpp analyzer/blockanalyzer.cpp
equalizer/equalizer.cpp equalizer/equalizer.cpp
equalizer/equalizerslider.cpp equalizer/equalizerslider.cpp
@ -173,7 +173,7 @@ set(SOURCES
playlistparsers/wplparser.cpp playlistparsers/wplparser.cpp
playlistparsers/xmlparser.cpp playlistparsers/xmlparser.cpp
playlistparsers/xspfparser.cpp playlistparsers/xspfparser.cpp
covermanager/albumcovermanager.cpp covermanager/albumcovermanager.cpp
covermanager/albumcovermanagerlist.cpp covermanager/albumcovermanagerlist.cpp
covermanager/albumcoverloader.cpp covermanager/albumcoverloader.cpp
@ -244,10 +244,10 @@ set(SOURCES
widgets/tracksliderpopup.cpp widgets/tracksliderpopup.cpp
widgets/tracksliderslider.cpp widgets/tracksliderslider.cpp
widgets/loginstatewidget.cpp widgets/loginstatewidget.cpp
musicbrainz/acoustidclient.cpp musicbrainz/acoustidclient.cpp
musicbrainz/musicbrainzclient.cpp musicbrainz/musicbrainzclient.cpp
globalshortcuts/globalshortcutbackend.cpp globalshortcuts/globalshortcutbackend.cpp
globalshortcuts/globalshortcuts.cpp globalshortcuts/globalshortcuts.cpp
globalshortcuts/gnomeglobalshortcutbackend.cpp globalshortcuts/gnomeglobalshortcutbackend.cpp
@ -294,10 +294,10 @@ set(HEADERS
analyzer/analyzerbase.h analyzer/analyzerbase.h
analyzer/analyzercontainer.h analyzer/analyzercontainer.h
analyzer/blockanalyzer.h analyzer/blockanalyzer.h
equalizer/equalizer.h equalizer/equalizer.h
equalizer/equalizerslider.h equalizer/equalizerslider.h
context/contextview.h context/contextview.h
context/contextalbumsmodel.h context/contextalbumsmodel.h
context/contextalbumsview.h context/contextalbumsview.h
@ -341,7 +341,7 @@ set(HEADERS
playlistparsers/playlistparser.h playlistparsers/playlistparser.h
playlistparsers/plsparser.h playlistparsers/plsparser.h
playlistparsers/xspfparser.h playlistparsers/xspfparser.h
covermanager/albumcovermanager.h covermanager/albumcovermanager.h
covermanager/albumcovermanagerlist.h covermanager/albumcovermanagerlist.h
covermanager/albumcoverloader.h covermanager/albumcoverloader.h
@ -409,10 +409,10 @@ set(HEADERS
widgets/tracksliderpopup.h widgets/tracksliderpopup.h
widgets/tracksliderslider.h widgets/tracksliderslider.h
widgets/loginstatewidget.h widgets/loginstatewidget.h
musicbrainz/acoustidclient.h musicbrainz/acoustidclient.h
musicbrainz/musicbrainzclient.h musicbrainz/musicbrainzclient.h
globalshortcuts/globalshortcutbackend.h globalshortcuts/globalshortcutbackend.h
globalshortcuts/globalshortcuts.h globalshortcuts/globalshortcuts.h
globalshortcuts/gnomeglobalshortcutbackend.h globalshortcuts/gnomeglobalshortcutbackend.h
@ -479,7 +479,7 @@ set(UI
widgets/osdpretty.ui widgets/osdpretty.ui
widgets/fileview.ui widgets/fileview.ui
widgets/loginstatewidget.ui widgets/loginstatewidget.ui
globalshortcuts/globalshortcutgrabber.ui globalshortcuts/globalshortcutgrabber.ui
tidal/tidalsearchview.ui tidal/tidalsearchview.ui

View File

@ -69,7 +69,7 @@ SCollection::~SCollection() {
} }
void SCollection::Init() { void SCollection::Init() {
watcher_ = new CollectionWatcher; watcher_ = new CollectionWatcher;
watcher_thread_ = new Thread(this); watcher_thread_ = new Thread(this);
watcher_thread_->SetIoPriority(Utilities::IOPRIO_CLASS_IDLE); watcher_thread_->SetIoPriority(Utilities::IOPRIO_CLASS_IDLE);
@ -116,7 +116,7 @@ void SCollection::Stopped() {
} }
void SCollection::CurrentSongChanged(const Song &song) { void SCollection::CurrentSongChanged(const Song &song) {
TagReaderReply *reply = nullptr; TagReaderReply *reply = nullptr;
if (reply) { if (reply) {

View File

@ -531,7 +531,7 @@ void CollectionBackend::MarkSongsUnavailable(const SongList &songs, bool unavail
} }
QStringList CollectionBackend::GetAll(const QString &column, const QueryOptions &opt) { QStringList CollectionBackend::GetAll(const QString &column, const QueryOptions &opt) {
CollectionQuery query(opt); CollectionQuery query(opt);
query.SetColumnSpec("DISTINCT " + column); query.SetColumnSpec("DISTINCT " + column);
query.AddCompilationRequirement(false); query.AddCompilationRequirement(false);

View File

@ -329,10 +329,10 @@ QString CollectionModel::DividerKey(GroupBy type, CollectionItem *item) const {
case GroupBy_Bitrate: case GroupBy_Bitrate:
return SortTextForNumber(item->metadata.bitrate()); return SortTextForNumber(item->metadata.bitrate());
case GroupBy_Samplerate: case GroupBy_Samplerate:
return SortTextForNumber(item->metadata.samplerate()); return SortTextForNumber(item->metadata.samplerate());
case GroupBy_Bitdepth: case GroupBy_Bitdepth:
return SortTextForNumber(item->metadata.bitdepth()); return SortTextForNumber(item->metadata.bitdepth());
@ -374,11 +374,11 @@ QString CollectionModel::DividerDisplayText(GroupBy type, const QString &key) co
case GroupBy_Bitrate: case GroupBy_Bitrate:
if (key == "000") return tr("Unknown"); if (key == "000") return tr("Unknown");
return QString::number(key.toInt()); // To remove leading 0s return QString::number(key.toInt()); // To remove leading 0s
case GroupBy_Samplerate: case GroupBy_Samplerate:
if (key == "000") return tr("Unknown"); if (key == "000") return tr("Unknown");
return QString::number(key.toInt()); // To remove leading 0s return QString::number(key.toInt()); // To remove leading 0s
case GroupBy_Bitdepth: case GroupBy_Bitdepth:
if (key == "000") return tr("Unknown"); if (key == "000") return tr("Unknown");
return QString::number(key.toInt()); // To remove leading 0s 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->key = QString::number(bitrate);
item->sort_text = SortTextForNumber(bitrate) + " "; item->sort_text = SortTextForNumber(bitrate) + " ";
break; break;
case GroupBy_Samplerate: case GroupBy_Samplerate:
samplerate = qMax(0, s.samplerate()); samplerate = qMax(0, s.samplerate());
item->key = QString::number(samplerate); item->key = QString::number(samplerate);
item->sort_text = SortTextForNumber(samplerate) + " "; item->sort_text = SortTextForNumber(samplerate) + " ";
break; break;
case GroupBy_Bitdepth: case GroupBy_Bitdepth:
bitdepth = qMax(0, s.bitdepth()); bitdepth = qMax(0, s.bitdepth());
item->key = QString::number(bitdepth); item->key = QString::number(bitdepth);

View File

@ -346,7 +346,7 @@ void CollectionView::ReloadSettings() {
app_->collection_model()->set_pretty_covers(settings.value("pretty_covers", true).toBool()); app_->collection_model()->set_pretty_covers(settings.value("pretty_covers", true).toBool());
app_->collection_model()->set_show_dividers(settings.value("show_dividers", true).toBool()); app_->collection_model()->set_show_dividers(settings.value("show_dividers", true).toBool());
} }
settings.endGroup(); settings.endGroup();
} }
@ -371,7 +371,7 @@ void CollectionView::TotalSongCountUpdated(int count) {
setCursor(Qt::PointingHandCursor); setCursor(Qt::PointingHandCursor);
else else
unsetCursor(); unsetCursor();
emit TotalSongCountUpdated_(); emit TotalSongCountUpdated_();
} }
@ -386,7 +386,7 @@ void CollectionView::TotalArtistCountUpdated(int count) {
setCursor(Qt::PointingHandCursor); setCursor(Qt::PointingHandCursor);
else else
unsetCursor(); unsetCursor();
emit TotalArtistCountUpdated_(); emit TotalArtistCountUpdated_();
} }
@ -401,7 +401,7 @@ void CollectionView::TotalAlbumCountUpdated(int count) {
setCursor(Qt::PointingHandCursor); setCursor(Qt::PointingHandCursor);
else else
unsetCursor(); unsetCursor();
emit TotalAlbumCountUpdated_(); emit TotalAlbumCountUpdated_();
} }

View File

@ -84,7 +84,7 @@ class CollectionView : public AutoExpandingTreeView {
// QTreeView // QTreeView
void keyboardSearch(const QString &search); void keyboardSearch(const QString &search);
void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible); void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible);
int TotalSongs(); int TotalSongs();
int TotalArtists(); int TotalArtists();
int TotalAlbums(); int TotalAlbums();

View File

@ -37,7 +37,7 @@ class SqlRow {
SqlRow(const CollectionQuery &query); SqlRow(const CollectionQuery &query);
const QVariant &value(int i) const { return columns_[i]; } const QVariant &value(int i) const { return columns_[i]; }
QList<QVariant> columns_; QList<QVariant> columns_;
private: private:

View File

@ -93,7 +93,7 @@ void ContextAlbumsModel::set_pretty_covers(bool use_pretty_covers) {
use_pretty_covers_ = use_pretty_covers; use_pretty_covers_ = use_pretty_covers;
Reset(); Reset();
} }
} }
void ContextAlbumsModel::AddSongs(const SongList &songs) { void ContextAlbumsModel::AddSongs(const SongList &songs) {

View File

@ -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) { bool ContextItemDelegate::helpEvent(QHelpEvent *event, QAbstractItemView *view, const QStyleOptionViewItem &option, const QModelIndex &index) {
return true; return true;
Q_UNUSED(option); Q_UNUSED(option);
@ -326,7 +326,7 @@ void ContextAlbumsView::ReloadSettings() {
if (app_ && model_) { if (app_ && model_) {
model_->set_pretty_covers(settings.value("pretty_covers", true).toBool()); model_->set_pretty_covers(settings.value("pretty_covers", true).toBool());
} }
settings.endGroup(); settings.endGroup();
} }
@ -334,7 +334,7 @@ void ContextAlbumsView::ReloadSettings() {
void ContextAlbumsView::SetApplication(Application *app) { void ContextAlbumsView::SetApplication(Application *app) {
app_ = app; app_ = app;
model_ = new ContextAlbumsModel(app_->collection_backend(), app_, this); model_ = new ContextAlbumsModel(app_->collection_backend(), app_, this);
model_->Reset(); model_->Reset();
@ -342,7 +342,7 @@ void ContextAlbumsView::SetApplication(Application *app) {
connect(model_, SIGNAL(modelAboutToBeReset()), this, SLOT(SaveFocus())); connect(model_, SIGNAL(modelAboutToBeReset()), this, SLOT(SaveFocus()));
connect(model_, SIGNAL(modelReset()), this, SLOT(RestoreFocus())); connect(model_, SIGNAL(modelReset()), this, SLOT(RestoreFocus()));
ReloadSettings(); ReloadSettings();
} }

View File

@ -78,7 +78,7 @@ class ContextAlbumsView : public AutoExpandingTreeView {
// QTreeView // QTreeView
void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible); void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible);
ContextAlbumsModel *albums_model() { return model_; } ContextAlbumsModel *albums_model() { return model_; }
public slots: public slots:
@ -146,9 +146,9 @@ signals:
Song last_selected_song_; Song last_selected_song_;
QString last_selected_container_; QString last_selected_container_;
QSet<QString> last_selected_path_; QSet<QString> last_selected_path_;
ContextAlbumsModel *model_; ContextAlbumsModel *model_;
}; };
#endif // CONTEXTALBUMSVIEW_H #endif // CONTEXTALBUMSVIEW_H

View File

@ -530,7 +530,7 @@ void ContextView::handlePaintEvent(QObject *object, QEvent *event) {
if (object == ui_->label_play_album) { if (object == ui_->label_play_album) {
PaintEventAlbum(event); PaintEventAlbum(event);
} }
return; return;
} }

View File

@ -62,7 +62,7 @@ Database::Token::Token(const QString &token, int start, int end)
: token(token), start_offset(start), end_offset(end) {} : token(token), start_offset(start), end_offset(end) {}
struct sqlite3_tokenizer_module { struct sqlite3_tokenizer_module {
int iVersion; int iVersion;
int (*xCreate)(int argc, /* Size of argv array */ int (*xCreate)(int argc, /* Size of argv array */
const char *const *argv, /* Tokenizer argument strings */ 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) { int Database::FTSDestroy(sqlite3_tokenizer *tokenizer) {
UnicodeTokenizer *real_tokenizer = reinterpret_cast<UnicodeTokenizer*>(tokenizer); UnicodeTokenizer *real_tokenizer = reinterpret_cast<UnicodeTokenizer*>(tokenizer);
delete real_tokenizer; delete real_tokenizer;
return SQLITE_OK; 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)); update.prepare(QString("UPDATE %1 SET filename=:filename WHERE ROWID=:id").arg(table));
select.exec(); select.exec();
if (CheckErrors(select)) return; if (CheckErrors(select)) return;
while (select.next()) { while (select.next()) {
const int rowid = select.value(0).toInt(); const int rowid = select.value(0).toInt();
const QString filename = select.value(1).toString(); 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) { bool Database::CheckErrors(const QSqlQuery &query) {
QSqlError last_error = query.lastError(); QSqlError last_error = query.lastError();
if (last_error.isValid()) { if (last_error.isValid()) {
qLog(Error) << "db error: " << last_error; qLog(Error) << "db error: " << last_error;

View File

@ -11,7 +11,7 @@ class PlatformInterface;
NSMenu* dock_menu_; NSMenu* dock_menu_;
MacGlobalShortcutBackend* shortcut_handler_; MacGlobalShortcutBackend* shortcut_handler_;
SPMediaKeyTap* key_tap_; SPMediaKeyTap* key_tap_;
} }
- (id) initWithHandler: (PlatformInterface*)handler; - (id) initWithHandler: (PlatformInterface*)handler;

View File

@ -17,7 +17,7 @@
* along with Strawberry. If not, see <http://www.gnu.org/licenses/>. * along with Strawberry. If not, see <http://www.gnu.org/licenses/>.
* *
*/ */
#include "config.h" #include "config.h"
#include "macsystemtrayicon.h" #include "macsystemtrayicon.h"
@ -183,7 +183,7 @@ void MacSystemTrayIcon::SetupMenu(QAction* previous, QAction* play, QAction* sto
SetupMenuItem(mute); SetupMenuItem(mute);
p_->AddSeparator(); p_->AddSeparator();
Q_UNUSED(quit); // Mac already has a Quit item. Q_UNUSED(quit); // Mac already has a Quit item.
} }
void MacSystemTrayIcon::SetupMenuItem(QAction* action) { void MacSystemTrayIcon::SetupMenuItem(QAction* action) {

View File

@ -280,7 +280,7 @@ MainWindow::MainWindow(Application *app, SystemTrayIcon *tray_icon, OSD *osd, co
collection_sort_model_->setDynamicSortFilter(true); collection_sort_model_->setDynamicSortFilter(true);
collection_sort_model_->setSortLocaleAware(true); collection_sort_model_->setSortLocaleAware(true);
collection_sort_model_->sort(0); collection_sort_model_->sort(0);
qLog(Debug) << "Creating models finished"; qLog(Debug) << "Creating models finished";
connect(ui_->playlist, SIGNAL(ViewSelectionModelChanged()), SLOT(PlaylistViewSelectionModelChanged())); 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(ModeChanged(FancyTabWidget::Mode)), SLOT(SaveGeometry()));
connect(ui_->tabs, SIGNAL(CurrentChanged(int)), SLOT(TabSwitched())); connect(ui_->tabs, SIGNAL(CurrentChanged(int)), SLOT(TabSwitched()));
connect(ui_->tabs, SIGNAL(CurrentChanged(int)), SLOT(SaveGeometry())); connect(ui_->tabs, SIGNAL(CurrentChanged(int)), SLOT(SaveGeometry()));
// Context // Context
connect(app_->playlist_manager(), SIGNAL(CurrentSongChanged(Song)), context_view_, SLOT(SongChanged(Song))); connect(app_->playlist_manager(), SIGNAL(CurrentSongChanged(Song)), context_view_, SLOT(SongChanged(Song)));
connect(app_->player(), SIGNAL(PlaylistFinished()), context_view_, SLOT(Stopped())); connect(app_->player(), SIGNAL(PlaylistFinished()), context_view_, SLOT(Stopped()));
@ -841,7 +841,7 @@ void MainWindow::MediaStopped() {
} }
void MainWindow::MediaPaused() { void MainWindow::MediaPaused() {
ui_->action_stop->setEnabled(true); ui_->action_stop->setEnabled(true);
ui_->action_stop_after_this_track->setEnabled(true); ui_->action_stop_after_this_track->setEnabled(true);
ui_->action_play_pause->setIcon(IconLoader::Load("media-play")); ui_->action_play_pause->setIcon(IconLoader::Load("media-play"));
@ -920,7 +920,7 @@ void MainWindow::resizeEvent(QResizeEvent *event) {
} }
void MainWindow::TabSwitched() { void MainWindow::TabSwitched() {
if (ui_->tabs->currentIndex() > 0) if (ui_->tabs->currentIndex() > 0)
ui_->widget_playing->SetEnabled(); ui_->widget_playing->SetEnabled();
else else
@ -943,7 +943,7 @@ void MainWindow::SaveGeometry() {
} }
void MainWindow::SavePlaybackStatus() { void MainWindow::SavePlaybackStatus() {
QSettings settings; QSettings settings;
settings.beginGroup("Player"); settings.beginGroup("Player");
@ -954,13 +954,13 @@ void MainWindow::SavePlaybackStatus() {
else { else {
settings.setValue("playback_position", 0); settings.setValue("playback_position", 0);
} }
settings.endGroup(); settings.endGroup();
} }
void MainWindow::LoadPlaybackStatus() { void MainWindow::LoadPlaybackStatus() {
QSettings settings; QSettings settings;
settings.beginGroup(BehaviourSettingsPage::kSettingsGroup); settings.beginGroup(BehaviourSettingsPage::kSettingsGroup);
@ -973,7 +973,7 @@ void MainWindow::LoadPlaybackStatus() {
saved_playback_state_ = static_cast<Engine::State> (settings.value("playback_state", Engine::Empty).toInt()); saved_playback_state_ = static_cast<Engine::State> (settings.value("playback_state", Engine::Empty).toInt());
saved_playback_position_ = settings.value("playback_position", 0).toDouble(); saved_playback_position_ = settings.value("playback_position", 0).toDouble();
settings.endGroup(); settings.endGroup();
if (saved_playback_state_ == Engine::Empty || saved_playback_state_ == Engine::Idle) { if (saved_playback_state_ == Engine::Empty || saved_playback_state_ == Engine::Idle) {
return; return;
} }
@ -998,7 +998,7 @@ void MainWindow::ResumePlayback() {
} }
void MainWindow::PlayIndex(const QModelIndex &index) { void MainWindow::PlayIndex(const QModelIndex &index) {
if (!index.isValid()) return; if (!index.isValid()) return;
int row = index.row(); int row = index.row();
@ -1043,7 +1043,7 @@ void MainWindow::VolumeWheelEvent(int delta) {
} }
void MainWindow::ToggleShowHide() { void MainWindow::ToggleShowHide() {
if (settings_.value("hidden").toBool()) { if (settings_.value("hidden").toBool()) {
show(); show();
SetHiddenInTray(false); SetHiddenInTray(false);
@ -1119,7 +1119,7 @@ void MainWindow::Seeked(qlonglong microseconds) {
} }
void MainWindow::UpdateTrackPosition() { void MainWindow::UpdateTrackPosition() {
// Track position in seconds // Track position in seconds
//Playlist *playlist = app_->playlist_manager()->active(); //Playlist *playlist = app_->playlist_manager()->active();
@ -1217,7 +1217,7 @@ void MainWindow::AddToPlaylist(QMimeData *data) {
} }
void MainWindow::AddToPlaylist(QAction *action) { void MainWindow::AddToPlaylist(QAction *action) {
int destination = action->data().toInt(); int destination = action->data().toInt();
PlaylistItemList items; PlaylistItemList items;
@ -1289,17 +1289,17 @@ void MainWindow::PlaylistRightClick(const QPoint &global_pos, const QModelIndex
int not_in_queue = 0; int not_in_queue = 0;
int in_skipped = 0; int in_skipped = 0;
int not_in_skipped = 0; int not_in_skipped = 0;
for (const QModelIndex &index : selection) { for (const QModelIndex &index : selection) {
all++; all++;
if (index.column() != 0) continue; if (index.column() != 0) continue;
selected++; selected++;
PlaylistItemPtr item = app_->playlist_manager()->current()->item_at(index.row()); PlaylistItemPtr item = app_->playlist_manager()->current()->item_at(index.row());
if (item->Metadata().has_cue()) { if (item->Metadata().has_cue()) {
cue_selected = true; cue_selected = true;
} }
@ -1349,7 +1349,7 @@ void MainWindow::PlaylistRightClick(const QPoint &global_pos, const QModelIndex
//qLog(Debug) << "selected" << selected; //qLog(Debug) << "selected" << selected;
//qLog(Debug) << "in_queue" << in_queue << "not_in_queue" << not_in_queue; //qLog(Debug) << "in_queue" << in_queue << "not_in_queue" << not_in_queue;
//qLog(Debug) << "in_skipped" << in_skipped << "not_in_skipped" << not_in_skipped; //qLog(Debug) << "in_skipped" << in_skipped << "not_in_skipped" << not_in_skipped;
if (selected < 1) { if (selected < 1) {
playlist_queue_->setVisible(false); playlist_queue_->setVisible(false);
playlist_skip_->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); ui_->action_edit_value->setVisible(false);
} }
else { else {
Playlist::Column column = (Playlist::Column)index.column(); Playlist::Column column = (Playlist::Column)index.column();
bool column_is_editable = Playlist::column_is_editable(column) && editable; bool column_is_editable = Playlist::column_is_editable(column) && editable;
@ -1584,7 +1584,7 @@ void MainWindow::EditValue() {
} }
void MainWindow::AddFile() { void MainWindow::AddFile() {
// Last used directory // Last used directory
QString directory =settings_.value("add_media_path", QDir::currentPath()).toString(); QString directory =settings_.value("add_media_path", QDir::currentPath()).toString();
@ -2052,7 +2052,7 @@ SettingsDialog *MainWindow::CreateSettingsDialog() {
} }
void MainWindow::EnsureSettingsDialogCreated() { void MainWindow::EnsureSettingsDialogCreated() {
//if (settings_dialog_) return; //if (settings_dialog_) return;
//settings_dialog_.reset(new SettingsDialog(app_)); //settings_dialog_.reset(new SettingsDialog(app_));
@ -2064,14 +2064,14 @@ void MainWindow::EnsureSettingsDialogCreated() {
// Allows custom notification preview // Allows custom notification preview
//connect(settings_dialog_.get(), SIGNAL(NotificationPreview(OSD::Behaviour,QString,QString)), SLOT(HandleNotificationPreview(OSD::Behaviour, QString, QString))); //connect(settings_dialog_.get(), SIGNAL(NotificationPreview(OSD::Behaviour,QString,QString)), SLOT(HandleNotificationPreview(OSD::Behaviour, QString, QString)));
} }
void MainWindow::OpenSettingsDialog() { void MainWindow::OpenSettingsDialog() {
EnsureSettingsDialogCreated(); EnsureSettingsDialogCreated();
settings_dialog_->show(); settings_dialog_->show();
} }
void MainWindow::OpenSettingsDialogAtPage(SettingsDialog::Page page) { void MainWindow::OpenSettingsDialogAtPage(SettingsDialog::Page page) {
@ -2127,7 +2127,7 @@ void MainWindow::ShowErrorDialog(const QString &message) {
} }
void MainWindow::CheckFullRescanRevisions() { void MainWindow::CheckFullRescanRevisions() {
int from = app_->database()->startup_schema_version(); int from = app_->database()->startup_schema_version();
int to = app_->database()->current_schema_version(); int to = app_->database()->current_schema_version();
@ -2169,7 +2169,7 @@ void MainWindow::ShowQueueManager() {
} }
void MainWindow::PlaylistViewSelectionModelChanged() { void MainWindow::PlaylistViewSelectionModelChanged() {
connect(ui_->playlist->view()->selectionModel(),SIGNAL(currentChanged(QModelIndex, QModelIndex)), SLOT(PlaylistCurrentChanged(QModelIndex))); connect(ui_->playlist->view()->selectionModel(),SIGNAL(currentChanged(QModelIndex, QModelIndex)), SLOT(PlaylistCurrentChanged(QModelIndex)));
} }
@ -2251,7 +2251,7 @@ void MainWindow::AutoCompleteTags() {
} }
void MainWindow::AutoCompleteTagsAccepted() { void MainWindow::AutoCompleteTagsAccepted() {
for (PlaylistItemPtr item : autocomplete_tag_items_) { for (PlaylistItemPtr item : autocomplete_tag_items_) {
item->Reload(); item->Reload();
} }
@ -2389,7 +2389,7 @@ void MainWindow::AlbumArtLoaded(const Song &song, const QString&, const QImage &
} }
void MainWindow::GetCoverAutomatically() { void MainWindow::GetCoverAutomatically() {
// Search for cover automatically? // Search for cover automatically?
bool search = bool search =
album_cover_choice_controller_->search_cover_auto_action()->isChecked() && album_cover_choice_controller_->search_cover_auto_action()->isChecked() &&

View File

@ -296,7 +296,7 @@ signals:
// creates the icon by painting the full one depending on the current position // creates the icon by painting the full one depending on the current position
QPixmap CreateOverlayedIcon(int position, int scrobble_point); QPixmap CreateOverlayedIcon(int position, int scrobble_point);
void GetCoverAutomatically(); void GetCoverAutomatically();
private: private:

View File

@ -453,7 +453,7 @@ bool MergedProxyModel::dropMimeData(const QMimeData *data, Qt::DropAction action
} }
QModelIndex MergedProxyModel::FindSourceParent(const QModelIndex &proxy_index) const { QModelIndex MergedProxyModel::FindSourceParent(const QModelIndex &proxy_index) const {
if (!proxy_index.isValid()) return QModelIndex(); if (!proxy_index.isValid()) return QModelIndex();
QModelIndex source_index = mapToSource(proxy_index); 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 { bool MergedProxyModel::canFetchMore(const QModelIndex &parent) const {
QModelIndex source_index = mapToSource(parent); QModelIndex source_index = mapToSource(parent);
if (!source_index.isValid()) if (!source_index.isValid())
@ -473,7 +473,7 @@ bool MergedProxyModel::canFetchMore(const QModelIndex &parent) const {
} }
void MergedProxyModel::fetchMore(const QModelIndex &parent) { void MergedProxyModel::fetchMore(const QModelIndex &parent) {
QModelIndex source_index = mapToSource(parent); QModelIndex source_index = mapToSource(parent);
if (!source_index.isValid()) if (!source_index.isValid())

View File

@ -52,7 +52,7 @@ class MimeData : public QMimeData {
// If this is set then the items are added to the queue after being inserted. // If this is set then the items are added to the queue after being inserted.
bool enqueue_now_; bool enqueue_now_;
// If this is set then the items are added to the beginning of the queue after being inserted. // If this is set then the items are added to the beginning of the queue after being inserted.
bool enqueue_next_now_; bool enqueue_next_now_;

View File

@ -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(CurrentSongChanged(Song)), SLOT(CurrentSongChanged(Song)));
connect(app_->playlist_manager(), SIGNAL(PlaylistChanged(Playlist*)), SLOT(PlaylistChanged(Playlist*))); connect(app_->playlist_manager(), SIGNAL(PlaylistChanged(Playlist*)), SLOT(PlaylistChanged(Playlist*)));
connect(app_->playlist_manager(), SIGNAL(CurrentChanged(Playlist*)), SLOT(PlaylistCollectionChanged(Playlist*))); connect(app_->playlist_manager(), SIGNAL(CurrentChanged(Playlist*)), SLOT(PlaylistCollectionChanged(Playlist*)));
} }
// when PlaylistManager gets it ready, we connect PlaylistSequence with this // when PlaylistManager gets it ready, we connect PlaylistSequence with this

View File

@ -155,7 +155,7 @@ void Player::CreateEngine(Engine::EngineType enginetype) {
} }
void Player::Init() { void Player::Init() {
if (!engine_->Init()) { qFatal("Error initialising audio engine"); } if (!engine_->Init()) { qFatal("Error initialising audio engine"); }
analyzer_->SetEngine(engine_.get()); analyzer_->SetEngine(engine_.get());
@ -347,7 +347,7 @@ void Player::TrackEnded() {
} }
void Player::PlayPause() { void Player::PlayPause() {
switch (engine_->state()) { switch (engine_->state()) {
case Engine::Paused: case Engine::Paused:
engine_->Unpause(); engine_->Unpause();
@ -520,7 +520,7 @@ void Player::CurrentMetadataChanged(const Song &metadata) {
} }
void Player::SeekTo(int seconds) { void Player::SeekTo(int seconds) {
const qint64 length_nanosec = engine_->length_nanosec(); 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. // 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); url_handlers_.insert(scheme, handler);
connect(handler, SIGNAL(destroyed(QObject*)), SLOT(UrlHandlerDestroyed(QObject*))); connect(handler, SIGNAL(destroyed(QObject*)), SLOT(UrlHandlerDestroyed(QObject*)));
connect(handler, SIGNAL(AsyncLoadComplete(UrlHandler::LoadResult)), SLOT(HandleLoadResult(UrlHandler::LoadResult))); connect(handler, SIGNAL(AsyncLoadComplete(UrlHandler::LoadResult)), SLOT(HandleLoadResult(UrlHandler::LoadResult)));
} }
void Player::UnregisterUrlHandler(UrlHandler *handler) { void Player::UnregisterUrlHandler(UrlHandler *handler) {

View File

@ -78,7 +78,7 @@ QtSystemTrayIcon::~QtSystemTrayIcon() {
} }
bool QtSystemTrayIcon::eventFilter(QObject *object, QEvent *event) { bool QtSystemTrayIcon::eventFilter(QObject *object, QEvent *event) {
if (QObject::eventFilter(object, event)) return true; if (QObject::eventFilter(object, event)) return true;
if (object != tray_) return false; if (object != tray_) return false;
@ -135,7 +135,7 @@ void QtSystemTrayIcon::SetupMenu(QAction *previous, QAction *play, QAction *stop
} }
void QtSystemTrayIcon::Clicked(QSystemTrayIcon::ActivationReason reason) { void QtSystemTrayIcon::Clicked(QSystemTrayIcon::ActivationReason reason) {
switch (reason) { switch (reason) {
case QSystemTrayIcon::DoubleClick: case QSystemTrayIcon::DoubleClick:
case QSystemTrayIcon::Trigger: case QSystemTrayIcon::Trigger:

View File

@ -1051,7 +1051,7 @@ void Song::BindToQuery(QSqlQuery *query) const {
query->bindValue(":mtime", notnullintval(d->mtime_)); query->bindValue(":mtime", notnullintval(d->mtime_));
query->bindValue(":ctime", notnullintval(d->ctime_)); query->bindValue(":ctime", notnullintval(d->ctime_));
query->bindValue(":unavailable", d->unavailable_ ? 1 : 0); query->bindValue(":unavailable", d->unavailable_ ? 1 : 0);
query->bindValue(":playcount", d->playcount_); query->bindValue(":playcount", d->playcount_);
query->bindValue(":skipcount", d->skipcount_); query->bindValue(":skipcount", d->skipcount_);
query->bindValue(":lastplayed", intval(d->lastplayed_)); 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_on", d->compilation_on_ ? 1 : 0);
query->bindValue(":compilation_off", d->compilation_off_ ? 1 : 0); query->bindValue(":compilation_off", d->compilation_off_ ? 1 : 0);
query->bindValue(":compilation_effective", is_compilation() ? 1 : 0); query->bindValue(":compilation_effective", is_compilation() ? 1 : 0);
query->bindValue(":art_automatic", d->art_automatic_); query->bindValue(":art_automatic", d->art_automatic_);
query->bindValue(":art_manual", d->art_manual_); query->bindValue(":art_manual", d->art_manual_);
query->bindValue(":effective_albumartist", this->effective_albumartist()); query->bindValue(":effective_albumartist", this->effective_albumartist());
query->bindValue(":effective_originalyear", intval(this->effective_originalyear())); query->bindValue(":effective_originalyear", intval(this->effective_originalyear()));
query->bindValue(":cue_path", d->cue_path_); query->bindValue(":cue_path", d->cue_path_);
#undef intval #undef intval

View File

@ -82,7 +82,7 @@ class Song {
static const QString kManuallyUnsetCover; static const QString kManuallyUnsetCover;
static const QString kEmbeddedCover; static const QString kEmbeddedCover;
static const QRegExp kCoverRemoveDisc; static const QRegExp kCoverRemoveDisc;
static QString JoinSpec(const QString &table); static QString JoinSpec(const QString &table);
@ -214,18 +214,18 @@ class Song {
const QString &art_automatic() const; const QString &art_automatic() const;
const QString &art_manual() const; const QString &art_manual() const;
const QString &cue_path() const; const QString &cue_path() const;
bool has_cue() const; bool has_cue() const;
const QString &effective_album() const; const QString &effective_album() const;
int effective_originalyear() const; int effective_originalyear() const;
const QString &effective_albumartist() const; const QString &effective_albumartist() const;
bool is_collection_song() const; bool is_collection_song() const;
bool is_stream() const; bool is_stream() const;
bool is_cdda() 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: // 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; const QString &playlist_albumartist() const;
@ -248,7 +248,7 @@ class Song {
QString PrettyYear() const; QString PrettyYear() const;
QString TitleWithCompilationArtist() const; QString TitleWithCompilationArtist() const;
QString SampleRateBitDepthToText() const; QString SampleRateBitDepthToText() const;
// Setters // Setters
@ -292,7 +292,7 @@ class Song {
void set_mtime(int v); void set_mtime(int v);
void set_ctime(int v); void set_ctime(int v);
void set_unavailable(bool v); void set_unavailable(bool v);
void set_playcount(int v); void set_playcount(int v);
void set_skipcount(int v); void set_skipcount(int v);
void set_lastplayed(int v); void set_lastplayed(int v);
@ -300,12 +300,12 @@ class Song {
void set_compilation_detected(bool v); void set_compilation_detected(bool v);
void set_compilation_on(bool v); void set_compilation_on(bool v);
void set_compilation_off(bool v); void set_compilation_off(bool v);
void set_art_automatic(const QString &v); void set_art_automatic(const QString &v);
void set_art_manual(const QString &v); void set_art_manual(const QString &v);
void set_cue_path(const QString &v); void set_cue_path(const QString &v);
void set_image(const QImage &i); void set_image(const QImage &i);
// Comparison functions // Comparison functions

View File

@ -96,7 +96,7 @@ SongLoader::SongLoader(CollectionBackendInterface *collection, const Player *pla
timeout_timer_->setSingleShot(true); timeout_timer_->setSingleShot(true);
connect(timeout_timer_, SIGNAL(timeout()), SLOT(Timeout())); connect(timeout_timer_, SIGNAL(timeout()), SLOT(Timeout()));
} }
SongLoader::~SongLoader() { SongLoader::~SongLoader() {
@ -520,7 +520,7 @@ GstBusSyncReply SongLoader::BusCallbackSync(GstBus *, GstMessage *msg, gpointer
#ifdef HAVE_GSTREAMER #ifdef HAVE_GSTREAMER
void SongLoader::ErrorMessageReceived(GstMessage *msg) { void SongLoader::ErrorMessageReceived(GstMessage *msg) {
if (state_ == Finished) return; if (state_ == Finished) return;
GError *error; GError *error;

View File

@ -55,7 +55,7 @@ void TagReaderClient::WorkerFailedToStart() {
} }
TagReaderReply *TagReaderClient::ReadFile(const QString &filename) { TagReaderReply *TagReaderClient::ReadFile(const QString &filename) {
pb::tagreader::Message message; pb::tagreader::Message message;
pb::tagreader::ReadFileRequest *req = message.mutable_read_file_request(); 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) { TagReaderReply *TagReaderClient::IsMediaFile(const QString &filename) {
pb::tagreader::Message message; pb::tagreader::Message message;
pb::tagreader::IsMediaFileRequest *req = message.mutable_is_media_file_request(); 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) { TagReaderReply *TagReaderClient::LoadEmbeddedArt(const QString &filename) {
pb::tagreader::Message message; pb::tagreader::Message message;
pb::tagreader::LoadEmbeddedArtRequest *req = message.mutable_load_embedded_art_request(); 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) { void TagReaderClient::ReadFileBlocking(const QString &filename, Song *song) {
Q_ASSERT(QThread::currentThread() != thread()); Q_ASSERT(QThread::currentThread() != thread());
TagReaderReply *reply = ReadFile(filename); 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) { bool TagReaderClient::SaveFileBlocking(const QString &filename, const Song &metadata) {
Q_ASSERT(QThread::currentThread() != thread()); Q_ASSERT(QThread::currentThread() != thread());
bool ret = false; bool ret = false;
@ -128,7 +128,7 @@ bool TagReaderClient::SaveFileBlocking(const QString &filename, const Song &meta
} }
bool TagReaderClient::IsMediaFileBlocking(const QString &filename) { bool TagReaderClient::IsMediaFileBlocking(const QString &filename) {
Q_ASSERT(QThread::currentThread() != thread()); Q_ASSERT(QThread::currentThread() != thread());
bool ret = false; bool ret = false;
@ -144,7 +144,7 @@ bool TagReaderClient::IsMediaFileBlocking(const QString &filename) {
} }
QImage TagReaderClient::LoadEmbeddedArtBlocking(const QString &filename) { QImage TagReaderClient::LoadEmbeddedArtBlocking(const QString &filename) {
Q_ASSERT(QThread::currentThread() != thread()); Q_ASSERT(QThread::currentThread() != thread());
QImage ret; QImage ret;

View File

@ -298,7 +298,7 @@ bool RemoveRecursive(const QString &path) {
} }
bool CopyRecursive(const QString &source, const QString &destination) { bool CopyRecursive(const QString &source, const QString &destination) {
// Make the destination directory // Make the destination directory
QString dir_name = source.section('/', -1, -1); QString dir_name = source.section('/', -1, -1);
QString dest_path = destination + "/" + dir_name; QString dest_path = destination + "/" + dir_name;
@ -323,7 +323,7 @@ bool CopyRecursive(const QString &source, const QString &destination) {
} }
bool Copy(QIODevice *source, QIODevice *destination) { bool Copy(QIODevice *source, QIODevice *destination) {
if (!source->open(QIODevice::ReadOnly)) return false; if (!source->open(QIODevice::ReadOnly)) return false;
if (!destination->open(QIODevice::WriteOnly)) 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); QCryptographicHash hash(QCryptographicHash::Sha1);
hash.addData(artist.toLower().toUtf8().constData()); hash.addData(artist.toLower().toUtf8().constData());
hash.addData(album.toLower().toUtf8().constData()); hash.addData(album.toLower().toUtf8().constData());
//qLog(Debug) << artist << album << hash.result(); //qLog(Debug) << artist << album << hash.result();
return hash.result(); return hash.result();

View File

@ -143,7 +143,7 @@ void AlbumCoverChoiceController::SaveCoverToFile(const Song &song, const QImage
} }
QString AlbumCoverChoiceController::GetInitialPathForFileDialog(const Song &song, const QString &filename) { QString AlbumCoverChoiceController::GetInitialPathForFileDialog(const Song &song, const QString &filename) {
// Art automatic is first to show user which cover the album may be using now; // 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 // 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()) { if (!song.art_automatic().isEmpty() && !song.has_embedded_cover()) {
@ -162,7 +162,7 @@ QString AlbumCoverChoiceController::GetInitialPathForFileDialog(const Song &song
} }
QString AlbumCoverChoiceController::LoadCoverFromURL(Song *song) { QString AlbumCoverChoiceController::LoadCoverFromURL(Song *song) {
if (!cover_from_url_dialog_) { cover_from_url_dialog_ = new CoverFromURLDialog(this); } if (!cover_from_url_dialog_) { cover_from_url_dialog_ = new CoverFromURLDialog(this); }
QImage image = cover_from_url_dialog_->Exec(); QImage image = cover_from_url_dialog_->Exec();
@ -174,7 +174,7 @@ QString AlbumCoverChoiceController::LoadCoverFromURL(Song *song) {
return cover; return cover;
} }
else { return QString(); } else { return QString(); }
} }
QString AlbumCoverChoiceController::SearchForCover(Song *song) { QString AlbumCoverChoiceController::SearchForCover(Song *song) {
@ -192,7 +192,7 @@ QString AlbumCoverChoiceController::SearchForCover(Song *song) {
return cover; return cover;
} }
else { return QString(); } else { return QString(); }
} }
QString AlbumCoverChoiceController::UnsetCover(Song *song) { QString AlbumCoverChoiceController::UnsetCover(Song *song) {

View File

@ -112,7 +112,7 @@ signals:
QHash<quint64, AlbumCoverFetcherSearch*> active_requests_; QHash<quint64, AlbumCoverFetcherSearch*> active_requests_;
QTimer *request_starter_; QTimer *request_starter_;
}; };
#endif // ALBUMCOVERFETCHER_H #endif // ALBUMCOVERFETCHER_H

View File

@ -102,7 +102,7 @@ class AlbumCoverFetcherSearch : public QObject {
QNetworkAccessManager *network_; QNetworkAccessManager *network_;
bool cancel_requested_; bool cancel_requested_;
}; };
#endif // ALBUMCOVERFETCHERSEARCH_H #endif // ALBUMCOVERFETCHERSEARCH_H

View File

@ -56,7 +56,7 @@ QString AlbumCoverLoader::ImageCacheDir() {
} }
void AlbumCoverLoader::CancelTask(quint64 id) { void AlbumCoverLoader::CancelTask(quint64 id) {
QMutexLocker l(&mutex_); QMutexLocker l(&mutex_);
for (QQueue<Task>::iterator it = tasks_.begin(); it != tasks_.end(); ++it) { for (QQueue<Task>::iterator it = tasks_.begin(); it != tasks_.end(); ++it) {
if (it->id == id) { if (it->id == id) {
@ -67,7 +67,7 @@ void AlbumCoverLoader::CancelTask(quint64 id) {
} }
void AlbumCoverLoader::CancelTasks(const QSet<quint64> &ids) { void AlbumCoverLoader::CancelTasks(const QSet<quint64> &ids) {
QMutexLocker l(&mutex_); QMutexLocker l(&mutex_);
for (QQueue<Task>::iterator it = tasks_.begin(); it != tasks_.end();) { for (QQueue<Task>::iterator it = tasks_.begin(); it != tasks_.end();) {
if (ids.contains(it->id)) { if (ids.contains(it->id)) {
@ -226,7 +226,7 @@ void AlbumCoverLoader::RemoteFetchFinished(QNetworkReply *reply) {
} }
NextState(&task); NextState(&task);
} }
QImage AlbumCoverLoader::ScaleAndPad(const AlbumCoverLoaderOptions &options, const QImage &image) { QImage AlbumCoverLoader::ScaleAndPad(const AlbumCoverLoaderOptions &options, const QImage &image) {

View File

@ -266,7 +266,7 @@ void AlbumCoverManager::CancelRequests() {
abort_progress_->hide(); abort_progress_->hide();
statusBar()->clearMessage(); statusBar()->clearMessage();
EnableCoversButtons(); EnableCoversButtons();
} }
static bool CompareNocase(const QString &left, const QString &right) { static bool CompareNocase(const QString &left, const QString &right) {
@ -292,7 +292,7 @@ void AlbumCoverManager::Reset() {
if (artist.isEmpty()) continue; if (artist.isEmpty()) continue;
new QListWidgetItem(artist_icon_, artist, ui_->artists, Specific_Artist); new QListWidgetItem(artist_icon_, artist, ui_->artists, Specific_Artist);
} }
} }
void AlbumCoverManager::EnableCoversButtons() { void AlbumCoverManager::EnableCoversButtons() {
@ -375,7 +375,7 @@ void AlbumCoverManager::CoverImageLoaded(quint64 id, const QImage &image) {
} }
void AlbumCoverManager::UpdateFilter() { void AlbumCoverManager::UpdateFilter() {
const QString filter = ui_->filter->text().toLower(); const QString filter = ui_->filter->text().toLower();
const bool hide_with_covers = filter_without_covers_->isChecked(); const bool hide_with_covers = filter_without_covers_->isChecked();
const bool hide_without_covers = filter_with_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() { void AlbumCoverManager::UpdateStatusText() {
QString message = tr("Got %1 covers out of %2 (%3 failed)") QString message = tr("Got %1 covers out of %2 (%3 failed)")
.arg(fetch_statistics_.chosen_images_) .arg(fetch_statistics_.chosen_images_)
.arg(jobs_) .arg(jobs_)
@ -540,7 +540,7 @@ Song AlbumCoverManager::GetFirstSelectedAsSong() {
} }
Song AlbumCoverManager::ItemAsSong(QListWidgetItem *item) { Song AlbumCoverManager::ItemAsSong(QListWidgetItem *item) {
Song result; Song result;
QString title = item->data(Role_AlbumName).toString(); QString title = item->data(Role_AlbumName).toString();
@ -569,7 +569,7 @@ Song AlbumCoverManager::ItemAsSong(QListWidgetItem *item) {
} }
void AlbumCoverManager::ShowCover() { void AlbumCoverManager::ShowCover() {
Song song = GetSingleSelectionAsSong(); Song song = GetSingleSelectionAsSong();
if (!song.is_valid()) return; if (!song.is_valid()) return;
@ -592,15 +592,15 @@ void AlbumCoverManager::FetchSingleCover() {
} }
void AlbumCoverManager::UpdateCoverInList(QListWidgetItem *item, const QString &cover) { void AlbumCoverManager::UpdateCoverInList(QListWidgetItem *item, const QString &cover) {
quint64 id = app_->album_cover_loader()->LoadImageAsync(cover_loader_options_, QString(), cover); quint64 id = app_->album_cover_loader()->LoadImageAsync(cover_loader_options_, QString(), cover);
item->setData(Role_PathManual, cover); item->setData(Role_PathManual, cover);
cover_loading_tasks_[id] = item; cover_loading_tasks_[id] = item;
} }
void AlbumCoverManager::LoadCoverFromFile() { void AlbumCoverManager::LoadCoverFromFile() {
Song song = GetSingleSelectionAsSong(); Song song = GetSingleSelectionAsSong();
if (!song.is_valid()) return; if (!song.is_valid()) return;
@ -611,7 +611,7 @@ void AlbumCoverManager::LoadCoverFromFile() {
if (!cover.isEmpty()) { if (!cover.isEmpty()) {
UpdateCoverInList(item, cover); UpdateCoverInList(item, cover);
} }
} }
void AlbumCoverManager::SaveCoverToFile() { void AlbumCoverManager::SaveCoverToFile() {
@ -638,7 +638,7 @@ void AlbumCoverManager::SaveCoverToFile() {
} }
album_cover_choice_controller_->SaveCoverToFile(song, image); album_cover_choice_controller_->SaveCoverToFile(song, image);
} }
void AlbumCoverManager::LoadCoverFromURL() { void AlbumCoverManager::LoadCoverFromURL() {
@ -676,11 +676,11 @@ void AlbumCoverManager::SearchForCover() {
UpdateCoverInList(current, cover); UpdateCoverInList(current, cover);
} }
} }
void AlbumCoverManager::UnsetCover() { void AlbumCoverManager::UnsetCover() {
Song song = GetFirstSelectedAsSong(); Song song = GetFirstSelectedAsSong();
if (!song.is_valid()) return; if (!song.is_valid()) return;
@ -699,11 +699,11 @@ void AlbumCoverManager::UnsetCover() {
album_cover_choice_controller_->SaveCover(&current_song, cover); album_cover_choice_controller_->SaveCover(&current_song, cover);
} }
} }
} }
SongList AlbumCoverManager::GetSongsInAlbum(const QModelIndex &index) const { SongList AlbumCoverManager::GetSongsInAlbum(const QModelIndex &index) const {
SongList ret; SongList ret;
CollectionQuery q; CollectionQuery q;
@ -731,7 +731,7 @@ SongList AlbumCoverManager::GetSongsInAlbum(const QModelIndex &index) const {
ret << song; ret << song;
} }
return ret; return ret;
} }
SongList AlbumCoverManager::GetSongsInAlbums(const QModelIndexList &indexes) const { SongList AlbumCoverManager::GetSongsInAlbums(const QModelIndexList &indexes) const {
@ -741,7 +741,7 @@ SongList AlbumCoverManager::GetSongsInAlbums(const QModelIndexList &indexes) con
ret << GetSongsInAlbum(index); ret << GetSongsInAlbum(index);
} }
return ret; return ret;
} }
SongMimeData *AlbumCoverManager::GetMimeDataForAlbums(const QModelIndexList &indexes) const { SongMimeData *AlbumCoverManager::GetMimeDataForAlbums(const QModelIndexList &indexes) const {
@ -781,7 +781,7 @@ void AlbumCoverManager::LoadSelectedToPlaylist() {
} }
void AlbumCoverManager::SaveAndSetCover(QListWidgetItem *item, const QImage &image) { void AlbumCoverManager::SaveAndSetCover(QListWidgetItem *item, const QImage &image) {
const QString artist = item->data(Role_ArtistName).toString(); const QString artist = item->data(Role_ArtistName).toString();
const QString albumartist = item->data(Role_AlbumArtistName).toString(); const QString albumartist = item->data(Role_AlbumArtistName).toString();
const QString album = item->data(Role_AlbumName).toString(); const QString album = item->data(Role_AlbumName).toString();
@ -799,7 +799,7 @@ void AlbumCoverManager::SaveAndSetCover(QListWidgetItem *item, const QImage &ima
} }
void AlbumCoverManager::ExportCovers() { void AlbumCoverManager::ExportCovers() {
AlbumCoverExport::DialogResult result = cover_export_->Exec(); AlbumCoverExport::DialogResult result = cover_export_->Exec();
if (result.cancelled_) { if (result.cancelled_) {
@ -838,7 +838,7 @@ void AlbumCoverManager::ExportCovers() {
} }
void AlbumCoverManager::UpdateExportStatus(int exported, int skipped, int max) { void AlbumCoverManager::UpdateExportStatus(int exported, int skipped, int max) {
progress_bar_->setValue(exported); progress_bar_->setValue(exported);
QString message = tr("Exported %1 covers out of %2 (%3 skipped)") QString message = tr("Exported %1 covers out of %2 (%3 skipped)")

View File

@ -55,13 +55,13 @@ const char *AmazonCoverProvider::kSecretAccessKeyB64 = "TjFZU3F2c2hJZDVtUGxKVW1K
AmazonCoverProvider::AmazonCoverProvider(QObject *parent) : CoverProvider("Amazon", true, parent), network_(new NetworkAccessManager(this)) {} AmazonCoverProvider::AmazonCoverProvider(QObject *parent) : CoverProvider("Amazon", true, parent), network_(new NetworkAccessManager(this)) {}
bool AmazonCoverProvider::StartSearch(const QString &artist, const QString &album, int id) { bool AmazonCoverProvider::StartSearch(const QString &artist, const QString &album, int id) {
typedef QPair<QString, QString> Arg; typedef QPair<QString, QString> Arg;
typedef QList<Arg> ArgList; typedef QList<Arg> ArgList;
typedef QPair<QByteArray, QByteArray> EncodedArg; typedef QPair<QByteArray, QByteArray> EncodedArg;
typedef QList<EncodedArg> EncodedArgList; typedef QList<EncodedArg> EncodedArgList;
// Must be sorted by parameter name // Must be sorted by parameter name
ArgList args = ArgList() ArgList args = ArgList()
<< Arg("AWSAccessKeyId", QByteArray::fromBase64(kAccessKeyB64)) << Arg("AWSAccessKeyId", QByteArray::fromBase64(kAccessKeyB64))
@ -108,9 +108,9 @@ void AmazonCoverProvider::QueryError(QNetworkReply::NetworkError error, QNetwork
} }
void AmazonCoverProvider::QueryFinished(QNetworkReply *reply, int id) { void AmazonCoverProvider::QueryFinished(QNetworkReply *reply, int id) {
reply->deleteLater(); reply->deleteLater();
QString data(reply->readAll()); QString data(reply->readAll());
CoverSearchResults results; CoverSearchResults results;

View File

@ -91,11 +91,11 @@ bool DiscogsCoverProvider::StartRelease(DiscogsCoverSearchContext *s_ctx, int r_
SendReleaseRequest(s_ctx, r_ctx); SendReleaseRequest(s_ctx, r_ctx);
return true; return true;
} }
void DiscogsCoverProvider::SendSearchRequest(DiscogsCoverSearchContext *s_ctx) { void DiscogsCoverProvider::SendSearchRequest(DiscogsCoverSearchContext *s_ctx) {
typedef QPair<QString, QString> Arg; typedef QPair<QString, QString> Arg;
typedef QList<Arg> ArgList; typedef QList<Arg> ArgList;
@ -187,7 +187,7 @@ void DiscogsCoverProvider::HandleSearchReply(QNetworkReply *reply, int s_id) {
return; return;
} }
DiscogsCoverSearchContext *s_ctx = requests_search_.value(s_id); DiscogsCoverSearchContext *s_ctx = requests_search_.value(s_id);
QJsonDocument json_doc = QJsonDocument::fromJson(reply->readAll()); QJsonDocument json_doc = QJsonDocument::fromJson(reply->readAll());
if ((json_doc.isNull()) || (!json_doc.isObject())) { if ((json_doc.isNull()) || (!json_doc.isObject())) {
qLog(Error) << "Discogs: Failed to create JSON doc."; qLog(Error) << "Discogs: Failed to create JSON doc.";
@ -210,7 +210,7 @@ void DiscogsCoverProvider::HandleSearchReply(QNetworkReply *reply, int s_id) {
EndSearch(s_ctx); EndSearch(s_ctx);
return; return;
} }
QVariantList results = reply_map["results"].toList(); QVariantList results = reply_map["results"].toList();
int i = 0; int i = 0;
@ -245,7 +245,7 @@ void DiscogsCoverProvider::HandleReleaseReply(QNetworkReply *reply, int s_id, in
return; return;
} }
DiscogsCoverSearchContext *s_ctx = requests_search_.value(s_id); DiscogsCoverSearchContext *s_ctx = requests_search_.value(s_id);
QJsonDocument json_doc = QJsonDocument::fromJson(reply->readAll()); QJsonDocument json_doc = QJsonDocument::fromJson(reply->readAll());
if ((json_doc.isNull()) || (!json_doc.isObject())) { if ((json_doc.isNull()) || (!json_doc.isObject())) {
qLog(Error) << "Discogs: Failed to create JSON doc."; 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(); QVariantMap result_map = result.toMap();
CoverSearchResult cover_result; CoverSearchResult cover_result;
cover_result.description = s_ctx->title; cover_result.description = s_ctx->title;
if (result_map.contains("type")) { if (result_map.contains("type")) {
QString type = result_map["type"].toString(); QString type = result_map["type"].toString();
if (type != "primary") continue; if (type != "primary") continue;
@ -324,11 +324,11 @@ void DiscogsCoverProvider::ReleaseRequestError(QNetworkReply::NetworkError error
void DiscogsCoverProvider::EndSearch(DiscogsCoverSearchContext *s_ctx, DiscogsCoverReleaseContext *r_ctx) { void DiscogsCoverProvider::EndSearch(DiscogsCoverSearchContext *s_ctx, DiscogsCoverReleaseContext *r_ctx) {
delete requests_release_.take(r_ctx->id); delete requests_release_.take(r_ctx->id);
s_ctx->r_count--; s_ctx->r_count--;
//qLog(Debug) << "r_count: " << s_ctx->r_count; //qLog(Debug) << "r_count: " << s_ctx->r_count;
if (s_ctx->r_count <= 0) EndSearch(s_ctx); if (s_ctx->r_count <= 0) EndSearch(s_ctx);
} }

View File

@ -69,7 +69,7 @@ class DiscogsCoverProvider : public CoverProvider {
explicit DiscogsCoverProvider(QObject *parent = nullptr); explicit DiscogsCoverProvider(QObject *parent = nullptr);
bool StartSearch(const QString &artist, const QString &album, int s_id); bool StartSearch(const QString &artist, const QString &album, int s_id);
void CancelSearch(int id); void CancelSearch(int id);
private slots: private slots:

View File

@ -47,7 +47,7 @@ bool ParseQuery(const QByteArray &data, XmlQuery *query, bool *connection_proble
} }
bool ParseUserList(QNetworkReply *reply, QList<User> *users) { bool ParseUserList(QNetworkReply *reply, QList<User> *users) {
lastfm::XmlQuery lfm; lastfm::XmlQuery lfm;
if (!lfm.parse(reply->readAll())) { if (!lfm.parse(reply->readAll())) {
return false; return false;

View File

@ -45,7 +45,7 @@ LastFmCoverProvider::LastFmCoverProvider(QObject *parent) : CoverProvider("last.
} }
bool LastFmCoverProvider::StartSearch(const QString &artist, const QString &album, int id) { bool LastFmCoverProvider::StartSearch(const QString &artist, const QString &album, int id) {
QMap<QString, QString> params; QMap<QString, QString> params;
params["method"] = "album.search"; params["method"] = "album.search";
params["album"] = album + " " + artist; params["album"] = album + " " + artist;

View File

@ -213,7 +213,7 @@ QList<QUrl> GioLister::MakeDeviceUrls(const QString &id) {
} }
ret << MakeUrlFromLocalPath(mount_point); ret << MakeUrlFromLocalPath(mount_point);
return ret; return ret;
} }

View File

@ -222,7 +222,7 @@ bool GPodDevice::RemoveTrackFromITunesDb(const QString &path, const QString &rel
itdb_track_remove(track); itdb_track_remove(track);
return true; return true;
} }
bool GPodDevice::DeleteFromStorage(const DeleteJob &job) { bool GPodDevice::DeleteFromStorage(const DeleteJob &job) {

View File

@ -71,7 +71,7 @@ About::About(QWidget *parent):QDialog(parent) {
<< Person("Tyler Rhodes", "tyler.s.rhodes@gmail.com"); << Person("Tyler Rhodes", "tyler.s.rhodes@gmail.com");
QString Title("About Strawberry"); QString Title("About Strawberry");
QFont title_font; QFont title_font;
title_font.setBold(true); title_font.setBold(true);
title_font.setPointSize(title_font.pointSize() + 4); title_font.setPointSize(title_font.pointSize() + 4);

View File

@ -40,7 +40,7 @@
#include "core/database.h" #include "core/database.h"
Console::Console(Application *app, QWidget *parent) : QDialog(parent), app_(app) { Console::Console(Application *app, QWidget *parent) : QDialog(parent), app_(app) {
ui_.setupUi(this); ui_.setupUi(this);
connect(ui_.run, SIGNAL(clicked()), SLOT(RunQuery())); connect(ui_.run, SIGNAL(clicked()), SLOT(RunQuery()));

View File

@ -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_Composer, ui_->composer);
new TagCompleter(app_->collection_backend(), Playlist::Column_Performer, ui_->performer); new TagCompleter(app_->collection_backend(), Playlist::Column_Performer, ui_->performer);
new TagCompleter(app_->collection_backend(), Playlist::Column_Grouping, ui_->grouping); new TagCompleter(app_->collection_backend(), Playlist::Column_Grouping, ui_->grouping);
} }
EditTagDialog::~EditTagDialog() { EditTagDialog::~EditTagDialog() {
@ -238,7 +238,7 @@ EditTagDialog::~EditTagDialog() {
} }
bool EditTagDialog::SetLoading(const QString &message) { bool EditTagDialog::SetLoading(const QString &message) {
const bool loading = !message.isEmpty(); const bool loading = !message.isEmpty();
if (loading == loading_) return false; if (loading == loading_) return false;
loading_ = loading; loading_ = loading;
@ -256,7 +256,7 @@ bool EditTagDialog::SetLoading(const QString &message) {
} }
QList<EditTagDialog::Data> EditTagDialog::LoadData(const SongList &songs) const { QList<EditTagDialog::Data> EditTagDialog::LoadData(const SongList &songs) const {
QList<Data> ret; QList<Data> ret;
for (const Song &song : songs) { for (const Song &song : songs) {
@ -276,7 +276,7 @@ QList<EditTagDialog::Data> EditTagDialog::LoadData(const SongList &songs) const
} }
void EditTagDialog::SetSongs(const SongList &s, const PlaylistItemList &items) { void EditTagDialog::SetSongs(const SongList &s, const PlaylistItemList &items) {
// Show the loading indicator // Show the loading indicator
if (!SetLoading(tr("Loading tracks") + "...")) return; 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) { QVariant EditTagDialog::Data::value(const Song &song, const QString &id) {
if (id == "title") return song.title(); if (id == "title") return song.title();
if (id == "artist") return song.artist(); if (id == "artist") return song.artist();
if (id == "album") return song.album(); 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) { void EditTagDialog::InitFieldValue(const FieldData &field, const QModelIndexList &sel) {
const bool varies = DoesValueVary(sel, field.id_); const bool varies = DoesValueVary(sel, field.id_);
// const bool modified = IsValueModified(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) { void EditTagDialog::UpdateFieldValue(const FieldData &field, const QModelIndexList &sel) {
// Get the value from the field // Get the value from the field
QVariant value; QVariant value;
if (ExtendedEditor *editor = dynamic_cast<ExtendedEditor*>(field.editor_)) { if (ExtendedEditor *editor = dynamic_cast<ExtendedEditor*>(field.editor_)) {
@ -436,7 +436,7 @@ void EditTagDialog::UpdateModifiedField(const FieldData &field, const QModelInde
} }
void EditTagDialog::ResetFieldValue(const FieldData &field, const QModelIndexList &sel) { void EditTagDialog::ResetFieldValue(const FieldData &field, const QModelIndexList &sel) {
// Reset each selected song // Reset each selected song
for (const QModelIndex &i : sel) { for (const QModelIndex &i : sel) {
Data &data = data_[i.row()]; Data &data = data_[i.row()];
@ -449,7 +449,7 @@ void EditTagDialog::ResetFieldValue(const FieldData &field, const QModelIndexLis
} }
void EditTagDialog::SelectionChanged() { void EditTagDialog::SelectionChanged() {
const QModelIndexList sel = ui_->song_list->selectionModel()->selectedIndexes(); const QModelIndexList sel = ui_->song_list->selectionModel()->selectedIndexes();
if (sel.isEmpty()) if (sel.isEmpty())
return; return;
@ -470,7 +470,7 @@ void EditTagDialog::SelectionChanged() {
} }
void EditTagDialog::UpdateUI(const QModelIndexList &sel){ void EditTagDialog::UpdateUI(const QModelIndexList &sel){
ignore_edits_ = true; ignore_edits_ = true;
for (const FieldData &field : fields_) { for (const FieldData &field : fields_) {
InitFieldValue(field, sel); 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) { static void SetDate(QLabel *label, uint time) {
if (time == std::numeric_limits<uint>::max()) { // -1 if (time == std::numeric_limits<uint>::max()) { // -1
label->setText(QObject::tr("Unknown")); label->setText(QObject::tr("Unknown"));
} }
@ -548,11 +548,11 @@ void EditTagDialog::UpdateSummaryTab(const Song &song) {
ui_->filename->setText(song.url().toString()); ui_->filename->setText(song.url().toString());
album_cover_choice_controller_->search_for_cover_action()->setEnabled(app_->cover_providers()->HasAnyProviders()); album_cover_choice_controller_->search_for_cover_action()->setEnabled(app_->cover_providers()->HasAnyProviders());
} }
void EditTagDialog::UpdateStatisticsTab(const Song &song) { void EditTagDialog::UpdateStatisticsTab(const Song &song) {
ui_->playcount->setText(QString::number(qMax(0, song.playcount()))); ui_->playcount->setText(QString::number(qMax(0, song.playcount())));
ui_->skipcount->setText(QString::number(qMax(0, song.skipcount()))); 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) { void EditTagDialog::ArtLoaded(quint64 id, const QImage &scaled, const QImage &original) {
if (id == cover_art_id_) { if (id == cover_art_id_) {
ui_->art->setPixmap(QPixmap::fromImage(scaled)); ui_->art->setPixmap(QPixmap::fromImage(scaled));
original_ = original; original_ = original;
@ -570,7 +570,7 @@ void EditTagDialog::ArtLoaded(quint64 id, const QImage &scaled, const QImage &or
} }
void EditTagDialog::FieldValueEdited() { void EditTagDialog::FieldValueEdited() {
if (ignore_edits_) return; if (ignore_edits_) return;
const QModelIndexList sel = ui_->song_list->selectionModel()->selectedIndexes(); const QModelIndexList sel = ui_->song_list->selectionModel()->selectedIndexes();
@ -590,7 +590,7 @@ void EditTagDialog::FieldValueEdited() {
} }
void EditTagDialog::ResetField() { void EditTagDialog::ResetField() {
const QModelIndexList sel = ui_->song_list->selectionModel()->selectedIndexes(); const QModelIndexList sel = ui_->song_list->selectionModel()->selectedIndexes();
if (sel.isEmpty()) if (sel.isEmpty())
return; return;
@ -610,7 +610,7 @@ void EditTagDialog::ResetField() {
} }
Song *EditTagDialog::GetFirstSelected() { Song *EditTagDialog::GetFirstSelected() {
const QModelIndexList sel = ui_->song_list->selectionModel()->selectedIndexes(); const QModelIndexList sel = ui_->song_list->selectionModel()->selectedIndexes();
if (sel.isEmpty()) return nullptr; if (sel.isEmpty()) return nullptr;
return &data_[sel.first().row()].original_; return &data_[sel.first().row()].original_;
@ -618,7 +618,7 @@ Song *EditTagDialog::GetFirstSelected() {
} }
void EditTagDialog::LoadCoverFromFile() { void EditTagDialog::LoadCoverFromFile() {
Song *song = GetFirstSelected(); Song *song = GetFirstSelected();
if (!song) return; if (!song) return;
@ -631,7 +631,7 @@ void EditTagDialog::LoadCoverFromFile() {
} }
void EditTagDialog::SaveCoverToFile() { void EditTagDialog::SaveCoverToFile() {
Song *song = GetFirstSelected(); Song *song = GetFirstSelected();
if (!song) return; if (!song) return;
@ -652,7 +652,7 @@ void EditTagDialog::LoadCoverFromURL() {
} }
void EditTagDialog::SearchForCover() { void EditTagDialog::SearchForCover() {
Song *song = GetFirstSelected(); Song *song = GetFirstSelected();
if (!song) return; if (!song) return;
@ -664,7 +664,7 @@ void EditTagDialog::SearchForCover() {
} }
void EditTagDialog::UnsetCover() { void EditTagDialog::UnsetCover() {
Song *song = GetFirstSelected(); Song *song = GetFirstSelected();
if (!song) return; if (!song) return;
@ -675,7 +675,7 @@ void EditTagDialog::UnsetCover() {
} }
void EditTagDialog::ShowCover() { void EditTagDialog::ShowCover() {
Song *song = GetFirstSelected(); Song *song = GetFirstSelected();
if (!song) { if (!song) {
return; return;
@ -685,7 +685,7 @@ void EditTagDialog::ShowCover() {
} }
void EditTagDialog::UpdateCoverOf(const Song &selected, const QModelIndexList &sel, const QString &cover) { void EditTagDialog::UpdateCoverOf(const Song &selected, const QModelIndexList &sel, const QString &cover) {
if (!selected.is_valid() || selected.id() == -1) return; if (!selected.is_valid() || selected.id() == -1) return;
UpdateSummaryTab(selected); UpdateSummaryTab(selected);
@ -700,11 +700,11 @@ void EditTagDialog::UpdateCoverOf(const Song &selected, const QModelIndexList &s
other_song->set_art_manual(cover); other_song->set_art_manual(cover);
} }
} }
} }
void EditTagDialog::NextSong() { void EditTagDialog::NextSong() {
if (ui_->song_list->count() == 0) { if (ui_->song_list->count() == 0) {
return; return;
} }
@ -714,7 +714,7 @@ void EditTagDialog::NextSong() {
} }
void EditTagDialog::PreviousSong() { void EditTagDialog::PreviousSong() {
if (ui_->song_list->count() == 0) { if (ui_->song_list->count() == 0) {
return; return;
} }
@ -730,7 +730,7 @@ void EditTagDialog::ButtonClicked(QAbstractButton *button) {
} }
void EditTagDialog::SaveData(const QList<Data> &data) { void EditTagDialog::SaveData(const QList<Data> &data) {
for (int i = 0; i < data.count(); ++i) { for (int i = 0; i < data.count(); ++i) {
const Data &ref = data[i]; const Data &ref = data[i];
if (ref.current_.IsMetadataEqual(ref.original_)) continue; if (ref.current_.IsMetadataEqual(ref.original_)) continue;
@ -742,7 +742,7 @@ void EditTagDialog::SaveData(const QList<Data> &data) {
} }
void EditTagDialog::accept() { void EditTagDialog::accept() {
// Show the loading indicator // Show the loading indicator
if (!SetLoading(tr("Saving tracks") + "...")) return; if (!SetLoading(tr("Saving tracks") + "...")) return;
@ -752,14 +752,14 @@ void EditTagDialog::accept() {
} }
void EditTagDialog::AcceptFinished() { void EditTagDialog::AcceptFinished() {
if (!SetLoading(QString())) return; if (!SetLoading(QString())) return;
QDialog::accept(); QDialog::accept();
} }
bool EditTagDialog::eventFilter(QObject *o, QEvent *e) { bool EditTagDialog::eventFilter(QObject *o, QEvent *e) {
if (o == ui_->art) { if (o == ui_->art) {
switch (e->type()) { switch (e->type()) {
case QEvent::MouseButtonRelease: case QEvent::MouseButtonRelease:
@ -795,7 +795,7 @@ bool EditTagDialog::eventFilter(QObject *o, QEvent *e) {
} }
void EditTagDialog::showEvent(QShowEvent *e) { void EditTagDialog::showEvent(QShowEvent *e) {
// Set the dialog's height to the smallest possible // Set the dialog's height to the smallest possible
resize(width(), sizeHint().height()); resize(width(), sizeHint().height());
@ -808,7 +808,7 @@ void EditTagDialog::showEvent(QShowEvent *e) {
} }
void EditTagDialog::hideEvent(QHideEvent *e) { void EditTagDialog::hideEvent(QHideEvent *e) {
// Save the current tab // Save the current tab
QSettings s; QSettings s;
s.beginGroup(kSettingsGroup); s.beginGroup(kSettingsGroup);
@ -818,7 +818,7 @@ void EditTagDialog::hideEvent(QHideEvent *e) {
} }
void EditTagDialog::ResetPlayCounts() { void EditTagDialog::ResetPlayCounts() {
const QModelIndexList sel = ui_->song_list->selectionModel()->selectedIndexes(); const QModelIndexList sel = ui_->song_list->selectionModel()->selectedIndexes();
if (sel.isEmpty()) if (sel.isEmpty())
return; return;
@ -839,7 +839,7 @@ void EditTagDialog::ResetPlayCounts() {
#if defined(HAVE_GSTREAMER) && defined(HAVE_CHROMAPRINT) #if defined(HAVE_GSTREAMER) && defined(HAVE_CHROMAPRINT)
void EditTagDialog::FetchTag() { void EditTagDialog::FetchTag() {
const QModelIndexList sel = ui_->song_list->selectionModel()->selectedIndexes(); const QModelIndexList sel = ui_->song_list->selectionModel()->selectedIndexes();
SongList songs; SongList songs;
@ -863,7 +863,7 @@ void EditTagDialog::FetchTag() {
} }
void EditTagDialog::FetchTagSongChosen(const Song &original_song, const Song &new_metadata) { void EditTagDialog::FetchTagSongChosen(const Song &original_song, const Song &new_metadata) {
const QString filename = original_song.url().toLocalFile(); const QString filename = original_song.url().toLocalFile();
// Find the song with this filename // Find the song with this filename

View File

@ -79,7 +79,7 @@ public:
virtual qint64 position_nanosec() const = 0; virtual qint64 position_nanosec() const = 0;
virtual qint64 length_nanosec() const = 0; virtual qint64 length_nanosec() const = 0;
virtual const Scope &scope(int chunk_length) { return scope_; } virtual const Scope &scope(int chunk_length) { return scope_; }
// Sets new values for the beginning and end markers of the currently playing song. // Sets new values for the beginning and end markers of the currently playing song.
@ -106,7 +106,7 @@ public slots:
protected: protected:
void EmitAboutToEnd(); void EmitAboutToEnd();
public: public:
// Simple accessors // Simple accessors
@ -200,7 +200,7 @@ protected:
private: private:
bool about_to_end_emitted_; bool about_to_end_emitted_;
Q_DISABLE_COPY(Base); Q_DISABLE_COPY(Base);
}; };
struct SimpleMetaBundle { struct SimpleMetaBundle {

View File

@ -37,12 +37,12 @@ class EngineDevice : public QObject {
~EngineDevice(); ~EngineDevice();
void Init(); void Init();
QList<DeviceFinder*> device_finders_; QList<DeviceFinder*> device_finders_;
private: private:
QString output_; QString output_;
}; };
#endif // ENGINEDEVICE_H #endif // ENGINEDEVICE_H

View File

@ -45,7 +45,7 @@ QString EngineName(Engine::EngineType enginetype) {
default: return QString("None"); default: return QString("None");
} }
} }
QString EngineDescription(Engine::EngineType enginetype) { QString EngineDescription(Engine::EngineType enginetype) {
switch (enginetype) { switch (enginetype) {
case Engine::Xine: return QString("Xine"); case Engine::Xine: return QString("Xine");
@ -54,7 +54,7 @@ QString EngineDescription(Engine::EngineType enginetype) {
case Engine::VLC: return QString("VLC"); case Engine::VLC: return QString("VLC");
case Engine::None: case Engine::None:
default: return QString("None"); default: return QString("None");
} }
} }

View File

@ -26,7 +26,7 @@
#include <QString> #include <QString>
namespace Engine { namespace Engine {
enum EngineType { enum EngineType {
None, None,
GStreamer, GStreamer,

View File

@ -127,7 +127,7 @@ GstEngine::~GstEngine() {
} }
bool GstEngine::Init() { bool GstEngine::Init() {
SetEnvironment(); SetEnvironment();
initialising_ = QtConcurrent::run(this, &GstEngine::InitialiseGStreamer); initialising_ = QtConcurrent::run(this, &GstEngine::InitialiseGStreamer);

View File

@ -398,7 +398,7 @@ bool GstEnginePipeline::InitFromUrl(const QByteArray &media_url, const QUrl orig
} }
GstEnginePipeline::~GstEnginePipeline() { GstEnginePipeline::~GstEnginePipeline() {
if (pipeline_) { if (pipeline_) {
gst_bus_set_sync_handler(gst_pipeline_get_bus(GST_PIPELINE(pipeline_)), nullptr, nullptr, nullptr); gst_bus_set_sync_handler(gst_pipeline_get_bus(GST_PIPELINE(pipeline_)), nullptr, nullptr, nullptr);
g_source_remove(bus_cb_id_); g_source_remove(bus_cb_id_);
@ -517,7 +517,7 @@ void GstEnginePipeline::StreamStartMessageReceived() {
} }
void GstEnginePipeline::TaskEnterCallback(GstTask *, GThread *, gpointer) { void GstEnginePipeline::TaskEnterCallback(GstTask *, GThread *, gpointer) {
// Bump the priority of the thread only on OS X // Bump the priority of the thread only on OS X
#ifdef Q_OS_MACOS #ifdef Q_OS_MACOS
@ -527,7 +527,7 @@ void GstEnginePipeline::TaskEnterCallback(GstTask *, GThread *, gpointer) {
param.sched_priority = 99; param.sched_priority = 99;
pthread_setschedparam(pthread_self(), SCHED_RR, &param); pthread_setschedparam(pthread_self(), SCHED_RR, &param);
#endif #endif
} }
void GstEnginePipeline::ElementMessageReceived(GstMessage *msg) { void GstEnginePipeline::ElementMessageReceived(GstMessage *msg) {
@ -834,7 +834,7 @@ GstPadProbeReturn GstEnginePipeline::EventHandoffCallback(GstPad*, GstPadProbeIn
void GstEnginePipeline::AboutToFinishCallback(GstPlayBin *bin, gpointer self) { void GstEnginePipeline::AboutToFinishCallback(GstPlayBin *bin, gpointer self) {
GstEnginePipeline* instance = reinterpret_cast<GstEnginePipeline*>(self); GstEnginePipeline* instance = reinterpret_cast<GstEnginePipeline*>(self);
if (instance->has_next_valid_url() && !instance->next_uri_set_) { 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. // 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. // 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<GstStateChangeReturn> GstEnginePipeline::SetState(GstState state) {
} }
bool GstEnginePipeline::Seek(qint64 nanosec) { bool GstEnginePipeline::Seek(qint64 nanosec) {
if (ignore_next_seek_) { if (ignore_next_seek_) {
ignore_next_seek_ = false; ignore_next_seek_ = false;
return true; return true;
@ -937,14 +937,14 @@ bool GstEnginePipeline::Seek(qint64 nanosec) {
} }
void GstEnginePipeline::SetEqualizerEnabled(bool enabled) { void GstEnginePipeline::SetEqualizerEnabled(bool enabled) {
eq_enabled_ = enabled; eq_enabled_ = enabled;
UpdateEqualizer(); UpdateEqualizer();
} }
void GstEnginePipeline::SetEqualizerParams(int preamp, const QList<int>& band_gains) { void GstEnginePipeline::SetEqualizerParams(int preamp, const QList<int>& band_gains) {
eq_preamp_ = preamp; eq_preamp_ = preamp;
eq_band_gains_ = band_gains; eq_band_gains_ = band_gains;
UpdateEqualizer(); UpdateEqualizer();
@ -952,14 +952,14 @@ void GstEnginePipeline::SetEqualizerParams(int preamp, const QList<int>& band_ga
} }
void GstEnginePipeline::SetStereoBalance(float value) { void GstEnginePipeline::SetStereoBalance(float value) {
stereo_balance_ = value; stereo_balance_ = value;
UpdateStereoBalance(); UpdateStereoBalance();
} }
void GstEnginePipeline::UpdateEqualizer() { void GstEnginePipeline::UpdateEqualizer() {
if (!equalizer_ || !equalizer_preamp_) return; if (!equalizer_ || !equalizer_preamp_) return;
// Update band gains // Update band gains

View File

@ -208,7 +208,7 @@ signals:
bool buffering_; bool buffering_;
bool mono_playback_; bool mono_playback_;
// These get called when there is a new audio buffer available // These get called when there is a new audio buffer available
QList<GstBufferConsumer*> buffer_consumers_; QList<GstBufferConsumer*> buffer_consumers_;
QMutex buffer_consumers_mutex_; QMutex buffer_consumers_mutex_;

View File

@ -43,7 +43,7 @@ class PhononEngine : public Engine::Base {
~PhononEngine(); ~PhononEngine();
bool Init(); bool Init();
OutputDetailsList GetOutputsList() const; OutputDetailsList GetOutputsList() const;
bool CanDecode(const QUrl &url); bool CanDecode(const QUrl &url);
@ -62,7 +62,7 @@ class PhononEngine : public Engine::Base {
qint64 position_nanosec() const; qint64 position_nanosec() const;
qint64 length_nanosec() const; qint64 length_nanosec() const;
QString DefaultOutput() { return ""; } QString DefaultOutput() { return ""; }
bool ValidOutput(const QString &output); bool ValidOutput(const QString &output);
bool CustomDeviceSupport(const QString &output); bool CustomDeviceSupport(const QString &output);

View File

@ -49,7 +49,7 @@ VLCEngine::VLCEngine(TaskManager *task_manager)
} }
VLCEngine::~VLCEngine() { VLCEngine::~VLCEngine() {
libvlc_media_player_stop(player_); libvlc_media_player_stop(player_);
libvlc_media_player_release(player_); libvlc_media_player_release(player_);
libvlc_release(instance_); libvlc_release(instance_);
@ -275,7 +275,7 @@ uint VLCEngine::length() const {
} }
bool VLCEngine::CanDecode(const QUrl &url) { bool VLCEngine::CanDecode(const QUrl &url) {
// TODO // TODO
return true; 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) { void VLCEngine::StateChangedCallback(const libvlc_event_t *e, void *data) {
VLCEngine *engine = reinterpret_cast<VLCEngine*>(data); VLCEngine *engine = reinterpret_cast<VLCEngine*>(data);
switch (e->type) { switch (e->type) {

View File

@ -138,10 +138,10 @@ class XineEngine : public Engine::Base {
void Cleanup(); void Cleanup();
bool EnsureStream(); bool EnsureStream();
void SetDevice(); void SetDevice();
uint length() const; uint length() const;
uint position() const; uint position() const;
bool MetaDataForUrl(const QUrl &url, Engine::SimpleMetaBundle &b); bool MetaDataForUrl(const QUrl &url, Engine::SimpleMetaBundle &b);
bool GetAudioCDContents(const QString &device, QList<QUrl> &urls); bool GetAudioCDContents(const QString &device, QList<QUrl> &urls);
bool FlushBuffer(); bool FlushBuffer();

View File

@ -17,7 +17,7 @@
* along with Strawberry. If not, see <http://www.gnu.org/licenses/>. * along with Strawberry. If not, see <http://www.gnu.org/licenses/>.
* *
*/ */
#include "config.h" #include "config.h"
#include "globalshortcutgrabber.h" #include "globalshortcutgrabber.h"

View File

@ -17,7 +17,7 @@
* along with Strawberry. If not, see <http://www.gnu.org/licenses/>. * along with Strawberry. If not, see <http://www.gnu.org/licenses/>.
* *
*/ */
#include "config.h" #include "config.h"
#include "macglobalshortcutbackend.h" #include "macglobalshortcutbackend.h"

View File

@ -89,7 +89,7 @@ void AuddLyricsProvider::CancelSearch(quint64 id) {
} }
void AuddLyricsProvider::HandleSearchReply(QNetworkReply *reply, quint64 id, const QString artist, const QString title) { void AuddLyricsProvider::HandleSearchReply(QNetworkReply *reply, quint64 id, const QString artist, const QString title) {
reply->deleteLater(); reply->deleteLater();
QJsonArray json_result = ExtractResult(reply, id); QJsonArray json_result = ExtractResult(reply, id);

View File

@ -52,7 +52,7 @@ class AuddLyricsProvider : public LyricsProvider {
static const int kMaxLength; static const int kMaxLength;
QNetworkAccessManager *network_; QNetworkAccessManager *network_;
void Error(quint64 id, QString error, QVariant debug = QVariant()); void Error(quint64 id, QString error, QVariant debug = QVariant());
QJsonObject ExtractJsonObj(QNetworkReply *reply, quint64 id); QJsonObject ExtractJsonObj(QNetworkReply *reply, quint64 id);
QJsonArray ExtractResult(QNetworkReply *reply, quint64 id); QJsonArray ExtractResult(QNetworkReply *reply, quint64 id);

View File

@ -89,7 +89,7 @@ signals:
QHash<quint64, LyricsFetcherSearch*> active_requests_; QHash<quint64, LyricsFetcherSearch*> active_requests_;
QTimer *request_starter_; QTimer *request_starter_;
}; };
#endif // LYRICSFETCHER_H #endif // LYRICSFETCHER_H

View File

@ -63,7 +63,7 @@ class LyricsFetcherSearch : public QObject {
LyricsSearchResults results_; LyricsSearchResults results_;
QMap<int, LyricsProvider*> pending_requests_; QMap<int, LyricsProvider*> pending_requests_;
bool cancel_requested_; bool cancel_requested_;
}; };
#endif // LYRICSFETCHERSEARCH_H #endif // LYRICSFETCHERSEARCH_H

View File

@ -150,7 +150,7 @@ Playlist::Playlist(PlaylistBackend *backend, TaskManager *task_manager, Collecti
connect(queue_, SIGNAL(layoutChanged()), SLOT(QueueLayoutChanged())); connect(queue_, SIGNAL(layoutChanged()), SLOT(QueueLayoutChanged()));
column_alignments_ = PlaylistView::DefaultColumnAlignment(); column_alignments_ = PlaylistView::DefaultColumnAlignment();
} }
Playlist::~Playlist() { 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 { int Playlist::PreviousVirtualIndex(int i, bool ignore_repeat_track) const {
PlaylistSequence::RepeatMode repeat_mode = playlist_sequence_->repeat_mode(); PlaylistSequence::RepeatMode repeat_mode = playlist_sequence_->repeat_mode();
PlaylistSequence::ShuffleMode shuffle_mode = playlist_sequence_->shuffle_mode(); PlaylistSequence::ShuffleMode shuffle_mode = playlist_sequence_->shuffle_mode();
bool album_only = repeat_mode == PlaylistSequence::Repeat_Album || shuffle_mode == PlaylistSequence::Shuffle_InsideAlbum; 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 { int Playlist::next_row(bool ignore_repeat_track) const {
// Any queued items take priority // Any queued items take priority
if (!queue_->is_empty()) { if (!queue_->is_empty()) {
return queue_->PeekNext(); 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; if (next_virtual_index < 0 || next_virtual_index >= virtual_items_.count()) return -1;
return virtual_items_[next_virtual_index]; return virtual_items_[next_virtual_index];
} }
int Playlist::previous_row(bool ignore_repeat_track) const { 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; if (prev_virtual_index < 0) return -1;
return virtual_items_[prev_virtual_index]; return virtual_items_[prev_virtual_index];
} }
void Playlist::set_current_row(int i, bool is_stopping) { void Playlist::set_current_row(int i, bool is_stopping) {
QModelIndex old_current_item_index = current_item_index_; QModelIndex old_current_item_index = current_item_index_;
ClearStreamMetadata(); ClearStreamMetadata();
@ -620,7 +620,7 @@ Qt::ItemFlags Playlist::flags(const QModelIndex &index) const {
if (index.isValid()) return flags | Qt::ItemIsDragEnabled; if (index.isValid()) return flags | Qt::ItemIsDragEnabled;
return Qt::ItemIsDropEnabled; return Qt::ItemIsDropEnabled;
} }
QStringList Playlist::mimeTypes() const { QStringList Playlist::mimeTypes() const {
@ -640,7 +640,7 @@ bool Playlist::dropMimeData(const QMimeData *data, Qt::DropAction action, int ro
bool play_now = false; bool play_now = false;
bool enqueue_now = false; bool enqueue_now = false;
bool enqueue_next_now = false; bool enqueue_next_now = false;
if (const MimeData *mime_data = qobject_cast<const MimeData*>(data)) { if (const MimeData *mime_data = qobject_cast<const MimeData*>(data)) {
if (mime_data->clear_first_) { if (mime_data->clear_first_) {
Clear(); Clear();
@ -727,12 +727,12 @@ bool Playlist::dropMimeData(const QMimeData *data, Qt::DropAction action, int ro
} }
void Playlist::InsertUrls(const QList<QUrl> &urls, int pos, bool play_now, bool enqueue, bool enqueue_next) { void Playlist::InsertUrls(const QList<QUrl> &urls, int pos, bool play_now, bool enqueue, bool enqueue_next) {
SongLoaderInserter *inserter = new SongLoaderInserter(task_manager_, collection_, backend_->app()->player()); SongLoaderInserter *inserter = new SongLoaderInserter(task_manager_, collection_, backend_->app()->player());
connect(inserter, SIGNAL(Error(QString)), SIGNAL(Error(QString))); connect(inserter, SIGNAL(Error(QString)), SIGNAL(Error(QString)));
inserter->Load(this, pos, play_now, enqueue, urls); inserter->Load(this, pos, play_now, enqueue, urls);
} }
void Playlist::MoveItemWithoutUndo(int source, int dest) { void Playlist::MoveItemWithoutUndo(int source, int dest) {
@ -740,7 +740,7 @@ void Playlist::MoveItemWithoutUndo(int source, int dest) {
} }
void Playlist::MoveItemsWithoutUndo(const QList<int> &source_rows, int pos) { void Playlist::MoveItemsWithoutUndo(const QList<int> &source_rows, int pos) {
layoutAboutToBeChanged(); layoutAboutToBeChanged();
PlaylistItemList moved_items; PlaylistItemList moved_items;
@ -836,11 +836,11 @@ void Playlist::MoveItemsWithoutUndo(int start, const QList<int> &dest_rows) {
layoutChanged(); layoutChanged();
Save(); Save();
} }
void Playlist::InsertItems(const PlaylistItemList &itemsIn, int pos, bool play_now, bool enqueue, bool enqueue_next) { void Playlist::InsertItems(const PlaylistItemList &itemsIn, int pos, bool play_now, bool enqueue, bool enqueue_next) {
if (itemsIn.isEmpty()) if (itemsIn.isEmpty())
return; return;
@ -895,7 +895,7 @@ void Playlist::InsertItems(const PlaylistItemList &itemsIn, int pos, bool play_n
} }
if (play_now) emit PlayRequested(index(start, 0)); if (play_now) emit PlayRequested(index(start, 0));
} }
void Playlist::InsertItemsWithoutUndo(const PlaylistItemList &items, int pos, bool enqueue) { void Playlist::InsertItemsWithoutUndo(const PlaylistItemList &items, int pos, bool enqueue) {
@ -936,7 +936,7 @@ void Playlist::InsertItemsWithoutUndo(const PlaylistItemList &items, int pos, bo
Save(); Save();
ReshuffleIndices(); ReshuffleIndices();
} }
void Playlist::InsertCollectionItems(const SongList &songs, int pos, bool play_now, bool enqueue, bool enqueue_next) { 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 { QMimeData *Playlist::mimeData(const QModelIndexList &indexes) const {
if (indexes.isEmpty()) return nullptr; 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. // 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) { QString Playlist::abbreviated_column_name(Column column) {
const QString &column_name = Playlist::column_name(column); const QString &column_name = Playlist::column_name(column);
switch (column) { switch (column) {
case Column_Disc: case Column_Disc:
case Column_PlayCount: case Column_PlayCount:
@ -1186,7 +1186,7 @@ QString Playlist::abbreviated_column_name(Column column) {
} }
void Playlist::sort(int column, Qt::SortOrder order) { void Playlist::sort(int column, Qt::SortOrder order) {
if (ignore_sorting_) return; if (ignore_sorting_) return;
PlaylistItemList new_items(items_); PlaylistItemList new_items(items_);
@ -1244,7 +1244,7 @@ void Playlist::Paused() { SetCurrentIsPaused(true); }
void Playlist::Stopped() { SetCurrentIsPaused(false); } void Playlist::Stopped() { SetCurrentIsPaused(false); }
void Playlist::SetCurrentIsPaused(bool paused) { void Playlist::SetCurrentIsPaused(bool paused) {
if (paused == current_is_paused_) return; if (paused == current_is_paused_) return;
current_is_paused_ = paused; current_is_paused_ = paused;
@ -1265,7 +1265,7 @@ void Playlist::Save() const {
//} //}
void Playlist::Restore() { void Playlist::Restore() {
if (!backend_) return; if (!backend_) return;
items_.clear(); items_.clear();
@ -1476,7 +1476,7 @@ void Playlist::SetStreamMetadata(const QUrl &url, const Song &song) {
} }
void Playlist::ClearStreamMetadata() { void Playlist::ClearStreamMetadata() {
if (!current_item()) return; if (!current_item()) return;
current_item()->ClearTemporaryMetadata(); current_item()->ClearTemporaryMetadata();
@ -1532,7 +1532,7 @@ void Playlist::Clear() {
} }
Save(); Save();
} }
void Playlist::RemoveItemsNotInQueue() { void Playlist::RemoveItemsNotInQueue() {
@ -1562,10 +1562,11 @@ void Playlist::RemoveItemsNotInQueue() {
RemoveItemsWithoutUndo(start, count); RemoveItemsWithoutUndo(start, count);
start++; start++;
} }
} }
void Playlist::ReloadItems(const QList<int> &rows) { void Playlist::ReloadItems(const QList<int> &rows) {
for (int row : rows) { for (int row : rows) {
PlaylistItemPtr item = item_at(row); PlaylistItemPtr item = item_at(row);
@ -1580,6 +1581,7 @@ void Playlist::ReloadItems(const QList<int> &rows) {
} }
Save(); Save();
} }
void Playlist::AddSongInsertVetoListener(SongInsertVetoListener *listener) { void Playlist::AddSongInsertVetoListener(SongInsertVetoListener *listener) {
@ -1597,7 +1599,7 @@ void Playlist::SongInsertVetoListenerDestroyed() {
} }
void Playlist::Shuffle() { void Playlist::Shuffle() {
PlaylistItemList new_items(items_); PlaylistItemList new_items(items_);
int begin = 0; int begin = 0;
@ -1610,22 +1612,23 @@ void Playlist::Shuffle() {
} }
undo_stack_->push(new PlaylistUndoCommands::ShuffleItems(this, new_items)); undo_stack_->push(new PlaylistUndoCommands::ShuffleItems(this, new_items));
} }
namespace { namespace {
bool AlbumShuffleComparator(const QMap<QString, int> &album_key_positions, const QMap<int, QString> &album_keys, int left, int right) { bool AlbumShuffleComparator(const QMap<QString, int> &album_key_positions, const QMap<int, QString> &album_keys, int left, int right) {
const int left_pos = album_key_positions[album_keys[left]]; const int left_pos = album_key_positions[album_keys[left]];
const int right_pos = album_key_positions[album_keys[right]]; const int right_pos = album_key_positions[album_keys[right]];
if (left_pos == right_pos) return left < right; if (left_pos == right_pos) return left < right;
return left_pos < right_pos; return left_pos < right_pos;
} }
} }
void Playlist::ReshuffleIndices() { void Playlist::ReshuffleIndices() {
if (!playlist_sequence_) { if (!playlist_sequence_) {
return; return;
} }
@ -1833,7 +1836,7 @@ struct SongSimilarEqual {
}; };
void Playlist::RemoveDuplicateSongs() { void Playlist::RemoveDuplicateSongs() {
QList<int> rows_to_remove; QList<int> rows_to_remove;
unordered_map<Song, int, SongSimilarHash, SongSimilarEqual> unique_songs; unordered_map<Song, int, SongSimilarHash, SongSimilarEqual> unique_songs;
@ -1864,11 +1867,11 @@ void Playlist::RemoveDuplicateSongs() {
} }
removeRows(rows_to_remove); removeRows(rows_to_remove);
} }
void Playlist::RemoveUnavailableSongs() { void Playlist::RemoveUnavailableSongs() {
QList<int> rows_to_remove; QList<int> rows_to_remove;
for (int row = 0; row < items_.count(); ++row) { for (int row = 0; row < items_.count(); ++row) {
PlaylistItemPtr item = items_[row]; PlaylistItemPtr item = items_[row];
@ -1881,11 +1884,11 @@ void Playlist::RemoveUnavailableSongs() {
} }
removeRows(rows_to_remove); removeRows(rows_to_remove);
} }
bool Playlist::ApplyValidityOnCurrentSong(const QUrl &url, bool valid) { bool Playlist::ApplyValidityOnCurrentSong(const QUrl &url, bool valid) {
PlaylistItemPtr current = current_item(); PlaylistItemPtr current = current_item();
if (current) { if (current) {
@ -1917,12 +1920,12 @@ void Playlist::SetColumnAlignment(const ColumnAlignmentMap &alignment) {
} }
void Playlist::SkipTracks(const QModelIndexList &source_indexes) { void Playlist::SkipTracks(const QModelIndexList &source_indexes) {
for (const QModelIndex &source_index : source_indexes) { for (const QModelIndex &source_index : source_indexes) {
PlaylistItemPtr track_to_skip = item_at(source_index.row()); PlaylistItemPtr track_to_skip = item_at(source_index.row());
track_to_skip->SetShouldSkip(!((track_to_skip)->GetShouldSkip())); track_to_skip->SetShouldSkip(!((track_to_skip)->GetShouldSkip()));
emit dataChanged(source_index, source_index); emit dataChanged(source_index, source_index);
} }
} }

View File

@ -71,7 +71,7 @@ PlaylistBackend::PlaylistList PlaylistBackend::GetAllFavoritePlaylists() {
} }
PlaylistBackend::PlaylistList PlaylistBackend::GetPlaylists(GetPlaylistsFlags flags) { PlaylistBackend::PlaylistList PlaylistBackend::GetPlaylists(GetPlaylistsFlags flags) {
QMutexLocker l(db_->Mutex()); QMutexLocker l(db_->Mutex());
QSqlDatabase db(db_->Connect()); QSqlDatabase db(db_->Connect());
@ -210,15 +210,15 @@ PlaylistItemPtr PlaylistBackend::NewPlaylistItemFromQuery(const SqlRow &row, std
} }
Song PlaylistBackend::NewSongFromQuery(const SqlRow &row, std::shared_ptr<NewSongFromQueryState> state) { Song PlaylistBackend::NewSongFromQuery(const SqlRow &row, std::shared_ptr<NewSongFromQueryState> state) {
return NewPlaylistItemFromQuery(row, state)->Metadata(); return NewPlaylistItemFromQuery(row, state)->Metadata();
} }
// If song had a CUE and the CUE still exists, the metadata from it will be applied here. // 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<NewSongFromQueryState> state) { PlaylistItemPtr PlaylistBackend::RestoreCueData(PlaylistItemPtr item, std::shared_ptr<NewSongFromQueryState> state) {
// We need collection to run a CueParser; also, this method applies only to file-type PlaylistItems // We need collection to run a CueParser; also, this method applies only to file-type PlaylistItems
if (item->source() != Song::Source_LocalFile) return item; 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) { int PlaylistBackend::CreatePlaylist(const QString &name, const QString &special_type) {
QMutexLocker l(db_->Mutex()); QMutexLocker l(db_->Mutex());
QSqlDatabase db(db_->Connect()); QSqlDatabase db(db_->Connect());
@ -326,7 +326,7 @@ int PlaylistBackend::CreatePlaylist(const QString &name, const QString &special_
} }
void PlaylistBackend::RemovePlaylist(int id) { void PlaylistBackend::RemovePlaylist(int id) {
QMutexLocker l(db_->Mutex()); QMutexLocker l(db_->Mutex());
QSqlDatabase db(db_->Connect()); QSqlDatabase db(db_->Connect());
QSqlQuery delete_playlist(db); QSqlQuery delete_playlist(db);
@ -350,7 +350,7 @@ void PlaylistBackend::RemovePlaylist(int id) {
} }
void PlaylistBackend::RenamePlaylist(int id, const QString &new_name) { void PlaylistBackend::RenamePlaylist(int id, const QString &new_name) {
QMutexLocker l(db_->Mutex()); QMutexLocker l(db_->Mutex());
QSqlDatabase db(db_->Connect()); QSqlDatabase db(db_->Connect());
QSqlQuery q(db); QSqlQuery q(db);
@ -378,7 +378,7 @@ void PlaylistBackend::FavoritePlaylist(int id, bool is_favorite) {
} }
void PlaylistBackend::SetPlaylistOrder(const QList<int> &ids) { void PlaylistBackend::SetPlaylistOrder(const QList<int> &ids) {
QMutexLocker l(db_->Mutex()); QMutexLocker l(db_->Mutex());
QSqlDatabase db(db_->Connect()); QSqlDatabase db(db_->Connect());
ScopedTransaction transaction(&db); ScopedTransaction transaction(&db);

View File

@ -287,7 +287,7 @@ void PlaylistContainer::PlaylistRenamed(int id, const QString &new_name) {
void PlaylistContainer::NewPlaylist() { manager_->New(tr("Playlist")); } void PlaylistContainer::NewPlaylist() { manager_->New(tr("Playlist")); }
void PlaylistContainer::LoadPlaylist() { void PlaylistContainer::LoadPlaylist() {
QString filename = settings_.value("last_load_playlist").toString(); QString filename = settings_.value("last_load_playlist").toString();
filename = QFileDialog::getOpenFileName(this, tr("Load playlist"), filename, manager_->parser()->filters()); filename = QFileDialog::getOpenFileName(this, tr("Load playlist"), filename, manager_->parser()->filters());
@ -323,7 +323,7 @@ void PlaylistContainer::GoToPreviousPlaylistTab() {
} }
void PlaylistContainer::Save() { void PlaylistContainer::Save() {
if (starting_up_) return; if (starting_up_) return;
settings_.setValue("current_playlist", ui_->tab_bar->current_id()); settings_.setValue("current_playlist", ui_->tab_bar->current_id());

View File

@ -33,11 +33,11 @@
#include "playlistlistmodel.h" #include "playlistlistmodel.h"
PlaylistListModel::PlaylistListModel(QObject *parent) : QStandardItemModel(parent), dropping_rows_(false) { PlaylistListModel::PlaylistListModel(QObject *parent) : QStandardItemModel(parent), dropping_rows_(false) {
connect(this, SIGNAL(dataChanged(QModelIndex, QModelIndex)), SLOT(RowsChanged(QModelIndex, QModelIndex))); 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(rowsAboutToBeRemoved(QModelIndex, int, int)), SLOT(RowsAboutToBeRemoved(QModelIndex, int, int)));
connect(this, SIGNAL(rowsInserted(QModelIndex, int, int)), SLOT(RowsInserted(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) { void PlaylistListModel::SetIcons(const QIcon &playlist_icon, const QIcon &folder_icon) {

View File

@ -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) { void PlaylistManager::New(const QString &name, const SongList &songs, const QString &special_type) {
if (name.isNull()) return; if (name.isNull()) return;
int id = playlist_backend_->CreatePlaylist(name, special_type); 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) { void PlaylistManager::Load(const QString &filename) {
QFileInfo info(filename); QFileInfo info(filename);
int id = playlist_backend_->CreatePlaylist(info.baseName(), QString()); int id = playlist_backend_->CreatePlaylist(info.baseName(), QString());

View File

@ -119,7 +119,7 @@ namespace PlaylistUndoCommands {
//int column_; //int column_;
//Qt::SortOrder order_; //Qt::SortOrder order_;
}; };
class ShuffleItems : public ReOrderItems { class ShuffleItems : public ReOrderItems {
public: public:
ShuffleItems(Playlist *playlist, const PlaylistItemList &new_items); ShuffleItems(Playlist *playlist, const PlaylistItemList &new_items);

View File

@ -683,16 +683,16 @@ void PlaylistView::mouseMoveEvent(QMouseEvent *event) {
void PlaylistView::leaveEvent(QEvent *e) { void PlaylistView::leaveEvent(QEvent *e) {
QTreeView::leaveEvent(e); QTreeView::leaveEvent(e);
} }
void PlaylistView::mousePressEvent(QMouseEvent *event) { void PlaylistView::mousePressEvent(QMouseEvent *event) {
if (editTriggers() & QAbstractItemView::NoEditTriggers) { if (editTriggers() & QAbstractItemView::NoEditTriggers) {
QTreeView::mousePressEvent(event); QTreeView::mousePressEvent(event);
return; return;
} }
QTreeView::mousePressEvent(event); QTreeView::mousePressEvent(event);
inhibit_autoscroll_ = true; inhibit_autoscroll_ = true;
@ -701,7 +701,7 @@ void PlaylistView::mousePressEvent(QMouseEvent *event) {
} }
void PlaylistView::scrollContentsBy(int dx, int dy) { void PlaylistView::scrollContentsBy(int dx, int dy) {
if (dx) { if (dx) {
InvalidateCachedCurrentPixmap(); 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, // 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. // as this will cause the fading animation to start again.
// This also avoid to do useless "force_background_redraw". // 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) { 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; background_initialized_ = true;
// Store background properties // Store background properties
@ -1019,7 +1019,7 @@ void PlaylistView::ReloadSettings() {
setEditTriggers(editTriggers() & ~QAbstractItemView::SelectedClicked); setEditTriggers(editTriggers() & ~QAbstractItemView::SelectedClicked);
else else
setEditTriggers(editTriggers() | QAbstractItemView::SelectedClicked); setEditTriggers(editTriggers() | QAbstractItemView::SelectedClicked);
s.endGroup(); s.endGroup();
} }
@ -1037,11 +1037,11 @@ void PlaylistView::SaveSettings() {
s.beginGroup(AppearanceSettingsPage::kSettingsGroup); s.beginGroup(AppearanceSettingsPage::kSettingsGroup);
s.setValue(kSettingBackgroundImageType, background_image_type_); s.setValue(kSettingBackgroundImageType, background_image_type_);
s.endGroup(); s.endGroup();
s.beginGroup(Playlist::kSettingsGroup); s.beginGroup(Playlist::kSettingsGroup);
s.setValue("column_alignments", QVariant::fromValue(column_alignment_)); s.setValue("column_alignments", QVariant::fromValue(column_alignment_));
s.endGroup(); s.endGroup();
} }
void PlaylistView::StretchChanged(bool stretch) { 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) { void PlaylistView::set_background_image(const QImage &image) {
// Save previous image, for fading // Save previous image, for fading
previous_background_image_ = cached_scaled_background_image_; previous_background_image_ = cached_scaled_background_image_;

View File

@ -135,7 +135,7 @@ SongList CueParser::Load(QIODevice *device, const QString &playlist_path, const
// REM DATE // REM DATE
} else if (line_value.toLower() == kDate) { } else if (line_value.toLower() == kDate) {
date = splitted[2]; date = splitted[2];
// REM DISC // REM DISC
} else if (line_value.toLower() == kDisc) { } else if (line_value.toLower() == kDisc) {
disc = splitted[2]; 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_genre(entry.genre);
song->set_year(entry.date.toInt()); song->set_year(entry.date.toInt());
song->set_disc(entry.disc.toInt()); song->set_disc(entry.disc.toInt());
return true; return true;
} }
@ -329,7 +329,7 @@ bool CueParser::UpdateLastSong(const CueEntry &entry, Song *song) const {
song->set_year(entry.date.toInt()); song->set_year(entry.date.toInt());
song->set_composer(entry.PrettyComposer()); song->set_composer(entry.PrettyComposer());
song->set_disc(entry.disc.toInt()); 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) // 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); song->set_beginning_nanosec(beginning);

View File

@ -59,7 +59,7 @@ class CueParser : public ParserBase {
static const char *kGenre; static const char *kGenre;
static const char *kDate; static const char *kDate;
static const char *kDisc; static const char *kDisc;
CueParser(CollectionBackendInterface *library, QObject *parent = nullptr); CueParser(CollectionBackendInterface *library, QObject *parent = nullptr);
QString name() const { return "CUE"; } QString name() const { return "CUE"; }

View File

@ -47,7 +47,7 @@ class BackendSettingsPage : public SettingsPage {
public: public:
BackendSettingsPage(SettingsDialog *dialog); BackendSettingsPage(SettingsDialog *dialog);
~BackendSettingsPage(); ~BackendSettingsPage();
static const char *kSettingsGroup; static const char *kSettingsGroup;
void Load(); void Load();

View File

@ -101,7 +101,7 @@ void BehaviourSettingsPage::Load() {
} }
void BehaviourSettingsPage::Save() { void BehaviourSettingsPage::Save() {
QSettings s; QSettings s;
MainWindow::StartupBehaviour behaviour = MainWindow::Startup_Remember; MainWindow::StartupBehaviour behaviour = MainWindow::Startup_Remember;
@ -120,7 +120,7 @@ void BehaviourSettingsPage::Save() {
} }
void BehaviourSettingsPage::ShowTrayIconToggled(bool on) { void BehaviourSettingsPage::ShowTrayIconToggled(bool on) {
ui_->radiobutton_alwayshide->setEnabled(on); ui_->radiobutton_alwayshide->setEnabled(on);
if (!on && ui_->radiobutton_alwayshide->isChecked()) ui_->radiobutton_remember->setChecked(true); if (!on && ui_->radiobutton_alwayshide->isChecked()) ui_->radiobutton_remember->setChecked(true);
ui_->checkbox_keeprunning->setEnabled(on); ui_->checkbox_keeprunning->setEnabled(on);

View File

@ -40,7 +40,7 @@ class SettingsDialog;
const char *PlaylistSettingsPage::kSettingsGroup = "Playlist"; const char *PlaylistSettingsPage::kSettingsGroup = "Playlist";
PlaylistSettingsPage::PlaylistSettingsPage(SettingsDialog* dialog) : SettingsPage(dialog), ui_(new Ui_PlaylistSettingsPage) { PlaylistSettingsPage::PlaylistSettingsPage(SettingsDialog* dialog) : SettingsPage(dialog), ui_(new Ui_PlaylistSettingsPage) {
ui_->setupUi(this); ui_->setupUi(this);
setWindowIcon(IconLoader::Load("document-new")); 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_warncloseplaylist->setChecked(s.value("warn_close_playlist", true).toBool());
ui_->checkbox_editmetadatainline->setChecked(s.value("editmetadatainline", false).toBool()); ui_->checkbox_editmetadatainline->setChecked(s.value("editmetadatainline", false).toBool());
ui_->checkbox_writemetadata->setChecked(s.value(Playlist::kWriteMetadata, false).toBool()); ui_->checkbox_writemetadata->setChecked(s.value(Playlist::kWriteMetadata, false).toBool());
s.endGroup(); s.endGroup();
} }
void PlaylistSettingsPage::Save() { void PlaylistSettingsPage::Save() {
QSettings s; QSettings s;
MainWindow::AddBehaviour doubleclick_addmode = MainWindow::AddBehaviour(ui_->combobox_doubleclickaddmode->itemData(ui_->combobox_doubleclickaddmode->currentIndex()).toInt()); MainWindow::AddBehaviour doubleclick_addmode = MainWindow::AddBehaviour(ui_->combobox_doubleclickaddmode->itemData(ui_->combobox_doubleclickaddmode->currentIndex()).toInt());

View File

@ -178,7 +178,7 @@ void GlobalShortcutsSettingsPage::DefaultClicked() {
} }
void GlobalShortcutsSettingsPage::ChangeClicked() { void GlobalShortcutsSettingsPage::ChangeClicked() {
GlobalShortcuts *manager = dialog()->global_shortcuts_manager(); GlobalShortcuts *manager = dialog()->global_shortcuts_manager();
manager->Unregister(); manager->Unregister();
QKeySequence key = grabber_->GetKey(shortcuts_[current_id_].s.action->text()); QKeySequence key = grabber_->GetKey(shortcuts_[current_id_].s.action->text());
@ -197,7 +197,7 @@ void GlobalShortcutsSettingsPage::ChangeClicked() {
} }
void GlobalShortcutsSettingsPage::OpenGnomeKeybindingProperties() { void GlobalShortcutsSettingsPage::OpenGnomeKeybindingProperties() {
if (!QProcess::startDetached("gnome-keybinding-properties")) { if (!QProcess::startDetached("gnome-keybinding-properties")) {
if (!QProcess::startDetached("gnome-control-center", QStringList() << "keyboard")) { if (!QProcess::startDetached("gnome-control-center", QStringList() << "keyboard")) {
QMessageBox::warning(this, "Error", QMessageBox::warning(this, "Error",

View File

@ -52,7 +52,7 @@ class TidalSearch : public QObject {
QString pixmap_cache_key_; QString pixmap_cache_key_;
}; };
typedef QList<Result> ResultList; typedef QList<Result> ResultList;
static const int kDelayedSearchTimeoutMs; static const int kDelayedSearchTimeoutMs;
static const int kMaxResultsPerEmission; static const int kMaxResultsPerEmission;
@ -81,7 +81,7 @@ class TidalSearch : public QObject {
void ArtLoaded(int id, const QPixmap &pixmap); void ArtLoaded(int id, const QPixmap &pixmap);
void ArtLoaded(int id, const QImage &image); void ArtLoaded(int id, const QImage &image);
protected: protected:
struct PendingState { struct PendingState {

View File

@ -133,7 +133,7 @@ signals:
QIcon search_icon_; QIcon search_icon_;
QIcon warning_icon_; QIcon warning_icon_;
TidalSettingsPage::SearchBy searchby_; TidalSettingsPage::SearchBy searchby_;
bool error_; bool error_;

View File

@ -41,7 +41,7 @@ class TidalUrlHandler : public UrlHandler {
LoadResult StartLoading(const QUrl &url); LoadResult StartLoading(const QUrl &url);
void CancelTask(); void CancelTask();
private slots: private slots:
void GetStreamURLFinished(QUrl url, Song::FileType filetype); void GetStreamURLFinished(QUrl url, Song::FileType filetype);

View File

@ -2,17 +2,17 @@
Strawberry Music Player Strawberry Music Player
This file was part of Clementine. This file was part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com> Copyright 2010, David Sansome <me@davidsansome.com>
Strawberry is free software: you can redistribute it and/or modify Strawberry is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
Strawberry is distributed in the hope that it will be useful, Strawberry is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Strawberry. If not, see <http://www.gnu.org/licenses/>. along with Strawberry. If not, see <http://www.gnu.org/licenses/>.

View File

@ -2,17 +2,17 @@
Strawberry Music Player Strawberry Music Player
This file was part of Clementine. This file was part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com> Copyright 2010, David Sansome <me@davidsansome.com>
Strawberry is free software: you can redistribute it and/or modify Strawberry is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
Strawberry is distributed in the hope that it will be useful, Strawberry is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Strawberry. If not, see <http://www.gnu.org/licenses/>. along with Strawberry. If not, see <http://www.gnu.org/licenses/>.

View File

@ -228,11 +228,11 @@ void PlayingWidget::SetMode(int mode) {
s.beginGroup(kSettingsGroup); s.beginGroup(kSettingsGroup);
s.setValue("mode", mode_); s.setValue("mode", mode_);
s.endGroup(); s.endGroup();
} }
void PlayingWidget::FitCoverWidth(bool fit) { void PlayingWidget::FitCoverWidth(bool fit) {
fit_width_ = fit; fit_width_ = fit;
UpdateHeight(); UpdateHeight();
update(); update();
@ -335,7 +335,7 @@ void PlayingWidget::SetHeight(int height) {
timeline_show_hide_->toggleDirection(); timeline_show_hide_->toggleDirection();
} }
} }
} }
void PlayingWidget::UpdateHeight() { void PlayingWidget::UpdateHeight() {
@ -439,7 +439,7 @@ void PlayingWidget::DrawContents(QPainter *p) {
break; break;
} }
} }
void PlayingWidget::FadePreviousTrack(qreal value) { void PlayingWidget::FadePreviousTrack(qreal value) {
@ -456,7 +456,7 @@ void PlayingWidget::FadePreviousTrack(qreal value) {
} }
void PlayingWidget::resizeEvent(QResizeEvent* e) { void PlayingWidget::resizeEvent(QResizeEvent* e) {
//if (visible_ && e->oldSize() != e->size()) { //if (visible_ && e->oldSize() != e->size()) {
if (e->oldSize() != e->size()) { if (e->oldSize() != e->size()) {
if (mode_ == LargeSongDetails) { if (mode_ == LargeSongDetails) {
@ -464,7 +464,7 @@ void PlayingWidget::resizeEvent(QResizeEvent* e) {
UpdateDetailsText(); UpdateDetailsText();
} }
} }
} }
void PlayingWidget::contextMenuEvent(QContextMenuEvent* e) { void PlayingWidget::contextMenuEvent(QContextMenuEvent* e) {

View File

@ -353,7 +353,7 @@ QPixmap Amarok::VolumeSlider::drawVolumePixmap () const {
QPainter painter(&pixmap); QPainter painter(&pixmap);
QPen pen(palette().color(QPalette::WindowText), 0.3, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin); QPen pen(palette().color(QPalette::WindowText), 0.3, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin);
painter.setPen(pen); painter.setPen(pen);
painter.setRenderHint(QPainter::Antialiasing); painter.setRenderHint(QPainter::Antialiasing);
painter.setRenderHint(QPainter::SmoothPixmapTransform); painter.setRenderHint(QPainter::SmoothPixmapTransform);
// Draw volume control pixmap // Draw volume control pixmap
@ -375,7 +375,7 @@ void Amarok::VolumeSlider::drawVolumeSliderHandle() {
QImage pixmapHandleGlow_image(pixmapHandleGlow.size(), QImage::Format_ARGB32_Premultiplied); QImage pixmapHandleGlow_image(pixmapHandleGlow.size(), QImage::Format_ARGB32_Premultiplied);
QPainter painter(&pixmapHandleGlow_image); QPainter painter(&pixmapHandleGlow_image);
painter.setRenderHint(QPainter::Antialiasing); painter.setRenderHint(QPainter::Antialiasing);
painter.setRenderHint(QPainter::SmoothPixmapTransform); painter.setRenderHint(QPainter::SmoothPixmapTransform);
@ -383,7 +383,7 @@ void Amarok::VolumeSlider::drawVolumeSliderHandle() {
painter.fillRect(pixmapHandleGlow_image.rect(), QBrush(palette().color(QPalette::Highlight))); painter.fillRect(pixmapHandleGlow_image.rect(), QBrush(palette().color(QPalette::Highlight)));
painter.setCompositionMode(QPainter::CompositionMode_DestinationIn); painter.setCompositionMode(QPainter::CompositionMode_DestinationIn);
painter.drawImage(0, 0, pixmapHandleGlow); painter.drawImage(0, 0, pixmapHandleGlow);
// Overlay the volume slider handle image // Overlay the volume slider handle image
painter.setCompositionMode(QPainter::CompositionMode_SourceAtop); painter.setCompositionMode(QPainter::CompositionMode_SourceAtop);
painter.drawImage(0, 0, pixmapHandle); painter.drawImage(0, 0, pixmapHandle);