Commit f4a64b54 authored by Andreas Cord-Landwehr's avatar Andreas Cord-Landwehr
Browse files

Do not warn for valid use cases of empty files

parent e8fc8f81
/*
* Copyright 2013 Andreas Cord-Landwehr <cordlandwehr@kde.org>
* Copyright 2013-2019 Andreas Cord-Landwehr <cordlandwehr@kde.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
......@@ -34,17 +34,8 @@ Player::Player(QObject *parent)
}
Player::~Player()
{
// nothing to do
}
void Player::setSoundFile(const QUrl &fileUrl)
{
if (!fileUrl.isValid() || fileUrl.isEmpty()) {
qCWarning(ARTIKULATE_LOG) << "Not setting empty sound file path.";
return;
}
m_soundFile = fileUrl;
emit soundFileChanged();
}
......@@ -68,7 +59,7 @@ Player::PlaybackState Player::state() const
void Player::playback()
{
OutputDeviceController::self().disconnect();
if (m_soundFile.isEmpty()) {
if (!m_soundFile.isValid()) {
qCritical() << "Abort playing sound, no file available";
return;
}
......
/*
* Copyright 2013 Andreas Cord-Landwehr <cordlandwehr@kde.org>
* Copyright 2013-2019 Andreas Cord-Landwehr <cordlandwehr@kde.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
......@@ -39,8 +39,8 @@ public:
PausedState
};
explicit Player(QObject *parent = 0);
~Player();
explicit Player(QObject *parent = nullptr);
~Player() = default;
Q_INVOKABLE void playback();
Q_INVOKABLE void stop();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment