Commit 32b58fff authored by Jonathan Marten's avatar Jonathan Marten
Browse files

Port deprecated KDiskFreeSpaceInfo -> QStorageInfo

parent 2432f263
......@@ -19,7 +19,6 @@
#include "k3b_i18n.h"
#include <KProcess>
#include <KDiskFreeSpaceInfo>
#include <KIO/Job>
#include <KIO/StatJob>
#include <KMountPoint>
......@@ -33,6 +32,7 @@
#include <QFile>
#include <QStandardPaths>
#include <QUrl>
#include <QStorageInfo>
#include <cmath>
#include <sys/utsname.h>
......@@ -199,10 +199,10 @@ QString K3b::systemName()
bool K3b::kbFreeOnFs( const QString& path, unsigned long& size, unsigned long& avail )
{
KDiskFreeSpaceInfo fs = KDiskFreeSpaceInfo::freeSpaceInfo( path );
const QStorageInfo fs(path);
if ( fs.isValid() ) {
size = fs.size()/1024;
avail = fs.available()/1024;
size = fs.bytesTotal()/1024;
avail = fs.bytesFree()/1024;
return true;
}
else {
......
......@@ -15,7 +15,6 @@
#include <KConfig>
#include <KLocalizedString>
#include <KIconLoader>
#include <KDiskFreeSpaceInfo>
#include <KIO/Global>
#include <KUrlRequester>
#include <kio_version.h>
......@@ -26,6 +25,7 @@
#include <QLabel>
#include <QLayout>
#include <QToolTip>
#include <QStorageInfo>
K3b::TempDirSelectionWidget::TempDirSelectionWidget( QWidget *parent )
......@@ -92,8 +92,8 @@ KIO::filesize_t K3b::TempDirSelectionWidget::freeTempSpace() const
if( !QFile::exists( path ) )
path.truncate( path.lastIndexOf('/') );
KDiskFreeSpaceInfo diskFreeSpaceInfo = KDiskFreeSpaceInfo::freeSpaceInfo( path );
return diskFreeSpaceInfo.available();
const QStorageInfo diskFreeSpaceInfo( path );
return diskFreeSpaceInfo.bytesFree();
}
......
......@@ -17,7 +17,6 @@
#include <KConfigGroup>
#include <KColorScheme>
#include <KLocalizedString>
#include <KDiskFreeSpaceInfo>
#include <KUrlRequester>
#include <KIconLoader>
......@@ -27,6 +26,7 @@
#include <QStandardPaths>
#include <QTimer>
#include <QToolButton>
#include <QStorageInfo>
......@@ -38,7 +38,7 @@ public:
QTimer freeSpaceUpdateTimer;
KIO::filesize_t neededSize;
qint64 neededSize;
AudioEncoder* encoderForIndex( int index ) const;
QString pluginNameForIndex( int index ) const;
......@@ -238,11 +238,11 @@ void K3b::AudioConvertingOptionWidget::slotUpdateFreeTempSpace()
{
KColorScheme::ForegroundRole textColor;
KDiskFreeSpaceInfo diskInfo = KDiskFreeSpaceInfo::freeSpaceInfo( m_editBaseDir->url().toLocalFile() );
const QStorageInfo diskInfo( m_editBaseDir->url().toLocalFile() );
if( diskInfo.isValid() ) {
m_labelFreeSpace->setText( KIO::convertSize(diskInfo.available()) );
m_labelFreeSpace->setText( KIO::convertSize(diskInfo.bytesFree()) );
if( d->neededSize > diskInfo.available() )
if( d->neededSize > diskInfo.bytesFree() )
textColor = KColorScheme::NegativeText;
else
textColor = KColorScheme::NormalText;
......
......@@ -12,7 +12,6 @@
#include <KLineEdit>
#include <KColorScheme>
#include <KLocalizedString>
#include <KDiskFreeSpaceInfo>
#include <KIO/Global>
#include <KUrlRequester>
#include <KUrlLabel>
......@@ -27,6 +26,7 @@
#include <QPushButton>
#include <QSpinBox>
#include <QWhatsThis>
#include <QStorageInfo>
static const int s_mp3Bitrates[] = {
......@@ -241,10 +241,10 @@ void K3b::VideoDVDRippingWidget::slotUpdateFreeTempSpace()
const KColorScheme colorScheme( isEnabled() ? QPalette::Normal : QPalette::Disabled, KColorScheme::Window );
QColor textColor;
KDiskFreeSpaceInfo free = KDiskFreeSpaceInfo::freeSpaceInfo( path );
const QStorageInfo free( path );
if( free.isValid() ) {
m_labelFreeSpace->setText( KIO::convertSizeFromKiB(free.available()/1024) );
if( free.available() < m_neededSize )
m_labelFreeSpace->setText( KIO::convertSizeFromKiB(free.bytesFree()/1024) );
if( free.bytesFree() < m_neededSize )
textColor = colorScheme.foreground( KColorScheme::NegativeText ).color();
else
textColor = colorScheme.foreground( KColorScheme::NormalText ).color();
......
......@@ -47,7 +47,7 @@ namespace K3b {
private:
QTimer* m_freeSpaceUpdateTimer;
KIO::filesize_t m_neededSize;
qint64 m_neededSize;
QSize m_customVideoSize;
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment