Avoid Phonon's deprecation warnings
authorManuel Nickschas <sputnick@quassel-irc.org>
Tue, 19 Nov 2013 22:01:16 +0000 (23:01 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Tue, 19 Nov 2013 22:01:16 +0000 (23:01 +0100)
MediaSource prefers a QUrl now. This shouldn't break with older Phonon
versions, I hope, since it seems MediaSource(QUrl) has been around since
forever.

src/qtui/phononnotificationbackend.cpp

index b4adc1c..b7317d2 100644 (file)
@@ -99,7 +99,7 @@ void PhononNotificationBackend::createMediaObject(const QString &file)
         return;
     }
 
         return;
     }
 
-    _media = Phonon::createPlayer(Phonon::NotificationCategory, Phonon::MediaSource(file));
+    _media = Phonon::createPlayer(Phonon::NotificationCategory, Phonon::MediaSource(QUrl::fromLocalFile(file)));
 }
 
 
 }
 
 
@@ -200,7 +200,7 @@ void PhononNotificationBackend::ConfigWidget::on_play_clicked()
             if (audioPreview)
                 delete audioPreview;
 
             if (audioPreview)
                 delete audioPreview;
 
-            audioPreview = Phonon::createPlayer(Phonon::NotificationCategory, Phonon::MediaSource(ui.filename->text()));
+            audioPreview = Phonon::createPlayer(Phonon::NotificationCategory, Phonon::MediaSource(QUrl::fromLocalFile(ui.filename->text())));
             audioPreview->play();
         }
     }
             audioPreview->play();
         }
     }