fixed free space / size display on large filesystems
authorHeikki Holstila <heikki.holstila@gmail.com>
Wed, 13 Oct 2010 11:53:48 +0000 (14:53 +0300)
committerHeikki Holstila <heikki.holstila@gmail.com>
Wed, 13 Oct 2010 11:53:48 +0000 (14:53 +0300)
TODO.txt
aaptinterface.h
fapman
mainwindow.cpp

index 2148089..ed2cd07 100644 (file)
--- a/TODO.txt
+++ b/TODO.txt
@@ -8,7 +8,7 @@
 0.7:
 * ensure that package icons are scaled to proper size in the package details dialog
 * minor UI tweaks
-- fetch dates for other repositories than maemo.org?
+* fix: show free space and size correctly for large filesystems
 - support loading .install files
 - support installing local .debs
 - dbus interface for installing packages by name
@@ -22,6 +22,7 @@
 
 
 later/any/uncertain:
+- fetch dates from other repositories than maemo.org?
 - don't lose package selections when returning to main menu
   (autostore/load selections - to different file than normal store)
 - update install/remove changes directly to internal package db & don't require re-reading package lists afterwards
@@ -44,6 +45,6 @@ later/any/uncertain:
 
 known bugs:
 - possible to get stuck in portrait mode (wait for Qt autorotation fix)
-- no window menu indicator in stacked windows (probably Qt bug)
+- no window menu indicator in stacked windows (probably a Qt bug)
 - updating menu icons after installation does not work or works only sometimes (currently disabled)
 
index f14ae59..17c2e42 100644 (file)
@@ -81,10 +81,17 @@ public:
        int numSelectedPackages() const { return iNumSelectedPackages; }
        void setNumSelectedPackages(int p_) { iNumSelectedPackages=p_; }
 
-       QHash<QString, Package*>* packagesAvailable() { return &iPackagesAvailable; }
-       QHash<QString, Package*>* packagesInstalled() { return &iPackagesInstalled; }
+       const QHash<QString, Package*>* packagesAvailable() { return &iPackagesAvailable; }
+       const QHash<QString, Package*>* packagesInstalled() { return &iPackagesInstalled; }
        QList<Repository*>* repositories() { return  &iRepositories; }
 
+       // new api functions to support multiple packages with the same name
+       /*
+       QList<Package*> allLatestAvailablePackages();
+       QList<Package*> allAvailablePackagesNamed(QString name);
+       Package* findNewestAvailablePackage(QString name);
+       */
+
        QByteArray readLogFile();
        void readRepositoryInfo();
        bool writeRepositories();
diff --git a/fapman b/fapman
index e662776..cc287ac 100755 (executable)
Binary files a/fapman and b/fapman differ
index a2f6c5c..71d9337 100644 (file)
@@ -675,10 +675,10 @@ void MainWindow::showFreeSpace()
        struct statfs opt_stat;
        statfs("/",&root_stat);
        statfs("/opt",&opt_stat);
-       quint64 free_root = root_stat.f_bavail * root_stat.f_bsize / 1024;
-       quint64 free_opt = opt_stat.f_bavail * opt_stat.f_bsize / 1024;
-       quint64 total_root = root_stat.f_blocks * root_stat.f_bsize / 1024;
-       quint64 total_opt = opt_stat.f_blocks * opt_stat.f_bsize / 1024;
+       quint64 free_root = static_cast<quint64>(root_stat.f_bavail) * static_cast<quint64>(root_stat.f_bsize) / 1024;
+       quint64 free_opt = static_cast<quint64>(opt_stat.f_bavail) * static_cast<quint64>(opt_stat.f_bsize) / 1024;
+       quint64 total_root = static_cast<quint64>(root_stat.f_blocks) * static_cast<quint64>(root_stat.f_bsize) / 1024;
+       quint64 total_opt = static_cast<quint64>(opt_stat.f_blocks) * static_cast<quint64>(opt_stat.f_bsize) / 1024;
        qDebug() << "rootfs" << free_root << "/" << total_root << "kB free";
        qDebug() << "opt fs" << free_opt << "/" << total_opt << "kB free";