[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/phonon
From:       Matthias Kretz <kretz () kde ! org>
Date:       2008-02-29 21:00:44
Message-ID: 1204318844.396627.13694.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 780719 by mkretz:

simplify IFACE macro(s)

 M  +15 -20    mediacontroller.cpp  


--- trunk/KDE/kdelibs/phonon/mediacontroller.cpp #780718:780719
@@ -61,20 +61,16 @@
     delete d;
 }
 
-#define IFACE0 \
+#define IFACE \
     AddonInterface *iface = d->iface(); \
-    do { if (!iface) return; } while (false)
+    if (!iface) return
 
-#define IFACE1(retDefault) \
-    AddonInterface *iface = d->iface(); \
-    do { if (!iface) return retDefault; } while (false)
-
 MediaController::Features MediaController::supportedFeatures() const
 {
     if (!d || !d->media) {
         return false;
     }
-    IFACE1(false);
+    IFACE false;
     Features ret;
     if (iface->hasInterface(AddonInterface::AngleInterface)) {
         ret |= Angles;
@@ -90,35 +86,35 @@
 
 int MediaController::availableTitles() const
 {
-    IFACE1(0);
+    IFACE 0;
     return iface->interfaceCall(AddonInterface::TitleInterface,
             AddonInterface::availableTitles).toInt();
 }
 
 int MediaController::currentTitle() const
 {
-    IFACE1(0);
+    IFACE 0;
     return iface->interfaceCall(AddonInterface::TitleInterface,
             AddonInterface::title).toInt();
 }
 
 void MediaController::setCurrentTitle(int titleNumber)
 {
-    IFACE0;
+    IFACE;
     iface->interfaceCall(AddonInterface::TitleInterface,
             AddonInterface::setTitle, QList<QVariant>() << QVariant(titleNumber));
 }
 
 bool MediaController::autoplayTitles() const
 {
-    IFACE1(true);
+    IFACE true;
     return iface->interfaceCall(AddonInterface::TitleInterface,
             AddonInterface::autoplayTitles).toBool();
 }
 
 void MediaController::setAutoplayTitles(bool b)
 {
-    IFACE0;
+    IFACE;
     iface->interfaceCall(AddonInterface::TitleInterface,
             AddonInterface::setAutoplayTitles, QList<QVariant>() << QVariant(b));
 }
@@ -135,48 +131,47 @@
 
 int MediaController::availableChapters() const
 {
-    IFACE1(0);
+    IFACE 0;
     return iface->interfaceCall(AddonInterface::ChapterInterface,
             AddonInterface::availableChapters).toInt();
 }
 
 int MediaController::currentChapter() const
 {
-    IFACE1(0);
+    IFACE 0;
     return iface->interfaceCall(AddonInterface::ChapterInterface,
             AddonInterface::chapter).toInt();
 }
 
 void MediaController::setCurrentChapter(int titleNumber)
 {
-    IFACE0;
+    IFACE;
     iface->interfaceCall(AddonInterface::ChapterInterface,
             AddonInterface::setChapter, QList<QVariant>() << QVariant(titleNumber));
 }
 
 int MediaController::availableAngles() const
 {
-    IFACE1(0);
+    IFACE 0;
     return iface->interfaceCall(AddonInterface::AngleInterface,
             AddonInterface::availableAngles).toInt();
 }
 
 int MediaController::currentAngle() const
 {
-    IFACE1(0);
+    IFACE 0;
     return iface->interfaceCall(AddonInterface::AngleInterface,
             AddonInterface::angle).toInt();
 }
 
 void MediaController::setCurrentAngle(int titleNumber)
 {
-    IFACE0;
+    IFACE;
     iface->interfaceCall(AddonInterface::AngleInterface,
             AddonInterface::setAngle, QList<QVariant>() << QVariant(titleNumber));
 }
 
-#undef IFACE0
-#undef IFACE1
+#undef IFACE
 
 } // namespace Phonon
 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic