summaryrefslogtreecommitdiffstats
path: root/noatun-plugins/oblique/tree.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:22:56 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:22:56 +0000
commit7346aee26bf190a7e70333c40fab4caca847cd27 (patch)
tree4b019b434f88dcc3eeaafe1d3f26240b4c4718e8 /noatun-plugins/oblique/tree.cpp
parent23a3d3aa5b44cbdf305495919866d9dbf4f6da54 (diff)
downloadtdeaddons-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 'noatun-plugins/oblique/tree.cpp')
-rw-r--r--noatun-plugins/oblique/tree.cpp106
1 files changed, 53 insertions, 53 deletions
diff --git a/noatun-plugins/oblique/tree.cpp b/noatun-plugins/oblique/tree.cpp
index 4160650..0087b99 100644
--- a/noatun-plugins/oblique/tree.cpp
+++ b/noatun-plugins/oblique/tree.cpp
@@ -7,7 +7,7 @@
#include "menu.h"
#include "oblique.h"
-#include <qpainter.h>
+#include <tqpainter.h>
#include <iostream>
#include <klocale.h>
@@ -105,7 +105,7 @@ static void treeItemSort(TreeItem *first)
if (at > 1)
treeItemSort(set, set+count-manually-1);
- // grr, QListView sucks
+ // grr, TQListView sucks
set[0]->moveItem(set[1]);
TreeItem *previous = set[0];
@@ -149,7 +149,7 @@ inline static void sortify(T *item)
}
-TreeItem::TreeItem(Tree *parent, QueryGroup *group, const File &file, const QString &p)
+TreeItem::TreeItem(Tree *parent, QueryGroup *group, const File &file, const TQString &p)
: KListViewItem(parent, p), mGroup(group), mUserOpened(false), mHidden(false)
{
if (group->option(QueryGroup::Playable))
@@ -161,7 +161,7 @@ TreeItem::TreeItem(Tree *parent, QueryGroup *group, const File &file, const QStr
sortify(parent);
}
-TreeItem::TreeItem(TreeItem *parent, QueryGroup *group, const File &file, const QString &p)
+TreeItem::TreeItem(TreeItem *parent, QueryGroup *group, const File &file, const TQString &p)
: KListViewItem(parent, p), mGroup(group), mUserOpened(false), mHidden(false)
{
if (group->option(QueryGroup::Playable))
@@ -196,7 +196,7 @@ void Tree::deleted(TreeItem *item)
}
}
-static void pad(QString &str)
+static void pad(TQString &str)
{
int len=str.length();
int at = 0;
@@ -205,11 +205,11 @@ static void pad(QString &str)
static const int paddingsize=12;
// not static for reason
- const QChar chars[paddingsize] =
+ const TQChar chars[paddingsize] =
{
- QChar('0'), QChar('0'), QChar('0'), QChar('0'),
- QChar('0'), QChar('0'), QChar('0'), QChar('0'),
- QChar('0'), QChar('0'), QChar('0'), QChar('0')
+ TQChar('0'), TQChar('0'), TQChar('0'), TQChar('0'),
+ TQChar('0'), TQChar('0'), TQChar('0'), TQChar('0'),
+ TQChar('0'), TQChar('0'), TQChar('0'), TQChar('0')
};
for (int i=0; i < len; i++)
@@ -237,10 +237,10 @@ static void pad(QString &str)
}
}
-int TreeItem::compare(QListViewItem *i, int col, bool) const
+int TreeItem::compare(TQListViewItem *i, int col, bool) const
{
- QString text1 = text(col);
- QString text2 = i->text(col);
+ TQString text1 = text(col);
+ TQString text2 = i->text(col);
pad(text1);
pad(text2);
@@ -253,7 +253,7 @@ Tree *TreeItem::tree()
return static_cast<Tree*>(KListViewItem::listView());
}
-QString TreeItem::presentation() const
+TQString TreeItem::presentation() const
{
return text(0);
}
@@ -287,27 +287,27 @@ TreeItem *TreeItem::nextPlayable()
return next;
}
-void TreeItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int align)
+void TreeItem::paintCell(TQPainter *p, const TQColorGroup &cg, int column, int width, int align)
{
- QFont font = p->font();
+ TQFont font = p->font();
if (tree()->current() == this)
{
font.setUnderline(true);
p->setFont(font);
}
- QColorGroup newcg(cg);
+ TQColorGroup newcg(cg);
if (parent() && parent()->isOpen() && !parent()->mUserOpened)
{
// slow, but not often used
- QColor text = newcg.text();
- QColor bg = newcg.background();
+ TQColor text = newcg.text();
+ TQColor bg = newcg.background();
int r = text.red() + bg.red();
int g = text.green() + bg.green();
int b = text.blue() + bg.blue();
text.setRgb(r/2,g/2,b/2);
- newcg.setColor(QColorGroup::Text, text);
+ newcg.setColor(TQColorGroup::Text, text);
}
KListViewItem::paintCell(p, newcg, column, width, align);
@@ -346,7 +346,7 @@ void TreeItem::forceAutoExpand()
setOpen(true);
}
-bool TreeItem::hideIfNoMatch(const QString &match)
+bool TreeItem::hideIfNoMatch(const TQString &match)
{
if (!firstChild())
{
@@ -372,7 +372,7 @@ bool TreeItem::hideIfNoMatch(const QString &match)
if (visible)
{
- QString empty;
+ TQString empty;
for (TreeItem *ch = firstChild(); ch; ch = ch->nextSibling())
{
ch->hideIfNoMatch(empty);
@@ -395,7 +395,7 @@ bool TreeItem::hideIfNoMatch(const QString &match)
void TreeItem::setup()
{
- QListViewItem::setup();
+ TQListViewItem::setup();
if (mHidden)
setHeight(0);
}
@@ -431,7 +431,7 @@ TreeItem *TreeItem::next()
-Tree::Tree(Oblique *oblique, QWidget *parent)
+Tree::Tree(Oblique *oblique, TQWidget *parent)
: KListView(parent), mOblique(oblique), mAutoExpanding(0)
{
mCurrent = 0;
@@ -449,32 +449,32 @@ Tree::Tree(Oblique *oblique, QWidget *parent)
setDropVisualizer(true);
setSorting(-1);
- ((QWidget*)header())->hide();
+ ((TQWidget*)header())->hide();
connect(
- this, SIGNAL(moved(QPtrList<QListViewItem>&, QPtrList<QListViewItem>&, QPtrList<QListViewItem>&)),
- SLOT(dropped(QPtrList<QListViewItem>&, QPtrList<QListViewItem>&, QPtrList<QListViewItem>&))
+ this, TQT_SIGNAL(moved(TQPtrList<TQListViewItem>&, TQPtrList<TQListViewItem>&, TQPtrList<TQListViewItem>&)),
+ TQT_SLOT(dropped(TQPtrList<TQListViewItem>&, TQPtrList<TQListViewItem>&, TQPtrList<TQListViewItem>&))
);
connect(
- this, SIGNAL(contextMenu(KListView*, QListViewItem*, const QPoint&)),
- SLOT(contextMenu(KListView*, QListViewItem*, const QPoint&))
+ this, TQT_SIGNAL(contextMenu(KListView*, TQListViewItem*, const TQPoint&)),
+ TQT_SLOT(contextMenu(KListView*, TQListViewItem*, const TQPoint&))
);
connect(
- this, SIGNAL(executed(QListViewItem*)),
- SLOT(play(QListViewItem*))
+ this, TQT_SIGNAL(executed(TQListViewItem*)),
+ TQT_SLOT(play(TQListViewItem*))
);
Base *base = oblique->base();
- connect(base, SIGNAL(added(File)), SLOT(insert(File)));
- connect(base, SIGNAL(removed(File)), SLOT(remove(File)));
- connect(base, SIGNAL(modified(File)), SLOT(update(File)));
+ connect(base, TQT_SIGNAL(added(File)), TQT_SLOT(insert(File)));
+ connect(base, TQT_SIGNAL(removed(File)), TQT_SLOT(remove(File)));
+ connect(base, TQT_SIGNAL(modified(File)), TQT_SLOT(update(File)));
- connect(base, SIGNAL(addedTo(Slice*, File)), SLOT(checkInsert(Slice*, File)));
- connect(base, SIGNAL(removedFrom(Slice*, File)), SLOT(checkRemove(Slice*, File)));
+ connect(base, TQT_SIGNAL(addedTo(Slice*, File)), TQT_SLOT(checkInsert(Slice*, File)));
+ connect(base, TQT_SIGNAL(removedFrom(Slice*, File)), TQT_SLOT(checkRemove(Slice*, File)));
- connect(this, SIGNAL(selected(TreeItem*)), oblique, SLOT(selected(TreeItem*)));
+ connect(this, TQT_SIGNAL(selected(TreeItem*)), oblique, TQT_SLOT(selected(TreeItem*)));
mSlice = oblique->base()->defaultSlice();
@@ -503,10 +503,10 @@ void Tree::clear()
KListView::clear();
}
-void Tree::movableDropEvent (QListViewItem* parent, QListViewItem* afterme)
+void Tree::movableDropEvent (TQListViewItem* parent, TQListViewItem* afterme)
{
- QPtrList<QListViewItem> items = selectedItems(true);
- for (QPtrList<QListViewItem>::Iterator i(items.begin()); *i; ++i)
+ TQPtrList<TQListViewItem> items = selectedItems(true);
+ for (TQPtrList<TQListViewItem>::Iterator i(items.begin()); *i; ++i)
{
if ((*i)->parent() != parent)
return;
@@ -516,10 +516,10 @@ void Tree::movableDropEvent (QListViewItem* parent, QListViewItem* afterme)
}
-void Tree::dropped(QPtrList<QListViewItem> &items, QPtrList<QListViewItem> &, QPtrList<QListViewItem> &afterNow)
+void Tree::dropped(TQPtrList<TQListViewItem> &items, TQPtrList<TQListViewItem> &, TQPtrList<TQListViewItem> &afterNow)
{
- QPtrList<QListViewItem>::Iterator itemi = items.begin();
- QPtrList<QListViewItem>::Iterator afteri = afterNow.begin();
+ TQPtrList<TQListViewItem>::Iterator itemi = items.begin();
+ TQPtrList<TQListViewItem>::Iterator afteri = afterNow.begin();
while (*itemi)
{
TreeItem *item = static_cast<TreeItem*>(*itemi);
@@ -622,21 +622,21 @@ void Tree::setCurrent(TreeItem *cur)
// undo the old one
TreeItem *old = mCurrent;
mCurrent = cur;
- QPtrList<TreeItem> oldAutoExpanded = mAutoExpanded;
+ TQPtrList<TreeItem> oldAutoExpanded = mAutoExpanded;
mAutoExpanded.clear();
repaintItem(old);
repaintItem(cur);
if (cur) cur->autoExpand();
// do an anti-intersection on oldAutoUpdated and the new mAutoExpanded
- for (QPtrListIterator<TreeItem> i(mAutoExpanded); *i; ++i)
+ for (TQPtrListIterator<TreeItem> i(mAutoExpanded); *i; ++i)
{
oldAutoExpanded.removeRef(*i);
}
bool user=false;
- for (QPtrListIterator<TreeItem> i(oldAutoExpanded); *i; ++i)
+ for (TQPtrListIterator<TreeItem> i(oldAutoExpanded); *i; ++i)
{
if ((*i)->userOpened())
{
@@ -646,7 +646,7 @@ void Tree::setCurrent(TreeItem *cur)
}
if (!user)
{
- for (QPtrListIterator<TreeItem> i(oldAutoExpanded); *i; ++i)
+ for (TQPtrListIterator<TreeItem> i(oldAutoExpanded); *i; ++i)
{
(*i)->setOpen(false);
}
@@ -660,7 +660,7 @@ void Tree::reload()
delete mLoader;
clear();
mLoader = new Loader(this);
- connect(mLoader, SIGNAL(finished()), SLOT(destroyLoader()));
+ connect(mLoader, TQT_SIGNAL(finished()), TQT_SLOT(destroyLoader()));
}
void Tree::setSlice(Slice *slice)
@@ -670,7 +670,7 @@ void Tree::setSlice(Slice *slice)
reload();
}
-bool Tree::setSchema(const QString &name)
+bool Tree::setSchema(const TQString &name)
{
mFileOfQuery = name;
if (!oblique()->loadSchema(mQuery, name))
@@ -679,7 +679,7 @@ bool Tree::setSchema(const QString &name)
return true;
}
-QDragObject *Tree::dragObject()
+TQDragObject *Tree::dragObject()
{
if (currentItem() && static_cast<TreeItem*>(currentItem())->file())
return KListView::dragObject();
@@ -692,7 +692,7 @@ void Tree::destroyLoader()
mLoader = 0;
}
-void Tree::setLimit(const QString &text)
+void Tree::setLimit(const TQString &text)
{
for (TreeItem *ch = firstChild(); ch; ch = ch->nextSibling())
{
@@ -701,7 +701,7 @@ void Tree::setLimit(const QString &text)
}
-void Tree::contextMenu(KListView*, QListViewItem* i, const QPoint& p)
+void Tree::contextMenu(KListView*, TQListViewItem* i, const TQPoint& p)
{
if (!i) return;
delete lastMenu;
@@ -709,7 +709,7 @@ void Tree::contextMenu(KListView*, QListViewItem* i, const QPoint& p)
lastMenu->popup(p);
}
-void Tree::play(QListViewItem *_item)
+void Tree::play(TQListViewItem *_item)
{
if (!_item) return;
TreeItem *item = static_cast<TreeItem*>(_item);
@@ -757,7 +757,7 @@ TreeItem *Tree::node(TreeItem *fix, QueryGroup *group, const File &file, TreeIte
else
children = firstChild();
- QString presentation = group->presentation(file);
+ TQString presentation = group->presentation(file);
while (children)
{
// merging would be done here