From: Fredrik Tolf Date: Sat, 13 Oct 2007 19:06:35 +0000 (+0200) Subject: Merge commit 'pubserv/master' X-Git-Tag: 1.0~25 X-Git-Url: http://git.dolda2000.com/gitweb/?p=doldaconnect.git;a=commitdiff_plain;h=a9477b339d8edadb9eb109718e3acffc178d65c6;hp=a415902212d50526dbe9b53bb99f40de25a3ce3d Merge commit 'pubserv/master' --- diff --git a/autopackage/dolcon.apspec.in b/autopackage/dolcon.apspec.in index 2263f69..e7f0457 100644 --- a/autopackage/dolcon.apspec.in +++ b/autopackage/dolcon.apspec.in @@ -38,7 +38,7 @@ unprepareBuild echo bin/dolcon share | import [Prepare] -require @gtk.org/gtk 2.0 +require @gtk.org/gtk 2.4 require @dolda2000.com/fredrik/doldaconnect/dcuilib 1.1 [Install] diff --git a/autopackage/guishell.apspec.in b/autopackage/guishell.apspec.in new file mode 100644 index 0000000..53cfcc0 --- /dev/null +++ b/autopackage/guishell.apspec.in @@ -0,0 +1,37 @@ +# -*-shell-script-*- + +[Meta] +RootName: @dolda2000.com/fredrik/doldaconnect/guishell:$SOFTWAREVERSION +DisplayName: Dolda Connect GUI +ShortName: doldaconnect-guishell +Maintainer: Fredrik Tolf +Packager: Fredrik Tolf +Summary: A friendly GUI for Dolda Connect +URL: http://www.dolda2000.com/~fredrik/doldaconnect/ +License: GNU General Public License, Version 2 or later +SoftwareVersion: @VERSION@ +Repository: http://www.dolda2000.com/~fredrik/doldaconnect/ap/doldaconnect-guishell.xml +AutopackageTarget: 1.2 + +[BuildPrepare] +prepareBuild --enable-dolconf --enable-guishell --disable-gtk2ui --disable-daemon + +[BuildUnprepare] +unprepareBuild + +[Imports] +echo bin share/locale | import + +[Prepare] +require @gtk.org/gtk 2.10 +require @dolda2000.com/fredrik/doldaconnect/dcuilib 1.1 + +[Install] +installExe bin/dolconf +installExe bin/dolcon-launch +installExe bin/doldacond-shell +installLocale share/locale + +[Uninstall] +# Usually just the following line is enough to uninstall everything +uninstallFromLog diff --git a/clients/gtk2/dolcon.c b/clients/gtk2/dolcon.c index b209370..9da836b 100644 --- a/clients/gtk2/dolcon.c +++ b/clients/gtk2/dolcon.c @@ -279,23 +279,16 @@ char *bytes2si(long long bytes) { int i; double b; - char *sd; static char ret[64]; + static char pfx[] = {'k', 'M', 'G', 'T'}; b = bytes; - for(i = 0; (b >= 1024) && (i < 4); i++) + for(i = 0; (b >= 1024) && (i < sizeof(pfx)); i++) b /= 1024; if(i == 0) - sd = "B"; - else if(i == 1) - sd = "kiB"; - else if(i == 2) - sd = "MiB"; - else if(i == 3) - sd = "GiB"; + snprintf(ret, 64, "%.1f B", b); else - sd = "TiB"; - snprintf(ret, 64, "%.1f %s", b, sd); + snprintf(ret, 64, "%.1f %ciB", b, pfx[i - 1]); return(ret); } diff --git a/configure.in b/configure.in index c52a3e9..f90ec5f 100644 --- a/configure.in +++ b/configure.in @@ -271,6 +271,7 @@ autopackage/doldacond.apspec autopackage/dolcon.apspec autopackage/dcuilib.apspec autopackage/dcguile.apspec +autopackage/guishell.apspec ]) echo