Home
Phabricator
Search
Log In
Paste
P594
Masterwork From Distant Lands
Active
Public
Actions
Authored by
davidedmundson
on May 7 2020, 10:38 AM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Subscribers
None
From 1f7bd4a59288f2b8e34b6ad8f6e67d1f706fc1b0 Mon Sep 17 00:00:00 2001
From: David Edmundson <kde@davidedmundson.co.uk>
Date: Thu, 7 May 2020 11:34:46 +0100
Subject: [PATCH] Prefix disk name on size labels
labels for CPU frequency are "CPU 1 Clock Frequency". Network speeds
have the interface name at front. Partitions didn't match, leaving the
key in the graph to be just "Available" several times if you plotted
multiple disks.
This adds a prefix so it's consistent.
---
ksysguardd/Linux/diskstat.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/ksysguardd/Linux/diskstat.c b/ksysguardd/Linux/diskstat.c
index 3b849aaa..2eeee07f 100644
--- a/ksysguardd/Linux/diskstat.c
+++ b/ksysguardd/Linux/diskstat.c
@@ -321,7 +321,7 @@ void printDiskStatUsedInfo( const char* cmd )
{
char *mntpnt = getMntPnt( cmd );
- output( "Used\t0\t%ld\tKB\n", getTotal( mntpnt ) );
+ output( "%s Used\t0\t%ld\tKB\n", mntpnt, getTotal( mntpnt ) );
}
void printDiskStatFree( const char* cmd )
@@ -354,7 +354,7 @@ void printDiskStatFreeInfo( const char* cmd )
{
char *mntpnt = (char*)getMntPnt( cmd );
- output( "Available\t0\t%ld\tKB\n", getTotal( mntpnt ) );
+ output( "%s Available\t0\t%ld\tKB\n", mntpnt, getTotal( mntpnt ) );
}
void printDiskStatPercent( const char* cmd )
@@ -391,19 +391,18 @@ void printDiskStatPercent( const char* cmd )
void printDiskStatPercentInfo( const char* cmd )
{
- (void)cmd;
- output( "Percentage Used\t0\t100\t%%\n" );
+ char *mntpnt = (char*)getMntPnt( cmd );
+ output( "%s Percentage Used\t0\t100\t%%\n", mntpnt );
}
void printDiskStatTotal( const char* cmd )
{
char *mntpnt = (char*)getMntPnt( cmd );
-
- output( "%ld\n\n", getTotal( mntpnt ) );
+ output( "%s, %ld\n\n", mntpnt, getTotal( mntpnt ) );
}
void printDiskStatTotalInfo( const char* cmd )
{
- (void)cmd;
- output( "Total Size\t0\t0\tKB\n" );
+ char *mntpnt = (char*)getMntPnt( cmd );
+ output( "%s Total Size\t0\t0\tKB\n", mntpnt);
}
--
2.26.0
davidedmundson
edited the content of this paste.
(Show Details)
May 7 2020, 10:38 AM
davidedmundson
changed the title of this paste from untitled to
Masterwork From Distant Lands
.
Log In to Comment