summaryrefslogtreecommitdiffstats
path: root/tdeioslave/trash/discspaceutil.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tdeioslave/trash/discspaceutil.cpp')
-rw-r--r--tdeioslave/trash/discspaceutil.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/tdeioslave/trash/discspaceutil.cpp b/tdeioslave/trash/discspaceutil.cpp
index 186cb0e7f..bca944e39 100644
--- a/tdeioslave/trash/discspaceutil.cpp
+++ b/tdeioslave/trash/discspaceutil.cpp
@@ -52,10 +52,17 @@ unsigned long DiscSpaceUtil::sizeOfPath( const TQString &path )
TQFileInfoListIterator it( *infos );
unsigned long sum = 0;
- TQFileInfo *info = 0;
- while ( (info = it.current()) != 0 ) {
- if ( info->fileName() != "." && info->fileName() != ".." )
- sum += sizeOfPath( info->absFilePath() );
+ const TQFileInfo *info = nullptr;
+ while ((info = it.current()))
+ {
+ if (info->isFile())
+ {
+ sum += info->size();
+ }
+ else if (info->fileName() != "." && info->fileName() != "..")
+ {
+ sum += sizeOfPath(info->absFilePath());
+ }
++it;
}
@@ -102,9 +109,9 @@ void DiscSpaceUtil::done()
void DiscSpaceUtil::calculateFullSize()
{
KDiskFreeSp *sp = KDiskFreeSp::findUsageInfo( mDirectory );
- connect( sp, TQT_SIGNAL( foundMountPoint( const TQString&, unsigned long, unsigned long, unsigned long ) ),
- this, TQT_SLOT( foundMountPoint( const TQString&, unsigned long, unsigned long, unsigned long ) ) );
- connect( sp, TQT_SIGNAL( done() ), this, TQT_SLOT( done() ) );
+ connect( sp, TQ_SIGNAL( foundMountPoint( const TQString&, unsigned long, unsigned long, unsigned long ) ),
+ this, TQ_SLOT( foundMountPoint( const TQString&, unsigned long, unsigned long, unsigned long ) ) );
+ connect( sp, TQ_SIGNAL( done() ), this, TQ_SLOT( done() ) );
tqApp->eventLoop()->enterLoop();
}