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

List:       kde-commits
Subject:    extragear/multimedia/k3b/libk3bdevice
From:       Sebastian Trueg <sebastian () trueg ! de>
Date:       2005-10-19 16:17:31
Message-ID: 1129738651.177953.32356.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 472046 by trueg:

Made some methods const (and once again break binary comp ;)
added a proper clear() method to K3bToc


 M  +2 -1      k3bdevice.cpp  
 M  +1 -1      k3bdevice.h  
 M  +8 -8      k3bdevicemanager.cpp  
 M  +7 -7      k3bdevicemanager.h  
 M  +8 -0      k3btoc.cpp  
 M  +2 -0      k3btoc.h  


--- trunk/extragear/multimedia/k3b/libk3bdevice/k3bdevice.cpp #472045:472046
@@ -146,6 +146,7 @@
 #ifdef Q_OS_FREEBSD
       cam(0),
 #endif
+      openedReadWrite(false),
       burnfree(false) {
   }
 
@@ -413,7 +414,7 @@
 }
 
 
-K3bDevice::Interface K3bDevice::Device::interfaceType()
+K3bDevice::Interface K3bDevice::Device::interfaceType() const
 {
   if( m_bus != -1 && m_target != -1 && m_lun != -1 )
     return SCSI;
--- trunk/extragear/multimedia/k3b/libk3bdevice/k3bdevice.h #472045:472046
@@ -63,7 +63,7 @@
        *
        * \return K3bDevice::SCSI or K3bDevice::IDE.
        */
-      Interface interfaceType();
+      Interface interfaceType() const;
 
       /**
        * The device type.
--- trunk/extragear/multimedia/k3b/libk3bdevice/k3bdevicemanager.cpp #472045:472046
@@ -188,40 +188,40 @@
 }
 
 
-QPtrList<K3bDevice::Device>& K3bDevice::DeviceManager::cdWriter() const
+const QPtrList<K3bDevice::Device>& K3bDevice::DeviceManager::cdWriter() const
 {
   return d->cdWriter;
 }
 
-QPtrList<K3bDevice::Device>& K3bDevice::DeviceManager::cdReader() const
+const QPtrList<K3bDevice::Device>& K3bDevice::DeviceManager::cdReader() const
 {
   return d->cdReader;
 }
 
-QPtrList<K3bDevice::Device>& K3bDevice::DeviceManager::dvdWriter() const
+const QPtrList<K3bDevice::Device>& K3bDevice::DeviceManager::dvdWriter() const
 {
   return d->dvdWriter;
 }
 
-QPtrList<K3bDevice::Device>& K3bDevice::DeviceManager::dvdReader() const
+const QPtrList<K3bDevice::Device>& K3bDevice::DeviceManager::dvdReader() const
 {
   return d->dvdReader;
 }
 
 
-QPtrList<K3bDevice::Device>& K3bDevice::DeviceManager::burningDevices() const
+const QPtrList<K3bDevice::Device>& K3bDevice::DeviceManager::burningDevices() const
 {
   return cdWriter();
 }
 
 
-QPtrList<K3bDevice::Device>& K3bDevice::DeviceManager::readingDevices() const
+const QPtrList<K3bDevice::Device>& K3bDevice::DeviceManager::readingDevices() const
 {
   return cdReader();
 }
 
 
-QPtrList<K3bDevice::Device>& K3bDevice::DeviceManager::allDevices() const
+const QPtrList<K3bDevice::Device>& K3bDevice::DeviceManager::allDevices() const
 {
   return d->allDevices;
 }
@@ -323,7 +323,7 @@
   kdDebug() << "(K3bDevice::DeviceManager) SCANNING FOR GENERIC DEVICES." << endl;
   for( int i = 0; i < 16; i++ ) {
     QString sgDev = resolveSymLink( QString("/dev/sg%1").arg(i) );
-    int bus, id, lun;
+    int bus = -1, id = -1, lun = -1;
     if( determineBusIdLun( sgDev, bus, id, lun ) ) {
       if( Device* dev = findDevice( bus, id, lun ) ) {
 	dev->m_genericDevice = sgDev;
--- trunk/extragear/multimedia/k3b/libk3bdevice/k3bdevicemanager.h #472045:472046
@@ -103,13 +103,13 @@
        * \return List of all cd writer devices.
        * \deprecated use cdWriter()
        */
-      QPtrList<Device>& burningDevices() const;
+      const QPtrList<Device>& burningDevices() const;
 
       /**
        * \return List of all reader devices without writer devices.
        * \deprecated use cdReader()
        **/
-      QPtrList<Device>& readingDevices() const;
+      const QPtrList<Device>& readingDevices() const;
 
       /**
        * Before getting the devices do a @ref scanBus() or add 
@@ -117,7 +117,7 @@
        *
        * \return List of all devices.
        */
-      QPtrList<Device>& allDevices() const;
+      const QPtrList<Device>& allDevices() const;
 
       /**
        * Before getting the devices do a @ref scanBus() or add 
@@ -125,7 +125,7 @@
        *
        * \return List of all cd writer devices.
        */
-      QPtrList<Device>& cdWriter() const;
+      const QPtrList<Device>& cdWriter() const;
 
       /**
        * Before getting the devices do a @ref scanBus() or add 
@@ -133,7 +133,7 @@
        *
        * \return List of all cd reader devices.
        */
-      QPtrList<Device>& cdReader() const;
+      const QPtrList<Device>& cdReader() const;
 
       /**
        * Before getting the devices do a @ref scanBus() or add 
@@ -141,7 +141,7 @@
        *
        * \return List of all DVD writer devices.
        */
-      QPtrList<Device>& dvdWriter() const;
+      const QPtrList<Device>& dvdWriter() const;
 
       /**
        * Before getting the devices do a @ref scanBus() or add 
@@ -149,7 +149,7 @@
        *
        * \return List of all DVD reader devices.
        */
-      QPtrList<Device>& dvdReader() const;
+      const QPtrList<Device>& dvdReader() const;
 
       /**
        * Reads the device information from the config file.
--- trunk/extragear/multimedia/k3b/libk3bdevice/k3btoc.cpp #472045:472046
@@ -120,3 +120,11 @@
   else
     return last().session();
 }
+
+
+void K3bDevice::Toc::clear()
+{
+  QValueList<Track>::clear();
+  m_mcn.resize( 0 );
+  m_firstSector = 0;
+}
--- trunk/extragear/multimedia/k3b/libk3bdevice/k3btoc.h #472045:472046
@@ -83,6 +83,8 @@
 
     void setMcn( const QCString& mcn ) { m_mcn = mcn; }
 
+    void clear();
+
   private:
     unsigned int m_discId;
     K3b::Msf m_firstSector;
[prev in list] [next in list] [prev in thread] [next in thread] 

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