Skip to content

Commit

Permalink
Fixing some memory leaks.
Browse files Browse the repository at this point in the history
  • Loading branch information
eartle committed Mar 21, 2013
1 parent 66c967f commit 778ab65
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 40 deletions.
15 changes: 5 additions & 10 deletions app/client/Services/ScrobbleService/ScrobbleService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,16 +232,11 @@ ScrobbleService::setConnection(PlayerConnection*c)
}

//
connect(c, SIGNAL(trackStarted(Track, Track)), SLOT(onTrackStarted(Track, Track)));
connect(c, SIGNAL(paused()), SLOT(onPaused()));
connect(c, SIGNAL(resumed()), SLOT(onResumed()));
connect(c, SIGNAL(stopped()), SLOT(onStopped()));

//connect(c, SIGNAL(trackStarted(Track, Track)), SIGNAL(trackStarted(Track, Track)));
connect(c, SIGNAL(resumed()), SIGNAL(resumed()));
connect(c, SIGNAL(paused()), SIGNAL(paused()));
connect(c, SIGNAL(stopped()), SIGNAL(stopped()));
connect(c, SIGNAL(bootstrapReady(QString)), SIGNAL( bootstrapReady(QString)));
connect(c, SIGNAL(trackStarted(Track, Track)), SLOT(onTrackStarted(Track, Track)), Qt::QueuedConnection);
connect(c, SIGNAL(paused()), SLOT(onPaused()), Qt::QueuedConnection);
connect(c, SIGNAL(resumed()), SLOT(onResumed()), Qt::QueuedConnection);
connect(c, SIGNAL(stopped()), SLOT(onStopped()), Qt::QueuedConnection);
connect(c, SIGNAL(bootstrapReady(QString)), SIGNAL( bootstrapReady(QString)), Qt::QueuedConnection);

m_connection = c;

Expand Down
5 changes: 5 additions & 0 deletions app/client/Widgets/BioWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ BioWidget::BioWidget( QWidget* p )
qDebug() << fontInfo().pixelSize();
}

BioWidget::~BioWidget()
{
delete m_widgetTextObject;
}

void
BioWidget::setBioText( const QString& bioText )
{
Expand Down
2 changes: 2 additions & 0 deletions app/client/Widgets/BioWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class BioWidget : public QTextBrowser
Q_OBJECT
public:
BioWidget( QWidget* parent );
~BioWidget();

bool eventFilter( QObject* o, QEvent* e );

void setBioText( const QString& bioText );
Expand Down
55 changes: 28 additions & 27 deletions app/client/Widgets/MetadataWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,34 @@
You should have received a copy of the GNU General Public License
along with lastfm-desktop. If not, see <http://www.gnu.org/licenses/>.
*/


#include "MetadataWidget.h"
#include "ui_MetadataWidget.h"

#include "../Application.h"
#include "../Services/ScrobbleService.h"
#include "../Services/RadioService.h"
#include "../Services/AnalyticsService.h"
#include "ScrobbleControls.h"
#include "BioWidget.h"
#include "TagWidget.h"

#include "lib/unicorn/widgets/HttpImageWidget.h"
#include "lib/unicorn/widgets/DataBox.h"
#include "lib/unicorn/widgets/DataListWidget.h"
#include "lib/unicorn/widgets/BannerWidget.h"
#include "lib/unicorn/widgets/LfmListViewWidget.h"
#include "lib/unicorn/widgets/Label.h"
#include "lib/unicorn/layouts/FlowLayout.h"
#include "lib/unicorn/DesktopServices.h"

#include <lastfm/XmlQuery.h>
#include <lastfm/ws.h>
#include <lastfm/User.h>
#include <lastfm/Track.h>
#include <lastfm/Artist.h>

#include <QDebug>
#include <QVBoxLayout>
#include <QGridLayout>
Expand All @@ -33,35 +61,8 @@
#include <QTextFrame>
#include <QScrollBar>
#include <QMenu>
#include <QDebug>
#include <QMovie>

#include <lastfm/XmlQuery.h>
#include <lastfm/ws.h>
#include <lastfm/User.h>
#include <lastfm/Track.h>
#include <lastfm/Artist.h>

#include "lib/unicorn/widgets/HttpImageWidget.h"
#include "lib/unicorn/widgets/DataBox.h"
#include "lib/unicorn/widgets/DataListWidget.h"
#include "lib/unicorn/widgets/BannerWidget.h"
#include "lib/unicorn/widgets/LfmListViewWidget.h"
#include "lib/unicorn/widgets/Label.h"
#include "lib/unicorn/layouts/FlowLayout.h"
#include "lib/unicorn/DesktopServices.h"

#include "../Application.h"
#include "../Services/ScrobbleService.h"
#include "../Services/RadioService.h"
#include "../Services/AnalyticsService.h"
#include "ScrobbleControls.h"
#include "BioWidget.h"
#include "TagWidget.h"

#include "MetadataWidget.h"
#include "ui_MetadataWidget.h"

using unicorn::Label;

MetadataWidget::MetadataWidget( const Track& track, QWidget* p )
Expand Down
6 changes: 3 additions & 3 deletions lib/unicorn/UnicornApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,17 +230,17 @@ unicorn::Application::translate()
#endif

//TODO need a unicorn/core/etc. translation, plus policy of no translations elsewhere or something!
QTranslator* t1 = new QTranslator;
QTranslator* t1 = new QTranslator( this );
t1->load( d.filePath( "lastfm_" + qmExt ) );

QTranslator* t2 = new QTranslator;
QTranslator* t2 = new QTranslator( this );
t2->load( d.filePath( "qt_" + qmExt ) );

installTranslator( t1 );
installTranslator( t2 );

#ifdef Q_OS_WIN
QTranslator* t3 = new QTranslator;
QTranslator* t3 = new QTranslator( this );
t3->load( d.filePath( "qtsparkle/" + qmExt ) );
installTranslator( t3 );
#endif
Expand Down

0 comments on commit 778ab65

Please sign in to comment.