Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nemo-qml-plugin-systemsettings
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
martyone
nemo-qml-plugin-systemsettings
Commits
254ef0d8
Commit
254ef0d8
authored
Dec 07, 2016
by
jpetrell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[storage] Expose partition model as its own role. Contributes to JB#36373
parent
39d7065c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
2 deletions
+6
-2
src/partitionmodel.cpp
src/partitionmodel.cpp
+4
-1
src/partitionmodel.h
src/partitionmodel.h
+1
-0
tests/ut_diskusage.cpp
tests/ut_diskusage.cpp
+1
-1
No files found.
src/partitionmodel.cpp
View file @
254ef0d8
...
...
@@ -131,7 +131,8 @@ QHash<int, QByteArray> PartitionModel::roleNames() const
{
MountPathRole
,
"mountPath"
},
{
BytesAvailableRole
,
"bytesAvailable"
},
{
BytesTotalRole
,
"bytesTotal"
},
{
BytesFreeRole
,
"bytesFree"
}
{
BytesFreeRole
,
"bytesFree"
},
{
PartitionModelRole
,
"partitionModel"
}
};
return
roleNames
;
...
...
@@ -172,6 +173,8 @@ QVariant PartitionModel::data(const QModelIndex &index, int role) const
return
partition
.
bytesTotal
();
case
BytesFreeRole
:
return
partition
.
bytesFree
();
case
PartitionModelRole
:
return
QVariant
::
fromValue
(
static_cast
<
QObject
*>
(
const_cast
<
PartitionModel
*>
((
this
))));
default:
return
QVariant
();
}
...
...
src/partitionmodel.h
View file @
254ef0d8
...
...
@@ -57,6 +57,7 @@ public:
BytesAvailableRole
,
BytesTotalRole
,
BytesFreeRole
,
PartitionModelRole
};
enum
Status
{
...
...
tests/ut_diskusage.cpp
View file @
254ef0d8
...
...
@@ -52,7 +52,7 @@ static QVariantMap g_mocked_apkd_size;
/* Mocked implementations of size calculation functions */
quint64
DiskUsageWorker
::
calculateSize
(
QString
directory
,
QString
*
expandedPath
,
bool
androidHomeExists
)
quint64
DiskUsageWorker
::
calculateSize
(
QString
directory
,
QString
*
expandedPath
,
bool
)
{
if
(
expandedPath
)
{
*
expandedPath
=
directory
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment