summaryrefslogtreecommitdiffstats
path: root/konq-plugins/fsview
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-18 17:00:31 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-18 17:00:31 +0000
commit395a904bff7b4d6ead445c342f7ac0c5fbf29121 (patch)
tree9829cadb79d2cc7c29a940627fadb28b11e54150 /konq-plugins/fsview
parent399f47c376fdf4d19192732a701ea9578d11619d (diff)
downloadtdeaddons-395a904bff7b4d6ead445c342f7ac0c5fbf29121.tar.gz
tdeaddons-395a904bff7b4d6ead445c342f7ac0c5fbf29121.zip
TQt4 port kdeaddons
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaddons@1237404 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'konq-plugins/fsview')
-rw-r--r--konq-plugins/fsview/fsview.cpp28
-rw-r--r--konq-plugins/fsview/fsview.h3
-rw-r--r--konq-plugins/fsview/fsview_part.cpp20
-rw-r--r--konq-plugins/fsview/fsview_part.h9
-rw-r--r--konq-plugins/fsview/inode.cpp50
-rw-r--r--konq-plugins/fsview/inode.h2
-rw-r--r--konq-plugins/fsview/scan.cpp4
-rw-r--r--konq-plugins/fsview/scan.h4
-rw-r--r--konq-plugins/fsview/treemap.cpp302
-rw-r--r--konq-plugins/fsview/treemap.h77
10 files changed, 252 insertions, 247 deletions
diff --git a/konq-plugins/fsview/fsview.cpp b/konq-plugins/fsview/fsview.cpp
index 931c43f..48d97f7 100644
--- a/konq-plugins/fsview/fsview.cpp
+++ b/konq-plugins/fsview/fsview.cpp
@@ -43,8 +43,8 @@
TQMap<TQString, MetricEntry> FSView::_dirMetric;
-FSView::FSView(Inode* base, TQWidget* parent, const char* name)
- : TreeMapWidget(base, parent, name)
+FSView::FSView(Inode* base, TQWidget* tqparent, const char* name)
+ : TreeMapWidget(base, tqparent, name)
{
setFieldType(0, i18n("Name"));
setFieldType(1, i18n("Size"));
@@ -94,12 +94,12 @@ FSView::FSView(Inode* base, TQWidget* parent, const char* name)
double s;
TQString str;
for (i=1;i<=ccount;i++) {
- str = TQString("Dir%1").arg(i);
+ str = TQString("Dir%1").tqarg(i);
if (!cconfig.hasKey(str)) continue;
str = cconfig.readPathEntry(str);
- 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);
+ s = cconfig.readDoubleNumEntry(TQString("Size%1").tqarg(i), 0.0);
+ f = cconfig.readNumEntry(TQString("Files%1").tqarg(i), 0);
+ d = cconfig.readNumEntry(TQString("Dirs%1").tqarg(i), 0);
if (s==0.0 || f==0 || d==0) continue;
setDirMetric(str, s, f, d);
}
@@ -133,7 +133,7 @@ void FSView::setPath(TQString p)
if (!fi.isDir()) {
_path = fi.dirPath(true);
}
- _pathDepth = _path.contains('/');
+ _pathDepth = _path.tqcontains('/');
KURL u;
u.setPath(_path);
@@ -147,7 +147,7 @@ void FSView::setPath(TQString p)
b->setPeer(d);
- setCaption(TQString("%1 - FSView").arg(_path));
+ setCaption(TQString("%1 - FSView").tqarg(_path));
requestUpdate(b);
}
@@ -170,7 +170,7 @@ bool FSView::getDirMetric(const TQString& k,
{
TQMap<TQString, MetricEntry>::iterator it;
- it = _dirMetric.find(k);
+ it = _dirMetric.tqfind(k);
if (it == _dirMetric.end()) return false;
s = (*it).size;
@@ -286,7 +286,7 @@ void FSView::contextMenu(TreeMapItem* i, const TQPoint& p)
popup.insertItem(i18n("Refresh"), 5);
popup.setItemEnabled(5, !_sm.scanRunning());
- if (i) popup.insertItem(i18n("Refresh '%1'").arg(i->text(0)), 4);
+ if (i) popup.insertItem(i18n("Refresh '%1'").tqarg(i->text(0)), 4);
popup.insertSeparator();
addDepthStopItems(dpopup, 1001, i);
popup.insertItem(i18n("Stop at Depth"), dpopup, 1000);
@@ -331,10 +331,10 @@ void FSView::saveMetric(KConfigGroup* g)
TQMap<TQString, MetricEntry>::iterator it;
int c = 1;
for (it=_dirMetric.begin();it!=_dirMetric.end();++it) {
- 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);
+ g->writePathEntry(TQString("Dir%1").tqarg(c), it.key());
+ g->writeEntry(TQString("Size%1").tqarg(c), (*it).size);
+ g->writeEntry(TQString("Files%1").tqarg(c), (*it).fileCount);
+ g->writeEntry(TQString("Dirs%1").tqarg(c), (*it).dirCount);
c++;
}
g->writeEntry("Count", c-1);
diff --git a/konq-plugins/fsview/fsview.h b/konq-plugins/fsview/fsview.h
index 2e12986..fe1c689 100644
--- a/konq-plugins/fsview/fsview.h
+++ b/konq-plugins/fsview/fsview.h
@@ -58,11 +58,12 @@ class MetricEntry
class FSView : public TreeMapWidget, public ScanListener
{
Q_OBJECT
+ TQ_OBJECT
public:
enum ColorMode { None = 0, Depth, Name, Owner, Group, Mime };
- FSView(Inode*, TQWidget* parent=0, const char* name=0);
+ FSView(Inode*, TQWidget* tqparent=0, const char* name=0);
~FSView();
KConfig* config() { return _config; }
diff --git a/konq-plugins/fsview/fsview_part.cpp b/konq-plugins/fsview/fsview_part.cpp
index 02df4c6..b9d2f5b 100644
--- a/konq-plugins/fsview/fsview_part.cpp
+++ b/konq-plugins/fsview/fsview_part.cpp
@@ -74,7 +74,7 @@ void FSJob::progressSlot(int percent, int dirs, const TQString& cDir)
emitPercent(percent, 100);
slotInfoMessage(this, i18n("Read 1 folder, in %1",
"Read %n folders, in %1",
- dirs ).arg(cDir));
+ dirs ).tqarg(cDir));
}
else
slotInfoMessage(this, i18n("1 folder", "%n folders", dirs));
@@ -93,15 +93,15 @@ KAboutData* FSViewPart::createAboutData()
return aboutData;
}
-FSViewPart::FSViewPart(TQWidget *parentWidget, const char *widgetName,
- TQObject *parent, const char *name,
+FSViewPart::FSViewPart(TQWidget *tqparentWidget, const char *widgetName,
+ TQObject *tqparent, const char *name,
const TQStringList& /* args */)
- : KParts::ReadOnlyPart(parent, name)
+ : KParts::ReadOnlyPart(tqparent, name)
{
// we need an instance
setInstance( FSViewPartFactory::instance() );
- _view = new FSView(new Inode(), parentWidget, widgetName);
+ _view = new FSView(new Inode(), tqparentWidget, widgetName);
TQWhatsThis::add(_view, i18n("<p>This is the FSView plugin, a graphical "
"browsing mode showing filesystem utilization "
"by using a tree map visualization.</p>"
@@ -201,7 +201,7 @@ void FSViewPart::showInfo()
"currently visible in FSView, from the outside.\n"
"For details, see the 'Help/FSView Manual'.");
- KMessageBox::information( _view, info, TQString::null, "ShowFSViewInfo");
+ KMessageBox::information( _view, info, TQString(), "ShowFSViewInfo");
}
void FSViewPart::showHelp()
@@ -219,7 +219,7 @@ void FSViewPart::startedSlot()
void FSViewPart::completedSlot(int dirs)
{
if (_job) {
- _job->progressSlot(100, dirs, TQString::null);
+ _job->progressSlot(100, dirs, TQString());
delete _job;
_job = 0;
}
@@ -344,7 +344,7 @@ void FSViewBrowserExtension::trash()
void FSViewBrowserExtension::copySelection( bool move )
{
KonqDrag *urlData = KonqDrag::newDrag( _view->selectedUrls(), move );
- TQApplication::clipboard()->setData( urlData );
+ TQApplication::tqclipboard()->setData( urlData );
}
void FSViewBrowserExtension::editMimeType()
@@ -365,9 +365,9 @@ void FSViewBrowserExtension::refresh()
while( (i=s.next()) )
commonParent = commonParent->commonParent(i);
- /* if commonParent is a file, update parent directory */
+ /* if commonParent is a file, update tqparent directory */
if ( !((Inode*)commonParent)->isDir() ) {
- commonParent = commonParent->parent();
+ commonParent = commonParent->tqparent();
if (!commonParent) return;
}
diff --git a/konq-plugins/fsview/fsview_part.h b/konq-plugins/fsview/fsview_part.h
index ff0a17e..1adba9e 100644
--- a/konq-plugins/fsview/fsview_part.h
+++ b/konq-plugins/fsview/fsview_part.h
@@ -37,6 +37,7 @@ class FSViewPart;
class FSViewBrowserExtension : public KParts::BrowserExtension
{
Q_OBJECT
+ TQ_OBJECT
public:
FSViewBrowserExtension(FSViewPart *viewPart, const char *name=0L);
@@ -64,6 +65,7 @@ private:
class FSJob: public KIO::Job
{
Q_OBJECT
+ TQ_OBJECT
public:
FSJob(FSView*);
@@ -81,10 +83,11 @@ private:
class FSViewPart : public KParts::ReadOnlyPart
{
Q_OBJECT
- Q_PROPERTY( bool supportsUndo READ supportsUndo )
+ TQ_OBJECT
+ TQ_PROPERTY( bool supportsUndo READ supportsUndo )
public:
- FSViewPart(TQWidget *parentWidget, const char *widgetName,
- TQObject *parent, const char *name, const TQStringList &args);
+ FSViewPart(TQWidget *tqparentWidget, const char *widgetName,
+ TQObject *tqparent, const char *name, const TQStringList &args);
virtual ~FSViewPart();
diff --git a/konq-plugins/fsview/inode.cpp b/konq-plugins/fsview/inode.cpp
index 6f5073c..849877e 100644
--- a/konq-plugins/fsview/inode.cpp
+++ b/konq-plugins/fsview/inode.cpp
@@ -40,12 +40,12 @@ Inode::Inode()
init("");
}
-Inode::Inode(ScanDir* d, Inode* parent)
- : TreeMapItem(parent)
+Inode::Inode(ScanDir* d, Inode* tqparent)
+ : TreeMapItem(tqparent)
{
TQString absPath;
- if (parent) {
- absPath = parent->path();
+ if (tqparent) {
+ absPath = tqparent->path();
if (!absPath.endsWith("/")) absPath += "/";
}
absPath += d->name();
@@ -56,12 +56,12 @@ Inode::Inode(ScanDir* d, Inode* parent)
init(absPath);
}
-Inode::Inode(ScanFile* f, Inode* parent)
- : TreeMapItem(parent)
+Inode::Inode(ScanFile* f, Inode* tqparent)
+ : TreeMapItem(tqparent)
{
TQString absPath;
- if (parent)
- absPath = parent->path() + "/";
+ if (tqparent)
+ absPath = tqparent->path() + "/";
absPath += f->name();
_dirPeer = 0;
@@ -168,7 +168,7 @@ void Inode::destroyed(ScanDir* d)
{
if (_dirPeer == d) _dirPeer = 0;
- // remove children
+ // remove tqchildren
clear();
}
@@ -179,15 +179,15 @@ void Inode::destroyed(ScanFile* f)
-TreeMapItemList* Inode::children()
+TreeMapItemList* Inode::tqchildren()
{
if (!_dirPeer) return 0;
- if (!_children) {
+ if (!_tqchildren) {
if (!_dirPeer->scanStarted()) return 0;
- _children = new TreeMapItemList;
- _children->setAutoDelete(true);
+ _tqchildren = new TreeMapItemList;
+ _tqchildren->setAutoDelete(true);
setSorting(-1);
@@ -215,7 +215,7 @@ TreeMapItemList* Inode::children()
_resortNeeded = false;
}
- return _children;
+ return _tqchildren;
}
@@ -284,7 +284,7 @@ TQColor Inode::backColor() const
if (id>0) n = TQString::number(id);
if (n.isEmpty())
- return widget()->colorGroup().button();
+ return widget()->tqcolorGroup().button();
const char* str = n.ascii();
int h = 0, s = 100;
@@ -325,21 +325,21 @@ TQString Inode::text(int i) const
double s = size();
if (s < 1000)
- text = TQString("%1 B").arg((int)(s+.5));
+ text = TQString("%1 B").tqarg((int)(s+.5));
else if (s < 10 * 1024)
- text = TQString("%1 kB").arg(KGlobal::locale()->formatNumber(s/1024+.005,2));
+ text = TQString("%1 kB").tqarg(KGlobal::locale()->formatNumber(s/1024+.005,2));
else if (s < 100 * 1024)
- text = TQString("%1 kB").arg(KGlobal::locale()->formatNumber(s/1024+.05,1));
+ text = TQString("%1 kB").tqarg(KGlobal::locale()->formatNumber(s/1024+.05,1));
else if (s < 1000 * 1024)
- text = TQString("%1 kB").arg((int)(s/1024+.5));
+ text = TQString("%1 kB").tqarg((int)(s/1024+.5));
else if (s < 10 * 1024 * 1024)
- text = TQString("%1 MB").arg(KGlobal::locale()->formatNumber(s/1024/1024+.005,2));
+ text = TQString("%1 MB").tqarg(KGlobal::locale()->formatNumber(s/1024/1024+.005,2));
else if (s < 100 * 1024 * 1024)
- text = TQString("%1 MB").arg(KGlobal::locale()->formatNumber(s/1024/1024+.05,1));
+ text = TQString("%1 MB").tqarg(KGlobal::locale()->formatNumber(s/1024/1024+.05,1));
else if (s < 1000 * 1024 * 1024)
- text = TQString("%1 MB").arg((int)(s/1024/1024+.5));
+ text = TQString("%1 MB").tqarg((int)(s/1024/1024+.5));
else
- text = TQString("%1 GB").arg(KGlobal::locale()->formatNumber(s/1024/1024/1024+.005,2));
+ text = TQString("%1 GB").tqarg(KGlobal::locale()->formatNumber(s/1024/1024/1024+.005,2));
if (_sizeEstimation>0) text += "+";
return text;
@@ -354,10 +354,10 @@ TQString Inode::text(int i) const
if (f>0) {
while (f>1000) {
- text = TQString("%1 %2").arg(TQString::number(f).right(3)).arg(text);
+ text = TQString("%1 %2").tqarg(TQString::number(f).right(3)).tqarg(text);
f /= 1000;
}
- text = TQString("%1 %2").arg(TQString::number(f)).arg(text);
+ text = TQString("%1 %2").tqarg(TQString::number(f)).tqarg(text);
if (_fileCountEstimation>0) text += "+";
}
return text;
diff --git a/konq-plugins/fsview/inode.h b/konq-plugins/fsview/inode.h
index eb1e3dd..d21a689 100644
--- a/konq-plugins/fsview/inode.h
+++ b/konq-plugins/fsview/inode.h
@@ -53,7 +53,7 @@ public:
void setPeer(ScanDir*);
- TreeMapItemList* children();
+ TreeMapItemList* tqchildren();
double value() const;
double size() const;
diff --git a/konq-plugins/fsview/scan.cpp b/konq-plugins/fsview/scan.cpp
index 1d3d06a..c79ff99 100644
--- a/konq-plugins/fsview/scan.cpp
+++ b/konq-plugins/fsview/scan.cpp
@@ -80,8 +80,8 @@ void ScanManager::startScan(ScanDir* from)
if (scanRunning()) stopScan();
from->clear();
- if (from->parent())
- from->parent()->setupChildRescan();
+ if (from->tqparent())
+ from->tqparent()->setupChildRescan();
_list.append(new ScanItem(from->path(),from));
}
diff --git a/konq-plugins/fsview/scan.h b/konq-plugins/fsview/scan.h
index ca4ce4f..6d570f7 100644
--- a/konq-plugins/fsview/scan.h
+++ b/konq-plugins/fsview/scan.h
@@ -179,7 +179,7 @@ class ScanDir
*/
void setupChildRescan();
- /* Absolute path. Warning: Slow, loops to top parent. */
+ /* Absolute path. Warning: Slow, loops to top tqparent. */
TQString path();
/* get integer data attribute */
@@ -192,7 +192,7 @@ class ScanDir
KIO::fileoffset_t size() { update(); return _size; }
unsigned int fileCount() { update(); return _fileCount; }
unsigned int dirCount() { update(); return _dirCount; }
- ScanDir* parent() { return _parent; }
+ ScanDir* tqparent() { return _parent; }
bool scanStarted() { return (_dirsFinished >= 0); }
bool scanFinished() { return (_dirsFinished == (int)_dirs.count()); }
bool scanRunning() { return scanStarted() && !scanFinished(); }
diff --git a/konq-plugins/fsview/treemap.cpp b/konq-plugins/fsview/treemap.cpp
index 5a42c75..b3f6cb6 100644
--- a/konq-plugins/fsview/treemap.cpp
+++ b/konq-plugins/fsview/treemap.cpp
@@ -51,7 +51,7 @@ StoredDrawParams::StoredDrawParams()
_shaded = true;
_rotated = false;
- _backColor = Qt::white;
+ _backColor = TQt::white;
// field array has size 0
}
@@ -72,7 +72,7 @@ StoredDrawParams::StoredDrawParams(TQColor c,
TQString StoredDrawParams::text(int f) const
{
if ((f<0) || (f >= (int)_field.size()))
- return TQString::null;
+ return TQString();
return _field[f].text;
}
@@ -266,7 +266,7 @@ void RectDrawing::drawBack(TQPainter* p, DrawParams* dp)
if (dp->shaded()) {
// some shading
- bool goDark = qGray(normal.rgb())>128;
+ bool goDark = tqGray(normal.rgb())>128;
int rBase, gBase, bBase;
normal.rgb(&rBase, &gBase, &bBase);
p->setBrush(TQBrush::NoBrush);
@@ -525,7 +525,7 @@ bool RectDrawing::drawField(TQPainter* p, int f, DrawParams* dp)
}
p->save();
- p->setPen( (qGray(dp->backColor().rgb())>100) ? Qt::black : Qt::white);
+ p->setPen( (tqGray(dp->backColor().rgb())>100) ? TQt::black : TQt::white);
p->setFont(dp->font());
if (rotate) {
//p->translate(r.x()+2, r.y()+r.height());
@@ -616,7 +616,7 @@ bool RectDrawing::drawField(TQPainter* p, int f, DrawParams* dp)
}
}
else
- remaining = TQString::null;
+ remaining = TQString();
/* truncate and add ... if needed */
if (w>width) {
@@ -655,7 +655,7 @@ bool RectDrawing::drawField(TQPainter* p, int f, DrawParams* dp)
p->drawText( x+pixW, y,
width - pixW, h,
- Qt::AlignLeft, name);
+ TQt::AlignLeft, name);
y = isBottom ? (y-h) : (y+h);
lines--;
@@ -717,11 +717,11 @@ int TreeMapItemList::compareItems ( Item item1, Item item2 )
bool ascending;
int result;
- TreeMapItem* parent = ((TreeMapItem*)item1)->parent();
+ TreeMapItem* tqparent = ((TreeMapItem*)item1)->tqparent();
// shouldn't happen
- if (!parent) return 0;
+ if (!tqparent) return 0;
- int textNo = parent->sorting(&ascending);
+ int textNo = tqparent->sorting(&ascending);
if (textNo < 0) {
double diff = ((TreeMapItem*)item1)->value() -
@@ -738,25 +738,25 @@ int TreeMapItemList::compareItems ( Item item1, Item item2 )
TreeMapItem* TreeMapItemList::commonParent()
{
- TreeMapItem* parent, *item;
- parent = first();
- if (parent)
+ TreeMapItem* tqparent, *item;
+ tqparent = first();
+ if (tqparent)
while( (item = next()) != 0)
- parent = parent->commonParent(item);
+ tqparent = tqparent->commonParent(item);
- return parent;
+ return tqparent;
}
// TreeMapItem
-TreeMapItem::TreeMapItem(TreeMapItem* parent, double value)
+TreeMapItem::TreeMapItem(TreeMapItem* tqparent, double value)
{
_value = value;
- _parent = parent;
+ _parent = tqparent;
_sum = 0;
- _children = 0;
+ _tqchildren = 0;
_widget = 0;
_index = -1;
_depth = -1; // not set
@@ -764,7 +764,7 @@ TreeMapItem::TreeMapItem(TreeMapItem* parent, double value)
_freeRects = 0;
if (_parent) {
- // take sorting from parent
+ // take sorting from tqparent
_sortTextNo = _parent->sorting(&_sortAscending);
_parent->addItem(this);
}
@@ -775,12 +775,12 @@ TreeMapItem::TreeMapItem(TreeMapItem* parent, double value)
}
-TreeMapItem::TreeMapItem(TreeMapItem* parent, double value,
+TreeMapItem::TreeMapItem(TreeMapItem* tqparent, double value,
TQString text1, TQString text2,
TQString text3, TQString text4)
{
_value = value;
- _parent = parent;
+ _parent = tqparent;
// this resizes the text vector only if needed
if (!text4.isEmpty()) setText(3, text4);
@@ -789,7 +789,7 @@ TreeMapItem::TreeMapItem(TreeMapItem* parent, double value,
setText(0, text1);
_sum = 0;
- _children = 0;
+ _tqchildren = 0;
_widget = 0;
_index = -1;
_depth = -1; // not set
@@ -801,7 +801,7 @@ TreeMapItem::TreeMapItem(TreeMapItem* parent, double value,
TreeMapItem::~TreeMapItem()
{
- if (_children) delete _children;
+ if (_tqchildren) delete _tqchildren;
if (_freeRects) delete _freeRects;
// finally, notify widget about deletion
@@ -829,7 +829,7 @@ bool TreeMapItem::isChildOf(TreeMapItem* item)
TreeMapItem* TreeMapItem::commonParent(TreeMapItem* item)
{
while (item && !isChildOf(item)) {
- item = item->parent();
+ item = item->tqparent();
}
return item;
}
@@ -842,18 +842,18 @@ void TreeMapItem::redraw()
void TreeMapItem::clear()
{
- if (_children) {
+ if (_tqchildren) {
// delete selected items below this item from selection
if (_widget) _widget->clearSelection(this);
- delete _children;
- _children = 0;
+ delete _tqchildren;
+ _tqchildren = 0;
}
}
-// invalidates current children and forces redraw
-// this is only usefull when children are created on demand in items()
+// tqinvalidates current tqchildren and forces redraw
+// this is only usefull when tqchildren are created on demand in items()
void TreeMapItem::refresh()
{
clear();
@@ -887,9 +887,9 @@ int TreeMapItem::depth() const
bool TreeMapItem::initialized()
{
- if (!_children) {
- _children = new TreeMapItemList;
- _children->setAutoDelete(true);
+ if (!_tqchildren) {
+ _tqchildren = new TreeMapItemList;
+ _tqchildren->setAutoDelete(true);
return false;
}
return true;
@@ -899,16 +899,16 @@ void TreeMapItem::addItem(TreeMapItem* i)
{
if (!i) return;
- if (!_children) {
- _children = new TreeMapItemList;
- _children->setAutoDelete(true);
+ if (!_tqchildren) {
+ _tqchildren = new TreeMapItemList;
+ _tqchildren->setAutoDelete(true);
}
i->setParent(this);
if (sorting(0) == -1)
- _children->append(i); // preserve insertion order
+ _tqchildren->append(i); // preserve insertion order
else
- _children->inSort(i);
+ _tqchildren->inSort(i);
}
@@ -974,17 +974,17 @@ void TreeMapItem::setSorting(int textNo, bool ascending)
_sortAscending = ascending;
_sortTextNo = textNo;
- if (_children && _sortTextNo != -1) _children->sort();
+ if (_tqchildren && _sortTextNo != -1) _tqchildren->sort();
}
void TreeMapItem::resort(bool recursive)
{
- if (!_children) return;
+ if (!_tqchildren) return;
- if (_sortTextNo != -1) _children->sort();
+ if (_sortTextNo != -1) _tqchildren->sort();
if (recursive)
- for (TreeMapItem* i=_children->first(); i; i=_children->next())
+ for (TreeMapItem* i=_tqchildren->first(); i; i=_tqchildren->next())
i->resort(recursive);
}
@@ -1002,13 +1002,13 @@ int TreeMapItem::rtti() const
return 0;
}
-TreeMapItemList* TreeMapItem::children()
+TreeMapItemList* TreeMapItem::tqchildren()
{
- if (!_children) {
- _children = new TreeMapItemList;
- _children->setAutoDelete(true);
+ if (!_tqchildren) {
+ _tqchildren = new TreeMapItemList;
+ _tqchildren->setAutoDelete(true);
}
- return _children;
+ return _tqchildren;
}
void TreeMapItem::clearItemRect()
@@ -1072,7 +1072,7 @@ void TreeMapItem::addFreeRect(const TQRect& r)
// Tooltips for TreeMapWidget
-class TreeMapTip: public QToolTip
+class TreeMapTip: public TQToolTip
{
public:
TreeMapTip( TQWidget* p ):TQToolTip(p) {}
@@ -1083,17 +1083,17 @@ protected:
void TreeMapTip::maybeTip( const TQPoint& pos )
{
- if ( !parentWidget()->inherits( "TreeMapWidget" ) )
+ if ( !tqparentWidget()->inherits( "TreeMapWidget" ) )
return;
- TreeMapWidget* p = (TreeMapWidget*)parentWidget();
+ TreeMapWidget* p = (TreeMapWidget*)tqparentWidget();
TreeMapItem* i;
i = p->item(pos.x(), pos.y());
TQPtrList<TQRect>* rList = i ? i->freeRects() : 0;
if (rList) {
TQRect* r;
for(r=rList->first();r;r=rList->next())
- if (r->contains(pos))
+ if (r->tqcontains(pos))
tip(*r, p->tipString(i));
}
}
@@ -1103,8 +1103,8 @@ void TreeMapTip::maybeTip( const TQPoint& pos )
// TreeMapWidget
TreeMapWidget::TreeMapWidget(TreeMapItem* base,
- TQWidget* parent, const char* name)
- : TQWidget(parent, name)
+ TQWidget* tqparent, const char* name)
+ : TQWidget(tqparent, name)
{
_base = base;
_base->setWidget(this);
@@ -1139,8 +1139,8 @@ TreeMapWidget::TreeMapWidget(TreeMapItem* base,
_lastOver = 0;
_needsRefresh = _base;
- setBackgroundMode(Qt::NoBackground);
- setFocusPolicy(TQWidget::StrongFocus);
+ setBackgroundMode(TQt::NoBackground);
+ setFocusPolicy(TQ_StrongFocus);
_tip = new TreeMapTip(this);
}
@@ -1252,7 +1252,7 @@ void TreeMapWidget::setMaxDrawingDepth(int d)
TQString TreeMapWidget::defaultFieldType(int f) const
{
- return i18n("Text %1").arg(f+1);
+ return i18n("Text %1").tqarg(f+1);
}
TQString TreeMapWidget::defaultFieldStop(int) const
@@ -1433,10 +1433,10 @@ void TreeMapWidget::setMinimalArea(int area)
void TreeMapWidget::deletingItem(TreeMapItem* i)
{
// remove any references to the item to be deleted
- while(_selection.findRef(i) > -1)
+ while(_selection.tqfindRef(i) > -1)
_selection.remove();
- while(_tmpSelection.findRef(i) > -1)
+ while(_tmpSelection.tqfindRef(i) > -1)
_tmpSelection.remove();
if (_current == i) _current = 0;
@@ -1446,9 +1446,9 @@ void TreeMapWidget::deletingItem(TreeMapItem* i)
// don't redraw a deleted item
if (_needsRefresh == i) {
- // we can savely redraw the parent, as deleting order is
- // from child to parent; i.e. i->parent() is existing.
- _needsRefresh = i->parent();
+ // we can savely redraw the tqparent, as deleting order is
+ // from child to tqparent; i.e. i->tqparent() is existing.
+ _needsRefresh = i->tqparent();
}
}
@@ -1468,7 +1468,7 @@ TQString TreeMapWidget::tipString(TreeMapItem* i) const
tip += itemTip;
}
- i = i->parent();
+ i = i->tqparent();
}
return tip;
}
@@ -1478,11 +1478,11 @@ TreeMapItem* TreeMapWidget::item(int x, int y) const
TreeMapItem* p = _base;
TreeMapItem* i;
- if (!rect().contains(x, y)) return 0;
+ if (!TQT_TQRECT_OBJECT(rect()).tqcontains(x, y)) return 0;
if (DEBUG_DRAWING) kdDebug(90100) << "item(" << x << "," << y << "):" << endl;
while (1) {
- TreeMapItemList* list = p->children();
+ TreeMapItemList* list = p->tqchildren();
if (!list)
i = 0;
else {
@@ -1491,11 +1491,11 @@ TreeMapItem* TreeMapWidget::item(int x, int y) const
if (DEBUG_DRAWING)
kdDebug(90100) << " Checking " << i->path(0).join("/") << " ("
- << i->itemRect().x() << "/" << i->itemRect().y()
- << "-" << i->itemRect().width()
- << "x" << i->itemRect().height() << ")" << endl;
+ << i->tqitemRect().x() << "/" << i->tqitemRect().y()
+ << "-" << i->tqitemRect().width()
+ << "x" << i->tqitemRect().height() << ")" << endl;
- if (i->itemRect().contains(x, y)) {
+ if (i->tqitemRect().tqcontains(x, y)) {
if (DEBUG_DRAWING) kdDebug(90100) << " .. Got. Index " << idx << endl;
@@ -1513,7 +1513,7 @@ TreeMapItem* TreeMapWidget::item(int x, int y) const
if (DEBUG_DRAWING)
kdDebug(90100) << "item(" << x << "," << y << "): Got "
<< p->path(0).join("/") << " (Size "
- << p->itemRect().width() << "x" << p->itemRect().height()
+ << p->tqitemRect().width() << "x" << p->tqitemRect().height()
<< ", Val " << p->value() << ")" << endl;
}
@@ -1530,7 +1530,7 @@ TreeMapItem* TreeMapWidget::possibleSelection(TreeMapItem* i) const
if (_maxSelectDepth>=0) {
int depth = i->depth();
while(i && depth > _maxSelectDepth) {
- i = i->parent();
+ i = i->tqparent();
depth--;
}
}
@@ -1542,16 +1542,16 @@ TreeMapItem* TreeMapWidget::visibleItem(TreeMapItem* i) const
{
if (i) {
/* Must have a visible area */
- while(i && ((i->itemRect().width() <1) ||
- (i->itemRect().height() <1))) {
- TreeMapItem* p = i->parent();
+ while(i && ((i->tqitemRect().width() <1) ||
+ (i->tqitemRect().height() <1))) {
+ TreeMapItem* p = i->tqparent();
if (!p) break;
- int idx = p->children()->findRef(i);
+ int idx = p->tqchildren()->tqfindRef(i);
idx--;
if (idx<0)
i = p;
else
- i = p->children()->at(idx);
+ i = p->tqchildren()->at(idx);
}
}
return i;
@@ -1596,12 +1596,12 @@ TreeMapItemList TreeMapWidget::diff(TreeMapItemList& l1,
TreeMapItem* item;
while ( (item = it1.current()) != 0 ) {
++it1;
- if (l2.containsRef(item) > 0) continue;
+ if (l2.tqcontainsRef(item) > 0) continue;
l.append(item);
}
while ( (item = it2.current()) != 0 ) {
++it2;
- if (l1.containsRef(item) > 0) continue;
+ if (l1.tqcontainsRef(item) > 0) continue;
l.append(item);
}
@@ -1644,13 +1644,13 @@ TreeMapItem* TreeMapWidget::setTmpSelected(TreeMapItem* item, bool selected)
}
-bool TreeMapWidget::clearSelection(TreeMapItem* parent)
+bool TreeMapWidget::clearSelection(TreeMapItem* tqparent)
{
TreeMapItemList old = _selection;
TreeMapItem* i=_selection.first();
while (i) {
- if (i->isChildOf(parent)) {
+ if (i->isChildOf(tqparent)) {
_selection.remove();
i = _selection.current();
}
@@ -1668,12 +1668,12 @@ bool TreeMapWidget::clearSelection(TreeMapItem* parent)
bool TreeMapWidget::isSelected(TreeMapItem* i) const
{
- return _selection.containsRef(i)>0;
+ return _selection.tqcontainsRef(i)>0;
}
bool TreeMapWidget::isTmpSelected(TreeMapItem* i)
{
- return _tmpSelection.containsRef(i)>0;
+ return _tmpSelection.tqcontainsRef(i)>0;
}
@@ -1738,14 +1738,14 @@ TreeMapItem* TreeMapWidget::setTmpRangeSelection(TreeMapItem* i1,
TreeMapItem* commonParent = i1;
while (commonParent && !i2->isChildOf(commonParent)) {
i1 = commonParent;
- commonParent = commonParent->parent();
+ commonParent = commonParent->tqparent();
}
if (!commonParent) return changed;
- while (i2 && i2->parent() != commonParent)
- i2 = i2->parent();
+ while (i2 && i2->tqparent() != commonParent)
+ i2 = i2->tqparent();
if (!i2) return changed;
- TreeMapItemList* list = commonParent->children();
+ TreeMapItemList* list = commonParent->tqchildren();
if (!list) return changed;
TreeMapItem* i = list->first();
@@ -1768,11 +1768,11 @@ void TreeMapWidget::contextMenuEvent( TQContextMenuEvent* e )
{
//kdDebug(90100) << "TreeMapWidget::contextMenuEvent" << endl;
- if ( receivers( TQT_SIGNAL(contextMenuRequested(TreeMapItem*, const TQPoint &)) ) )
+ if ( tqreceivers( TQT_SIGNAL(contextMenuRequested(TreeMapItem*, const TQPoint &)) ) )
e->accept();
if ( e->reason() == TQContextMenuEvent::Keyboard ) {
- TQRect r = (_current) ? _current->itemRect() : _base->itemRect();
+ TQRect r = (_current) ? _current->tqitemRect() : _base->tqitemRect();
TQPoint p = TQPoint(r.left() + r.width()/2, r.top() + r.height()/2);
emit contextMenuRequested(_current, p);
}
@@ -1826,7 +1826,7 @@ void TreeMapWidget::mousePressEvent( TQMouseEvent* e )
}
// item under mouse always selected on right button press
- if (e->button() == RightButton) {
+ if (e->button() == Qt::RightButton) {
TreeMapItem* changed2 = setTmpSelected(item, true);
if (changed2) changed = changed2->commonParent(changed);
}
@@ -1836,7 +1836,7 @@ void TreeMapWidget::mousePressEvent( TQMouseEvent* e )
if (changed)
redraw(changed);
- if (e->button() == RightButton) {
+ if (e->button() == Qt::RightButton) {
// emit selection change
if (! (_tmpSelection == _selection)) {
@@ -1935,15 +1935,15 @@ void TreeMapWidget::mouseDoubleClickEvent( TQMouseEvent* e )
/* returns -1 if nothing visible found */
int nextVisible(TreeMapItem* i)
{
- TreeMapItem* p = i->parent();
- if (!p || p->itemRect().isEmpty()) return -1;
+ TreeMapItem* p = i->tqparent();
+ if (!p || p->tqitemRect().isEmpty()) return -1;
- int idx = p->children()->findRef(i);
+ int idx = p->tqchildren()->tqfindRef(i);
if (idx<0) return -1;
- while (idx < (int)p->children()->count()-1) {
+ while (idx < (int)p->tqchildren()->count()-1) {
idx++;
- TQRect r = p->children()->at(idx)->itemRect();
+ TQRect r = p->tqchildren()->at(idx)->tqitemRect();
if (r.width()>1 && r.height()>1)
return idx;
}
@@ -1953,15 +1953,15 @@ int nextVisible(TreeMapItem* i)
/* returns -1 if nothing visible found */
int prevVisible(TreeMapItem* i)
{
- TreeMapItem* p = i->parent();
- if (!p || p->itemRect().isEmpty()) return -1;
+ TreeMapItem* p = i->tqparent();
+ if (!p || p->tqitemRect().isEmpty()) return -1;
- int idx = p->children()->findRef(i);
+ int idx = p->tqchildren()->tqfindRef(i);
if (idx<0) return -1;
while (idx > 0) {
idx--;
- TQRect r = p->children()->at(idx)->itemRect();
+ TQRect r = p->tqchildren()->at(idx)->tqitemRect();
if (r.width()>1 && r.height()>1)
return idx;
}
@@ -2024,7 +2024,7 @@ void TreeMapWidget::keyPressEvent( TQKeyEvent* e )
}
TreeMapItem* old = _current, *newItem;
- TreeMapItem* p = _current->parent();
+ TreeMapItem* p = _current->tqparent();
bool goBack;
if (_current->sorting(&goBack) == -1) {
@@ -2042,24 +2042,24 @@ void TreeMapWidget::keyPressEvent( TQKeyEvent* e )
int newIdx = goBack ? nextVisible(_current) : prevVisible(_current);
if (p && newIdx>=0) {
p->setIndex(newIdx);
- setCurrent(p->children()->at(newIdx), true);
+ setCurrent(p->tqchildren()->at(newIdx), true);
}
}
else if (e->key() == Key_Right) {
int newIdx = goBack ? prevVisible(_current) : nextVisible(_current);
if (p && newIdx>=0) {
p->setIndex(newIdx);
- setCurrent(p->children()->at(newIdx), true);
+ setCurrent(p->tqchildren()->at(newIdx), true);
}
}
else if (e->key() == Key_Down) {
- if (_current->children() && _current->children()->count()>0) {
+ if (_current->tqchildren() && _current->tqchildren()->count()>0) {
int newIdx = _current->index();
if (newIdx<0)
- newIdx = goBack ? (_current->children()->count()-1) : 0;
- if (newIdx>=(int)_current->children()->count())
- newIdx = _current->children()->count()-1;
- newItem = visibleItem(_current->children()->at(newIdx));
+ newIdx = goBack ? (_current->tqchildren()->count()-1) : 0;
+ if (newIdx>=(int)_current->tqchildren()->count())
+ newIdx = _current->tqchildren()->count()-1;
+ newItem = visibleItem(_current->tqchildren()->at(newIdx));
setCurrent(newItem, true);
}
}
@@ -2136,7 +2136,7 @@ void TreeMapWidget::drawTreeMap()
}
else {
// only subitem
- if (!_needsRefresh->itemRect().isValid()) return;
+ if (!_needsRefresh->tqitemRect().isValid()) return;
}
// reset cached font object; it could have been changed
@@ -2147,14 +2147,14 @@ void TreeMapWidget::drawTreeMap()
_needsRefresh = 0;
}
- bitBlt( this, 0, 0, &_pixmap, 0, 0,
+ bitBlt( TQT_TQPAINTDEVICE(this), 0, 0, TQT_TQPAINTDEVICE(&_pixmap), 0, 0,
TQWidget::width(), TQWidget::height(), CopyROP, true);
if (hasFocus()) {
TQPainter p(this);
- style().drawPrimitive( TQStyle::PE_FocusRect, &p,
+ tqstyle().tqdrawPrimitive( TQStyle::PE_FocusRect, &p,
TQRect(0, 0, TQWidget::width(), TQWidget::height()),
- colorGroup() );
+ tqcolorGroup() );
}
}
@@ -2184,7 +2184,7 @@ void TreeMapWidget::drawItem(TQPainter* p,
TreeMapItem* i;
if (_markNo>0) {
- for(i = item;i;i=i->parent())
+ for(i = item;i;i=i->tqparent())
if (i->isMarked(_markNo)) break;
isSelected = (i!=0);
@@ -2198,7 +2198,7 @@ void TreeMapWidget::drawItem(TQPainter* p,
bool isCurrent = _current && item->isChildOf(_current);
- RectDrawing d(item->itemRect());
+ RectDrawing d(item->tqitemRect());
item->setSelected(isSelected);
item->setCurrent(isCurrent);
item->setShaded(_shading);
@@ -2232,25 +2232,25 @@ void TreeMapWidget::drawItems(TQPainter* p,
{
if (DEBUG_DRAWING)
kdDebug(90100) << "+drawItems(" << item->path(0).join("/") << ", "
- << item->itemRect().x() << "/" << item->itemRect().y()
- << "-" << item->itemRect().width() << "x"
- << item->itemRect().height() << "), Val " << item->value()
+ << item->tqitemRect().x() << "/" << item->tqitemRect().y()
+ << "-" << item->tqitemRect().width() << "x"
+ << item->tqitemRect().height() << "), Val " << item->value()
<< ", Sum " << item->sum() << endl;
drawItem(p, item);
item->clearFreeRects();
- TQRect origRect = item->itemRect();
+ TQRect origRect = item->tqitemRect();
int bw = item->borderWidth();
TQRect r = TQRect(origRect.x()+bw, origRect.y()+bw,
origRect.width()-2*bw, origRect.height()-2*bw);
- TreeMapItemList* list = item->children();
+ TreeMapItemList* list = item->tqchildren();
TreeMapItem* i;
bool stopDrawing = false;
- // only subdivide if there are children
+ // only subdivide if there are tqchildren
if (!list || list->count()==0)
stopDrawing = true;
@@ -2283,12 +2283,12 @@ void TreeMapWidget::drawItems(TQPainter* p,
if (stopDrawing) {
if (list) {
- // invalidate rects
+ // tqinvalidate rects
for (i=list->first();i;i=list->next())
i->clearItemRect();
}
// tooltip apears on whole item rect
- item->addFreeRect(item->itemRect());
+ item->addFreeRect(item->tqitemRect());
// if we have space for text...
if ((r.height() < _fontHeight) || (r.width() < _fontHeight)) return;
@@ -2399,7 +2399,7 @@ void TreeMapWidget::drawItems(TQPainter* p,
r.setRect(r.x(), r.y()+sr.height(), r.width(), r.height()-sr.height());
}
- // set selfRect (not occupied by children) for tooltip
+ // set selfRect (not occupied by tqchildren) for tooltip
item->addFreeRect(sr);
if (0) kdDebug(90100) << "Item " << item->path(0).join("/") << ": SelfR "
@@ -2537,16 +2537,16 @@ void TreeMapWidget::drawItems(TQPainter* p,
kdDebug(90100) << "-drawItems(" << item->path(0).join("/") << ")" << endl;
}
-// fills area with a pattern if to small to draw children
+// fills area with a pattern if to small to draw tqchildren
void TreeMapWidget::drawFill(TreeMapItem* i, TQPainter* p, TQRect& r)
{
- p->setBrush(Qt::Dense4Pattern);
- p->setPen(Qt::NoPen);
+ p->setBrush(TQt::Dense4Pattern);
+ p->setPen(TQt::NoPen);
p->drawRect(r);
i->addFreeRect(r);
}
-// fills area with a pattern if to small to draw children
+// fills area with a pattern if to small to draw tqchildren
void TreeMapWidget::drawFill(TreeMapItem* i, TQPainter* p, TQRect& r,
TreeMapItemListIterator it, int len, bool goBack)
{
@@ -2555,8 +2555,8 @@ void TreeMapWidget::drawFill(TreeMapItem* i, TQPainter* p, TQRect& r,
<< "-" << r.width() << "x" << r.height()
<< ", len " << len << ")" << endl;
- p->setBrush(Qt::Dense4Pattern);
- p->setPen(Qt::NoPen);
+ p->setBrush(TQt::Dense4Pattern);
+ p->setPen(TQt::NoPen);
p->drawRect(r);
i->addFreeRect(r);
@@ -2845,10 +2845,10 @@ void TreeMapWidget::addVisualizationItems(TQPopupMenu* popup, int id)
popup->insertItem(i18n("Border"), bpopup, id+1);
bpopup->insertItem(i18n("Correct Borders Only"), id+2);
bpopup->insertSeparator();
- bpopup->insertItem(i18n("Width %1").arg(0), id+3);
- bpopup->insertItem(i18n("Width %1").arg(1), id+4);
- bpopup->insertItem(i18n("Width %1").arg(2), id+5);
- bpopup->insertItem(i18n("Width %1").arg(3), id+6);
+ bpopup->insertItem(i18n("Width %1").tqarg(0), id+3);
+ bpopup->insertItem(i18n("Width %1").tqarg(1), id+4);
+ bpopup->insertItem(i18n("Width %1").tqarg(2), id+5);
+ bpopup->insertItem(i18n("Width %1").tqarg(3), id+6);
bpopup->setItemChecked(id+2, skipIncorrectBorder());
bpopup->setItemChecked(id+3, borderWidth()==0);
bpopup->setItemChecked(id+4, borderWidth()==1);
@@ -2906,7 +2906,7 @@ void TreeMapWidget::selectionActivated(int id)
TreeMapItem* i = _menuItem;
id -= _selectionID;
while (id>0 && i) {
- i=i->parent();
+ i=i->tqparent();
id--;
}
if (i)
@@ -2928,18 +2928,18 @@ void TreeMapWidget::addSelectionItems(TQPopupMenu* popup,
TQString name = i->text(0);
if (name.isEmpty()) break;
popup->insertItem(i->text(0), id++);
- i = i->parent();
+ i = i->tqparent();
}
}
void TreeMapWidget::fieldStopActivated(int id)
{
- if (id == _fieldStopID) setFieldStop(0, TQString::null);
+ if (id == _fieldStopID) setFieldStop(0, TQString());
else {
TreeMapItem* i = _menuItem;
id -= _fieldStopID+1;
while (id>0 && i) {
- i=i->parent();
+ i=i->tqparent();
id--;
}
if (i)
@@ -2955,7 +2955,7 @@ void TreeMapWidget::addFieldStopItems(TQPopupMenu* popup,
connect(popup, TQT_SIGNAL(activated(int)),
this, TQT_SLOT(fieldStopActivated(int)));
- popup->insertItem(i18n("No %1 Limit").arg(fieldType(0)), id);
+ popup->insertItem(i18n("No %1 Limit").tqarg(fieldType(0)), id);
popup->setItemChecked(id, fieldStop(0).isEmpty());
_menuItem = i;
bool foundFieldStop = false;
@@ -2971,7 +2971,7 @@ void TreeMapWidget::addFieldStopItems(TQPopupMenu* popup,
popup->setItemChecked(id, true);
foundFieldStop = true;
}
- i = i->parent();
+ i = i->tqparent();
}
}
@@ -3014,7 +3014,7 @@ void TreeMapWidget::addAreaStopItems(TQPopupMenu* popup,
int area = i->width() * i->height();
popup->insertSeparator();
popup->insertItem(i18n("Area of '%1' (%2)")
- .arg(i->text(0)).arg(area), id+1);
+ .tqarg(i->text(0)).tqarg(area), id+1);
if (area == minimalArea()) {
popup->setItemChecked(id+1, true);
foundArea = true;
@@ -3040,9 +3040,9 @@ void TreeMapWidget::addAreaStopItems(TQPopupMenu* popup,
}
popup->insertItem(i18n("Double Area Limit (to %1)")
- .arg(minimalArea()*2), id+5);
+ .tqarg(minimalArea()*2), id+5);
popup->insertItem(i18n("Halve Area Limit (to %1)")
- .arg(minimalArea()/2), id+6);
+ .tqarg(minimalArea()/2), id+6);
}
}
@@ -3079,7 +3079,7 @@ void TreeMapWidget::addDepthStopItems(TQPopupMenu* popup,
int d = i->depth();
popup->insertSeparator();
popup->insertItem(i18n("Depth of '%1' (%2)")
- .arg(i->text(0)).arg(d), id+1);
+ .tqarg(i->text(0)).tqarg(d), id+1);
if (d == maxDrawingDepth()) {
popup->setItemChecked(id+1, true);
foundDepth = true;
@@ -3089,7 +3089,7 @@ void TreeMapWidget::addDepthStopItems(TQPopupMenu* popup,
popup->insertSeparator();
int depth = 2, count;
for (count=0;count<3;count++) {
- popup->insertItem(i18n("Depth %1").arg(depth), id+4+count);
+ popup->insertItem(i18n("Depth %1").tqarg(depth), id+4+count);
if (depth == maxDrawingDepth()) {
popup->setItemChecked(id+4+count, true);
foundDepth = true;
@@ -3100,14 +3100,14 @@ void TreeMapWidget::addDepthStopItems(TQPopupMenu* popup,
if (maxDrawingDepth()>1) {
popup->insertSeparator();
if (!foundDepth) {
- popup->insertItem(i18n("Depth %1").arg(maxDrawingDepth()), id+10);
+ popup->insertItem(i18n("Depth %1").tqarg(maxDrawingDepth()), id+10);
popup->setItemChecked(id+10, true);
}
popup->insertItem(i18n("Decrement (to %1)")
- .arg(maxDrawingDepth()-1), id+2);
+ .tqarg(maxDrawingDepth()-1), id+2);
popup->insertItem(i18n("Increment (to %1)")
- .arg(maxDrawingDepth()+1), id+3);
+ .tqarg(maxDrawingDepth()+1), id+3);
}
}
@@ -3130,13 +3130,13 @@ void TreeMapWidget::saveOptions(KConfigGroup* config, TQString prefix)
int f, fCount = _attr.size();
config->writeEntry(prefix+"FieldCount", fCount);
for (f=0;f<fCount;f++) {
- config->writeEntry(TQString(prefix+"FieldVisible%1").arg(f),
+ config->writeEntry(TQString(prefix+"FieldVisible%1").tqarg(f),
_attr[f].visible);
- config->writeEntry(TQString(prefix+"FieldForced%1").arg(f),
+ config->writeEntry(TQString(prefix+"FieldForced%1").tqarg(f),
_attr[f].forced);
- config->writeEntry(TQString(prefix+"FieldStop%1").arg(f),
+ config->writeEntry(TQString(prefix+"FieldStop%1").tqarg(f),
_attr[f].stop);
- config->writeEntry(TQString(prefix+"FieldPosition%1").arg(f),
+ config->writeEntry(TQString(prefix+"FieldPosition%1").tqarg(f),
fieldPositionString(f));
}
}
@@ -3180,18 +3180,18 @@ void TreeMapWidget::restoreOptions(KConfigGroup* config, TQString prefix)
int f;
for (f=0;f<num;f++) {
- str = TQString(prefix+"FieldVisible%1").arg(f);
+ str = TQString(prefix+"FieldVisible%1").tqarg(f);
if (config->hasKey(str))
setFieldVisible(f, config->readBoolEntry(str));
- str = TQString(prefix+"FieldForced%1").arg(f);
+ str = TQString(prefix+"FieldForced%1").tqarg(f);
if (config->hasKey(str))
setFieldForced(f, config->readBoolEntry(str));
- str = config->readEntry(TQString(prefix+"FieldStop%1").arg(f));
+ str = config->readEntry(TQString(prefix+"FieldStop%1").tqarg(f));
setFieldStop(f, str);
- str = config->readEntry(TQString(prefix+"FieldPosition%1").arg(f));
+ str = config->readEntry(TQString(prefix+"FieldPosition%1").tqarg(f));
if (!str.isEmpty()) setFieldPosition(f, str);
}
}
diff --git a/konq-plugins/fsview/treemap.h b/konq-plugins/fsview/treemap.h
index d4b37a9..ca10251 100644
--- a/konq-plugins/fsview/treemap.h
+++ b/konq-plugins/fsview/treemap.h
@@ -81,7 +81,7 @@ public:
virtual int maxLines(int) const { return 0; }
virtual int fieldCount() const { return 0; }
- virtual TQColor backColor() const { return Qt::white; }
+ virtual TQColor backColor() const { return TQt::white; }
virtual const TQFont& font() const = 0;
virtual bool selected() const { return false; }
@@ -215,7 +215,7 @@ typedef TQPtrListIterator<TreeMapItem> TreeMapItemListIterator;
*
* If you want more flexibility, reimplement TreeMapItem and
* override the corresponding methods. For dynamic creation of child
- * items on demand, reimplement children().
+ * items on demand, reimplement tqchildren().
*/
class TreeMapItem: public StoredDrawParams
{
@@ -227,20 +227,20 @@ public:
* longest side of rectangle left for drawing
* Best: Choose split direction for all subitems of an area
* depending on longest side
- * HAlternate: Horizontal at top; alternate direction on depth step
- * VAlternate: Vertical at top; alternate direction on depth step
- * Horizontal: Always horizontal split direction
- * Vertical: Always vertical split direction
+ * HAlternate:Qt::Horizontal at top; alternate direction on depth step
+ * VAlternate:Qt::Vertical at top; alternate direction on depth step
+ * Qt::Horizontal: Always horizontal split direction
+ * Qt::Vertical: Always vertical split direction
*/
enum SplitMode { Bisection, Columns, Rows,
AlwaysBest, Best,
HAlternate, VAlternate,
Horizontal, Vertical };
- TreeMapItem(TreeMapItem* parent = 0, double value = 1.0 );
- TreeMapItem(TreeMapItem* parent, double value,
- TQString text1, TQString text2 = TQString::null,
- TQString text3 = TQString::null, TQString text4 = TQString::null);
+ TreeMapItem(TreeMapItem* tqparent = 0, double value = 1.0 );
+ TreeMapItem(TreeMapItem* tqparent, double value,
+ TQString text1, TQString text2 = TQString(),
+ TQString text3 = TQString(), TQString text4 = TQString());
virtual ~TreeMapItem();
bool isChildOf(TreeMapItem*);
@@ -250,7 +250,7 @@ public:
// force a redraw of this item
void redraw();
- // delete all children
+ // delete all tqchildren
void clear();
// force new child generation & refresh
@@ -261,9 +261,9 @@ public:
bool initialized();
/**
- * Adds an item to a parent.
+ * Adds an item to a tqparent.
* When no sorting is used, the item is appended (drawn at bottom).
- * This is only needed if the parent was not already specified in the
+ * This is only needed if the tqparent was not already specified in the
* construction of the item.
*/
void addItem(TreeMapItem*);
@@ -282,7 +282,7 @@ public:
/**
* Parent Item
*/
- TreeMapItem* parent() const { return _parent; }
+ TreeMapItem* tqparent() const { return _parent; }
/**
* Temporary rectangle used for drawing this item the last time.
@@ -290,7 +290,7 @@ public:
*/
void setItemRect(const TQRect& r) { _rect = r; }
void clearItemRect();
- const TQRect& itemRect() const { return _rect; }
+ const TQRect& tqitemRect() const { return _rect; }
int width() const { return _rect.width(); }
int height() const { return _rect.height(); }
@@ -321,7 +321,7 @@ public:
virtual double sum() const;
virtual double value() const;
- // replace "Default" position with setting from TreeMapWidget
+ // tqreplace "Default" position with setting from TreeMapWidget
virtual Position position(int) const;
virtual const TQFont& font() const;
virtual bool isMarked(int) const;
@@ -343,7 +343,7 @@ public:
* For value() sorting, use <textNo> = -2
*
* For fast sorting, set this to -1 before child insertions and call
- * again after inserting all children.
+ * again after inserting all tqchildren.
*/
void setSorting(int textNo, bool ascending = true);
@@ -351,18 +351,18 @@ public:
* Resort according to the already set sorting.
*
* This has to be done if the sorting base changes (e.g. text or values
- * change). If this is only true for the children of this item, you can
+ * change). If this is only true for the tqchildren of this item, you can
* set the recursive parameter to false.
*/
void resort(bool recursive = true);
virtual SplitMode splitMode() const;
virtual int rtti() const;
- // not const as this can create children on demand
- virtual TreeMapItemList* children();
+ // not const as this can create tqchildren on demand
+ virtual TreeMapItemList* tqchildren();
protected:
- TreeMapItemList* _children;
+ TreeMapItemList* _tqchildren;
double _sum, _value;
private:
@@ -372,7 +372,7 @@ private:
int _sortTextNo;
bool _sortAscending;
- // temporary layout
+ // temporary tqlayout
TQRect _rect;
TQPtrList<TQRect>* _freeRects;
int _depth;
@@ -389,18 +389,19 @@ private:
* Class for visualisation of a metric of hierarchically
* nested items as 2D areas.
*/
-class TreeMapWidget: public QWidget
+class TreeMapWidget: public TQWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
/**
- * Same as in QListBox/QListView
+ * Same as in TQListBox/TQListView
*/
enum SelectionMode { Single, Multi, Extended, NoSelection };
- TreeMapWidget(TreeMapItem* base, TQWidget* parent=0, const char* name=0);
+ TreeMapWidget(TreeMapItem* base, TQWidget* tqparent=0, const char* name=0);
~TreeMapWidget();
/**
@@ -427,7 +428,7 @@ public:
/**
* Returns the item possible for selection. this returns the
- * given item itself or a parent thereof,
+ * given item itself or a tqparent thereof,
* depending on setting of maxSelectDepth().
*/
TreeMapItem* possibleSelection(TreeMapItem*) const;
@@ -435,7 +436,7 @@ public:
/**
* Selects or unselects an item.
* In multiselection mode, the constrain that a selected item
- * has no selected children or parents stays true.
+ * has no selected tqchildren or tqparents stays true.
*/
void setSelected(TreeMapItem*, bool selected = true);
@@ -451,19 +452,19 @@ public:
void setMarked(int markNo = 1, bool redraw = true);
/**
- * Clear selection of all selected items which are children of
- * parent. When parent == 0, clears whole selection
+ * Clear selection of all selected items which are tqchildren of
+ * tqparent. When tqparent == 0, clears whole selection
* Returns true if selection changed.
*/
- bool clearSelection(TreeMapItem* parent = 0);
+ bool clearSelection(TreeMapItem* tqparent = 0);
/**
* Selects or unselects items in a range.
* This is needed internally for Shift-Click in Extented mode.
* Range means for a hierarchical widget:
* - select/unselect i1 and i2 according selected
- * - search common parent of i1 and i2, and select/unselect the
- * range of direct children between but excluding the child
+ * - search common tqparent of i1 and i2, and select/unselect the
+ * range of direct tqchildren between but excluding the child
* leading to i1 and the child leading to i2.
*/
void setRangeSelection(TreeMapItem* i1,
@@ -516,15 +517,15 @@ public:
void setVisibleWidth(int width, bool reuseSpace = false);
/**
- * If a children value() is almost the parents sum(),
+ * If a tqchildren value() is almost the tqparents sum(),
* it can happen that the border to be drawn for visibilty of
* nesting relations takes to much space, and the
- * parent/child size relation can not be mapped to a correct
+ * tqparent/child size relation can not be mapped to a correct
* area size relation.
*
* Either
* (1) Ignore the incorrect drawing, or
- * (2) Skip drawing of the parent level alltogether.
+ * (2) Skip drawing of the tqparent level alltogether.
*/
void setSkipIncorrectBorder(bool enable = true);
bool skipIncorrectBorder() const { return _skipIncorrectBorder; }
@@ -598,8 +599,8 @@ public:
/**
* Save/restore options.
*/
- void saveOptions(KConfigGroup*, TQString prefix = TQString::null);
- void restoreOptions(KConfigGroup*, TQString prefix = TQString::null);
+ void saveOptions(KConfigGroup*, TQString prefix = TQString());
+ void restoreOptions(KConfigGroup*, TQString prefix = TQString());
/**
* These functions populate given popup menus.
@@ -628,7 +629,7 @@ public:
virtual TQString tipString(TreeMapItem* i) const;
/**
- * Redraws an item with all children.
+ * Redraws an item with all tqchildren.
* This takes changed values(), sums(), colors() and text() into account.
*/
void redraw(TreeMapItem*);