OSDN Git Service

make use of KUrl on phonon calls
authorIvailo Monev <xakepa10@gmail.com>
Wed, 31 Dec 2014 01:07:19 +0000 (01:07 +0000)
committerIvailo Monev <xakepa10@gmail.com>
Wed, 31 Dec 2014 01:07:19 +0000 (01:07 +0000)
KUrl handles "file://" appending when neccessary

kcontrol/access/kaccess.cpp
knotify/notifybysound.cpp
phonon/kcm/devicepreference.cpp

index a73e497..c476fdf 100644 (file)
@@ -3,7 +3,6 @@
 
 #include <QTimer>
 #include <QPainter>
-#include <QUrl>
 #include <QLabel>
 #include <QtGui/QDesktopWidget>
 #include <QGroupBox>
@@ -19,6 +18,7 @@
 #include <KConfig>
 #include <KGlobal>
 #include <KLocale>
+#include <KUrl>
 #include <netwm.h>
 #include <KShortcut>
 #include <kwindowsystem.h>
@@ -477,7 +477,7 @@ void KAccessApp::xkbBellNotify(XkbBellNotifyEvent *event)
     if (!_player) { // as creating the player is expensive, delay the creation
       _player = Phonon::createPlayer(Phonon::AccessibilityCategory);
       _player->setParent(this);
-      _player->setCurrentSource(QUrl::fromLocalFile(_currentPlayerSource));
+      _player->setCurrentSource(KUrl(_currentPlayerSource));
     }
     _player->play();
   }
index 7fa02a7..f6aa100 100644 (file)
@@ -33,7 +33,6 @@
 #include <QtCore/QTimer>
 #include <QtCore/QTimerEvent>
 #include <QtCore/QStack>
-#include <QtCore/QUrl>
 #include <QSignalMapper>
 
 // KDE headers
@@ -61,7 +60,7 @@ struct Player
                Phonon::createPath(media, output);
        }
 
-       inline void play(const QString &file) { media->setCurrentSource(QUrl::fromLocalFile(file)); media->enqueue(Phonon::MediaSource()); media->play(); }
+       inline void play(const QString &file) { media->setCurrentSource(KUrl(file)); media->enqueue(Phonon::MediaSource()); media->play(); }
        inline void stop() { media->stop(); }
        inline void setVolume(float volume) { output->setVolume(volume); }
 
index 0e5782d..be4fc55 100644 (file)
@@ -21,7 +21,6 @@
 
 #include "devicepreference.h"
 
-#include <QtCore/QUrl>
 #include <QtCore/QList>
 #include <QtCore/QPointer>
 #include <QtDBus/QDBusConnection>
@@ -53,6 +52,7 @@
 #include <kmessagebox.h>
 #include <kstandarddirs.h>
 #include <kdebug.h>
+#include <kurl.h>
 
 #ifndef METATYPE_QLIST_INT_DEFINED
 #define METATYPE_QLIST_INT_DEFINED
@@ -899,7 +899,7 @@ void DevicePreference::on_testPlaybackButton_toggled(bool down)
 
             createPath(m_media, m_audioOutput);
 
-            m_media->setCurrentSource(QUrl::fromLocalFile(KStandardDirs::locate("sound", "KDE-Sys-Log-In.ogg")));
+            m_media->setCurrentSource(KUrl(KStandardDirs::locate("sound", "KDE-Sys-Log-In.ogg")));
             connect(m_media, SIGNAL(finished()), testPlaybackButton, SLOT(toggle()));
 
             break;