diff options
Diffstat (limited to 'src/statusbarspaceinfo.cpp')
-rw-r--r-- | src/statusbarspaceinfo.cpp | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/src/statusbarspaceinfo.cpp b/src/statusbarspaceinfo.cpp index 221a4f0..cf70190 100644 --- a/src/statusbarspaceinfo.cpp +++ b/src/statusbarspaceinfo.cpp @@ -20,15 +20,15 @@ #include "statusbarspaceinfo.h" -#include <qpainter.h> -#include <qtimer.h> +#include <tqpainter.h> +#include <tqtimer.h> #include <kglobalsettings.h> #include <kdiskfreesp.h> #include <klocale.h> #include <kio/job.h> -StatusBarSpaceInfo::StatusBarSpaceInfo(QWidget* parent) : - QWidget(parent), +StatusBarSpaceInfo::StatusBarSpaceInfo(TQWidget* tqparent) : + TQWidget(tqparent), m_gettingSize(false), m_kBSize(0), m_kBAvailable(0) @@ -37,8 +37,8 @@ StatusBarSpaceInfo::StatusBarSpaceInfo(QWidget* parent) : // Update the space information each 10 seconds. Polling is useful // here, as files can be deleted/added outside the scope of Dolphin. - QTimer* timer = new QTimer(this); - connect(timer, SIGNAL(timeout()), this, SLOT(refresh())); + TQTimer* timer = new TQTimer(this); + connect(timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(refresh())); timer->start(10000); } @@ -53,32 +53,32 @@ void StatusBarSpaceInfo::setURL(const KURL& url) update(); } -void StatusBarSpaceInfo::paintEvent(QPaintEvent* /* event */) +void StatusBarSpaceInfo::paintEvent(TQPaintEvent* /* event */) { - QPainter painter(this); + TQPainter painter(this); const int barWidth = width(); const int barTop = 2; const int barHeight = height() - 4; - QString text; + TQString text; const int widthDec = 3; // visual decrement for the available width - const QColor c1 = colorGroup().background(); - const QColor c2 = KGlobalSettings::buttonTextColor(); - const QColor frameColor((c1.red() + c2.red()) / 2, + const TQColor c1 = tqcolorGroup().background(); + const TQColor c2 = KGlobalSettings::buttonTextColor(); + const TQColor frameColor((c1.red() + c2.red()) / 2, (c1.green() + c2.green()) / 2, (c1.blue() + c2.blue()) / 2); painter.setPen(frameColor); - const QColor backgrColor = KGlobalSettings::baseColor(); + const TQColor backgrColor = KGlobalSettings::baseColor(); painter.setBrush(backgrColor); - painter.drawRect(QRect(0, barTop + 1 , barWidth - widthDec, barHeight)); + painter.drawRect(TQRect(0, barTop + 1 , barWidth - widthDec, barHeight)); if ((m_kBSize > 0) && (m_kBAvailable > 0)) { // draw 'used size' bar - painter.setPen(Qt::NoPen); + painter.setPen(TQt::NoPen); painter.setBrush(progressColor(backgrColor)); int usedWidth = barWidth - static_cast<int>((m_kBAvailable * static_cast<float>(barWidth)) / m_kBSize); @@ -87,10 +87,10 @@ void StatusBarSpaceInfo::paintEvent(QPaintEvent* /* event */) if (right < left) { right = left; } - painter.drawRect(QRect(left, barTop + 2, right, barHeight - 2)); + painter.drawRect(TQRect(left, barTop + 2, right, barHeight - 2)); text = i18n("%1 free") - .arg(KIO::convertSizeFromKB(m_kBAvailable)); + .tqarg(KIO::convertSizeFromKB(m_kBAvailable)); } else { if (m_gettingSize) { @@ -98,14 +98,14 @@ void StatusBarSpaceInfo::paintEvent(QPaintEvent* /* event */) } else { text = ""; - QTimer::singleShot(0, this, SLOT(hide())); + TQTimer::singleShot(0, this, TQT_SLOT(hide())); } } // draw text (usually 'Y GB free') painter.setPen(KGlobalSettings::textColor()); - painter.drawText(QRect(1, 1, barWidth - 2, barHeight + 4), - Qt::AlignHCenter | Qt::AlignVCenter | Qt::WordBreak, + painter.drawText(TQRect(1, 1, barWidth - 2, barHeight + 4), + TQt::AlignHCenter | TQt::AlignVCenter | TQt::WordBreak, text); } @@ -113,7 +113,7 @@ void StatusBarSpaceInfo::paintEvent(QPaintEvent* /* event */) void StatusBarSpaceInfo::slotFoundMountPoint(const unsigned long& kBSize, const unsigned long& /* kBUsed */, const unsigned long& kBAvailable, - const QString& /* mountPoint */) + const TQString& /* mountPoint */) { m_gettingSize = false; m_kBSize = kBSize; @@ -122,7 +122,7 @@ void StatusBarSpaceInfo::slotFoundMountPoint(const unsigned long& kBSize, // Bypass a the issue (?) of KDiskFreeSp that for protocols like // FTP, SMB the size of root partition is returned. // TODO: check whether KDiskFreeSp is buggy or Dolphin uses it in a wrong way - const QString protocol(m_url.protocol()); + const TQString protocol(m_url.protocol()); if (!protocol.isEmpty() && (protocol != "file")) { m_kBSize = 0; m_kBAvailable = 0; @@ -147,26 +147,26 @@ void StatusBarSpaceInfo::refresh() m_kBSize = 0; m_kBAvailable = 0; - const QString mountPoint(KIO::findPathMountPoint(m_url.path())); + const TQString mountPoint(KIO::findPathMountPoint(m_url.path())); - KDiskFreeSp* job = new KDiskFreeSp(this); - connect(job, SIGNAL(foundMountPoint(const unsigned long&, + KDiskFreeSp* job = new KDiskFreeSp(TQT_TQOBJECT(this)); + connect(job, TQT_SIGNAL(foundMountPoint(const unsigned long&, const unsigned long&, const unsigned long&, - const QString& )), - this, SLOT(slotFoundMountPoint(const unsigned long&, + const TQString& )), + this, TQT_SLOT(slotFoundMountPoint(const unsigned long&, const unsigned long&, const unsigned long&, - const QString& ))); - connect(job, SIGNAL(done()), - this, SLOT(slotDone())); + const TQString& ))); + connect(job, TQT_SIGNAL(done()), + this, TQT_SLOT(slotDone())); job->readDF(mountPoint); } -QColor StatusBarSpaceInfo::progressColor(const QColor& bgColor) const +TQColor StatusBarSpaceInfo::progressColor(const TQColor& bgColor) const { - QColor color = KGlobalSettings::buttonBackground(); + TQColor color = KGlobalSettings::buttonBackground(); // assure that enough contrast is given between the background color // and the progressbar color @@ -174,8 +174,8 @@ QColor StatusBarSpaceInfo::progressColor(const QColor& bgColor) const 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 backgrBrightness = tqGray(bgRed, bgGreen, bgBlue); + const int progressBrightness = tqGray(color.red(), color.green(), color.blue()); const int limit = 32; const int diff = backgrBrightness - progressBrightness; @@ -183,7 +183,7 @@ QColor StatusBarSpaceInfo::progressColor(const QColor& bgColor) const ((diff < 0) && (diff > -limit)); if (adjustColor) { const int inc = (backgrBrightness < 2 * limit) ? (2 * limit) : -limit; - color = QColor(bgRed + inc, bgGreen + inc, bgBlue + inc); + color = TQColor(bgRed + inc, bgGreen + inc, bgBlue + inc); } return color; |