Commit b0fb0924 authored by Scott Wheeler's avatar Scott Wheeler

Make it possible to read and set the search text via DCOP.

svn path=/trunk/kdemultimedia/juk/; revision=358781
parent 494d30f2
......@@ -69,4 +69,15 @@ protected:
PlayerIface() : DCOPObject("Player") {}
};
class SearchIface : public DCOPObject
{
K_DCOP
k_dcop:
virtual QString searchText() const = 0;
virtual void setSearchText(const QString &text) = 0;
protected:
SearchIface() : DCOPObject("Search") {}
};
#endif
......@@ -198,6 +198,16 @@ void SearchWidget::setSearch(const PlaylistSearch &search)
m_searchLine->setSearchComponent(*components.begin());
}
QString SearchWidget::searchText() const
{
return m_searchLine->searchComponent().query();
}
void SearchWidget::setSearchText(const QString &text)
{
m_searchLine->setSearchComponent(PlaylistSearch::Component(text));
}
PlaylistSearch SearchWidget::search(const PlaylistList &playlists) const
{
PlaylistSearch::ComponentList components;
......@@ -205,6 +215,8 @@ PlaylistSearch SearchWidget::search(const PlaylistList &playlists) const
return PlaylistSearch(playlists, components);
}
////////////////////////////////////////////////////////////////////////////////
// SearchWidget public slots
////////////////////////////////////////////////////////////////////////////////
......
......@@ -24,6 +24,7 @@
#include <qhbox.h>
#include "playlistsearch.h"
#include "jukIface.h"
class QCheckBox;
......@@ -64,7 +65,7 @@ private:
QValueList<int> m_columnList;
};
class SearchWidget : public KToolBar
class SearchWidget : public KToolBar, public SearchIface
{
Q_OBJECT
......@@ -75,6 +76,9 @@ public:
PlaylistSearch search(const PlaylistList &playlists) const;
void setSearch(const PlaylistSearch &search);
virtual QString searchText() const;
virtual void setSearchText(const QString &text);
public slots:
void clear();
void setEnabled(bool enable);
......
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