Clear up Highlight sound settings (#4194)
Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com> Closes https://github.com/Chatterino/chatterino2/issues/1540
This commit is contained in:
@@ -19,14 +19,17 @@ namespace chatterino {
|
||||
|
||||
namespace {
|
||||
|
||||
/**
|
||||
* Gets the default sound url if the user set one,
|
||||
* or the chatterino default ping sound if no url is set.
|
||||
*/
|
||||
QUrl getFallbackHighlightSound()
|
||||
{
|
||||
QString path = getSettings()->pathHighlightSound;
|
||||
bool fileExists = QFileInfo::exists(path) && QFileInfo(path).isFile();
|
||||
bool fileExists = !path.isEmpty() && QFileInfo::exists(path) &&
|
||||
QFileInfo(path).isFile();
|
||||
|
||||
// Use fallback sound when checkbox is not checked
|
||||
// or custom file doesn't exist
|
||||
if (getSettings()->customHighlightSound && fileExists)
|
||||
if (fileExists)
|
||||
{
|
||||
return QUrl::fromLocalFile(path);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user