Everyone loves scoped_ptr.
This commit is contained in:
parent
864215cb23
commit
54a5bd2c8e
|
@ -34,7 +34,6 @@ const char* LastFMService::kSecret = "d3072b60ae626be12be69448f5c46e70";
|
||||||
LastFMService::LastFMService(QObject* parent)
|
LastFMService::LastFMService(QObject* parent)
|
||||||
: RadioService(kServiceName, parent),
|
: RadioService(kServiceName, parent),
|
||||||
scrobbler_(NULL),
|
scrobbler_(NULL),
|
||||||
config_(NULL),
|
|
||||||
station_dialog_(new LastFMStationDialog),
|
station_dialog_(new LastFMStationDialog),
|
||||||
context_menu_(new QMenu),
|
context_menu_(new QMenu),
|
||||||
initial_tune_(false),
|
initial_tune_(false),
|
||||||
|
@ -64,9 +63,6 @@ LastFMService::LastFMService(QObject* parent)
|
||||||
}
|
}
|
||||||
|
|
||||||
LastFMService::~LastFMService() {
|
LastFMService::~LastFMService() {
|
||||||
delete config_;
|
|
||||||
delete station_dialog_;
|
|
||||||
delete context_menu_;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LastFMService::ReloadSettings() {
|
void LastFMService::ReloadSettings() {
|
||||||
|
@ -81,7 +77,7 @@ void LastFMService::ReloadSettings() {
|
||||||
|
|
||||||
void LastFMService::ShowConfig() {
|
void LastFMService::ShowConfig() {
|
||||||
if (!config_) {
|
if (!config_) {
|
||||||
config_ = new LastFMConfigDialog;
|
config_.reset(new LastFMConfigDialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
config_->show();
|
config_->show();
|
||||||
|
|
|
@ -14,16 +14,17 @@ uint qHash(const lastfm::Track& track);
|
||||||
|
|
||||||
#include "radioservice.h"
|
#include "radioservice.h"
|
||||||
#include "song.h"
|
#include "song.h"
|
||||||
|
#include "lastfmconfigdialog.h"
|
||||||
#include "lastfmstationdialog.h"
|
#include "lastfmstationdialog.h"
|
||||||
|
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
|
#include <QMenu>
|
||||||
#include <QNetworkAccessManager>
|
#include <QNetworkAccessManager>
|
||||||
#include <QQueue>
|
#include <QQueue>
|
||||||
|
|
||||||
class QMenu;
|
#include <boost/scoped_ptr.hpp>
|
||||||
class QAction;
|
|
||||||
|
|
||||||
class LastFMConfigDialog;
|
class QAction;
|
||||||
|
|
||||||
class LastFMService : public RadioService {
|
class LastFMService : public RadioService {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@ -135,10 +136,10 @@ class LastFMService : public RadioService {
|
||||||
lastfm::Track next_metadata_;
|
lastfm::Track next_metadata_;
|
||||||
QQueue<lastfm::Track> playlist_;
|
QQueue<lastfm::Track> playlist_;
|
||||||
|
|
||||||
LastFMConfigDialog* config_;
|
boost::scoped_ptr<LastFMConfigDialog> config_;
|
||||||
LastFMStationDialog* station_dialog_;
|
boost::scoped_ptr<LastFMStationDialog> station_dialog_;
|
||||||
|
|
||||||
QMenu* context_menu_;
|
boost::scoped_ptr<QMenu> context_menu_;
|
||||||
QAction* play_action_;
|
QAction* play_action_;
|
||||||
QAction* remove_action_;
|
QAction* remove_action_;
|
||||||
QAction* add_artist_action_;
|
QAction* add_artist_action_;
|
||||||
|
|
Loading…
Reference in New Issue