From 9f1ec0ce935d6031ecd3b8e0dee523fa6928cfcb Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Thu, 17 Nov 2011 13:26:50 -0500 Subject: [PATCH] More cleanup, more actioncollectionifying, and fix a few signals --- src/libtomahawk/actioncollection.cpp | 5 ++++ src/libtomahawk/audio/audioengine.cpp | 8 +++++- src/libtomahawk/audio/audioengine.h | 2 ++ src/libtomahawk/contextmenu.h | 4 +-- .../dynamic/widgets/CollapsibleControls.cpp | 15 +++++------ .../dynamic/widgets/CollapsibleControls.h | 2 +- src/libtomahawk/widgets/imagebutton.cpp | 13 +++++----- src/libtomahawk/widgets/imagebutton.h | 6 ++--- src/sourcetree/sourcedelegate.cpp | 6 ++--- src/sourcetree/sourcedelegate.h | 4 +-- src/sourcetree/sourcetreeview.cpp | 3 +-- src/tomahawkapp.cpp | 26 ++++++++++--------- src/tomahawkapp.h | 10 +++---- src/tomahawktrayicon.cpp | 24 +++++++---------- src/tomahawktrayicon.h | 12 +++------ 15 files changed, 70 insertions(+), 70 deletions(-) diff --git a/src/libtomahawk/actioncollection.cpp b/src/libtomahawk/actioncollection.cpp index b2d9bbba4..2d252eacc 100644 --- a/src/libtomahawk/actioncollection.cpp +++ b/src/libtomahawk/actioncollection.cpp @@ -54,6 +54,11 @@ ActionCollection::initActions() m_actionCollection[ "loadPlaylist"] = new QAction( tr( "&Load Playlist" ), this ); m_actionCollection[ "renamePlaylist"] = new QAction( tr( "&Rename Playlist" ), this ); m_actionCollection[ "copyPlaylist"] = new QAction( tr( "&Copy Playlist Link" ), this ); + m_actionCollection[ "playPause"] = new QAction( tr( "&Play" ), this ); + m_actionCollection[ "stop"] = new QAction( tr( "&Stop" ), this ); + m_actionCollection[ "previousTrack"] = new QAction( tr( "&Previous Track" ), this ); + m_actionCollection[ "nextTrack"] = new QAction( tr( "&Next Track" ), this ); + m_actionCollection[ "quit"] = new QAction( tr( "&Quit" ), this ); } diff --git a/src/libtomahawk/audio/audioengine.cpp b/src/libtomahawk/audio/audioengine.cpp index 25da732b2..097a89c40 100644 --- a/src/libtomahawk/audio/audioengine.cpp +++ b/src/libtomahawk/audio/audioengine.cpp @@ -79,7 +79,12 @@ AudioEngine::AudioEngine() #ifndef TOMAHAWK_HEADLESS tDebug() << Q_FUNC_INFO << "Connecting privacy toggle"; - connect( ActionCollection::instance()->getAction( "togglePrivacy" ), SIGNAL( triggered( bool ) ), this, SLOT( togglePrivateListeningMode() ) ); + ActionCollection *ac = ActionCollection::instance(); + connect( ac->getAction( "togglePrivacy" ), SIGNAL( triggered() ), SLOT( togglePrivateListeningMode() ), Qt::UniqueConnection ); + connect( ac->getAction( "playPause" ), SIGNAL( triggered() ), SLOT( playPause() ), Qt::UniqueConnection ); + connect( ac->getAction( "stop" ), SIGNAL( triggered() ), SLOT( stop() ), Qt::UniqueConnection ); + connect( ac->getAction( "previousTrack" ), SIGNAL( triggered() ), SLOT( previous() ), Qt::UniqueConnection ); + connect( ac->getAction( "nextTrack" ), SIGNAL( triggered() ), SLOT( next() ), Qt::UniqueConnection ); #endif onVolumeChanged( m_audioOutput->volume() ); @@ -416,6 +421,7 @@ AudioEngine::togglePrivateListeningMode() privacyToggle->setText( tr( QString( isPublic ? "&Listen Privately" : "&Listen Publicly" ).toAscii().constData() ) ); privacyToggle->setIconVisibleInMenu( isPublic ); #endif + emit privacyModeChanged(); } diff --git a/src/libtomahawk/audio/audioengine.h b/src/libtomahawk/audio/audioengine.h index 0638270d3..be8beb43e 100644 --- a/src/libtomahawk/audio/audioengine.h +++ b/src/libtomahawk/audio/audioengine.h @@ -125,6 +125,8 @@ signals: void error( AudioErrorCode errorCode ); + void privacyModeChanged(); + private slots: bool loadTrack( const Tomahawk::result_ptr& result ); void loadPreviousTrack(); diff --git a/src/libtomahawk/contextmenu.h b/src/libtomahawk/contextmenu.h index a610de4d5..56f0406d7 100644 --- a/src/libtomahawk/contextmenu.h +++ b/src/libtomahawk/contextmenu.h @@ -19,8 +19,8 @@ #ifndef CONTEXTMENU_H #define CONTEXTMENU_H -#include -#include +#include +#include #include "typedefs.h" #include "dllmacro.h" diff --git a/src/libtomahawk/playlist/dynamic/widgets/CollapsibleControls.cpp b/src/libtomahawk/playlist/dynamic/widgets/CollapsibleControls.cpp index 042a46f3b..b0a3f9d2c 100644 --- a/src/libtomahawk/playlist/dynamic/widgets/CollapsibleControls.cpp +++ b/src/libtomahawk/playlist/dynamic/widgets/CollapsibleControls.cpp @@ -25,14 +25,13 @@ #include "utils/tomahawkutils.h" #include "widgets/elidedlabel.h" -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include "utils/logger.h" diff --git a/src/libtomahawk/playlist/dynamic/widgets/CollapsibleControls.h b/src/libtomahawk/playlist/dynamic/widgets/CollapsibleControls.h index e2c640121..860557817 100644 --- a/src/libtomahawk/playlist/dynamic/widgets/CollapsibleControls.h +++ b/src/libtomahawk/playlist/dynamic/widgets/CollapsibleControls.h @@ -21,7 +21,7 @@ #include "typedefs.h" -#include +#include class QPaintEvent; class QHBoxLayout; diff --git a/src/libtomahawk/widgets/imagebutton.cpp b/src/libtomahawk/widgets/imagebutton.cpp index d921db24a..eb1cee693 100644 --- a/src/libtomahawk/widgets/imagebutton.cpp +++ b/src/libtomahawk/widgets/imagebutton.cpp @@ -18,13 +18,12 @@ #include "imagebutton.h" -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include "utils/logger.h" diff --git a/src/libtomahawk/widgets/imagebutton.h b/src/libtomahawk/widgets/imagebutton.h index d3b060ab4..8b519fb99 100644 --- a/src/libtomahawk/widgets/imagebutton.h +++ b/src/libtomahawk/widgets/imagebutton.h @@ -19,9 +19,9 @@ #ifndef IMAGE_BUTTON_H #define IMAGE_BUTTON_H -#include -#include -#include +#include +#include +#include #include "dllmacro.h" diff --git a/src/sourcetree/sourcedelegate.cpp b/src/sourcetree/sourcedelegate.cpp index 5f059aebd..5e77cf209 100644 --- a/src/sourcetree/sourcedelegate.cpp +++ b/src/sourcetree/sourcedelegate.cpp @@ -31,9 +31,9 @@ #include "source.h" #include "tomahawksettings.h" -#include -#include -#include +#include +#include +#include #include