- KDiskFreeSpace* job = new KDiskFreeSpace(this);
- connect(job, SIGNAL(foundMountPoint(const quint64&,
- const quint64&,
- const quint64&,
- const QString&)),
- this, SLOT(slotFoundMountPoint(const quint64&,
- const quint64&,
- const quint64&,
- const QString&)));
- connect(job, SIGNAL(done()),
- this, SLOT(showResult()));
-
- job->readDF(mp->mountPoint());
-}
-
-QColor StatusBarSpaceInfo::progressColor(const QColor& bgColor) const
-{
- QColor color = KColorScheme(KColorScheme::Button).background();
-
- // assure that enough contrast is given between the background color
- // and the progressbar color
- int bgRed = bgColor.red();
- int bgGreen = bgColor.green();
- int bgBlue = bgColor.blue();
-
- const int backgrBrightness = qGray(bgRed, bgGreen, bgBlue);
- const int progressBrightness = qGray(color.red(), color.green(), color.blue());
-
- const int limit = 32;
- const int diff = backgrBrightness - progressBrightness;
- bool adjustColor = ((diff >= 0) && (diff < limit)) ||
- ((diff < 0) && (diff > -limit));
- if (adjustColor) {
- const int inc = (backgrBrightness < 2 * limit) ? (2 * limit) : -limit;
- color = QColor(bgRed + inc, bgGreen + inc, bgBlue + inc);