From 6af763a9542606c457362d673a947326b43b8f25 Mon Sep 17 00:00:00 2001 From: Thomas Frauendorfer Date: Sun, 17 Feb 2008 08:12:30 +0100 Subject: [PATCH] Whitespace cleanups and replaceing a functon from XMMSHandler by one in xplayback --- lib/xcollection.cpp | 11 +++++++++++ lib/xcollection.h | 6 +++++- lib/xplayback.cpp | 5 +++-- lib/xplayback.h | 16 ++++++++-------- src/Display.cpp | 3 ++- src/XMMSHandler.cpp | 5 ----- src/XMMSHandler.h | 1 - src/playlist/playlistwidget.cpp | 5 ++++- 8 files changed, 33 insertions(+), 19 deletions(-) diff --git a/lib/xcollection.cpp b/lib/xcollection.cpp index edb0805..00b6b76 100644 --- a/lib/xcollection.cpp +++ b/lib/xcollection.cpp @@ -214,3 +214,14 @@ XCollection::playlistAddUrl (QUrl url, QString plsname) return true; } + +bool +XCollection::playlistClear (QString name) +{ + if (name == "") { + name = d->m_activePlaylist; + } + m_client->playlist ()->clear (XClient::qToStd (name)); + + return true; +} diff --git a/lib/xcollection.h b/lib/xcollection.h index e610d82..4284a7a 100644 --- a/lib/xcollection.h +++ b/lib/xcollection.h @@ -34,10 +34,14 @@ class XCollection : public QObject bool remove (QString name, QString ns); // idlist specific - bool setActivePlaylist (QString name); QString activePlaylist (); + + public slots: + // idlist spesific + bool setActivePlaylist (QString name); bool addIdlist (QString name); bool playlistAddUrl (QUrl url, QString plsname = ""); + bool playlistClear (QString name = ""); signals: void collectionModified (QString collection, QString ns, int type, diff --git a/lib/xplayback.cpp b/lib/xplayback.cpp index 719be10..8febc94 100644 --- a/lib/xplayback.cpp +++ b/lib/xplayback.cpp @@ -69,7 +69,9 @@ XPlayback::next () m_client->playback ()->tickle (); } - +/* + * Seeking + */ void XPlayback::seekMs (uint milliseconds) { @@ -85,4 +87,3 @@ XPlayback::seekMsRel (int milliseconds) m_client->playback ()->seekMsRel (milliseconds); } - diff --git a/lib/xplayback.h b/lib/xplayback.h index 605c8cb..4ddf999 100644 --- a/lib/xplayback.h +++ b/lib/xplayback.h @@ -30,17 +30,17 @@ class XPlayback : public QObject { Q_OBJECT public: - XPlayback (XClient *); + XPlayback (XClient *); public slots: - void play (); - void pause (); - void stop (); - void prev (); - void next (); + void play (); + void pause (); + void stop (); + void prev (); + void next (); - void seekMs (uint milliseconds); - void seekMsRel (int milliseconds); + void seekMs (uint milliseconds); + void seekMsRel (int milliseconds); private: XClient *m_client; diff --git a/src/Display.cpp b/src/Display.cpp index 8f154eb..3869496 100644 --- a/src/Display.cpp +++ b/src/Display.cpp @@ -14,6 +14,7 @@ */ #include "XMMSHandler.h" +#include "xcollection.h" #include "mainwindow.h" #include "Display.h" @@ -88,7 +89,7 @@ SkinDisplay::fileOpen (void) XMMSHandler &xmmsh = XMMSHandler::getInstance(); if (files.count() > 0) { - xmmsh.playlistClear (); + xmmsh.xcollection ()->playlistClear (); } for (int i = 0; i < files.count(); i++) { diff --git a/src/XMMSHandler.cpp b/src/XMMSHandler.cpp index 55b1e7f..9deb027 100644 --- a/src/XMMSHandler.cpp +++ b/src/XMMSHandler.cpp @@ -273,8 +273,3 @@ XMMSHandler::volume_get (const Xmms::Dict &levels) } - -void XMMSHandler::playlistClear () -{ - m_client->playlist.clear () (); -} diff --git a/src/XMMSHandler.h b/src/XMMSHandler.h index 45efe56..5406b4d 100644 --- a/src/XMMSHandler.h +++ b/src/XMMSHandler.h @@ -67,7 +67,6 @@ class XMMSHandler : public XClient { PlaylistModel *getPlaylistModel () {return m_playlist_model; } public slots: - void playlistClear (); void volumeSet (uint volume); signals: diff --git a/src/playlist/playlistwidget.cpp b/src/playlist/playlistwidget.cpp index 42d1298..fb79fe3 100644 --- a/src/playlist/playlistwidget.cpp +++ b/src/playlist/playlistwidget.cpp @@ -21,7 +21,9 @@ #include "playlistwindow.h" #include "playlistwidget.h" #include "playlistview.h" + #include "playlistmodel.h" +#include "xcollection.h" #include "playlistshade.h" #include "playlistmenu.h" @@ -240,7 +242,8 @@ PlaylistWidget::addButtons (void) b = new PlaylistMenuButton (m_del, Skin::PLS_DEL_ALL_0, Skin::PLS_DEL_ALL_1); connect (b, SIGNAL (activated ()), - &XMMSHandler::getInstance(), SLOT (playlistClear ())); + XMMSHandler::getInstance().xcollection (), + SLOT (playlistClear ())); b = new PlaylistMenuButton (m_del, Skin::PLS_DEL_CRP_0, Skin::PLS_DEL_CRP_1); connect (b, SIGNAL (activated ()),