Index: src/rip/videodvd/k3bvideodvdrippingwidget.cpp =================================================================== --- src/rip/videodvd/k3bvideodvdrippingwidget.cpp (revision 958507) +++ src/rip/videodvd/k3bvideodvdrippingwidget.cpp (working copy) @@ -26,7 +26,10 @@ #include #include #include +#include +#if KDE_IS_VERSION(4,2,0) #include +#endif #include #include @@ -255,10 +258,17 @@ path.truncate( path.lastIndexOf('/') ); QPalette pal( m_labelFreeSpace->palette() ); +#if KDE_IS_VERSION(4,2,0) KDiskFreeSpaceInfo free = KDiskFreeSpaceInfo::freeSpaceInfo( path ); if( free.isValid() ) { m_labelFreeSpace->setText( KIO::convertSizeFromKiB(free.available()) ); if( free.available() < m_neededSize/1024 ) +#else + unsigned long size, avail; + if( K3b::kbFreeOnFs( path, size, avail ) ) { + m_labelFreeSpace->setText( KIO::convertSizeFromKiB(avail) ); + if( avail < m_neededSize/1024 ) +#endif pal.setColor( QPalette::Text, Qt::red ); else pal.setColor( QPalette::Text, palette().color( QPalette::Text ) ); Index: libk3b/core/k3bglobals.cpp =================================================================== --- libk3b/core/k3bglobals.cpp (revision 958522) +++ libk3b/core/k3bglobals.cpp (working copy) @@ -33,7 +33,17 @@ #include #include #include +#if KDE_IS_VERSION(4,2,0) #include +#else +#include +#ifdef HAVE_SYS_STATVFS_H +# include +#endif +#ifdef HAVE_SYS_VFS_H +# include +#endif +#endif #include #include @@ -209,6 +219,7 @@ bool K3b::kbFreeOnFs( const QString& path, unsigned long& size, unsigned long& avail ) { +#if KDE_IS_VERSION(4,2,0) KDiskFreeSpaceInfo fs = KDiskFreeSpaceInfo::freeSpaceInfo( path ); if ( fs.isValid() ) { size = fs.size()/1024; @@ -218,6 +229,21 @@ else { return false; } +#else +#ifdef HAVE_SYS_STATVFS_H + struct statvfs fs; + if( ::statvfs( QFile::encodeName(path), &fs ) == 0 ) { + unsigned long kBfak = fs.f_frsize/1024; + + size = fs.f_blocks*kBfak; + avail = fs.f_bavail*kBfak; + + return true; + } + else +#endif + return false; +#endif }