win32: fix alert_play_file
@@ -190,22 +190,25 @@ void alert_vibrate(int duration_ms) {
void alert_play_file(char* file_name, char *media_type)
{
- String path = RHODESAPP().getRhoRootPath() + file_name;
+ RAWLOGC_INFO("AlertImpl", "OnAlertPlayFile: trying to play file");
+ String path = file_name;
#if QT_VERSION >= 0x050000
QMediaPlayer* player = new QMediaPlayer;
QUrl url = QUrl::fromLocalFile(QString::fromStdString(path));
player->setMedia(url);
player->setVolume(100);
player->play();
- if ((player->availability() != QMultimedia::Available) || (player->error() != QMediaPlayer::NoError))
+ if ((player->availability() != QMultimedia::Available) || (player->error() != QMediaPlayer::NoError)){
+
+ }
+ player->deleteLater();
#else
+ RAWLOGC_INFO("AlertImpl",path.c_str());
if (QSound::isAvailable()) {
QSound::play(QString(path.c_str()));
- } else
-#endif
+ } else{
RAWLOGC_INFO("AlertImpl", "OnAlertPlayFile: failed to play file");
-#if QT_VERSION >= 0x050000
- delete player;
+ }
#endif
}
