Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vimba
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
kr69sugu
vimba
Commits
97ea10e4
Commit
97ea10e4
authored
1 year ago
by
am0ebe
Browse files
Options
Downloads
Patches
Plain Diff
mv calcdirsize from util to record
parent
faec0004
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/record.cpp
+17
-1
17 additions, 1 deletion
src/record.cpp
src/record.h
+1
-0
1 addition, 0 deletions
src/record.h
src/utils.cpp
+0
-16
0 additions, 16 deletions
src/utils.cpp
src/utils.h
+0
-1
0 additions, 1 deletion
src/utils.h
with
18 additions
and
18 deletions
src/record.cpp
+
17
−
1
View file @
97ea10e4
...
...
@@ -206,7 +206,7 @@ void Record::checkDiskSpace(const QString &dir, seconds dur)
//in bytes
qint64
available
=
storageInfo
.
bytesAvailable
();
qint64
total
=
storageInfo
.
bytesTotal
();
qint64
used
=
utils
::
calcDirSize
(
dir
);
qint64
used
=
calcDirSize
(
dir
);
int
usedPercentage
=
(
double
(
used
)
/
total
)
*
100
;
info
(
progressBar
(
usedPercentage
)
);
// << cuz of this line, the function is here not in utils...
...
...
@@ -224,3 +224,19 @@ void Record::checkDiskSpace(const QString &dir, seconds dur)
qWarning
()
<<
"Warning: Estimated recording space exceeds available space!"
;
}
}
qint64
Record
::
calcDirSize
(
const
QString
&
dirrr
)
{
QDir
dir
(
dirrr
);
qint64
size
=
0
;
// Recursively calculate size of files in the directory
foreach
(
QFileInfo
fileInfo
,
dir
.
entryInfoList
(
QDir
::
Files
|
QDir
::
Dirs
|
QDir
::
NoDotAndDotDot
,
QDir
::
DirsFirst
))
{
if
(
fileInfo
.
isDir
())
size
+=
calcDirSize
(
fileInfo
.
absoluteFilePath
());
else
size
+=
fileInfo
.
size
();
}
return
size
;
}
This diff is collapsed.
Click to expand it.
src/record.h
+
1
−
0
View file @
97ea10e4
...
...
@@ -35,6 +35,7 @@ public slots:
private
:
bool
checkDirExists
();
qint64
calcDirSize
(
const
QString
&
);
CamPtr
_cam
;
QTimer
*
_timer
;
...
...
This diff is collapsed.
Click to expand it.
src/utils.cpp
+
0
−
16
View file @
97ea10e4
...
...
@@ -251,20 +251,4 @@ QString settingsFile(QString filename)
return
_settingsFile
.
isEmpty
()
?
utils
::
getFirstFileInAppDirEndingWith
(
"xml"
)
:
_settingsFile
;
}
qint64
calcDirSize
(
const
QString
&
dirrr
)
{
QDir
dir
(
dirrr
);
qint64
size
=
0
;
// Recursively calculate size of files in the directory
foreach
(
QFileInfo
fileInfo
,
dir
.
entryInfoList
(
QDir
::
Files
|
QDir
::
Dirs
|
QDir
::
NoDotAndDotDot
,
QDir
::
DirsFirst
))
{
if
(
fileInfo
.
isDir
())
size
+=
calcDirSize
(
fileInfo
.
absoluteFilePath
());
else
size
+=
fileInfo
.
size
();
}
return
size
;
}
}
// namespace utils
This diff is collapsed.
Click to expand it.
src/utils.h
+
0
−
1
View file @
97ea10e4
...
...
@@ -24,7 +24,6 @@ QString outDir(QString dirname="");
int
frameSize
();
int
fps
();
qint64
calcDirSize
(
const
QString
&
);
QString
getFirstFileInAppDirEndingWith
(
QString
const
&
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment