diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:22:56 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:22:56 +0000 |
commit | 7346aee26bf190a7e70333c40fab4caca847cd27 (patch) | |
tree | 4b019b434f88dcc3eeaafe1d3f26240b4c4718e8 /konq-plugins/fsview/fsview.cpp | |
parent | 23a3d3aa5b44cbdf305495919866d9dbf4f6da54 (diff) | |
download | tdeaddons-7346aee26bf190a7e70333c40fab4caca847cd27.tar.gz tdeaddons-7346aee26bf190a7e70333c40fab4caca847cd27.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaddons@1157634 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'konq-plugins/fsview/fsview.cpp')
-rw-r--r-- | konq-plugins/fsview/fsview.cpp | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/konq-plugins/fsview/fsview.cpp b/konq-plugins/fsview/fsview.cpp index b0c82d8..931c43f 100644 --- a/konq-plugins/fsview/fsview.cpp +++ b/konq-plugins/fsview/fsview.cpp @@ -21,9 +21,9 @@ */ -#include <qdir.h> -#include <qpopupmenu.h> -#include <qtimer.h> +#include <tqdir.h> +#include <tqpopupmenu.h> +#include <tqtimer.h> #include <kapplication.h> #include <kconfig.h> @@ -41,9 +41,9 @@ // FSView -QMap<QString, MetricEntry> FSView::_dirMetric; +TQMap<TQString, MetricEntry> FSView::_dirMetric; -FSView::FSView(Inode* base, QWidget* parent, const char* name) +FSView::FSView(Inode* base, TQWidget* parent, const char* name) : TreeMapWidget(base, parent, name) { setFieldType(0, i18n("Name")); @@ -81,25 +81,25 @@ FSView::FSView(Inode* base, QWidget* parent, const char* name) _config = new KConfig("fsviewrc"); // restore TreeMap visualization options of last execution - KConfigGroup tmconfig(_config, QCString("TreeMap")); + KConfigGroup tmconfig(_config, TQCString("TreeMap")); restoreOptions(&tmconfig); - QString str = tmconfig.readEntry("ColorMode"); + TQString str = tmconfig.readEntry("ColorMode"); if (!str.isEmpty()) setColorMode(str); if (_dirMetric.count() == 0) { // restore metric cache - KConfigGroup cconfig(_config, QCString("MetricCache")); + KConfigGroup cconfig(_config, TQCString("MetricCache")); int ccount = cconfig.readNumEntry("Count", 0); int i, f, d; double s; - QString str; + TQString str; for (i=1;i<=ccount;i++) { - str = QString("Dir%1").arg(i); + str = TQString("Dir%1").arg(i); if (!cconfig.hasKey(str)) continue; str = cconfig.readPathEntry(str); - s = cconfig.readDoubleNumEntry(QString("Size%1").arg(i), 0.0); - f = cconfig.readNumEntry(QString("Files%1").arg(i), 0); - d = cconfig.readNumEntry(QString("Dirs%1").arg(i), 0); + s = cconfig.readDoubleNumEntry(TQString("Size%1").arg(i), 0.0); + f = cconfig.readNumEntry(TQString("Files%1").arg(i), 0); + d = cconfig.readNumEntry(TQString("Dirs%1").arg(i), 0); if (s==0.0 || f==0 || d==0) continue; setDirMetric(str, s, f, d); } @@ -118,7 +118,7 @@ void FSView::stop() _sm.stopScan(); } -void FSView::setPath(QString p) +void FSView::setPath(TQString p) { Inode* b = (Inode*)base(); if (!b) return; @@ -128,7 +128,7 @@ void FSView::setPath(QString p) // stop any previous updating stop(); - QFileInfo fi(p); + TQFileInfo fi(p); _path = fi.absFilePath(); if (!fi.isDir()) { _path = fi.dirPath(true); @@ -139,7 +139,7 @@ void FSView::setPath(QString p) u.setPath(_path); if (!kapp->authorizeURLAction("list", KURL(), u)) { - QString msg = KIO::buildErrorString(KIO::ERR_ACCESS_DENIED, u.prettyURL()); + TQString msg = KIO::buildErrorString(KIO::ERR_ACCESS_DENIED, u.prettyURL()); KMessageBox::queuedMessageBox(this, KMessageBox::Sorry, msg); } @@ -147,7 +147,7 @@ void FSView::setPath(QString p) b->setPeer(d); - setCaption(QString("%1 - FSView").arg(_path)); + setCaption(TQString("%1 - FSView").arg(_path)); requestUpdate(b); } @@ -165,10 +165,10 @@ KURL::List FSView::selectedUrls() return urls; } -bool FSView::getDirMetric(const QString& k, +bool FSView::getDirMetric(const TQString& k, double& s, unsigned int& f, unsigned int& d) { - QMap<QString, MetricEntry>::iterator it; + TQMap<TQString, MetricEntry>::iterator it; it = _dirMetric.find(k); if (it == _dirMetric.end()) return false; @@ -183,7 +183,7 @@ bool FSView::getDirMetric(const QString& k, return true; } -void FSView::setDirMetric(const QString& k, +void FSView::setDirMetric(const TQString& k, double s, unsigned int f, unsigned int d) { if (0) kdDebug(90100) << "setDirMetric '" << k << "': size " @@ -203,8 +203,8 @@ void FSView::requestUpdate(Inode* i) i->clear(); if (!_sm.scanRunning()) { - QTimer::singleShot(0, this, SLOT(doUpdate())); - QTimer::singleShot(100, this, SLOT(doRedraw())); + TQTimer::singleShot(0, this, TQT_SLOT(doUpdate())); + TQTimer::singleShot(100, this, TQT_SLOT(doRedraw())); /* start new progress chunk */ _progressPhase = 1; @@ -266,14 +266,14 @@ void FSView::selected(TreeMapItem* i) setPath(((Inode*)i)->path()); } -void FSView::contextMenu(TreeMapItem* i, const QPoint& p) +void FSView::contextMenu(TreeMapItem* i, const TQPoint& p) { - QPopupMenu popup; + TQPopupMenu popup; - QPopupMenu* spopup = new QPopupMenu(); - QPopupMenu* dpopup = new QPopupMenu(); - QPopupMenu* apopup = new QPopupMenu(); - QPopupMenu* fpopup = new QPopupMenu(); + TQPopupMenu* spopup = new TQPopupMenu(); + TQPopupMenu* dpopup = new TQPopupMenu(); + TQPopupMenu* apopup = new TQPopupMenu(); + TQPopupMenu* fpopup = new TQPopupMenu(); // choosing from the selection menu will give a selectionChanged() signal addSelectionItems(spopup, 901, i); @@ -297,10 +297,10 @@ void FSView::contextMenu(TreeMapItem* i, const QPoint& p) popup.insertSeparator(); - QPopupMenu* cpopup = new QPopupMenu(); + TQPopupMenu* cpopup = new TQPopupMenu(); addColorItems(cpopup, 1401); popup.insertItem(i18n("Color Mode"), cpopup, 1400); - QPopupMenu* vpopup = new QPopupMenu(); + TQPopupMenu* vpopup = new TQPopupMenu(); addVisualizationItems(vpopup, 1301); popup.insertItem(i18n("Visualization"), vpopup, 1300); @@ -328,13 +328,13 @@ void FSView::contextMenu(TreeMapItem* i, const QPoint& p) void FSView::saveMetric(KConfigGroup* g) { - QMap<QString, MetricEntry>::iterator it; + TQMap<TQString, MetricEntry>::iterator it; int c = 1; for (it=_dirMetric.begin();it!=_dirMetric.end();++it) { - g->writePathEntry(QString("Dir%1").arg(c), it.key()); - g->writeEntry(QString("Size%1").arg(c), (*it).size); - g->writeEntry(QString("Files%1").arg(c), (*it).fileCount); - g->writeEntry(QString("Dirs%1").arg(c), (*it).dirCount); + g->writePathEntry(TQString("Dir%1").arg(c), it.key()); + g->writeEntry(TQString("Size%1").arg(c), (*it).size); + g->writeEntry(TQString("Files%1").arg(c), (*it).fileCount); + g->writeEntry(TQString("Dirs%1").arg(c), (*it).dirCount); c++; } g->writeEntry("Count", c-1); @@ -348,7 +348,7 @@ void FSView::setColorMode(FSView::ColorMode cm) redraw(); } -bool FSView::setColorMode(QString mode) +bool FSView::setColorMode(TQString mode) { if (mode == "None") setColorMode(None); else if (mode == "Depth") setColorMode(Depth); @@ -361,9 +361,9 @@ bool FSView::setColorMode(QString mode) return true; } -QString FSView::colorModeString() const +TQString FSView::colorModeString() const { - QString mode; + TQString mode; switch(_colorMode) { case None: mode = "None"; break; case Depth: mode = "Depth"; break; @@ -376,13 +376,13 @@ QString FSView::colorModeString() const return mode; } -void FSView::addColorItems(QPopupMenu* popup, int id) +void FSView::addColorItems(TQPopupMenu* popup, int id) { _colorID = id; popup->setCheckable(true); - connect(popup, SIGNAL(activated(int)), - this, SLOT(colorActivated(int))); + connect(popup, TQT_SIGNAL(activated(int)), + this, TQT_SLOT(colorActivated(int))); popup->insertItem(i18n("None"), id); popup->insertItem(i18n("Depth"), id+1); @@ -414,14 +414,14 @@ void FSView::colorActivated(int id) void FSView::saveFSOptions() { - KConfigGroup tmconfig(_config, QCString("TreeMap")); + KConfigGroup tmconfig(_config, TQCString("TreeMap")); saveOptions(&tmconfig); tmconfig.writeEntry("ColorMode", colorModeString()); - KConfigGroup gconfig(_config, QCString("General")); + KConfigGroup gconfig(_config, TQCString("General")); gconfig.writeEntry("Path", _path); - KConfigGroup cconfig(_config, QCString("MetricCache")); + KConfigGroup cconfig(_config, TQCString("MetricCache")); saveMetric(&cconfig); } @@ -458,7 +458,7 @@ void FSView::doRedraw() redo = true; if (redo) { - QTimer::singleShot(500, this, SLOT(doRedraw())); + TQTimer::singleShot(500, this, TQT_SLOT(doRedraw())); redrawCounter++; } } @@ -532,7 +532,7 @@ void FSView::doUpdate() } if (_sm.scanRunning()) - QTimer::singleShot(0, this, SLOT(doUpdate())); + TQTimer::singleShot(0, this, TQT_SLOT(doUpdate())); else emit completed(_dirsFinished); } |