diff options
author | Ken Moore <moorekou@gmail.com> | 2015-09-10 12:39:35 -0400 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2015-09-10 12:39:35 -0400 |
commit | 3365faa51cbd133e960d4ea6d3c6c930390c4b95 (patch) | |
tree | 4b807631ae4a45dc29e13e3deb64551fcc55d737 /libLumina/LuminaUtils.cpp | |
parent | Add a new panel plugin: systemstart (diff) | |
download | lumina-3365faa51cbd133e960d4ea6d3c6c930390c4b95.tar.gz lumina-3365faa51cbd133e960d4ea6d3c6c930390c4b95.tar.bz2 lumina-3365faa51cbd133e960d4ea6d3c6c930390c4b95.zip |
Add come fixes to libLumina to work with the new systemstart plugin, and adjust the theme files accordingly.
Diffstat (limited to 'libLumina/LuminaUtils.cpp')
-rw-r--r-- | libLumina/LuminaUtils.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/libLumina/LuminaUtils.cpp b/libLumina/LuminaUtils.cpp index c4091fbc..f45c3813 100644 --- a/libLumina/LuminaUtils.cpp +++ b/libLumina/LuminaUtils.cpp @@ -306,6 +306,27 @@ QString LUtils::BytesToDisplaySize(qint64 ibytes){ return (num+labs[c]); } +QString LUtils::SecondsToDisplay(int secs){ + if(secs < 0){ return "??"; } + QString rem; //remaining + if(secs > 3600){ + int hours = secs/3600; + rem.append( QString::number(hours)+"h "); + secs = secs - (hours*3600); + } + if(secs > 60){ + int min = secs/60; + rem.append( QString::number(min)+"m "); + secs = secs - (min*60); + } + if(secs > 0){ + rem.append( QString::number(secs)+"s"); + }else{ + rem.append( "0s" ); + } + return rem; +} + //Various function for finding valid QtQuick plugins on the system bool LUtils::validQuickPlugin(QString ID){ return ( !LUtils::findQuickPluginFile(ID).isEmpty() ); |