Commit 95f54941 authored by Scott Wheeler's avatar Scott Wheeler

Another patch based on Lars's work. Translate the coordinates properly and

do some other small cleanups while I was in there.

CCMAIL:hel@admin.de

svn path=/trunk/kdemultimedia/juk/; revision=239762
parent 938a8c39
......@@ -605,15 +605,12 @@ bool Playlist::eventFilter(QObject* watched, QEvent* e)
void Playlist::contentsDropEvent(QDropEvent *e)
{
QListViewItem *moveAfter = itemAt(e->pos());
if(!moveAfter)
moveAfter = lastItem();
// This is slightly more efficient since it doesn't have to cast everything
// to PlaylistItem.
if(e->source() == this) {
QListViewItem *moveAfter = itemAt(contentsToViewport(e->pos()));
if(!moveAfter)
moveAfter = lastItem();
// Since we're trying to arrange things manually, turn off sorting.
setSorting(columns() + 1);
......@@ -621,8 +618,8 @@ void Playlist::contentsDropEvent(QDropEvent *e)
QPtrList<QListViewItem> items = KListView::selectedItems();
for(QPtrListIterator<QListViewItem> it(items); it.current(); ++it) {
(*it)->moveItem(moveAfter);
moveAfter = *it;
it.current()->moveItem(moveAfter);
moveAfter = it.current();
}
}
else
......@@ -635,7 +632,8 @@ void Playlist::showEvent(QShowEvent *e)
KListView::showEvent(e);
}
PlaylistItem *Playlist::createItem(const QFileInfo &file, const QString &absFilePath, QListViewItem *after, bool emitChanged)
PlaylistItem *Playlist::createItem(const QFileInfo &file, const QString &absFilePath,
QListViewItem *after, bool emitChanged)
{
QString filePath;
......@@ -651,7 +649,8 @@ PlaylistItem *Playlist::createItem(const QFileInfo &file, const QString &absFile
// If a valid tag was not created, destroy the CollectionListItem.
if(!item->isValid()) {
kdError() << "Playlist::createItem() -- A valid tag was not created for \"" << file.filePath() << "\"" << endl;
kdError() << "Playlist::createItem() -- A valid tag was not created for \""
<< file.filePath() << "\"" << endl;
delete item;
return 0;
}
......
......@@ -330,7 +330,7 @@ void PlaylistBox::decode(QMimeSource *s, Item *item)
void PlaylistBox::contentsDropEvent(QDropEvent *e)
{
Item *i = static_cast<Item *>(itemAt(e->pos()));
Item *i = static_cast<Item *>(itemAt(contentsToViewport(e->pos())));
decode(e, i);
}
......
......@@ -119,7 +119,9 @@ PlaylistSearch::Component::Component() :
}
PlaylistSearch::Component::Component(const QString &query, bool caseSensitive, const ColumnList &columns) :
PlaylistSearch::Component::Component(const QString &query,
bool caseSensitive,
const ColumnList &columns) :
m_query(query),
m_columns(columns),
m_searchAllVisible(columns.isEmpty()),
......
......@@ -72,7 +72,6 @@ private:
class PlaylistSearch::Component
{
public:
/**
* Create an empty search component. This is only provided for use by
* QValueList and should not be used in any other context.
......@@ -82,7 +81,9 @@ public:
/**
* Create a query component. This defaults to searching all visible coulumns.
*/
Component(const QString &query, bool caseSensitive = false, const ColumnList &columns = ColumnList());
Component(const QString &query,
bool caseSensitive = false,
const ColumnList &columns = ColumnList());
/**
* Create a query component. This defaults to searching all visible coulumns.
......
......@@ -642,7 +642,7 @@ QString PlaylistSplitter::play(PlaylistItem *item)
Playlist *p = static_cast<Playlist *>(item->listView());
if (!p)
if(!p)
return QString::null;
p->setPlaying(item, true);
......
......@@ -3,7 +3,7 @@
-------------------
begin : Sun Mar 6 2003
copyright : (C) 2003 by Scott Wheeler
(C) 2003 by Richard Lärkäng <nouseforaname@home.se>
(C) 2003 by Richard Lrkng <nouseforaname@home.se>
***************************************************************************/
/***************************************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment