summaryrefslogtreecommitdiffstats
path: root/src/playlistview.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-30 06:10:56 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-30 06:10:56 +0000
commit769e63d24adf5c844137484f06a972fcce732d6a (patch)
tree5185797dcb3ff4b1b3cb71d367123bf89eb2410f /src/playlistview.cpp
parent0a8af92185eac74d48da1225e6053a0d66c078f5 (diff)
downloadkmplayer-769e63d24adf5c844137484f06a972fcce732d6a.tar.gz
kmplayer-769e63d24adf5c844137484f06a972fcce732d6a.zip
TQt4 port kmplayer
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kmplayer@1238840 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/playlistview.cpp')
-rw-r--r--src/playlistview.cpp252
1 files changed, 126 insertions, 126 deletions
diff --git a/src/playlistview.cpp b/src/playlistview.cpp
index a7d5503..c13cb54 100644
--- a/src/playlistview.cpp
+++ b/src/playlistview.cpp
@@ -19,17 +19,17 @@
#include <stdio.h>
#include <config.h>
-// include files for Qt
-#include <qapplication.h>
-#include <qclipboard.h>
-#include <qpopupmenu.h>
-#include <qdrawutil.h>
-#include <qpainter.h>
-#include <qiconset.h>
-#include <qpixmap.h>
-#include <qheader.h>
-#include <qstyle.h>
-#include <qtimer.h>
+// include files for TQt
+#include <tqapplication.h>
+#include <tqclipboard.h>
+#include <tqpopupmenu.h>
+#include <tqdrawutil.h>
+#include <tqpainter.h>
+#include <tqiconset.h>
+#include <tqpixmap.h>
+#include <tqheader.h>
+#include <tqstyle.h>
+#include <tqtimer.h>
#include <kiconloader.h>
#include <kfinddialog.h>
@@ -48,12 +48,12 @@ using namespace KMPlayer;
namespace KMPlayer {
- KDE_NO_EXPORT bool isDragValid (QDropEvent * de) {
+ KDE_NO_EXPORT bool isDragValid (TQDropEvent * de) {
if (KURLDrag::canDecode (de))
return true;
- if (QTextDrag::canDecode (de)) {
- QString text;
- if (QTextDrag::decode (de, text) && KURL (text).isValid ())
+ if (TQTextDrag::canDecode (de)) {
+ TQString text;
+ if (TQTextDrag::decode (de, text) && KURL (text).isValid ())
return true;
}
return false;
@@ -62,59 +62,59 @@ namespace KMPlayer {
//-----------------------------------------------------------------------------
-KDE_NO_CDTOR_EXPORT PlayListItem::PlayListItem (QListViewItem *p, const NodePtr & e, PlayListView * lv) : QListViewItem (p), node (e), listview (lv) {}
+KDE_NO_CDTOR_EXPORT PlayListItem::PlayListItem (TQListViewItem *p, const NodePtr & e, PlayListView * lv) : TQListViewItem (p), node (e), listview (lv) {}
-KDE_NO_CDTOR_EXPORT PlayListItem::PlayListItem (QListViewItem *p, const AttributePtr & a, PlayListView * lv) : QListViewItem (p), m_attr (a), listview (lv) {}
+KDE_NO_CDTOR_EXPORT PlayListItem::PlayListItem (TQListViewItem *p, const AttributePtr & a, PlayListView * lv) : TQListViewItem (p), m_attr (a), listview (lv) {}
KDE_NO_CDTOR_EXPORT
-PlayListItem::PlayListItem (PlayListView *v, const NodePtr &e, QListViewItem *b)
- : QListViewItem (v, b), node (e), listview (v) {}
+PlayListItem::PlayListItem (PlayListView *v, const NodePtr &e, TQListViewItem *b)
+ : TQListViewItem (v, b), node (e), listview (v) {}
-KDE_NO_CDTOR_EXPORT void PlayListItem::paintCell (QPainter * p, const QColorGroup & cg, int column, int width, int align) {
+KDE_NO_CDTOR_EXPORT void PlayListItem::paintCell (TQPainter * p, const TQColorGroup & cg, int column, int width, int align) {
if (node && node->state == Node::state_began) {
- QColorGroup mycg (cg);
- mycg.setColor (QColorGroup::Foreground, listview->activeColor ());
- mycg.setColor (QColorGroup::Text, listview->activeColor ());
- QListViewItem::paintCell (p, mycg, column, width, align);
+ TQColorGroup mycg (cg);
+ mycg.setColor (TQColorGroup::Foreground, listview->activeColor ());
+ mycg.setColor (TQColorGroup::Text, listview->activeColor ());
+ TQListViewItem::paintCell (p, mycg, column, width, align);
} else
- QListViewItem::paintCell (p, cg, column, width, align);
+ TQListViewItem::paintCell (p, cg, column, width, align);
}
-KDE_NO_CDTOR_EXPORT void PlayListItem::paintBranches (QPainter * p, const QColorGroup &, int w, int, int h) {
+KDE_NO_CDTOR_EXPORT void PlayListItem::paintBranches (TQPainter * p, const TQColorGroup &, int w, int, int h) {
p->fillRect (0, 0, w, h, listview->paletteBackgroundColor());
}
//-----------------------------------------------------------------------------
KDE_NO_CDTOR_EXPORT
-RootPlayListItem::RootPlayListItem (int _id, PlayListView *v, const NodePtr & e, QListViewItem * before, int flgs)
+RootPlayListItem::RootPlayListItem (int _id, PlayListView *v, const NodePtr & e, TQListViewItem * before, int flgs)
: PlayListItem (v, e, before),
id (_id),
flags (flgs),
show_all_nodes (false),
have_dark_nodes (false) {}
-KDE_NO_CDTOR_EXPORT void RootPlayListItem::paintCell (QPainter * p, const QColorGroup & cg, int column, int width, int align) {
- QColorGroup mycg (cg);
- mycg.setColor (QColorGroup::Base, listview->topLevelWidget()->paletteBackgroundColor());
- mycg.setColor (QColorGroup::Highlight, mycg.base ());
- mycg.setColor (QColorGroup::Text, listview->topLevelWidget()->paletteForegroundColor());
- mycg.setColor (QColorGroup::HighlightedText, mycg.text ());
- QListViewItem::paintCell (p, mycg, column, width, align);
+KDE_NO_CDTOR_EXPORT void RootPlayListItem::paintCell (TQPainter * p, const TQColorGroup & cg, int column, int width, int align) {
+ TQColorGroup mycg (cg);
+ mycg.setColor (TQColorGroup::Base, listview->tqtopLevelWidget()->paletteBackgroundColor());
+ mycg.setColor (TQColorGroup::Highlight, mycg.base ());
+ mycg.setColor (TQColorGroup::Text, listview->tqtopLevelWidget()->paletteForegroundColor());
+ mycg.setColor (TQColorGroup::HighlightedText, mycg.text ());
+ TQListViewItem::paintCell (p, mycg, column, width, align);
qDrawShadeRect (p, 0, 0, width -1, height () -1, mycg, !isOpen ());
}
//-----------------------------------------------------------------------------
-KDE_NO_CDTOR_EXPORT PlayListView::PlayListView (QWidget * parent, View * view, KActionCollection * ac)
- : KListView (parent, "kde_kmplayer_playlist"),
+KDE_NO_CDTOR_EXPORT PlayListView::PlayListView (TQWidget * tqparent, View * view, KActionCollection * ac)
+ : KListView (tqparent, "kde_kmplayer_playlist"),
m_view (view),
m_find_dialog (0L),
m_active_color (30, 0, 255),
last_id (0),
last_drag_tree_id (0),
m_ignore_expanded (false) {
- addColumn (QString ());
+ addColumn (TQString ());
header()->hide ();
//setRootIsDecorated (true);
setSorting (-1);
@@ -122,36 +122,36 @@ KDE_NO_CDTOR_EXPORT PlayListView::PlayListView (QWidget * parent, View * view, K
setDropVisualizer (true);
setItemsRenameable (true);
setItemMargin (2);
- setPaletteBackgroundColor (QColor (0, 0, 0));
- setPaletteForegroundColor (QColor (0xB2, 0xB2, 0xB2));
- m_itemmenu = new QPopupMenu (this);
- folder_pix = KGlobal::iconLoader ()->loadIcon (QString ("folder"), KIcon::Small);
- auxiliary_pix = KGlobal::iconLoader ()->loadIcon (QString ("folder_grey"), KIcon::Small);
- video_pix = KGlobal::iconLoader ()->loadIcon (QString ("video"), KIcon::Small);
- info_pix = KGlobal::iconLoader ()->loadIcon (QString ("messagebox_info"), KIcon::Small);
- img_pix = KGlobal::iconLoader ()->loadIcon (QString ("colorize"), KIcon::Small);
- unknown_pix = KGlobal::iconLoader ()->loadIcon (QString ("unknown"), KIcon::Small);
- menu_pix = KGlobal::iconLoader ()->loadIcon (QString ("player_playlist"), KIcon::Small);
- config_pix = KGlobal::iconLoader ()->loadIcon (QString ("configure"), KIcon::Small);
- url_pix = KGlobal::iconLoader ()->loadIcon (QString ("www"), KIcon::Small);
- m_find = KStdAction::find (this, SLOT (slotFind ()), ac, "find");
- m_find_next = KStdAction::findNext (this, SLOT(slotFindNext()), ac, "next");
+ setPaletteBackgroundColor (TQColor (0, 0, 0));
+ setPaletteForegroundColor (TQColor (0xB2, 0xB2, 0xB2));
+ m_itemmenu = new TQPopupMenu (this);
+ folder_pix = KGlobal::iconLoader ()->loadIcon (TQString ("folder"), KIcon::Small);
+ auxiliary_pix = KGlobal::iconLoader ()->loadIcon (TQString ("folder_grey"), KIcon::Small);
+ video_pix = KGlobal::iconLoader ()->loadIcon (TQString ("video"), KIcon::Small);
+ info_pix = KGlobal::iconLoader ()->loadIcon (TQString ("messagebox_info"), KIcon::Small);
+ img_pix = KGlobal::iconLoader ()->loadIcon (TQString ("colorize"), KIcon::Small);
+ unknown_pix = KGlobal::iconLoader ()->loadIcon (TQString ("unknown"), KIcon::Small);
+ menu_pix = KGlobal::iconLoader ()->loadIcon (TQString ("player_playlist"), KIcon::Small);
+ config_pix = KGlobal::iconLoader ()->loadIcon (TQString ("configure"), KIcon::Small);
+ url_pix = KGlobal::iconLoader ()->loadIcon (TQString ("www"), KIcon::Small);
+ m_tqfind = KStdAction::find (TQT_TQOBJECT(this), TQT_SLOT (slotFind ()), ac, "tqfind");
+ m_find_next = KStdAction::findNext (TQT_TQOBJECT(this), TQT_SLOT(slotFindNext()), ac, "next");
m_find_next->setEnabled (false);
- connect (this, SIGNAL (contextMenuRequested (QListViewItem *, const QPoint &, int)), this, SLOT (contextMenuItem (QListViewItem *, const QPoint &, int)));
- connect (this, SIGNAL (expanded (QListViewItem *)),
- this, SLOT (itemExpanded (QListViewItem *)));
- connect (this, SIGNAL (dropped (QDropEvent *, QListViewItem *)),
- this, SLOT (itemDropped (QDropEvent *, QListViewItem *)));
- connect (this, SIGNAL (itemRenamed (QListViewItem *)),
- this, SLOT (itemIsRenamed (QListViewItem *)));
- connect (this, SIGNAL (selectionChanged (QListViewItem *)),
- this, SLOT (itemIsSelected (QListViewItem *)));
+ connect (this, TQT_SIGNAL (contextMenuRequested (TQListViewItem *, const TQPoint &, int)), this, TQT_SLOT (contextMenuItem (TQListViewItem *, const TQPoint &, int)));
+ connect (this, TQT_SIGNAL (expanded (TQListViewItem *)),
+ this, TQT_SLOT (itemExpanded (TQListViewItem *)));
+ connect (this, TQT_SIGNAL (dropped (TQDropEvent *, TQListViewItem *)),
+ this, TQT_SLOT (itemDropped (TQDropEvent *, TQListViewItem *)));
+ connect (this, TQT_SIGNAL (itemRenamed (TQListViewItem *)),
+ this, TQT_SLOT (itemIsRenamed (TQListViewItem *)));
+ connect (this, TQT_SIGNAL (selectionChanged (TQListViewItem *)),
+ this, TQT_SLOT (itemIsSelected (TQListViewItem *)));
}
KDE_NO_CDTOR_EXPORT PlayListView::~PlayListView () {
}
-int PlayListView::addTree (NodePtr root, const QString & source, const QString & icon, int flags) {
+int PlayListView::addTree (NodePtr root, const TQString & source, const TQString & icon, int flags) {
//kdDebug () << "addTree " << source << " " << root->mrl()->src << endl;
RootPlayListItem * ritem = new RootPlayListItem (++last_id, this, root, lastChild(), flags);
ritem->source = source;
@@ -173,7 +173,7 @@ KDE_NO_EXPORT PlayListItem * PlayListView::populate
}
PlayListItem * item = pitem ? new PlayListItem (pitem, e, this) : root;
Mrl * mrl = e->mrl ();
- QString text (e->nodeName());
+ TQString text (e->nodeName());
if (mrl && !root->show_all_nodes) {
if (mrl->pretty_name.isEmpty ()) {
if (!mrl->src.isEmpty())
@@ -201,7 +201,7 @@ KDE_NO_EXPORT PlayListItem * PlayListView::populate
as->setPixmap (0, menu_pix);
for (; a; a = a->nextSibling ()) {
PlayListItem * ai = new PlayListItem (as, a, this);
- ai->setText (0, QString ("%1=%2").arg (
+ ai->setText (0, TQString ("%1=%2").arg (
a->name ().toString ()).arg (a->value ()));
ai->setPixmap (0, config_pix);
}
@@ -210,7 +210,7 @@ KDE_NO_EXPORT PlayListItem * PlayListView::populate
}
if (item != root) {
Node::PlayType pt = e->playType ();
- QPixmap * pix;
+ TQPixmap * pix;
switch (pt) {
case Node::play_type_image:
pix = &img_pix;
@@ -238,7 +238,7 @@ void PlayListView::updateTree (int id, NodePtr root, NodePtr active,
bool select, bool open) {
// TODO, if root is same as rootitems->node and treeversion is the same
// and show all nodes is unchanged then only update the cells
- QWidget * w = focusWidget ();
+ TQWidget * w = tqfocusWidget ();
if (w && w != this)
w->clearFocus ();
//setSelected (firstChild (), true);
@@ -251,7 +251,7 @@ void PlayListView::updateTree (int id, NodePtr root, NodePtr active,
break; // found based on id
}
if (id == -1) { // wildcard id
- for (NodePtr n = root; n; n = n->parentNode ())
+ for (NodePtr n = root; n; n = n->tqparentNode ())
if (n == ritem->node) {
root = n;
break;
@@ -277,7 +277,7 @@ void PlayListView::updateTree (int id, NodePtr root, NodePtr active,
bool need_timer = !tree_update;
tree_update = new TreeUpdate (ritem, active, select, open, tree_update);
if (need_timer)
- QTimer::singleShot (0, this, SLOT (updateTrees ()));
+ TQTimer::singleShot (0, this, TQT_SLOT (updateTrees ()));
}
KDE_NO_EXPORT void PlayListView::updateTrees () {
@@ -308,23 +308,23 @@ void PlayListView::updateTree (RootPlayListItem * ritem, NodePtr active, bool se
m_ignore_expanded = false;
}
-void PlayListView::selectItem (const QString & txt) {
- QListViewItem * item = selectedItem ();
+void PlayListView::selectItem (const TQString & txt) {
+ TQListViewItem * item = selectedItem ();
if (item && item->text (0) == txt)
return;
- item = findItem (txt, 0);
+ item = tqfindItem (txt, 0);
if (item) {
setSelected (item, true);
ensureItemVisible (item);
}
}
-KDE_NO_EXPORT QDragObject * PlayListView::dragObject () {
+KDE_NO_EXPORT TQDragObject * PlayListView::dragObject () {
PlayListItem * item = static_cast <PlayListItem *> (selectedItem ());
if (item && item->node) {
- QString txt = item->node->isPlayable ()
+ TQString txt = item->node->isPlayable ()
? item->node->mrl ()->src : item->node->outerXML ();
- QTextDrag * drag = new QTextDrag (txt, this);
+ TQTextDrag * drag = new TQTextDrag (txt, this);
last_drag_tree_id = rootItem (item)->id;
m_last_drag = item->node;
drag->setPixmap (*item->pixmap (0));
@@ -335,40 +335,40 @@ KDE_NO_EXPORT QDragObject * PlayListView::dragObject () {
return 0;
}
-KDE_NO_EXPORT void PlayListView::setFont (const QFont & fnt) {
- setTreeStepSize (QFontMetrics (fnt).boundingRect ('m').width ());
+KDE_NO_EXPORT void PlayListView::setFont (const TQFont & fnt) {
+ setTreeStepSize (TQFontMetrics (fnt).boundingRect ('m').width ());
KListView::setFont (fnt);
}
-KDE_NO_EXPORT void PlayListView::contextMenuItem (QListViewItem * vi, const QPoint & p, int) {
+KDE_NO_EXPORT void PlayListView::contextMenuItem (TQListViewItem * vi, const TQPoint & p, int) {
if (vi) {
PlayListItem * item = static_cast <PlayListItem *> (vi);
if (item->node || item->m_attr) {
RootPlayListItem * ritem = rootItem (vi);
if (m_itemmenu->count () > 0) {
- m_find->unplug (m_itemmenu);
+ m_tqfind->unplug (m_itemmenu);
m_find_next->unplug (m_itemmenu);
m_itemmenu->clear ();
}
m_itemmenu->insertItem (KGlobal::iconLoader ()->loadIconSet
- (QString ("editcopy"), KIcon::Small, 0, true),
+ (TQString ("editcopy"), KIcon::Small, 0, true),
i18n ("&Copy to Clipboard"),
- this, SLOT (copyToClipboard ()), 0, 0);
+ this, TQT_SLOT (copyToClipboard ()), 0, 0);
if (item->m_attr ||
(item->node && (item->node->isPlayable () ||
item->node->isDocument ()) &&
item->node->mrl ()->bookmarkable))
m_itemmenu->insertItem (KGlobal::iconLoader ()->loadIconSet
- (QString ("bookmark_add"), KIcon::Small, 0, true),
+ (TQString ("bookmark_add"), KIcon::Small, 0, true),
i18n ("&Add Bookmark"),
- this, SLOT (addBookMark ()), 0, 1);
+ this, TQT_SLOT (addBookMark ()), 0, 1);
if (ritem->have_dark_nodes) {
m_itemmenu->insertItem (i18n ("&Show all"),
- this, SLOT (toggleShowAllNodes ()), 0, 2);
+ this, TQT_SLOT (toggleShowAllNodes ()), 0, 2);
m_itemmenu->setItemChecked (2, ritem->show_all_nodes);
}
m_itemmenu->insertSeparator ();
- m_find->plug (m_itemmenu);
+ m_tqfind->plug (m_itemmenu);
m_find_next->plug (m_itemmenu);
emit prepareMenu (item, m_itemmenu);
m_itemmenu->exec (p);
@@ -377,7 +377,7 @@ KDE_NO_EXPORT void PlayListView::contextMenuItem (QListViewItem * vi, const QPoi
m_view->controlPanel ()->popupMenu ()->exec (p);
}
-void PlayListView::itemExpanded (QListViewItem * item) {
+void PlayListView::itemExpanded (TQListViewItem * item) {
if (!m_ignore_expanded && item->childCount () == 1) {
PlayListItem * child_item = static_cast<PlayListItem*>(item->firstChild ());
child_item->setOpen (rootItem (item)->show_all_nodes ||
@@ -385,11 +385,11 @@ void PlayListView::itemExpanded (QListViewItem * item) {
}
}
-RootPlayListItem * PlayListView::rootItem (QListViewItem * item) const {
+RootPlayListItem * PlayListView::rootItem (TQListViewItem * item) const {
if (!item)
return 0L;
- while (item->parent ())
- item = item->parent ();
+ while (item->tqparent ())
+ item = item->tqparent ();
return static_cast <RootPlayListItem *> (item);
}
@@ -404,20 +404,20 @@ RootPlayListItem * PlayListView::rootItem (int id) const {
void PlayListView::copyToClipboard () {
PlayListItem * item = currentPlayListItem ();
- QString text = item->text (0);
+ TQString text = item->text (0);
if (item->node) {
Mrl * mrl = item->node->mrl ();
if (mrl && !mrl->src.isEmpty ())
text = mrl->src;
}
- QApplication::clipboard()->setText (text);
+ TQApplication::tqclipboard()->setText (text);
}
void PlayListView::addBookMark () {
PlayListItem * item = currentPlayListItem ();
if (item->node) {
Mrl * mrl = item->node->mrl ();
- KURL url (mrl ? mrl->src : QString (item->node->nodeName ()));
+ KURL url (mrl ? mrl->src : TQString (item->node->nodeName ()));
emit addBookMark (mrl->pretty_name.isEmpty () ? url.prettyURL () : mrl->pretty_name, url.url ());
}
}
@@ -445,8 +445,8 @@ KDE_NO_EXPORT void PlayListView::showAllNodes(RootPlayListItem *ri, bool show) {
}
}
-KDE_NO_EXPORT bool PlayListView::acceptDrag (QDropEvent * de) const {
- QListViewItem * item = itemAt (contentsToViewport (de->pos ()));
+KDE_NO_EXPORT bool PlayListView::acceptDrag (TQDropEvent * de) const {
+ TQListViewItem * item = itemAt (contentsToViewport (de->pos ()));
if (item && (de->source () == this || isDragValid (de))) {
RootPlayListItem * ritem = rootItem (item);
return ritem->flags & AllowDrops;
@@ -454,11 +454,11 @@ KDE_NO_EXPORT bool PlayListView::acceptDrag (QDropEvent * de) const {
return false;
}
-KDE_NO_EXPORT void PlayListView::itemDropped (QDropEvent * de, QListViewItem *after) {
+KDE_NO_EXPORT void PlayListView::itemDropped (TQDropEvent * de, TQListViewItem *after) {
if (!after) { // could still be a descendent
after = itemAt (contentsToViewport (de->pos ()));
if (after)
- after = after->parent ();
+ after = after->tqparent ();
}
if (after) {
RootPlayListItem * ritem = rootItem (after);
@@ -469,9 +469,9 @@ KDE_NO_EXPORT void PlayListView::itemDropped (QDropEvent * de, QListViewItem *af
KURL::List sl;
if (KURLDrag::canDecode (de)) {
KURLDrag::decode (de, sl);
- } else if (QTextDrag::canDecode (de)) {
- QString text;
- QTextDrag::decode (de, text);
+ } else if (TQTextDrag::canDecode (de)) {
+ TQString text;
+ TQTextDrag::decode (de, text);
sl.push_back (KURL (text));
}
if (valid && sl.size () > 0) {
@@ -482,7 +482,7 @@ KDE_NO_EXPORT void PlayListView::itemDropped (QDropEvent * de, QListViewItem *af
if (as_child)
n->insertBefore (ni, n->firstChild ());
else
- n->parentNode ()->insertBefore (ni, n->nextSibling ());
+ n->tqparentNode ()->insertBefore (ni, n->nextSibling ());
}
PlayListItem * citem = currentPlayListItem ();
NodePtr cn;
@@ -494,7 +494,7 @@ KDE_NO_EXPORT void PlayListView::itemDropped (QDropEvent * de, QListViewItem *af
m_view->dropEvent (de);
}
-KDE_NO_EXPORT void PlayListView::itemIsRenamed (QListViewItem * qitem) {
+KDE_NO_EXPORT void PlayListView::itemIsRenamed (TQListViewItem * qitem) {
PlayListItem * item = static_cast <PlayListItem *> (qitem);
if (item->node) {
RootPlayListItem * ri = rootItem (qitem);
@@ -505,30 +505,30 @@ KDE_NO_EXPORT void PlayListView::itemIsRenamed (QListViewItem * qitem) {
} else // restore damage ..
updateTree (ri, item->node, true);
} else if (item->m_attr) {
- QString txt = item->text (0);
- int pos = txt.find (QChar ('='));
+ TQString txt = item->text (0);
+ int pos = txt.tqfind (TQChar ('='));
if (pos > -1) {
item->m_attr->setName (txt.left (pos));
item->m_attr->setValue (txt.mid (pos + 1));
} else {
item->m_attr->setName (txt);
- item->m_attr->setValue (QString (""));
+ item->m_attr->setValue (TQString (""));
}
- PlayListItem * pi = static_cast <PlayListItem *> (item->parent ());
+ PlayListItem * pi = static_cast <PlayListItem *> (item->tqparent ());
if (pi && pi->node)
pi->node->document ()->m_tree_version++;
}
}
-KDE_NO_EXPORT void PlayListView::itemIsSelected (QListViewItem * qitem) {
+KDE_NO_EXPORT void PlayListView::itemIsSelected (TQListViewItem * qitem) {
RootPlayListItem * ri = rootItem (qitem);
setItemsRenameable (ri && (ri->flags & TreeEdit) && ri != qitem);
}
-KDE_NO_EXPORT void PlayListView::rename (QListViewItem * qitem, int c) {
+KDE_NO_EXPORT void PlayListView::rename (TQListViewItem * qitem, int c) {
PlayListItem * item = static_cast <PlayListItem *> (qitem);
if (rootItem (qitem)->show_all_nodes && item && item->m_attr) {
- PlayListItem * pi = static_cast <PlayListItem *> (qitem->parent ());
+ PlayListItem * pi = static_cast <PlayListItem *> (qitem->tqparent ());
if (pi && pi->node && pi->node->isEditable ())
KListView::rename (item, c);
} else if (item && item->node && item->node->isEditable ()) {
@@ -542,7 +542,7 @@ KDE_NO_EXPORT void PlayListView::rename (QListViewItem * qitem, int c) {
}
KDE_NO_EXPORT void PlayListView::editCurrent () {
- QListViewItem * qitem = selectedItem ();
+ TQListViewItem * qitem = selectedItem ();
if (qitem) {
RootPlayListItem * ri = rootItem (qitem);
if (ri && (ri->flags & TreeEdit) && ri != qitem)
@@ -553,24 +553,24 @@ KDE_NO_EXPORT void PlayListView::editCurrent () {
KDE_NO_EXPORT void PlayListView::slotFind () {
m_current_find_elm = 0L;
if (!m_find_dialog) {
- m_find_dialog = new KFindDialog (false, this, "kde_kmplayer_find", KFindDialog::CaseSensitive);
+ m_find_dialog = new KFindDialog (false, this, "kde_kmplayer_tqfind", KFindDialog::CaseSensitive);
m_find_dialog->setHasSelection (false);
- connect(m_find_dialog, SIGNAL(okClicked ()), this, SLOT(slotFindOk ()));
+ connect(m_find_dialog, TQT_SIGNAL(okClicked ()), this, TQT_SLOT(slotFindOk ()));
} else
- m_find_dialog->setPattern (QString ());
+ m_find_dialog->setPattern (TQString ());
m_find_dialog->show ();
}
-static QListViewItem * findNodeInTree (NodePtr n, QListViewItem * item) {
+static TQListViewItem * findNodeInTree (NodePtr n, TQListViewItem * item) {
//kdDebug () << "item:" << item->text (0) << " n:" << (n ? n->nodeName () : "null" ) <<endl;
PlayListItem * pi = static_cast <PlayListItem *> (item);
if (!n || !pi->node)
return 0L;
if (n == pi->node)
return item;
- for (QListViewItem * ci = item->firstChild(); ci; ci = ci->nextSibling ()) {
+ for (TQListViewItem * ci = item->firstChild(); ci; ci = ci->nextSibling ()) {
//kdDebug () << "ci:" << ci->text (0) << " n:" << n->nodeName () <<endl;
- QListViewItem * vi = findNodeInTree (n, ci);
+ TQListViewItem * vi = findNodeInTree (n, ci);
if (vi)
return vi;
}
@@ -590,7 +590,7 @@ KDE_NO_EXPORT void PlayListView::slotFindOk () {
m_current_find_elm = lvi->node;
current_find_tree_id = rootItem (lvi)->id;
} else if (lvi && lvi->m_attr) {
- PlayListItem*pi=static_cast<PlayListItem*>(currentItem()->parent());
+ PlayListItem*pi=static_cast<PlayListItem*>(currentItem()->tqparent());
if (pi) {
m_current_find_attr = lvi->m_attr;
m_current_find_elm = pi->node;
@@ -607,17 +607,17 @@ KDE_NO_EXPORT void PlayListView::slotFindOk () {
slotFindNext ();
}
-/* A bit tricky, but between the find's PlayListItems might be gone, so
+/* A bit tricky, but between the tqfind's PlayListItems might be gone, so
* try to match on the generated tree following the source's document tree
*/
KDE_NO_EXPORT void PlayListView::slotFindNext () {
if (!m_find_dialog)
return;
- QString str = m_find_dialog->pattern();
+ TQString str = m_find_dialog->pattern();
if (!m_current_find_elm || str.isEmpty ())
return;
long opt = m_find_dialog->options ();
- QRegExp regexp;
+ TQRegExp regexp;
if (opt & KFindDialog::RegularExpression)
regexp = str;
bool cs = (opt & KFindDialog::CaseSensitive);
@@ -627,7 +627,7 @@ KDE_NO_EXPORT void PlayListView::slotFindNext () {
while (!found && n) {
if (ri->show_all_nodes || n->expose ()) {
bool elm = n->isElementNode ();
- QString val = n->nodeName ();
+ TQString val = n->nodeName ();
if (elm && !ri->show_all_nodes) {
Mrl * mrl = n->mrl ();
if (mrl) {
@@ -640,19 +640,19 @@ KDE_NO_EXPORT void PlayListView::slotFindNext () {
} else if (!elm)
val = n->nodeValue ();
if (((opt & KFindDialog::RegularExpression) &&
- val.find (regexp, 0) > -1) ||
+ val.tqfind (regexp, 0) > -1) ||
(!(opt & KFindDialog::RegularExpression) &&
- val.find (str, 0, cs) > -1)) {
+ val.tqfind (str, 0, cs) > -1)) {
node = n;
m_current_find_attr = 0L;
found = true;
} else if (elm && ri->show_all_nodes) {
for (AttributePtr a = convertNode <Element> (n)->attributes ()->first (); a; a = a->nextSibling ()) {
- QString attr = a->name ().toString ();
+ TQString attr = a->name ().toString ();
if (((opt & KFindDialog::RegularExpression) &&
- (attr.find (regexp, 0) || a->value ().find (regexp, 0) > -1)) ||
+ (attr.tqfind (regexp, 0) || a->value ().tqfind (regexp, 0) > -1)) ||
(!(opt & KFindDialog::RegularExpression) &&
- (attr.find (str, 0, cs) > -1 || a->value ().find (str, 0, cs) > -1))) {
+ (attr.tqfind (str, 0, cs) > -1 || a->value ().tqfind (str, 0, cs) > -1))) {
node = n;
m_current_find_attr = a;
found = true;
@@ -668,7 +668,7 @@ KDE_NO_EXPORT void PlayListView::slotFindNext () {
} else if (n->previousSibling ()) {
n = n->previousSibling ();
} else {
- for (n = n->parentNode (); n; n = n->parentNode ())
+ for (n = n->tqparentNode (); n; n = n->tqparentNode ())
if (n->previousSibling ()) {
n = n->previousSibling ();
break;
@@ -685,7 +685,7 @@ KDE_NO_EXPORT void PlayListView::slotFindNext () {
} else if (n->nextSibling ()) {
n = n->nextSibling ();
} else {
- for (n = n->parentNode (); n; n = n->parentNode ())
+ for (n = n->tqparentNode (); n; n = n->tqparentNode ())
if (n->nextSibling ()) {
n = n->nextSibling ();
break;
@@ -703,7 +703,7 @@ KDE_NO_EXPORT void PlayListView::slotFindNext () {
m_current_find_elm = n;
kdDebug () << " search for " << str << "=" << (node ? node->nodeName () : "not found") << " next:" << (n ? n->nodeName () : " not found") << endl;
if (found) {
- QListViewItem * fc = findNodeInTree (node, ri);
+ TQListViewItem * fc = findNodeInTree (node, ri);
if (!fc) {
m_current_find_elm = 0L;
kdDebug () << "node not found in tree tree:" << ri->id << endl;