1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-10-04 17:41:42 +02:00

qt5: don't use QWeakPointer to track QObject* anymore

This commit is contained in:
Dominik Schmidt
2013-01-05 00:55:53 +01:00
parent c98803b531
commit 17a9ec4e20
105 changed files with 282 additions and 270 deletions

View File

@@ -95,7 +95,7 @@ private:
Ui::AudioControls* ui; Ui::AudioControls* ui;
QWeakPointer<SocialWidget> m_socialWidget; QPointer<SocialWidget> m_socialWidget;
Tomahawk::result_ptr m_currentTrack; Tomahawk::result_ptr m_currentTrack;
Tomahawk::PlaylistModes::RepeatMode m_repeatMode; Tomahawk::PlaylistModes::RepeatMode m_repeatMode;

View File

@@ -423,7 +423,7 @@ SettingsDialog::openAccountFactoryConfig( AccountFactory* factory )
#ifndef Q_OS_MAC #ifndef Q_OS_MAC
AccountFactoryWrapper dialog( factory, 0 ); AccountFactoryWrapper dialog( factory, 0 );
QWeakPointer< AccountFactoryWrapper > watcher( &dialog ); QPointer< AccountFactoryWrapper > watcher( &dialog );
dialog.exec(); dialog.exec();
#else #else

View File

@@ -185,18 +185,18 @@ TomahawkApp::init()
// Cause the creation of the nam, but don't need to address it directly, so prevent warning // Cause the creation of the nam, but don't need to address it directly, so prevent warning
Q_UNUSED( TomahawkUtils::nam() ); Q_UNUSED( TomahawkUtils::nam() );
m_audioEngine = QWeakPointer<AudioEngine>( new AudioEngine ); m_audioEngine = QPointer<AudioEngine>( new AudioEngine );
// init pipeline and resolver factories // init pipeline and resolver factories
new Pipeline(); new Pipeline();
m_servent = QWeakPointer<Servent>( new Servent( this ) ); m_servent = QPointer<Servent>( new Servent( this ) );
connect( m_servent.data(), SIGNAL( ready() ), SLOT( initSIP() ) ); connect( m_servent.data(), SIGNAL( ready() ), SLOT( initSIP() ) );
tDebug() << "Init Database."; tDebug() << "Init Database.";
initDatabase(); initDatabase();
m_scanManager = QWeakPointer<ScanManager>( new ScanManager( this ) ); m_scanManager = QPointer<ScanManager>( new ScanManager( this ) );
#ifndef ENABLE_HEADLESS #ifndef ENABLE_HEADLESS
Pipeline::instance()->addExternalResolverFactory( boost::bind( &QtScriptResolver::factory, _1 ) ); Pipeline::instance()->addExternalResolverFactory( boost::bind( &QtScriptResolver::factory, _1 ) );
@@ -221,7 +221,7 @@ TomahawkApp::init()
// Register shortcut handler for this platform // Register shortcut handler for this platform
#ifdef Q_WS_MAC #ifdef Q_WS_MAC
m_shortcutHandler = QWeakPointer<Tomahawk::ShortcutHandler>( new MacShortcutHandler( this ) ); m_shortcutHandler = QPointer<Tomahawk::ShortcutHandler>( new MacShortcutHandler( this ) );
Tomahawk::setShortcutHandler( static_cast<MacShortcutHandler*>( m_shortcutHandler.data() ) ); Tomahawk::setShortcutHandler( static_cast<MacShortcutHandler*>( m_shortcutHandler.data() ) );
Tomahawk::setApplicationHandler( this ); Tomahawk::setApplicationHandler( this );
@@ -242,10 +242,10 @@ TomahawkApp::init()
} }
tDebug() << "Init InfoSystem."; tDebug() << "Init InfoSystem.";
m_infoSystem = QWeakPointer<Tomahawk::InfoSystem::InfoSystem>( Tomahawk::InfoSystem::InfoSystem::instance() ); m_infoSystem = QPointer<Tomahawk::InfoSystem::InfoSystem>( Tomahawk::InfoSystem::InfoSystem::instance() );
tDebug() << "Init AccountManager."; tDebug() << "Init AccountManager.";
m_accountManager = QWeakPointer< Tomahawk::Accounts::AccountManager >( new Tomahawk::Accounts::AccountManager( this ) ); m_accountManager = QPointer< Tomahawk::Accounts::AccountManager >( new Tomahawk::Accounts::AccountManager( this ) );
connect( m_accountManager.data(), SIGNAL( ready() ), SLOT( accountManagerReady() ) ); connect( m_accountManager.data(), SIGNAL( ready() ), SLOT( accountManagerReady() ) );
Echonest::Config::instance()->setNetworkAccessManager( TomahawkUtils::nam() ); Echonest::Config::instance()->setNetworkAccessManager( TomahawkUtils::nam() );
@@ -517,7 +517,7 @@ TomahawkApp::initDatabase()
} }
tDebug( LOGEXTRA ) << "Using database:" << dbpath; tDebug( LOGEXTRA ) << "Using database:" << dbpath;
m_database = QWeakPointer<Database>( new Database( dbpath, this ) ); m_database = QPointer<Database>( new Database( dbpath, this ) );
Pipeline::instance()->databaseReady(); Pipeline::instance()->databaseReady();
} }
@@ -541,8 +541,8 @@ TomahawkApp::initHTTP()
return; return;
} }
m_session = QWeakPointer< QxtHttpSessionManager >( new QxtHttpSessionManager() ); m_session = QPointer< QxtHttpSessionManager >( new QxtHttpSessionManager() );
m_connector = QWeakPointer< QxtHttpServerConnector >( new QxtHttpServerConnector ); m_connector = QPointer< QxtHttpServerConnector >( new QxtHttpServerConnector );
if ( m_session.isNull() || m_connector.isNull() ) if ( m_session.isNull() || m_connector.isNull() )
{ {
if ( !m_session.isNull() ) if ( !m_session.isNull() )

View File

@@ -39,6 +39,7 @@
#include <QSettings> #include <QSettings>
#include <QDir> #include <QDir>
#include <QPersistentModelIndex> #include <QPersistentModelIndex>
#include <QPointer>
class AudioEngine; class AudioEngine;
class Database; class Database;
@@ -124,13 +125,13 @@ private:
void initLocalCollection(); void initLocalCollection();
void initPipeline(); void initPipeline();
QWeakPointer<Database> m_database; QPointer<Database> m_database;
QWeakPointer<ScanManager> m_scanManager; QPointer<ScanManager> m_scanManager;
QWeakPointer<AudioEngine> m_audioEngine; QPointer<AudioEngine> m_audioEngine;
QWeakPointer<Servent> m_servent; QPointer<Servent> m_servent;
QWeakPointer<Tomahawk::InfoSystem::InfoSystem> m_infoSystem; QPointer<Tomahawk::InfoSystem::InfoSystem> m_infoSystem;
QWeakPointer<Tomahawk::ShortcutHandler> m_shortcutHandler; QPointer<Tomahawk::ShortcutHandler> m_shortcutHandler;
QWeakPointer< Tomahawk::Accounts::AccountManager > m_accountManager; QPointer< Tomahawk::Accounts::AccountManager > m_accountManager;
bool m_scrubFriendlyName; bool m_scrubFriendlyName;
#ifdef LIBLASTFM_FOUND #ifdef LIBLASTFM_FOUND
@@ -143,8 +144,8 @@ private:
bool m_headless, m_loaded; bool m_headless, m_loaded;
QWeakPointer< QxtHttpServerConnector > m_connector; QPointer< QxtHttpServerConnector > m_connector;
QWeakPointer< QxtHttpSessionManager > m_session; QPointer< QxtHttpSessionManager > m_session;
}; };
Q_DECLARE_METATYPE( PairList ) Q_DECLARE_METATYPE( PairList )

View File

@@ -924,7 +924,7 @@ TomahawkWindow::loadSpiff()
connect( diag, SIGNAL( finished( int ) ), this, SLOT( loadXspfFinished( int ) ) ); connect( diag, SIGNAL( finished( int ) ), this, SLOT( loadXspfFinished( int ) ) );
diag->show(); diag->show();
#else #else
QWeakPointer< LoadXSPFDialog > safe( diag ); QPointer< LoadXSPFDialog > safe( diag );
int ret = diag->exec(); int ret = diag->exec();
if ( !safe.isNull() && ret == QDialog::Accepted ) if ( !safe.isNull() && ret == QDialog::Accepted )

View File

@@ -54,10 +54,10 @@ TwitterAccount::TwitterAccount( const QString &accountId )
qDebug() << "Got cached peers:" << configuration() << configuration()[ "cachedpeers" ]; qDebug() << "Got cached peers:" << configuration() << configuration()[ "cachedpeers" ];
m_configWidget = QWeakPointer< TwitterConfigWidget >( new TwitterConfigWidget( this, 0 ) ); m_configWidget = QPointer< TwitterConfigWidget >( new TwitterConfigWidget( this, 0 ) );
connect( m_configWidget.data(), SIGNAL( twitterAuthed( bool ) ), SLOT( configDialogAuthedSignalSlot( bool ) ) ); connect( m_configWidget.data(), SIGNAL( twitterAuthed( bool ) ), SLOT( configDialogAuthedSignalSlot( bool ) ) );
m_twitterAuth = QWeakPointer< TomahawkOAuthTwitter >( new TomahawkOAuthTwitter( TomahawkUtils::nam(), this ) ); m_twitterAuth = QPointer< TomahawkOAuthTwitter >( new TomahawkOAuthTwitter( TomahawkUtils::nam(), this ) );
m_onlinePixmap = QPixmap( ":/twitter-icon.png" ); m_onlinePixmap = QPixmap( ":/twitter-icon.png" );
m_offlinePixmap = QPixmap( ":/twitter-offline-icon.png" ); m_offlinePixmap = QPixmap( ":/twitter-offline-icon.png" );
@@ -97,7 +97,7 @@ TwitterAccount::sipPlugin()
if ( m_twitterSipPlugin.isNull() ) if ( m_twitterSipPlugin.isNull() )
{ {
qDebug() << "CHECKING:" << configuration() << configuration()[ "cachedpeers" ]; qDebug() << "CHECKING:" << configuration() << configuration()[ "cachedpeers" ];
m_twitterSipPlugin = QWeakPointer< TwitterSipPlugin >( new TwitterSipPlugin( this ) ); m_twitterSipPlugin = QPointer< TwitterSipPlugin >( new TwitterSipPlugin( this ) );
connect( m_twitterSipPlugin.data(), SIGNAL( stateChanged( Tomahawk::Accounts::Account::ConnectionState ) ), this, SIGNAL( connectionStateChanged( Tomahawk::Accounts::Account::ConnectionState ) ) ); connect( m_twitterSipPlugin.data(), SIGNAL( stateChanged( Tomahawk::Accounts::Account::ConnectionState ) ), this, SIGNAL( connectionStateChanged( Tomahawk::Accounts::Account::ConnectionState ) ) );
return m_twitterSipPlugin.data(); return m_twitterSipPlugin.data();
@@ -110,7 +110,7 @@ Tomahawk::InfoSystem::InfoPluginPtr
TwitterAccount::infoPlugin() TwitterAccount::infoPlugin()
{ {
if ( m_twitterInfoPlugin.isNull() ) if ( m_twitterInfoPlugin.isNull() )
m_twitterInfoPlugin = QWeakPointer< Tomahawk::InfoSystem::TwitterInfoPlugin >( new Tomahawk::InfoSystem::TwitterInfoPlugin( this ) ); m_twitterInfoPlugin = QPointer< Tomahawk::InfoSystem::TwitterInfoPlugin >( new Tomahawk::InfoSystem::TwitterInfoPlugin( this ) );
return Tomahawk::InfoSystem::InfoPluginPtr( m_twitterInfoPlugin.data() ); return Tomahawk::InfoSystem::InfoPluginPtr( m_twitterInfoPlugin.data() );
} }
@@ -191,7 +191,7 @@ TwitterAccount::refreshTwitterAuth()
Q_ASSERT( TomahawkUtils::nam() != 0 ); Q_ASSERT( TomahawkUtils::nam() != 0 );
tDebug() << Q_FUNC_INFO << " with nam " << TomahawkUtils::nam(); tDebug() << Q_FUNC_INFO << " with nam " << TomahawkUtils::nam();
m_twitterAuth = QWeakPointer< TomahawkOAuthTwitter >( new TomahawkOAuthTwitter( TomahawkUtils::nam(), this ) ); m_twitterAuth = QPointer< TomahawkOAuthTwitter >( new TomahawkOAuthTwitter( TomahawkUtils::nam(), this ) );
if( m_twitterAuth.isNull() ) if( m_twitterAuth.isNull() )
return false; return false;

View File

@@ -80,7 +80,7 @@ public:
TomahawkOAuthTwitter* twitterAuth() const { return m_twitterAuth.data(); } TomahawkOAuthTwitter* twitterAuth() const { return m_twitterAuth.data(); }
signals: signals:
void nowAuthenticated( const QWeakPointer< TomahawkOAuthTwitter >&, const QTweetUser &user ); void nowAuthenticated( const QPointer< TomahawkOAuthTwitter >&, const QTweetUser &user );
void nowDeauthenticated(); void nowDeauthenticated();
private slots: private slots:
@@ -92,10 +92,10 @@ private:
QIcon m_icon; QIcon m_icon;
bool m_isAuthenticated; bool m_isAuthenticated;
bool m_isAuthenticating; bool m_isAuthenticating;
QWeakPointer< TomahawkOAuthTwitter > m_twitterAuth; QPointer< TomahawkOAuthTwitter > m_twitterAuth;
QWeakPointer< TwitterConfigWidget > m_configWidget; QPointer< TwitterConfigWidget > m_configWidget;
QWeakPointer< TwitterSipPlugin > m_twitterSipPlugin; QPointer< TwitterSipPlugin > m_twitterSipPlugin;
QWeakPointer< Tomahawk::InfoSystem::TwitterInfoPlugin > m_twitterInfoPlugin; QPointer< Tomahawk::InfoSystem::TwitterInfoPlugin > m_twitterInfoPlugin;
// for settings access // for settings access
friend class TwitterConfigWidget; friend class TwitterConfigWidget;

View File

@@ -82,7 +82,7 @@ TwitterInfoPlugin::refreshTwitterAuth()
Q_ASSERT( TomahawkUtils::nam() != 0 ); Q_ASSERT( TomahawkUtils::nam() != 0 );
tDebug() << Q_FUNC_INFO << "with nam" << TomahawkUtils::nam() << this; tDebug() << Q_FUNC_INFO << "with nam" << TomahawkUtils::nam() << this;
m_twitterAuth = QWeakPointer< TomahawkOAuthTwitter >( new TomahawkOAuthTwitter( TomahawkUtils::nam(), this ) ); m_twitterAuth = QPointer< TomahawkOAuthTwitter >( new TomahawkOAuthTwitter( TomahawkUtils::nam(), this ) );
if ( m_twitterAuth.isNull() ) if ( m_twitterAuth.isNull() )
return false; return false;

View File

@@ -68,7 +68,7 @@ namespace Tomahawk {
bool isValid() const; bool isValid() const;
Tomahawk::Accounts::TwitterAccount* m_account; Tomahawk::Accounts::TwitterAccount* m_account;
QWeakPointer< TomahawkOAuthTwitter > m_twitterAuth; QPointer< TomahawkOAuthTwitter > m_twitterAuth;
}; };
} }

View File

@@ -60,7 +60,7 @@ TwitterSipPlugin::TwitterSipPlugin( Tomahawk::Accounts::Account* account )
{ {
qDebug() << Q_FUNC_INFO; qDebug() << Q_FUNC_INFO;
connect( account, SIGNAL( nowAuthenticated( const QWeakPointer< TomahawkOAuthTwitter > &, const QTweetUser & ) ), SLOT( accountAuthenticated( const QWeakPointer< TomahawkOAuthTwitter > &, const QTweetUser & ) ) ); connect( account, SIGNAL( nowAuthenticated( const QPointer< TomahawkOAuthTwitter > &, const QTweetUser & ) ), SLOT( accountAuthenticated( const QPointer< TomahawkOAuthTwitter > &, const QTweetUser & ) ) );
m_configuration = account->configuration(); m_configuration = account->configuration();
qDebug() << "SIP configuration:" << m_configuration << m_configuration[ "cachedpeers" ]; qDebug() << "SIP configuration:" << m_configuration << m_configuration[ "cachedpeers" ];
@@ -165,7 +165,7 @@ TwitterSipPlugin::disconnectPlugin()
} }
void void
TwitterSipPlugin::accountAuthenticated( const QWeakPointer< TomahawkOAuthTwitter > &twitterAuth, const QTweetUser &user ) TwitterSipPlugin::accountAuthenticated( const QPointer< TomahawkOAuthTwitter > &twitterAuth, const QTweetUser &user )
{ {
Q_UNUSED( user ); Q_UNUSED( user );
@@ -174,11 +174,11 @@ TwitterSipPlugin::accountAuthenticated( const QWeakPointer< TomahawkOAuthTwitter
m_cachedTwitterAuth = twitterAuth; m_cachedTwitterAuth = twitterAuth;
m_friendsTimeline = QWeakPointer<QTweetFriendsTimeline>( new QTweetFriendsTimeline( m_cachedTwitterAuth.data(), this ) ); m_friendsTimeline = QPointer<QTweetFriendsTimeline>( new QTweetFriendsTimeline( m_cachedTwitterAuth.data(), this ) );
m_mentions = QWeakPointer<QTweetMentions>( new QTweetMentions( m_cachedTwitterAuth.data(), this ) ); m_mentions = QPointer<QTweetMentions>( new QTweetMentions( m_cachedTwitterAuth.data(), this ) );
m_directMessages = QWeakPointer<QTweetDirectMessages>( new QTweetDirectMessages( m_cachedTwitterAuth.data(), this ) ); m_directMessages = QPointer<QTweetDirectMessages>( new QTweetDirectMessages( m_cachedTwitterAuth.data(), this ) );
m_directMessageNew = QWeakPointer<QTweetDirectMessageNew>( new QTweetDirectMessageNew( m_cachedTwitterAuth.data(), this ) ); m_directMessageNew = QPointer<QTweetDirectMessageNew>( new QTweetDirectMessageNew( m_cachedTwitterAuth.data(), this ) );
m_directMessageDestroy = QWeakPointer<QTweetDirectMessageDestroy>( new QTweetDirectMessageDestroy( m_cachedTwitterAuth.data(), this ) ); m_directMessageDestroy = QPointer<QTweetDirectMessageDestroy>( new QTweetDirectMessageDestroy( m_cachedTwitterAuth.data(), this ) );
connect( m_friendsTimeline.data(), SIGNAL( parsedStatuses(const QList< QTweetStatus > &) ), SLOT( friendsTimelineStatuses(const QList<QTweetStatus> &) ) ); connect( m_friendsTimeline.data(), SIGNAL( parsedStatuses(const QList< QTweetStatus > &) ), SLOT( friendsTimelineStatuses(const QList<QTweetStatus> &) ) );
connect( m_mentions.data(), SIGNAL( parsedStatuses(const QList< QTweetStatus > &) ), SLOT( mentionsStatuses(const QList<QTweetStatus> &) ) ); connect( m_mentions.data(), SIGNAL( parsedStatuses(const QList< QTweetStatus > &) ), SLOT( mentionsStatuses(const QList<QTweetStatus> &) ) );
connect( m_directMessages.data(), SIGNAL( parsedDirectMessages(const QList<QTweetDMStatus> &)), SLOT( directMessages(const QList<QTweetDMStatus> &) ) ); connect( m_directMessages.data(), SIGNAL( parsedDirectMessages(const QList<QTweetDMStatus> &)), SLOT( directMessages(const QList<QTweetDMStatus> &) ) );

View File

@@ -36,7 +36,7 @@
#include <QTweetLib/qtweetdmstatus.h> #include <QTweetLib/qtweetdmstatus.h>
#include <QTimer> #include <QTimer>
#include <QWeakPointer> #include <QPointer>
#include <QSet> #include <QSet>
@@ -81,7 +81,7 @@ public slots:
void checkSettings(); void checkSettings();
private slots: private slots:
void accountAuthenticated( const QWeakPointer< TomahawkOAuthTwitter > &twitterAuth, const QTweetUser &user ); void accountAuthenticated( const QPointer< TomahawkOAuthTwitter > &twitterAuth, const QTweetUser &user );
void checkTimerFired(); void checkTimerFired();
void connectTimerFired(); void connectTimerFired();
void friendsTimelineStatuses( const QList< QTweetStatus > &statuses ); void friendsTimelineStatuses( const QList< QTweetStatus > &statuses );
@@ -104,13 +104,13 @@ private:
bool refreshTwitterAuth(); bool refreshTwitterAuth();
void parseGotTomahawk( const QRegExp &regex, const QString &screenName, const QString &text ); void parseGotTomahawk( const QRegExp &regex, const QString &screenName, const QString &text );
QWeakPointer< TomahawkOAuthTwitter > m_cachedTwitterAuth; QPointer< TomahawkOAuthTwitter > m_cachedTwitterAuth;
QWeakPointer< QTweetFriendsTimeline > m_friendsTimeline; QPointer< QTweetFriendsTimeline > m_friendsTimeline;
QWeakPointer< QTweetMentions > m_mentions; QPointer< QTweetMentions > m_mentions;
QWeakPointer< QTweetDirectMessages > m_directMessages; QPointer< QTweetDirectMessages > m_directMessages;
QWeakPointer< QTweetDirectMessageNew > m_directMessageNew; QPointer< QTweetDirectMessageNew > m_directMessageNew;
QWeakPointer< QTweetDirectMessageDestroy > m_directMessageDestroy; QPointer< QTweetDirectMessageDestroy > m_directMessageDestroy;
QVariantHash m_configuration; QVariantHash m_configuration;

View File

@@ -44,7 +44,7 @@ XmppAccount::XmppAccount( const QString &accountId )
setAccountServiceName( "Jabber (XMPP)" ); setAccountServiceName( "Jabber (XMPP)" );
setTypes( SipType ); setTypes( SipType );
m_configWidget = QWeakPointer< QWidget >( new XmppConfigWidget( this, 0 ) ); m_configWidget = QPointer< QWidget >( new XmppConfigWidget( this, 0 ) );
m_onlinePixmap = QPixmap( ":/xmpp-icon.png" ); m_onlinePixmap = QPixmap( ":/xmpp-icon.png" );
m_offlinePixmap = QPixmap( ":/xmpp-offline-icon.png" ); m_offlinePixmap = QPixmap( ":/xmpp-offline-icon.png" );
@@ -119,7 +119,7 @@ XmppAccount::sipPlugin()
{ {
if ( m_xmppSipPlugin.isNull() ) if ( m_xmppSipPlugin.isNull() )
{ {
m_xmppSipPlugin = QWeakPointer< XmppSipPlugin >( new XmppSipPlugin( this ) ); m_xmppSipPlugin = QPointer< XmppSipPlugin >( new XmppSipPlugin( this ) );
connect( m_xmppSipPlugin.data(), SIGNAL( stateChanged( Tomahawk::Accounts::Account::ConnectionState ) ), this, SIGNAL( connectionStateChanged( Tomahawk::Accounts::Account::ConnectionState ) ) ); connect( m_xmppSipPlugin.data(), SIGNAL( stateChanged( Tomahawk::Accounts::Account::ConnectionState ) ), this, SIGNAL( connectionStateChanged( Tomahawk::Accounts::Account::ConnectionState ) ) );
connect( m_xmppSipPlugin.data(), SIGNAL( error( int, QString ) ), this, SIGNAL( error( int, QString ) ) ); connect( m_xmppSipPlugin.data(), SIGNAL( error( int, QString ) ), this, SIGNAL( error( int, QString ) ) );

View File

@@ -80,9 +80,9 @@ public:
virtual Tomahawk::Accounts::Account::ConnectionState connectionState() const; virtual Tomahawk::Accounts::Account::ConnectionState connectionState() const;
protected: protected:
QWeakPointer< QWidget > m_configWidget; // so the google wrapper can change the config dialog a bit QPointer< QWidget > m_configWidget; // so the google wrapper can change the config dialog a bit
QWeakPointer< XmppSipPlugin > m_xmppSipPlugin; QPointer< XmppSipPlugin > m_xmppSipPlugin;
QWeakPointer< Tomahawk::InfoSystem::XmppInfoPlugin > m_xmppInfoPlugin; QPointer< Tomahawk::InfoSystem::XmppInfoPlugin > m_xmppInfoPlugin;
QPixmap m_onlinePixmap; QPixmap m_onlinePixmap;
QPixmap m_offlinePixmap; QPixmap m_offlinePixmap;

View File

@@ -55,7 +55,7 @@ namespace Tomahawk {
void audioPaused(); void audioPaused();
private: private:
QWeakPointer< XmppSipPlugin > m_sipPlugin; QPointer< XmppSipPlugin > m_sipPlugin;
QTimer m_pauseTimer; QTimer m_pauseTimer;
}; };

View File

@@ -109,7 +109,7 @@ GoogleWrapper::sipPlugin()
{ {
if ( m_xmppSipPlugin.isNull() ) if ( m_xmppSipPlugin.isNull() )
{ {
m_xmppSipPlugin = QWeakPointer< XmppSipPlugin >( new GoogleWrapperSip( const_cast< GoogleWrapper* >( this ) ) ); m_xmppSipPlugin = QPointer< XmppSipPlugin >( new GoogleWrapperSip( const_cast< GoogleWrapper* >( this ) ) );
connect( m_xmppSipPlugin.data(), SIGNAL( stateChanged( Tomahawk::Accounts::Account::ConnectionState ) ), this, SIGNAL( connectionStateChanged( Tomahawk::Accounts::Account::ConnectionState ) ) ); connect( m_xmppSipPlugin.data(), SIGNAL( stateChanged( Tomahawk::Accounts::Account::ConnectionState ) ), this, SIGNAL( connectionStateChanged( Tomahawk::Accounts::Account::ConnectionState ) ) );
connect( m_xmppSipPlugin.data(), SIGNAL( error( int, QString ) ), this, SIGNAL( error( int, QString ) ) ); connect( m_xmppSipPlugin.data(), SIGNAL( error( int, QString ) ), this, SIGNAL( error( int, QString ) ) );

View File

@@ -73,7 +73,7 @@ public:
virtual SipPlugin* sipPlugin(); virtual SipPlugin* sipPlugin();
private: private:
QWeakPointer< GoogleWrapperSip > m_sipPlugin; QPointer< GoogleWrapperSip > m_sipPlugin;
}; };
} }

View File

@@ -202,7 +202,7 @@ InfoSystem::InfoPluginPtr
XmppSipPlugin::infoPlugin() XmppSipPlugin::infoPlugin()
{ {
if ( m_infoPlugin.isNull() ) if ( m_infoPlugin.isNull() )
m_infoPlugin = QWeakPointer< Tomahawk::InfoSystem::XmppInfoPlugin >( new Tomahawk::InfoSystem::XmppInfoPlugin( this ) ); m_infoPlugin = QPointer< Tomahawk::InfoSystem::XmppInfoPlugin >( new Tomahawk::InfoSystem::XmppInfoPlugin( this ) );
return InfoSystem::InfoPluginPtr( m_infoPlugin.data() ); return InfoSystem::InfoPluginPtr( m_infoPlugin.data() );
} }

View File

@@ -132,7 +132,7 @@ private:
int m_currentPort; int m_currentPort;
QString m_currentResource; QString m_currentResource;
QWeakPointer< Tomahawk::InfoSystem::XmppInfoPlugin > m_infoPlugin; QPointer< Tomahawk::InfoSystem::XmppInfoPlugin > m_infoPlugin;
Tomahawk::Accounts::Account::ConnectionState m_state; Tomahawk::Accounts::Account::ConnectionState m_state;
// sort out // sort out

View File

@@ -120,7 +120,7 @@ SipPlugin*
ZeroconfAccount::sipPlugin() ZeroconfAccount::sipPlugin()
{ {
if ( m_sipPlugin.isNull() ) if ( m_sipPlugin.isNull() )
m_sipPlugin = QWeakPointer< ZeroconfPlugin >( new ZeroconfPlugin( this ) ); m_sipPlugin = QPointer< ZeroconfPlugin >( new ZeroconfPlugin( this ) );
return m_sipPlugin.data(); return m_sipPlugin.data();
} }

View File

@@ -72,7 +72,7 @@ public:
QWidget* aclWidget() { return 0; } QWidget* aclWidget() { return 0; }
private: private:
QWeakPointer< ZeroconfPlugin > m_sipPlugin; QPointer< ZeroconfPlugin > m_sipPlugin;
}; };
} }

View File

@@ -111,7 +111,7 @@ private:
uint m_chartsFetchJobs; uint m_chartsFetchJobs;
QList< InfoRequestData > m_cachedRequests; QList< InfoRequestData > m_cachedRequests;
QHash< QString, QString > m_cachedCountries; QHash< QString, QString > m_cachedCountries;
QWeakPointer< QNetworkAccessManager > m_nam; QPointer< QNetworkAccessManager > m_nam;
}; };
} }

View File

@@ -92,7 +92,7 @@ private:
uint m_nrFetchJobs; uint m_nrFetchJobs;
QList< InfoRequestData > m_cachedRequests; QList< InfoRequestData > m_cachedRequests;
QHash< QString, QString > m_cachedCountries; QHash< QString, QString > m_cachedCountries;
QWeakPointer< QNetworkAccessManager > m_nam; QPointer< QNetworkAccessManager > m_nam;
}; };
} }

View File

@@ -26,7 +26,7 @@
#include <QNetworkAccessManager> #include <QNetworkAccessManager>
#include <QObject> #include <QObject>
#include <QVariant> #include <QVariant>
#include <QWeakPointer> #include <QPointer>
class QTimer; class QTimer;
@@ -80,7 +80,7 @@ private:
QUrl m_currentLongUrl; QUrl m_currentLongUrl;
QTimer* m_pauseTimer; QTimer* m_pauseTimer;
QWeakPointer<QNetworkAccessManager> m_nam; QPointer<QNetworkAccessManager> m_nam;
}; };

View File

@@ -40,14 +40,14 @@ AlbumPlaylistInterface::AlbumPlaylistInterface( Tomahawk::Album* album, Tomahawk
, m_databaseLoaded( false ) , m_databaseLoaded( false )
, m_mode( mode ) , m_mode( mode )
, m_collection( collection ) , m_collection( collection )
, m_album( QWeakPointer< Tomahawk::Album >( album ) ) , m_album( QPointer< Tomahawk::Album >( album ) )
{ {
} }
AlbumPlaylistInterface::~AlbumPlaylistInterface() AlbumPlaylistInterface::~AlbumPlaylistInterface()
{ {
m_album.clear(); m_album = 0;
} }
@@ -133,7 +133,7 @@ AlbumPlaylistInterface::tracks() const
else if ( m_mode == DatabaseMode && !m_databaseLoaded ) else if ( m_mode == DatabaseMode && !m_databaseLoaded )
{ {
DatabaseCommand_AllTracks* cmd = new DatabaseCommand_AllTracks( m_collection ); DatabaseCommand_AllTracks* cmd = new DatabaseCommand_AllTracks( m_collection );
cmd->setAlbum( m_album ); cmd->setAlbum( m_album->weakRef() );
cmd->setSortOrder( DatabaseCommand_AllTracks::AlbumPosition ); cmd->setSortOrder( DatabaseCommand_AllTracks::AlbumPosition );
connect( cmd, SIGNAL( tracks( QList<Tomahawk::query_ptr>, QVariant ) ), connect( cmd, SIGNAL( tracks( QList<Tomahawk::query_ptr>, QVariant ) ),
@@ -216,7 +216,7 @@ AlbumPlaylistInterface::infoSystemFinished( const QString& infoId )
if ( m_queries.isEmpty() && m_mode == Mixed ) if ( m_queries.isEmpty() && m_mode == Mixed )
{ {
DatabaseCommand_AllTracks* cmd = new DatabaseCommand_AllTracks( m_collection ); DatabaseCommand_AllTracks* cmd = new DatabaseCommand_AllTracks( m_collection );
cmd->setAlbum( m_album ); cmd->setAlbum( m_album->weakRef() );
//this takes discnumber into account as well //this takes discnumber into account as well
cmd->setSortOrder( DatabaseCommand_AllTracks::AlbumPosition ); cmd->setSortOrder( DatabaseCommand_AllTracks::AlbumPosition );

View File

@@ -21,7 +21,7 @@
#define TOMAHAWKALBUMPLAYLISTINTERFACE_H #define TOMAHAWKALBUMPLAYLISTINTERFACE_H
#include <QtCore/QObject> #include <QtCore/QObject>
#include <QtCore/QSharedPointer> #include <QtCore/QPointer>
#include "Album.h" #include "Album.h"
#include "Typedefs.h" #include "Typedefs.h"
@@ -81,7 +81,7 @@ private:
Tomahawk::ModelMode m_mode; Tomahawk::ModelMode m_mode;
Tomahawk::collection_ptr m_collection; Tomahawk::collection_ptr m_collection;
QWeakPointer< Tomahawk::Album > m_album; QPointer< Tomahawk::Album > m_album;
}; };
}; // ns }; // ns

View File

@@ -39,14 +39,14 @@ ArtistPlaylistInterface::ArtistPlaylistInterface( Tomahawk::Artist* artist, Toma
, m_databaseLoaded( false ) , m_databaseLoaded( false )
, m_mode( mode ) , m_mode( mode )
, m_collection( collection ) , m_collection( collection )
, m_artist( QWeakPointer< Tomahawk::Artist >( artist ) ) , m_artist( QPointer< Tomahawk::Artist >( artist ) )
{ {
} }
ArtistPlaylistInterface::~ArtistPlaylistInterface() ArtistPlaylistInterface::~ArtistPlaylistInterface()
{ {
m_artist.clear(); m_artist = 0;
} }
@@ -114,7 +114,7 @@ ArtistPlaylistInterface::tracks() const
else if ( m_mode == DatabaseMode && !m_databaseLoaded ) else if ( m_mode == DatabaseMode && !m_databaseLoaded )
{ {
DatabaseCommand_AllTracks* cmd = new DatabaseCommand_AllTracks( m_collection ); DatabaseCommand_AllTracks* cmd = new DatabaseCommand_AllTracks( m_collection );
cmd->setArtist( m_artist ); cmd->setArtist( m_artist->weakRef() );
cmd->setSortOrder( DatabaseCommand_AllTracks::AlbumPosition ); cmd->setSortOrder( DatabaseCommand_AllTracks::AlbumPosition );
connect( cmd, SIGNAL( tracks( QList<Tomahawk::query_ptr>, QVariant ) ), connect( cmd, SIGNAL( tracks( QList<Tomahawk::query_ptr>, QVariant ) ),
@@ -196,7 +196,7 @@ ArtistPlaylistInterface::infoSystemFinished( const QString &infoId )
if ( m_queries.isEmpty() && m_mode == Mixed ) if ( m_queries.isEmpty() && m_mode == Mixed )
{ {
DatabaseCommand_AllTracks* cmd = new DatabaseCommand_AllTracks( m_collection ); DatabaseCommand_AllTracks* cmd = new DatabaseCommand_AllTracks( m_collection );
cmd->setArtist( m_artist ); cmd->setArtist( m_artist->weakRef() );
//this takes discnumber into account as well //this takes discnumber into account as well
cmd->setSortOrder( DatabaseCommand_AllTracks::AlbumPosition ); cmd->setSortOrder( DatabaseCommand_AllTracks::AlbumPosition );

View File

@@ -21,7 +21,7 @@
#define TOMAHAWKARTISTPLAYLISTINTERFACE_H #define TOMAHAWKARTISTPLAYLISTINTERFACE_H
#include <QtCore/QObject> #include <QtCore/QObject>
#include <QtCore/QSharedPointer> #include <QtCore/QPointer>
#include "Artist.h" #include "Artist.h"
#include "Typedefs.h" #include "Typedefs.h"
@@ -80,7 +80,7 @@ private:
Tomahawk::ModelMode m_mode; Tomahawk::ModelMode m_mode;
Tomahawk::collection_ptr m_collection; Tomahawk::collection_ptr m_collection;
QWeakPointer< Tomahawk::Artist > m_artist; QPointer< Tomahawk::Artist > m_artist;
}; };
}; // ns }; // ns

View File

@@ -27,7 +27,7 @@ using namespace Tomahawk;
FuncTimeout::FuncTimeout( int ms, boost::function< void() > func, QObject* besafe ) FuncTimeout::FuncTimeout( int ms, boost::function< void() > func, QObject* besafe )
: m_func( func ) : m_func( func )
, m_watch( QWeakPointer< QObject >( besafe ) ) , m_watch( QPointer< QObject >( besafe ) )
{ {
//qDebug() << Q_FUNC_INFO; //qDebug() << Q_FUNC_INFO;
QTimer::singleShot( ms, this, SLOT( exec() ) ); QTimer::singleShot( ms, this, SLOT( exec() ) );

View File

@@ -20,7 +20,7 @@
#define FUNCTIMEOUT_H #define FUNCTIMEOUT_H
#include <QObject> #include <QObject>
#include <QWeakPointer> #include <QPointer>
#include "boost/function.hpp" #include "boost/function.hpp"
#include "boost/bind.hpp" #include "boost/bind.hpp"
@@ -51,7 +51,7 @@ public slots:
private: private:
boost::function<void()> m_func; boost::function<void()> m_func;
QWeakPointer< QObject > m_watch; QPointer< QObject > m_watch;
}; };
}; // ns }; // ns

View File

@@ -29,8 +29,6 @@
#include <QNetworkReply> #include <QNetworkReply>
#include <QObject> #include <QObject>
#include <QUrl> #include <QUrl>
#include <QWeakPointer>
/** /**
* Handles global actions such as parsing and creation of links, mime data handling, etc * Handles global actions such as parsing and creation of links, mime data handling, etc

View File

@@ -95,7 +95,7 @@ LatchManager::playlistChanged( Tomahawk::playlistinterface_ptr )
// We're current latched, and the user changed playlist, so stop // We're current latched, and the user changed playlist, so stop
SourcePlaylistInterface* origsourcepi = dynamic_cast< SourcePlaylistInterface* >( m_latchedInterface.data() ); SourcePlaylistInterface* origsourcepi = dynamic_cast< SourcePlaylistInterface* >( m_latchedInterface.data() );
Q_ASSERT( origsourcepi ); Q_ASSERT( origsourcepi );
const source_ptr source = origsourcepi->source(); const source_ptr source = SourceList::instance()->get( origsourcepi->source()->id() );
DatabaseCommand_SocialAction* cmd = new DatabaseCommand_SocialAction(); DatabaseCommand_SocialAction* cmd = new DatabaseCommand_SocialAction();
cmd->setSource( SourceList::instance()->getLocal() ); cmd->setSource( SourceList::instance()->getLocal() );

View File

@@ -68,7 +68,7 @@ Pipeline::~Pipeline()
m_running = false; m_running = false;
// stop script resolvers // stop script resolvers
foreach ( QWeakPointer< ExternalResolver > r, m_scriptResolvers ) foreach ( QPointer< ExternalResolver > r, m_scriptResolvers )
if ( !r.isNull() ) if ( !r.isNull() )
r.data()->deleteLater(); r.data()->deleteLater();
@@ -141,7 +141,7 @@ Pipeline::addScriptResolver( const QString& path )
if ( !res ) if ( !res )
continue; continue;
m_scriptResolvers << QWeakPointer< ExternalResolver >( res ); m_scriptResolvers << QPointer< ExternalResolver > ( res );
break; break;
} }
@@ -153,7 +153,7 @@ Pipeline::addScriptResolver( const QString& path )
void void
Pipeline::stopScriptResolver( const QString& path ) Pipeline::stopScriptResolver( const QString& path )
{ {
foreach ( QWeakPointer< ExternalResolver > res, m_scriptResolvers ) foreach ( QPointer< ExternalResolver > res, m_scriptResolvers )
{ {
if ( res.data()->filePath() == path ) if ( res.data()->filePath() == path )
res.data()->stop(); res.data()->stop();
@@ -164,8 +164,8 @@ Pipeline::stopScriptResolver( const QString& path )
void void
Pipeline::removeScriptResolver( const QString& scriptPath ) Pipeline::removeScriptResolver( const QString& scriptPath )
{ {
QWeakPointer< ExternalResolver > r; QPointer< ExternalResolver > r;
foreach ( QWeakPointer< ExternalResolver > res, m_scriptResolvers ) foreach ( QPointer< ExternalResolver > res, m_scriptResolvers )
{ {
if ( res.isNull() ) if ( res.isNull() )
continue; continue;
@@ -186,7 +186,7 @@ Pipeline::removeScriptResolver( const QString& scriptPath )
ExternalResolver* ExternalResolver*
Pipeline::resolverForPath( const QString& scriptPath ) Pipeline::resolverForPath( const QString& scriptPath )
{ {
foreach ( QWeakPointer< ExternalResolver > res, m_scriptResolvers ) foreach ( QPointer< ExternalResolver > res, m_scriptResolvers )
{ {
if ( res.data()->filePath() == scriptPath ) if ( res.data()->filePath() == scriptPath )
return res.data(); return res.data();

View File

@@ -61,7 +61,7 @@ public:
Tomahawk::ExternalResolver* addScriptResolver( const QString& scriptPath ); Tomahawk::ExternalResolver* addScriptResolver( const QString& scriptPath );
void stopScriptResolver( const QString& scriptPath ); void stopScriptResolver( const QString& scriptPath );
void removeScriptResolver( const QString& scriptPath ); void removeScriptResolver( const QString& scriptPath );
QList< QWeakPointer< ExternalResolver > > scriptResolvers() const { return m_scriptResolvers; } QList< QPointer< ExternalResolver > > scriptResolvers() const { return m_scriptResolvers; }
Tomahawk::ExternalResolver* resolverForPath( const QString& scriptPath ); Tomahawk::ExternalResolver* resolverForPath( const QString& scriptPath );
void addResolver( Resolver* r ); void addResolver( Resolver* r );
@@ -110,7 +110,7 @@ private:
int decQIDState( const Tomahawk::query_ptr& query ); int decQIDState( const Tomahawk::query_ptr& query );
QList< Resolver* > m_resolvers; QList< Resolver* > m_resolvers;
QList< QWeakPointer<Tomahawk::ExternalResolver> > m_scriptResolvers; QList< QPointer<Tomahawk::ExternalResolver> > m_scriptResolvers;
QList< ResolverFactoryFunc > m_resolverFactories; QList< ResolverFactoryFunc > m_resolverFactories;
QMap< QID, bool > m_qidsTimeout; QMap< QID, bool > m_qidsTimeout;
QMap< QID, unsigned int > m_qidsState; QMap< QID, unsigned int > m_qidsState;

View File

@@ -36,7 +36,7 @@ PlaylistPlaylistInterface::PlaylistPlaylistInterface( Tomahawk::Playlist* playli
PlaylistPlaylistInterface::~PlaylistPlaylistInterface() PlaylistPlaylistInterface::~PlaylistPlaylistInterface()
{ {
m_playlist.clear(); m_playlist = 0;
} }

View File

@@ -22,7 +22,7 @@
#include <QObject> #include <QObject>
#include <QList> #include <QList>
#include <QSharedPointer> #include <QPointer>
#include "Typedefs.h" #include "Typedefs.h"
#include "Result.h" #include "Result.h"
@@ -66,7 +66,7 @@ private:
PlaylistPlaylistInterface(); PlaylistPlaylistInterface();
Q_DISABLE_COPY( PlaylistPlaylistInterface ) Q_DISABLE_COPY( PlaylistPlaylistInterface )
QWeakPointer< Tomahawk::Playlist > m_playlist; QPointer< Tomahawk::Playlist > m_playlist;
result_ptr m_currentItem; result_ptr m_currentItem;
}; };

View File

@@ -389,7 +389,7 @@ Query::currentResolver() const
int x = m_resolvers.count(); int x = m_resolvers.count();
while ( --x ) while ( --x )
{ {
QWeakPointer< Resolver > r = m_resolvers.at( x ); QPointer< Resolver > r = m_resolvers.at( x );
if ( r.isNull() ) if ( r.isNull() )
continue; continue;

View File

@@ -111,7 +111,7 @@ public:
QPair< Tomahawk::source_ptr, unsigned int > playedBy() const; QPair< Tomahawk::source_ptr, unsigned int > playedBy() const;
Tomahawk::Resolver* currentResolver() const; Tomahawk::Resolver* currentResolver() const;
QList< QWeakPointer< Tomahawk::Resolver > > resolvedBy() const { return m_resolvers; } QList< QPointer< Tomahawk::Resolver > > resolvedBy() const { return m_resolvers; }
void setArtist( const QString& artist ) { m_artist = artist; updateSortNames(); } void setArtist( const QString& artist ) { m_artist = artist; updateSortNames(); }
void setComposer( const QString& composer ) { m_composer = composer; updateSortNames(); } void setComposer( const QString& composer ) { m_composer = composer; updateSortNames(); }
@@ -255,7 +255,7 @@ private:
mutable Tomahawk::album_ptr m_albumPtr; mutable Tomahawk::album_ptr m_albumPtr;
QPair< Tomahawk::source_ptr, unsigned int > m_playedBy; QPair< Tomahawk::source_ptr, unsigned int > m_playedBy;
QList< QWeakPointer< Tomahawk::Resolver > > m_resolvers; QList< QPointer< Tomahawk::Resolver > > m_resolvers;
bool m_saveResultHint; bool m_saveResultHint;

View File

@@ -117,7 +117,7 @@ Result::onResolverRemoved( Tomahawk::Resolver* resolver )
{ {
if ( m_resolvedBy.data() == resolver ) if ( m_resolvedBy.data() == resolver )
{ {
m_resolvedBy.clear(); m_resolvedBy = 0;
emit statusChanged(); emit statusChanged();
} }
} }
@@ -384,7 +384,7 @@ Result::resolvedBy() const
void void
Result::setResolvedBy( Tomahawk::Resolver* resolver ) Result::setResolvedBy( Tomahawk::Resolver* resolver )
{ {
m_resolvedBy = QWeakPointer< Tomahawk::Resolver >( resolver ); m_resolvedBy = QPointer< Tomahawk::Resolver >( resolver );
} }

View File

@@ -141,7 +141,7 @@ private:
mutable RID m_rid; mutable RID m_rid;
collection_ptr m_collection; collection_ptr m_collection;
Tomahawk::query_ptr m_query; Tomahawk::query_ptr m_query;
QWeakPointer< Tomahawk::Resolver > m_resolvedBy; QPointer< Tomahawk::Resolver > m_resolvedBy;
Tomahawk::artist_ptr m_artist; Tomahawk::artist_ptr m_artist;
Tomahawk::album_ptr m_album; Tomahawk::album_ptr m_album;

View File

@@ -46,7 +46,7 @@ SourcePlaylistInterface::SourcePlaylistInterface( Tomahawk::Source* source, Toma
SourcePlaylistInterface::~SourcePlaylistInterface() SourcePlaylistInterface::~SourcePlaylistInterface()
{ {
m_source.clear(); m_source = 0;
} }
@@ -146,7 +146,7 @@ SourcePlaylistInterface::tracks() const
} }
QWeakPointer< Tomahawk::Source > QPointer< Tomahawk::Source >
SourcePlaylistInterface::source() const SourcePlaylistInterface::source() const
{ {
return m_source; return m_source;

View File

@@ -21,7 +21,7 @@
#define TOMAHAWKSOURCEPLAYLISTINTERFACE_H #define TOMAHAWKSOURCEPLAYLISTINTERFACE_H
#include <QObject> #include <QObject>
#include <QSharedPointer> #include <QPointer>
#include "Typedefs.h" #include "Typedefs.h"
#include "PlaylistInterface.h" #include "PlaylistInterface.h"
@@ -65,7 +65,7 @@ public:
virtual bool shuffled() const { return false; } virtual bool shuffled() const { return false; }
virtual QWeakPointer< Tomahawk::Source > source() const; virtual QPointer< Tomahawk::Source > source() const;
virtual void reset(); virtual void reset();
@@ -79,7 +79,7 @@ private slots:
void resolvingFinished( bool hasResults ); void resolvingFinished( bool hasResults );
private: private:
QWeakPointer< Tomahawk::Source > m_source; QPointer< Tomahawk::Source > m_source;
mutable Tomahawk::result_ptr m_currentItem; mutable Tomahawk::result_ptr m_currentItem;
mutable bool m_gotNextItem; mutable bool m_gotNextItem;
}; };

View File

@@ -21,9 +21,11 @@
#define TYPEDEFS_H #define TYPEDEFS_H
#include <QSharedPointer> #include <QSharedPointer>
#include <QPointer>
#include <QUuid> #include <QUuid>
#include <QPair> #include <QPair>
#include <QPersistentModelIndex> #include <QPersistentModelIndex>
#include <boost/function.hpp> #include <boost/function.hpp>
//template <typename T> class QSharedPointer; //template <typename T> class QSharedPointer;
@@ -203,7 +205,7 @@ namespace Tomahawk
typedef QHash< QString, QString > InfoStringHash; typedef QHash< QString, QString > InfoStringHash;
typedef QPair< QVariantMap, QVariant > PushInfoPair; typedef QPair< QVariantMap, QVariant > PushInfoPair;
typedef QWeakPointer< InfoPlugin > InfoPluginPtr; typedef QPointer< InfoPlugin > InfoPluginPtr;
} }
}; // ns }; // ns

View File

@@ -739,7 +739,7 @@ ViewManager::currentPage() const
Tomahawk::playlist_ptr Tomahawk::playlist_ptr
ViewManager::playlistForInterface( Tomahawk::playlistinterface_ptr interface ) const ViewManager::playlistForInterface( Tomahawk::playlistinterface_ptr interface ) const
{ {
foreach ( QWeakPointer<FlexibleView> view, m_playlistViews.values() ) foreach ( QPointer<FlexibleView> view, m_playlistViews.values() )
{ {
if ( !view.isNull() && view.data()->playlistInterface() == interface ) if ( !view.isNull() && view.data()->playlistInterface() == interface )
{ {
@@ -754,7 +754,7 @@ ViewManager::playlistForInterface( Tomahawk::playlistinterface_ptr interface ) c
Tomahawk::dynplaylist_ptr Tomahawk::dynplaylist_ptr
ViewManager::dynamicPlaylistForInterface( Tomahawk::playlistinterface_ptr interface ) const ViewManager::dynamicPlaylistForInterface( Tomahawk::playlistinterface_ptr interface ) const
{ {
foreach ( QWeakPointer<DynamicWidget> view, m_dynamicWidgets.values() ) foreach ( QPointer<DynamicWidget> view, m_dynamicWidgets.values() )
{ {
if ( !view.isNull() && view.data()->playlistInterface() == interface ) if ( !view.isNull() && view.data()->playlistInterface() == interface )
{ {

View File

@@ -188,13 +188,13 @@ private:
QList< Tomahawk::collection_ptr > m_superCollections; QList< Tomahawk::collection_ptr > m_superCollections;
QHash< Tomahawk::dynplaylist_ptr, QWeakPointer<Tomahawk::DynamicWidget> > m_dynamicWidgets; QHash< Tomahawk::dynplaylist_ptr, QPointer<Tomahawk::DynamicWidget> > m_dynamicWidgets;
QHash< Tomahawk::collection_ptr, QWeakPointer<TreeView> > m_treeViews; QHash< Tomahawk::collection_ptr, QPointer<TreeView> > m_treeViews;
QHash< Tomahawk::artist_ptr, QWeakPointer<ArtistInfoWidget> > m_artistViews; QHash< Tomahawk::artist_ptr, QPointer<ArtistInfoWidget> > m_artistViews;
QHash< Tomahawk::album_ptr, QWeakPointer<AlbumInfoWidget> > m_albumViews; QHash< Tomahawk::album_ptr, QPointer<AlbumInfoWidget> > m_albumViews;
QHash< Tomahawk::query_ptr, QWeakPointer<TrackInfoWidget> > m_trackViews; QHash< Tomahawk::query_ptr, QPointer<TrackInfoWidget> > m_trackViews;
QHash< Tomahawk::playlist_ptr, QWeakPointer<FlexibleView> > m_playlistViews; QHash< Tomahawk::playlist_ptr, QPointer<FlexibleView> > m_playlistViews;
QHash< Tomahawk::source_ptr, QWeakPointer<SourceInfoWidget> > m_sourceViews; QHash< Tomahawk::source_ptr, QPointer<SourceInfoWidget> > m_sourceViews;
QList<Tomahawk::ViewPage*> m_pageHistoryBack; QList<Tomahawk::ViewPage*> m_pageHistoryBack;
QList<Tomahawk::ViewPage*> m_pageHistoryFwd; QList<Tomahawk::ViewPage*> m_pageHistoryFwd;

View File

@@ -127,7 +127,7 @@ ResolverAccount::hookupResolver()
{ {
tDebug() << "Hooking up resolver:" << configuration().value( "path" ).toString() << enabled(); tDebug() << "Hooking up resolver:" << configuration().value( "path" ).toString() << enabled();
m_resolver = QWeakPointer< ExternalResolverGui >( qobject_cast< ExternalResolverGui* >( Pipeline::instance()->addScriptResolver( configuration().value( "path" ).toString() ) ) ); m_resolver = QPointer< ExternalResolverGui >( qobject_cast< ExternalResolverGui* >( Pipeline::instance()->addScriptResolver( configuration().value( "path" ).toString() ) ) );
connect( m_resolver.data(), SIGNAL( changed() ), this, SLOT( resolverChanged() ) ); connect( m_resolver.data(), SIGNAL( changed() ), this, SLOT( resolverChanged() ) );
// What resolver do we have here? Should only be types that are 'real' resolvers // What resolver do we have here? Should only be types that are 'real' resolvers

View File

@@ -22,6 +22,8 @@
#include "accounts/Account.h" #include "accounts/Account.h"
#include "DllMacro.h" #include "DllMacro.h"
#include <QPointer>
namespace Tomahawk { namespace Tomahawk {
class ExternalResolverGui; class ExternalResolverGui;
@@ -93,7 +95,7 @@ protected:
void hookupResolver(); void hookupResolver();
QWeakPointer<ExternalResolverGui> m_resolver; QPointer<ExternalResolverGui> m_resolver;
private: private:
void init( const QString& path ); void init( const QString& path );

View File

@@ -141,7 +141,7 @@ QWidget*
LastFmAccount::configurationWidget() LastFmAccount::configurationWidget()
{ {
if ( m_configWidget.isNull() ) if ( m_configWidget.isNull() )
m_configWidget = QWeakPointer<LastFmConfig>( new LastFmConfig( this ) ); m_configWidget = QPointer<LastFmConfig>( new LastFmConfig( this ) );
return m_configWidget.data(); return m_configWidget.data();
} }
@@ -165,7 +165,7 @@ InfoPluginPtr
LastFmAccount::infoPlugin() LastFmAccount::infoPlugin()
{ {
if ( m_infoPlugin.isNull() ) if ( m_infoPlugin.isNull() )
m_infoPlugin = QWeakPointer< LastFmInfoPlugin >( new LastFmInfoPlugin( this ) ); m_infoPlugin = QPointer< LastFmInfoPlugin >( new LastFmInfoPlugin( this ) );
return InfoPluginPtr( m_infoPlugin.data() ); return InfoPluginPtr( m_infoPlugin.data() );
} }
@@ -286,7 +286,7 @@ LastFmAccount::hookupResolver()
const AtticaManager::Resolver data = AtticaManager::instance()->resolverData( res.id() ); const AtticaManager::Resolver data = AtticaManager::instance()->resolverData( res.id() );
m_resolver = QWeakPointer< ExternalResolverGui >( qobject_cast< ExternalResolverGui* >( Pipeline::instance()->addScriptResolver( data.scriptPath ) ) ); m_resolver = QPointer< ExternalResolverGui >( qobject_cast< ExternalResolverGui* >( Pipeline::instance()->addScriptResolver( data.scriptPath ) ) );
connect( m_resolver.data(), SIGNAL( changed() ), this, SLOT( resolverChanged() ) ); connect( m_resolver.data(), SIGNAL( changed() ), this, SLOT( resolverChanged() ) );
} }

View File

@@ -104,9 +104,9 @@ private slots:
private: private:
void hookupResolver(); void hookupResolver();
QWeakPointer<Tomahawk::ExternalResolverGui> m_resolver; QPointer<Tomahawk::ExternalResolverGui> m_resolver;
QWeakPointer<Tomahawk::InfoSystem::LastFmInfoPlugin> m_infoPlugin; QPointer<Tomahawk::InfoSystem::LastFmInfoPlugin> m_infoPlugin;
QWeakPointer<LastFmConfig> m_configWidget; QPointer<LastFmConfig> m_configWidget;
}; };
} }

View File

@@ -87,7 +87,7 @@ private:
void dataError( Tomahawk::InfoSystem::InfoRequestData requestData ); void dataError( Tomahawk::InfoSystem::InfoRequestData requestData );
QWeakPointer< Accounts::LastFmAccount > m_account; QPointer< Accounts::LastFmAccount > m_account;
QList<lastfm::Track> parseTrackList( QNetworkReply* reply ); QList<lastfm::Track> parseTrackList( QNetworkReply* reply );
lastfm::MutableTrack m_track; lastfm::MutableTrack m_track;

View File

@@ -217,7 +217,7 @@ SpotifyAccount::hookupResolver()
// Since the resolver in 0.4.x used an incompatible version of kdsingleappguard, we can't auto-kill old resolvers on the // Since the resolver in 0.4.x used an incompatible version of kdsingleappguard, we can't auto-kill old resolvers on the
// 0.4.x->0.5.x upgrade. So we do it manually for a while // 0.4.x->0.5.x upgrade. So we do it manually for a while
killExistingResolvers(); killExistingResolvers();
m_spotifyResolver = QWeakPointer< ScriptResolver >( qobject_cast< ScriptResolver* >( Pipeline::instance()->addScriptResolver( path ) ) ); m_spotifyResolver = QPointer< ScriptResolver >( qobject_cast< ScriptResolver* >( Pipeline::instance()->addScriptResolver( path ) ) );
m_spotifyResolver.data()->setIcon( TomahawkUtils::defaultPixmap( TomahawkUtils::SpotifyIcon ) ); m_spotifyResolver.data()->setIcon( TomahawkUtils::defaultPixmap( TomahawkUtils::SpotifyIcon ) );
connect( m_spotifyResolver.data(), SIGNAL( changed() ), this, SLOT( resolverChanged() ) ); connect( m_spotifyResolver.data(), SIGNAL( changed() ), this, SLOT( resolverChanged() ) );
@@ -352,7 +352,7 @@ SpotifyAccount::infoPlugin()
{ {
if ( m_infoPlugin.isNull() ) if ( m_infoPlugin.isNull() )
{ {
m_infoPlugin = QWeakPointer< InfoSystem::SpotifyInfoPlugin >( new InfoSystem::SpotifyInfoPlugin( this ) ); m_infoPlugin = QPointer< InfoSystem::SpotifyInfoPlugin >( new InfoSystem::SpotifyInfoPlugin( this ) );
} }
return InfoSystem::InfoPluginPtr( m_infoPlugin.data() ); return InfoSystem::InfoPluginPtr( m_infoPlugin.data() );
@@ -1112,7 +1112,7 @@ SpotifyAccount::configurationWidget()
{ {
if ( m_configWidget.isNull() ) if ( m_configWidget.isNull() )
{ {
m_configWidget = QWeakPointer< SpotifyAccountConfig >( new SpotifyAccountConfig( this ) ); m_configWidget = QPointer< SpotifyAccountConfig >( new SpotifyAccountConfig( this ) );
connect( m_configWidget.data(), SIGNAL( login( QString,QString ) ), this, SLOT( login( QString,QString ) ) ); connect( m_configWidget.data(), SIGNAL( login( QString,QString ) ), this, SLOT( login( QString,QString ) ) );
connect( m_configWidget.data(), SIGNAL( logout() ), this, SLOT( logout() ) ); connect( m_configWidget.data(), SIGNAL( logout() ), this, SLOT( logout() ) );
m_configWidget.data()->setPlaylists( m_allSpotifyPlaylists.values() ); m_configWidget.data()->setPlaylists( m_allSpotifyPlaylists.values() );
@@ -1141,7 +1141,7 @@ SpotifyAccount::aboutWidget()
l->addWidget( pm ); l->addWidget( pm );
l->addWidget( text ); l->addWidget( text );
w->setLayout( l ); w->setLayout( l );
m_aboutWidget = QWeakPointer< QWidget >( w ); m_aboutWidget = QPointer< QWidget >( w );
} }
return m_aboutWidget.data(); return m_aboutWidget.data();

View File

@@ -163,10 +163,10 @@ private:
SpotifyPlaylistUpdater* getPlaylistUpdater( QObject* sender ); SpotifyPlaylistUpdater* getPlaylistUpdater( QObject* sender );
static SpotifyAccount* s_instance; static SpotifyAccount* s_instance;
QWeakPointer<SpotifyAccountConfig> m_configWidget; QPointer<SpotifyAccountConfig> m_configWidget;
QWeakPointer<QWidget> m_aboutWidget; QPointer<QWidget> m_aboutWidget;
QWeakPointer<ScriptResolver> m_spotifyResolver; QPointer<ScriptResolver> m_spotifyResolver;
QWeakPointer< InfoSystem::SpotifyInfoPlugin > m_infoPlugin; QPointer< InfoSystem::SpotifyInfoPlugin > m_infoPlugin;
QMap<QString, QPair<QObject*, QString> > m_qidToSlotMap; QMap<QString, QPair<QObject*, QString> > m_qidToSlotMap;
QMap<QString, QVariant > m_qidToExtraData; QMap<QString, QVariant > m_qidToExtraData;

View File

@@ -22,13 +22,14 @@
#include "utils/Closure.h" #include "utils/Closure.h"
#include "utils/Logger.h" #include "utils/Logger.h"
using namespace Tomahawk; using namespace Tomahawk;
using namespace Tomahawk::InfoSystem; using namespace Tomahawk::InfoSystem;
SpotifyInfoPlugin::SpotifyInfoPlugin( Accounts::SpotifyAccount* account ) SpotifyInfoPlugin::SpotifyInfoPlugin( Accounts::SpotifyAccount* account )
: InfoPlugin() : InfoPlugin()
, m_account( QWeakPointer< Accounts::SpotifyAccount >( account ) ) , m_account( QPointer< Accounts::SpotifyAccount >( account ) )
{ {
if ( !m_account.isNull() ) if ( !m_account.isNull() )
{ {

View File

@@ -22,7 +22,7 @@
#include "infosystem/InfoSystem.h" #include "infosystem/InfoSystem.h"
#include "DllMacro.h" #include "DllMacro.h"
#include <QWeakPointer> #include <QPointer>
class QNetworkReply; class QNetworkReply;
@@ -62,7 +62,8 @@ private:
void dataError( InfoRequestData ); void dataError( InfoRequestData );
void trackListResult( const QStringList& trackNameList, const Tomahawk::InfoSystem::InfoRequestData& requestData ); void trackListResult( const QStringList& trackNameList, const Tomahawk::InfoSystem::InfoRequestData& requestData );
void sendLoveSong( const InfoType type, QVariant input ); void sendLoveSong( const InfoType type, QVariant input );
QWeakPointer< Tomahawk::Accounts::SpotifyAccount > m_account;
QPointer< Tomahawk::Accounts::SpotifyAccount > m_account;
}; };
} }

View File

@@ -109,7 +109,7 @@ private:
static QVariant queryToVariant( const Tomahawk::query_ptr& query ); static QVariant queryToVariant( const Tomahawk::query_ptr& query );
static QList< Tomahawk::query_ptr > variantToQueries( const QVariantList& list ); static QList< Tomahawk::query_ptr > variantToQueries( const QVariantList& list );
QWeakPointer<Tomahawk::Accounts::SpotifyAccount> m_spotify; QPointer<Tomahawk::Accounts::SpotifyAccount> m_spotify;
QString m_latestRev, m_spotifyId; QString m_latestRev, m_spotifyId;
QList< Tomahawk::plentry_ptr > m_waitingForIds; QList< Tomahawk::plentry_ptr > m_waitingForIds;
@@ -137,7 +137,7 @@ public:
virtual QString type() const { return "spotify"; } virtual QString type() const { return "spotify"; }
private: private:
QWeakPointer<Tomahawk::Accounts::SpotifyAccount> m_account; QPointer<Tomahawk::Accounts::SpotifyAccount> m_account;
}; };
#endif // SPOTIFYPLAYLISTUPDATER_H #endif // SPOTIFYPLAYLISTUPDATER_H

View File

@@ -64,7 +64,7 @@ Database::Database( const QString& dbname, QObject* parent )
while ( m_workerThreads.count() < m_maxConcurrentThreads ) while ( m_workerThreads.count() < m_maxConcurrentThreads )
{ {
QWeakPointer< DatabaseWorkerThread > workerThread( new DatabaseWorkerThread( this, false ) ); QPointer< DatabaseWorkerThread > workerThread( new DatabaseWorkerThread( this, false ) );
Q_ASSERT( workerThread ); Q_ASSERT( workerThread );
workerThread.data()->start(); workerThread.data()->start();
m_workerThreads << workerThread; m_workerThreads << workerThread;
@@ -82,7 +82,7 @@ Database::~Database()
if ( m_workerRW ) if ( m_workerRW )
m_workerRW.data()->quit(); m_workerRW.data()->quit();
foreach ( QWeakPointer< DatabaseWorkerThread > workerThread, m_workerThreads ) foreach ( QPointer< DatabaseWorkerThread > workerThread, m_workerThreads )
{ {
if ( workerThread && workerThread.data()->worker() ) if ( workerThread && workerThread.data()->worker() )
workerThread.data()->quit(); workerThread.data()->quit();
@@ -93,7 +93,7 @@ Database::~Database()
m_workerRW.data()->wait( 60000 ); m_workerRW.data()->wait( 60000 );
delete m_workerRW.data(); delete m_workerRW.data();
} }
foreach ( QWeakPointer< DatabaseWorkerThread > workerThread, m_workerThreads ) foreach ( QPointer< DatabaseWorkerThread > workerThread, m_workerThreads )
{ {
if ( workerThread ) if ( workerThread )
{ {
@@ -140,8 +140,8 @@ Database::enqueue( const QSharedPointer<DatabaseCommand>& lc )
{ {
// find thread for commandname with lowest amount of outstanding jobs and enqueue job // find thread for commandname with lowest amount of outstanding jobs and enqueue job
int busyThreads = 0; int busyThreads = 0;
QWeakPointer< DatabaseWorkerThread > workerThread; QPointer< DatabaseWorkerThread > workerThread;
QWeakPointer< DatabaseWorker > happyWorker; QPointer< DatabaseWorker > happyWorker;
for ( int i = 0; i < m_workerThreads.count(); i++ ) for ( int i = 0; i < m_workerThreads.count(); i++ )
{ {
workerThread = m_workerThreads.at( i ); workerThread = m_workerThreads.at( i );

View File

@@ -77,8 +77,8 @@ private:
bool m_ready; bool m_ready;
DatabaseImpl* m_impl; DatabaseImpl* m_impl;
QWeakPointer< DatabaseWorkerThread > m_workerRW; QPointer< DatabaseWorkerThread > m_workerRW;
QList< QWeakPointer< DatabaseWorkerThread > > m_workerThreads; QList< QPointer< DatabaseWorkerThread > > m_workerThreads;
IdThreadWorker* m_idWorker; IdThreadWorker* m_idWorker;
int m_maxConcurrentThreads; int m_maxConcurrentThreads;

View File

@@ -21,6 +21,7 @@
#include "DatabaseCommand.h" #include "DatabaseCommand.h"
#include "DllMacro.h" #include "DllMacro.h"
#include <QPointer>
class IndexingJobItem; class IndexingJobItem;
@@ -36,7 +37,7 @@ public:
virtual void exec( DatabaseImpl* db ); virtual void exec( DatabaseImpl* db );
private: private:
QWeakPointer<IndexingJobItem> m_statusJob; QPointer<IndexingJobItem> m_statusJob;
}; };
#endif // DATABASECOMMAND_UPDATESEARCHINDEX_H #endif // DATABASECOMMAND_UPDATESEARCHINDEX_H

View File

@@ -47,7 +47,7 @@ void
DatabaseWorkerThread::run() DatabaseWorkerThread::run()
{ {
tDebug() << Q_FUNC_INFO << "DatabaseWorkerThread starting..."; tDebug() << Q_FUNC_INFO << "DatabaseWorkerThread starting...";
m_worker = QWeakPointer< DatabaseWorker >( new DatabaseWorker( m_db, m_mutates ) ); m_worker = QPointer< DatabaseWorker >( new DatabaseWorker( m_db, m_mutates ) );
exec(); exec();
tDebug() << Q_FUNC_INFO << "DatabaseWorkerThread finishing..."; tDebug() << Q_FUNC_INFO << "DatabaseWorkerThread finishing...";
if ( m_worker ) if ( m_worker )
@@ -60,7 +60,7 @@ DatabaseWorkerThread::~DatabaseWorkerThread()
} }
QWeakPointer< DatabaseWorker > QPointer< DatabaseWorker >
DatabaseWorkerThread::worker() const DatabaseWorkerThread::worker() const
{ {
return m_worker; return m_worker;

View File

@@ -23,7 +23,7 @@
#include <QThread> #include <QThread>
#include <QMutex> #include <QMutex>
#include <QList> #include <QList>
#include <QSharedPointer> #include <QPointer>
#include <qjson/parser.h> #include <qjson/parser.h>
#include <qjson/serializer.h> #include <qjson/serializer.h>
@@ -71,13 +71,13 @@ public:
DatabaseWorkerThread( Database* db, bool mutates ); DatabaseWorkerThread( Database* db, bool mutates );
~DatabaseWorkerThread(); ~DatabaseWorkerThread();
QWeakPointer< DatabaseWorker > worker() const; QPointer< DatabaseWorker > worker() const;
protected: protected:
void run(); void run();
private: private:
QWeakPointer< DatabaseWorker > m_worker; QPointer< DatabaseWorker > m_worker;
Database* m_db; Database* m_db;
bool m_mutates; bool m_mutates;
}; };

View File

@@ -184,7 +184,7 @@ MusicScanner::scan()
m_dirListerThreadController = new QThread( this ); m_dirListerThreadController = new QThread( this );
m_dirLister = QWeakPointer< DirLister >( new DirLister( m_paths ) ); m_dirLister = QPointer< DirLister >( new DirLister( m_paths ) );
m_dirLister.data()->moveToThread( m_dirListerThreadController ); m_dirLister.data()->moveToThread( m_dirListerThreadController );
connect( m_dirLister.data(), SIGNAL( fileToScan( QFileInfo ) ), connect( m_dirLister.data(), SIGNAL( fileToScan( QFileInfo ) ),

View File

@@ -37,7 +37,6 @@
#include <QtCore/QTimer> #include <QtCore/QTimer>
#include <QtCore/QMutex> #include <QtCore/QMutex>
#include <QtCore/QMutexLocker> #include <QtCore/QMutexLocker>
#include <QtCore/QWeakPointer>
#include <database/Database.h> #include <database/Database.h>
// descend dir tree comparing dir mtimes to last known mtime // descend dir tree comparing dir mtimes to last known mtime
@@ -125,7 +124,7 @@ private:
QVariantList m_filesToDelete; QVariantList m_filesToDelete;
quint32 m_batchsize; quint32 m_batchsize;
QWeakPointer< DirLister > m_dirLister; QPointer< DirLister > m_dirLister;
QThread* m_dirListerThreadController; QThread* m_dirListerThreadController;
}; };

View File

@@ -255,7 +255,7 @@ ScanManager::runScan()
if ( m_musicScannerThreadController && m_scanner.isNull() ) if ( m_musicScannerThreadController && m_scanner.isNull() )
{ {
m_scanner = QWeakPointer< MusicScanner >( new MusicScanner( m_currScanMode, paths ) ); m_scanner = QPointer< MusicScanner >( new MusicScanner( m_currScanMode, paths ) );
m_scanner.data()->moveToThread( m_musicScannerThreadController ); m_scanner.data()->moveToThread( m_musicScannerThreadController );
connect( m_scanner.data(), SIGNAL( finished() ), SLOT( scannerFinished() ) ); connect( m_scanner.data(), SIGNAL( finished() ), SLOT( scannerFinished() ) );
m_musicScannerThreadController->start( QThread::IdlePriority ); m_musicScannerThreadController->start( QThread::IdlePriority );

View File

@@ -27,7 +27,7 @@
#include <QtCore/QMap> #include <QtCore/QMap>
#include <QtCore/QObject> #include <QtCore/QObject>
#include <QtCore/QStringList> #include <QtCore/QStringList>
#include <QtCore/QWeakPointer> #include <QtCore/QPointer>
#include <QtCore/QSet> #include <QtCore/QSet>
class MusicScanner; class MusicScanner;
@@ -72,7 +72,7 @@ private:
static ScanManager* s_instance; static ScanManager* s_instance;
ScanMode m_currScanMode; ScanMode m_currScanMode;
QWeakPointer< MusicScanner > m_scanner; QPointer< MusicScanner > m_scanner;
QThread* m_musicScannerThreadController; QThread* m_musicScannerThreadController;
QSet< QString > m_currScannerPaths; QSet< QString > m_currScannerPaths;
QStringList m_cachedScannerDirs; QStringList m_cachedScannerDirs;

View File

@@ -294,13 +294,13 @@ InfoSystem::removeInfoPlugin( Tomahawk::InfoSystem::InfoPluginPtr plugin )
} }
QWeakPointer< QThread > QPointer< QThread >
InfoSystem::workerThread() const InfoSystem::workerThread() const
{ {
if ( m_infoSystemWorkerThreadController->isRunning() && m_infoSystemWorkerThreadController->worker() ) if ( m_infoSystemWorkerThreadController->isRunning() && m_infoSystemWorkerThreadController->worker() )
return QWeakPointer< QThread >( m_infoSystemWorkerThreadController->worker()->thread() ); return QPointer< QThread >( m_infoSystemWorkerThreadController->worker()->thread() );
return QWeakPointer< QThread >(); return QPointer< QThread >();
} }
@@ -320,7 +320,7 @@ InfoSystemCacheThread::~InfoSystemCacheThread()
void void
InfoSystemCacheThread::InfoSystemCacheThread::run() InfoSystemCacheThread::InfoSystemCacheThread::run()
{ {
m_cache = QWeakPointer< InfoSystemCache >( new InfoSystemCache() ); m_cache = QPointer< InfoSystemCache >( new InfoSystemCache() );
exec(); exec();
if ( !m_cache.isNull() ) if ( !m_cache.isNull() )
delete m_cache.data(); delete m_cache.data();
@@ -350,7 +350,7 @@ InfoSystemWorkerThread::~InfoSystemWorkerThread()
void void
InfoSystemWorkerThread::InfoSystemWorkerThread::run() InfoSystemWorkerThread::InfoSystemWorkerThread::run()
{ {
m_worker = QWeakPointer< InfoSystemWorker >( new InfoSystemWorker() ); m_worker = QPointer< InfoSystemWorker >( new InfoSystemWorker() );
exec(); exec();
if( !m_worker.isNull() ) if( !m_worker.isNull() )
delete m_worker.data(); delete m_worker.data();

View File

@@ -24,7 +24,7 @@
#include <QtCore/QObject> #include <QtCore/QObject>
#include <QtCore/QtDebug> #include <QtCore/QtDebug>
#include <QtCore/QMap> #include <QtCore/QMap>
#include <QtCore/QWeakPointer> #include <QtCore/QPointer>
#include <QtCore/QSet> #include <QtCore/QSet>
#include <QtCore/QLinkedList> #include <QtCore/QLinkedList>
#include <QtCore/QUrl> #include <QtCore/QUrl>
@@ -153,7 +153,7 @@ public:
InfoSystemCache* cache() const; InfoSystemCache* cache() const;
private: private:
QWeakPointer< InfoSystemCache > m_cache; QPointer< InfoSystemCache > m_cache;
}; };
@@ -169,7 +169,7 @@ public:
InfoSystemWorker* worker() const; InfoSystemWorker* worker() const;
private: private:
QWeakPointer< InfoSystemWorker > m_worker; QPointer< InfoSystemWorker > m_worker;
}; };
@@ -189,7 +189,7 @@ public:
bool pushInfo( InfoPushData pushData ); bool pushInfo( InfoPushData pushData );
bool pushInfo( const QString &caller, const InfoTypeMap &input, const PushInfoFlags pushFlags ); bool pushInfo( const QString &caller, const InfoTypeMap &input, const PushInfoFlags pushFlags );
QWeakPointer< QThread > workerThread() const; QPointer< QThread > workerThread() const;
public slots: public slots:
// InfoSystem takes ownership of InfoPlugins // InfoSystem takes ownership of InfoPlugins

View File

@@ -26,7 +26,6 @@
#include <QtCore/QObject> #include <QtCore/QObject>
#include <QtCore/QtDebug> #include <QtCore/QtDebug>
#include <QtCore/QMap> #include <QtCore/QMap>
#include <QtCore/QWeakPointer>
#include <QtCore/QSet> #include <QtCore/QSet>
#include <QtCore/QList> #include <QtCore/QList>
#include <QtCore/QVariant> #include <QtCore/QVariant>

View File

@@ -92,7 +92,7 @@ LatchedStatusManager::sourceOffline()
if ( m_jobs.contains( s->userName() ) ) if ( m_jobs.contains( s->userName() ) )
{ {
QWeakPointer< LatchedStatusItem> job = m_jobs.take( s->userName() ).data(); QPointer< LatchedStatusItem> job = m_jobs.take( s->userName() ).data();
if ( !job.isNull() ) if ( !job.isNull() )
job.data()->stop(); job.data()->stop();
} }
@@ -107,7 +107,7 @@ LatchedStatusManager::latchedOff( const Tomahawk::source_ptr& from, const Tomaha
if ( to->isLocal() && m_jobs.contains( from->userName() ) ) if ( to->isLocal() && m_jobs.contains( from->userName() ) )
{ {
QWeakPointer< LatchedStatusItem > item = m_jobs.take( from->userName() ); QPointer< LatchedStatusItem > item = m_jobs.take( from->userName() );
if ( !item.isNull() ) if ( !item.isNull() )
item.data()->stop(); item.data()->stop();
} }

View File

@@ -61,7 +61,7 @@ private slots:
void sourceOffline(); void sourceOffline();
private: private:
QHash< QString, QWeakPointer< LatchedStatusItem > > m_jobs; QHash< QString, QPointer< LatchedStatusItem > > m_jobs;
}; };
#endif // LATCHEDSTATUSITEM_H #endif // LATCHEDSTATUSITEM_H

View File

@@ -101,7 +101,7 @@ PipelineStatusManager::resolving( const Tomahawk::query_ptr& p )
if ( m_curItem.isNull() ) if ( m_curItem.isNull() )
{ {
// No current query item and we're resolving something, so show it // No current query item and we're resolving something, so show it
m_curItem = QWeakPointer< PipelineStatusItem >( new PipelineStatusItem( p ) ); m_curItem = QPointer< PipelineStatusItem >( new PipelineStatusItem( p ) );
JobStatusView::instance()->model()->addJob( m_curItem.data() ); JobStatusView::instance()->model()->addJob( m_curItem.data() );
} }
} }

View File

@@ -23,6 +23,7 @@
#include "Query.h" #include "Query.h"
#include <QPixmap> #include <QPixmap>
#include <QPointer>
class PipelineStatusItem : public JobStatusItem class PipelineStatusItem : public JobStatusItem
{ {
@@ -58,7 +59,7 @@ private slots:
void resolving( const Tomahawk::query_ptr& p ); void resolving( const Tomahawk::query_ptr& p );
private: private:
QWeakPointer<PipelineStatusItem> m_curItem; QPointer<PipelineStatusItem> m_curItem;
}; };

View File

@@ -30,7 +30,7 @@
TransferStatusItem::TransferStatusItem( TransferStatusManager* p, StreamConnection* sc ) TransferStatusItem::TransferStatusItem( TransferStatusManager* p, StreamConnection* sc )
: m_parent( p ) : m_parent( p )
, m_stream( QWeakPointer< StreamConnection >( sc ) ) , m_stream( QPointer< StreamConnection >( sc ) )
{ {
if ( m_stream.data()->type() == StreamConnection::RECEIVING ) if ( m_stream.data()->type() == StreamConnection::RECEIVING )
m_type = "receive"; m_type = "receive";

View File

@@ -22,6 +22,8 @@
#include "JobStatusItem.h" #include "JobStatusItem.h"
#include <QPixmap> #include <QPixmap>
#include <QPointer>
class StreamConnection; class StreamConnection;
@@ -58,7 +60,7 @@ private slots:
private: private:
TransferStatusManager* m_parent; TransferStatusManager* m_parent;
QString m_type, m_main, m_right; QString m_type, m_main, m_right;
QWeakPointer< StreamConnection > m_stream; QPointer< StreamConnection > m_stream;
}; };
#endif // TRANSFERSTATUSITEM_H #endif // TRANSFERSTATUSITEM_H

View File

@@ -45,7 +45,7 @@ PortFwdThread::~PortFwdThread()
void void
PortFwdThread::run() PortFwdThread::run()
{ {
m_worker = QWeakPointer< PortFwdWorker >( new PortFwdWorker( m_port ) ); m_worker = QPointer< PortFwdWorker >( new PortFwdWorker( m_port ) );
Q_ASSERT( m_worker ); Q_ASSERT( m_worker );
connect( m_worker.data(), SIGNAL( externalAddressDetected( QHostAddress, unsigned int ) ), this, SIGNAL( externalAddressDetected( QHostAddress, unsigned int ) ) ); connect( m_worker.data(), SIGNAL( externalAddressDetected( QHostAddress, unsigned int ) ), this, SIGNAL( externalAddressDetected( QHostAddress, unsigned int ) ) );
QTimer::singleShot( 0, m_worker.data(), SLOT( work() ) ); QTimer::singleShot( 0, m_worker.data(), SLOT( work() ) );
@@ -62,7 +62,7 @@ PortFwdThread::run()
} }
QWeakPointer< PortFwdWorker > QPointer< PortFwdWorker >
PortFwdThread::worker() const PortFwdThread::worker() const
{ {
return m_worker; return m_worker;

View File

@@ -22,7 +22,7 @@
#include <QThread> #include <QThread>
#include <QMutex> #include <QMutex>
#include <QHostAddress> #include <QHostAddress>
#include <QWeakPointer> #include <QPointer>
class Portfwd; class Portfwd;
@@ -59,7 +59,7 @@ public:
explicit PortFwdThread( unsigned int port ); explicit PortFwdThread( unsigned int port );
~PortFwdThread(); ~PortFwdThread();
QWeakPointer< PortFwdWorker > worker() const; QPointer< PortFwdWorker > worker() const;
signals: signals:
void externalAddressDetected( QHostAddress ha, unsigned int port ); void externalAddressDetected( QHostAddress ha, unsigned int port );
@@ -68,7 +68,7 @@ protected:
void run(); void run();
private: private:
QWeakPointer< PortFwdWorker > m_worker; QPointer< PortFwdWorker > m_worker;
unsigned int m_port; unsigned int m_port;
}; };

View File

@@ -150,7 +150,7 @@ Servent::startListening( QHostAddress ha, bool upnp, int port )
} }
// TODO check if we have a public/internet IP on this machine directly // TODO check if we have a public/internet IP on this machine directly
tLog() << "External address mode set to upnp..."; tLog() << "External address mode set to upnp...";
m_portfwd = QWeakPointer< PortFwdThread >( new PortFwdThread( m_port ) ); m_portfwd = QPointer< PortFwdThread >( new PortFwdThread( m_port ) );
Q_ASSERT( m_portfwd ); Q_ASSERT( m_portfwd );
connect( m_portfwd.data(), SIGNAL( externalAddressDetected( QHostAddress, unsigned int ) ), connect( m_portfwd.data(), SIGNAL( externalAddressDetected( QHostAddress, unsigned int ) ),
SLOT( setExternalAddress( QHostAddress, unsigned int ) ) ); SLOT( setExternalAddress( QHostAddress, unsigned int ) ) );
@@ -243,7 +243,7 @@ Servent::setExternalAddress( QHostAddress ha, unsigned int port )
void void
Servent::registerOffer( const QString& key, Connection* conn ) Servent::registerOffer( const QString& key, Connection* conn )
{ {
m_offers[key] = QWeakPointer<Connection>(conn); m_offers[key] = QPointer<Connection>(conn);
} }
@@ -304,7 +304,7 @@ void
Servent::readyRead() Servent::readyRead()
{ {
Q_ASSERT( this->thread() == QThread::currentThread() ); Q_ASSERT( this->thread() == QThread::currentThread() );
QWeakPointer< QTcpSocketExtra > sock = (QTcpSocketExtra*)sender(); QPointer< QTcpSocketExtra > sock = (QTcpSocketExtra*)sender();
if( sock.isNull() || sock.data()->_disowned ) if( sock.isNull() || sock.data()->_disowned )
{ {
@@ -667,7 +667,7 @@ Servent::claimOffer( ControlConnection* cc, const QString &nodeid, const QString
if( m_offers.contains( key ) ) if( m_offers.contains( key ) )
{ {
QWeakPointer<Connection> conn = m_offers.value( key ); QPointer<Connection> conn = m_offers.value( key );
if( conn.isNull() ) if( conn.isNull() )
{ {
// This can happen if it's a streamconnection, but the audioengine has // This can happen if it's a streamconnection, but the audioengine has

View File

@@ -64,7 +64,7 @@ public:
QTimer::singleShot( AUTH_TIMEOUT, this, SLOT( authTimeout() ) ) ; QTimer::singleShot( AUTH_TIMEOUT, this, SLOT( authTimeout() ) ) ;
} }
QWeakPointer<Connection> _conn; QPointer<Connection> _conn;
bool _outbound; bool _outbound;
bool _disowned; bool _disowned;
msg_ptr _msg; msg_ptr _msg;
@@ -159,7 +159,7 @@ private:
QJson::Parser parser; QJson::Parser parser;
QList< ControlConnection* > m_controlconnections; // canonical list of authed peers QList< ControlConnection* > m_controlconnections; // canonical list of authed peers
QMap< QString, QWeakPointer< Connection > > m_offers; QMap< QString, QPointer< Connection > > m_offers;
QStringList m_connectedNodes; QStringList m_connectedNodes;
int m_port, m_externalPort; int m_port, m_externalPort;
@@ -174,7 +174,7 @@ private:
QMap< QString,boost::function< QSharedPointer< QIODevice >(Tomahawk::result_ptr) > > m_iofactories; QMap< QString,boost::function< QSharedPointer< QIODevice >(Tomahawk::result_ptr) > > m_iofactories;
QWeakPointer< PortFwdThread > m_portfwd; QPointer< PortFwdThread > m_portfwd;
static Servent* s_instance; static Servent* s_instance;
}; };

View File

@@ -46,7 +46,7 @@ PlayableProxyModelPlaylistInterface::PlayableProxyModelPlaylistInterface( Playab
PlayableProxyModelPlaylistInterface::~PlayableProxyModelPlaylistInterface() PlayableProxyModelPlaylistInterface::~PlayableProxyModelPlaylistInterface()
{ {
tDebug() << Q_FUNC_INFO; tDebug() << Q_FUNC_INFO;
m_proxyModel.clear(); m_proxyModel = 0;
} }

View File

@@ -20,13 +20,14 @@
#ifndef TRACKPROXYMODELPLAYLISTINTERFACE_H #ifndef TRACKPROXYMODELPLAYLISTINTERFACE_H
#define TRACKPROXYMODELPLAYLISTINTERFACE_H #define TRACKPROXYMODELPLAYLISTINTERFACE_H
#include <QtGui/QSortFilterProxyModel>
#include "PlaylistInterface.h" #include "PlaylistInterface.h"
#include "playlist/PlayableModel.h" #include "playlist/PlayableModel.h"
#include "DllMacro.h" #include "DllMacro.h"
#include <QSortFilterProxyModel>
#include <QPointer>
class PlayableProxyModel; class PlayableProxyModel;
namespace Tomahawk { namespace Tomahawk {
@@ -65,7 +66,7 @@ private slots:
void onCurrentIndexChanged(); void onCurrentIndexChanged();
protected: protected:
QWeakPointer< PlayableProxyModel > m_proxyModel; QPointer< PlayableProxyModel > m_proxyModel;
PlaylistModes::RepeatMode m_repeatMode; PlaylistModes::RepeatMode m_repeatMode;
bool m_shuffled; bool m_shuffled;

View File

@@ -43,7 +43,7 @@ TreeProxyModelPlaylistInterface::TreeProxyModelPlaylistInterface( TreeProxyModel
TreeProxyModelPlaylistInterface::~TreeProxyModelPlaylistInterface() TreeProxyModelPlaylistInterface::~TreeProxyModelPlaylistInterface()
{ {
m_proxyModel.clear(); m_proxyModel = 0;
} }

View File

@@ -67,7 +67,7 @@ public slots:
virtual void setShuffled( bool enabled ) { m_shuffled = enabled; emit shuffleModeChanged( enabled ); } virtual void setShuffled( bool enabled ) { m_shuffled = enabled; emit shuffleModeChanged( enabled ); }
private: private:
QWeakPointer< TreeProxyModel > m_proxyModel; QPointer< TreeProxyModel > m_proxyModel;
PlaylistModes::RepeatMode m_repeatMode; PlaylistModes::RepeatMode m_repeatMode;
bool m_shuffled; bool m_shuffled;

View File

@@ -62,8 +62,8 @@ namespace Tomahawk
// utility // utility
void calculateSummary(); void calculateSummary();
QWeakPointer< QWidget > m_input; QPointer< QWidget > m_input;
QWeakPointer< QWidget > m_match; QPointer< QWidget > m_match;
QString m_matchData; QString m_matchData;
QString m_matchString; QString m_matchString;
QString m_summary; QString m_summary;

View File

@@ -181,8 +181,8 @@ Tomahawk::EchonestControl::updateWidgets()
match->hide(); match->hide();
input->hide(); input->hide();
m_match = QWeakPointer< QWidget >( match ); m_match = QPointer< QWidget >( match );
m_input = QWeakPointer< QWidget >( input ); m_input = QPointer< QWidget >( input );
m_data.first = m_currentType; m_data.first = m_currentType;
} else if( selectedType() == "Artist Description" ) { } else if( selectedType() == "Artist Description" ) {
m_currentType = Echonest::DynamicPlaylist::Description; m_currentType = Echonest::DynamicPlaylist::Description;
@@ -200,8 +200,8 @@ Tomahawk::EchonestControl::updateWidgets()
match->hide(); match->hide();
input->hide(); input->hide();
m_match = QWeakPointer< QWidget >( match ); m_match = QPointer< QWidget >( match );
m_input = QWeakPointer< QWidget >( input ); m_input = QPointer< QWidget >( input );
m_data.first = m_currentType; m_data.first = m_currentType;
} else if( selectedType() == "User Radio" ) { } else if( selectedType() == "User Radio" ) {
m_currentType = Echonest::DynamicPlaylist::SourceCatalog; m_currentType = Echonest::DynamicPlaylist::SourceCatalog;
@@ -229,8 +229,8 @@ Tomahawk::EchonestControl::updateWidgets()
match->hide(); match->hide();
combo->hide(); combo->hide();
m_match = QWeakPointer< QWidget >( match ); m_match = QPointer< QWidget >( match );
m_input = QWeakPointer< QWidget >( combo ); m_input = QPointer< QWidget >( combo );
} else if( selectedType() == "Song" ) { } else if( selectedType() == "Song" ) {
m_currentType = Echonest::DynamicPlaylist::SongId; m_currentType = Echonest::DynamicPlaylist::SongId;
@@ -248,8 +248,8 @@ Tomahawk::EchonestControl::updateWidgets()
match->hide(); match->hide();
input->hide(); input->hide();
m_match = QWeakPointer< QWidget >( match ); m_match = QPointer< QWidget >( match );
m_input = QWeakPointer< QWidget >( input ); m_input = QPointer< QWidget >( input );
m_data.first = m_currentType; m_data.first = m_currentType;
} else if( selectedType() == "Variety" ) { } else if( selectedType() == "Variety" ) {
m_currentType = Echonest::DynamicPlaylist::Variety; m_currentType = Echonest::DynamicPlaylist::Variety;
@@ -269,8 +269,8 @@ Tomahawk::EchonestControl::updateWidgets()
match->hide(); match->hide();
input->hide(); input->hide();
m_match = QWeakPointer< QWidget >( match ); m_match = QPointer< QWidget >( match );
m_input = QWeakPointer< QWidget >( input ); m_input = QPointer< QWidget >( input );
m_data.first = m_currentType; m_data.first = m_currentType;
} else if( selectedType() == "Adventurousness" ) { } else if( selectedType() == "Adventurousness" ) {
m_currentType = Echonest::DynamicPlaylist::Adventurousness; m_currentType = Echonest::DynamicPlaylist::Adventurousness;
@@ -291,8 +291,8 @@ Tomahawk::EchonestControl::updateWidgets()
match->hide(); match->hide();
input->hide(); input->hide();
m_match = QWeakPointer< QWidget >( match ); m_match = QPointer< QWidget >( match );
m_input = QWeakPointer< QWidget >( input ); m_input = QPointer< QWidget >( input );
m_data.first = m_currentType; m_data.first = m_currentType;
} else if( selectedType() == "Tempo" ) { } else if( selectedType() == "Tempo" ) {
m_currentType = Echonest::DynamicPlaylist::MinTempo; m_currentType = Echonest::DynamicPlaylist::MinTempo;
@@ -354,8 +354,8 @@ Tomahawk::EchonestControl::updateWidgets()
match->hide(); match->hide();
combo->hide(); combo->hide();
m_match = QWeakPointer< QWidget >( match ); m_match = QPointer< QWidget >( match );
m_input = QWeakPointer< QWidget >( combo ); m_input = QPointer< QWidget >( combo );
} else if( selectedType() == "Key" ) { } else if( selectedType() == "Key" ) {
m_currentType = Echonest::DynamicPlaylist::Key; m_currentType = Echonest::DynamicPlaylist::Key;
@@ -383,8 +383,8 @@ Tomahawk::EchonestControl::updateWidgets()
match->hide(); match->hide();
combo->hide(); combo->hide();
m_match = QWeakPointer< QWidget >( match ); m_match = QPointer< QWidget >( match );
m_input = QWeakPointer< QWidget >( combo ); m_input = QPointer< QWidget >( combo );
} else if( selectedType() == "Sorting" ) { } else if( selectedType() == "Sorting" ) {
m_currentType = Echonest::DynamicPlaylist::Sort; m_currentType = Echonest::DynamicPlaylist::Sort;
@@ -416,8 +416,8 @@ Tomahawk::EchonestControl::updateWidgets()
match->hide(); match->hide();
combo->hide(); combo->hide();
m_match = QWeakPointer< QWidget >( match ); m_match = QPointer< QWidget >( match );
m_input = QWeakPointer< QWidget >( combo ); m_input = QPointer< QWidget >( combo );
} else if( selectedType() == "Mood" || selectedType() == "Style" ) { } else if( selectedType() == "Mood" || selectedType() == "Style" ) {
if( selectedType() == "Mood" ) if( selectedType() == "Mood" )
m_currentType = Echonest::DynamicPlaylist::Mood; m_currentType = Echonest::DynamicPlaylist::Mood;
@@ -437,13 +437,13 @@ Tomahawk::EchonestControl::updateWidgets()
match->hide(); match->hide();
combo->hide(); combo->hide();
m_match = QWeakPointer< QWidget >( match ); m_match = QPointer< QWidget >( match );
m_input = QWeakPointer< QWidget >( combo ); m_input = QPointer< QWidget >( combo );
insertMoodsAndStyles(); insertMoodsAndStyles();
} else { } else {
m_match = QWeakPointer<QWidget>( new QWidget ); m_match = QPointer<QWidget>( new QWidget );
m_input = QWeakPointer<QWidget>( new QWidget ); m_input = QPointer<QWidget>( new QWidget );
} }
updateData(); updateData();
calculateSummary(); calculateSummary();
@@ -472,8 +472,8 @@ Tomahawk::EchonestControl::setupMinMaxWidgets( Echonest::DynamicPlaylist::Playli
match->hide(); match->hide();
input->hide(); input->hide();
m_match = QWeakPointer< QWidget >( match ); m_match = QPointer< QWidget >( match );
m_input = QWeakPointer< QWidget >( input ); m_input = QPointer< QWidget >( input );
} }

View File

@@ -24,6 +24,7 @@
#include <echonest/Playlist.h> #include <echonest/Playlist.h>
#include <QTimer> #include <QTimer>
#include <QPointer>
namespace Tomahawk namespace Tomahawk
{ {
@@ -81,8 +82,8 @@ private:
Echonest::DynamicPlaylist::PlaylistParam m_currentType; Echonest::DynamicPlaylist::PlaylistParam m_currentType;
int m_overrideType; int m_overrideType;
QWeakPointer< QWidget > m_input; QPointer< QWidget > m_input;
QWeakPointer< QWidget > m_match; QPointer< QWidget > m_match;
QString m_matchData; QString m_matchData;
QString m_matchString; QString m_matchString;
QString m_summary; QString m_summary;

View File

@@ -40,12 +40,12 @@ DynamicControlWrapper::DynamicControlWrapper( const Tomahawk::dyncontrol_ptr& co
, m_minusButton( 0 ) , m_minusButton( 0 )
, m_control( control ) , m_control( control )
, m_typeSelector( 0 ) , m_typeSelector( 0 )
, m_layout( QWeakPointer< QGridLayout >( layout ) ) , m_layout( QPointer< QGridLayout >( layout ) )
{ {
m_typeSelector = new QComboBox( m_parent ); m_typeSelector = new QComboBox( m_parent );
m_matchSelector = QWeakPointer<QWidget>( control->matchSelector() ); m_matchSelector = QPointer<QWidget>( control->matchSelector() );
m_entryWidget = QWeakPointer<QWidget>( control->inputField() ); m_entryWidget = QPointer<QWidget>( control->inputField() );
m_minusButton = initButton( m_parent ); m_minusButton = initButton( m_parent );
m_minusButton->setIcon( TomahawkUtils::defaultPixmap( TomahawkUtils::ListRemove ) ); m_minusButton->setIcon( TomahawkUtils::defaultPixmap( TomahawkUtils::ListRemove ) );
@@ -157,12 +157,12 @@ DynamicControlWrapper::typeSelectorChanged( const QString& type, bool firstLoad
if( m_control->matchSelector() ) { if( m_control->matchSelector() ) {
m_matchSelector = QWeakPointer<QWidget>( m_control->matchSelector() ); m_matchSelector = QPointer<QWidget>( m_control->matchSelector() );
m_layout.data()->addWidget( m_matchSelector.data(), m_row, 1, Qt::AlignCenter ); m_layout.data()->addWidget( m_matchSelector.data(), m_row, 1, Qt::AlignCenter );
m_matchSelector.data()->show(); m_matchSelector.data()->show();
} }
if( m_control->inputField() ) { if( m_control->inputField() ) {
m_entryWidget = QWeakPointer<QWidget>( m_control->inputField() ); m_entryWidget = QPointer<QWidget>( m_control->inputField() );
m_layout.data()->addWidget( m_entryWidget.data(), m_row, 2 ); m_layout.data()->addWidget( m_entryWidget.data(), m_row, 2 );
m_entryWidget.data()->show(); m_entryWidget.data()->show();
} }

View File

@@ -20,6 +20,7 @@
#define DYNAMIC_CONTROL_WRAPPER_H #define DYNAMIC_CONTROL_WRAPPER_H
#include <QWidget> #include <QWidget>
#include <QPointer>
#include "Typedefs.h" #include "Typedefs.h"
@@ -70,9 +71,9 @@ private:
dyncontrol_ptr m_control; dyncontrol_ptr m_control;
QComboBox* m_typeSelector; QComboBox* m_typeSelector;
QWeakPointer<QWidget> m_matchSelector; QPointer<QWidget> m_matchSelector;
QWeakPointer<QWidget> m_entryWidget; QPointer<QWidget> m_entryWidget;
QWeakPointer<QGridLayout> m_layout; QPointer<QGridLayout> m_layout;
}; };
}; };

View File

@@ -523,7 +523,7 @@ QtScriptResolver::loadUi()
if( m.contains( "images" ) ) if( m.contains( "images" ) )
uiData = fixDataImagePaths( uiData, compressed, images ); uiData = fixDataImagePaths( uiData, compressed, images );
m_configWidget = QWeakPointer< QWidget >( widgetFromData( uiData, 0 ) ); m_configWidget = QPointer< QWidget >( widgetFromData( uiData, 0 ) );
emit changed(); emit changed();
} }

View File

@@ -176,7 +176,7 @@ private:
ExternalResolver::ErrorState m_error; ExternalResolver::ErrorState m_error;
QtScriptResolverHelper* m_resolverHelper; QtScriptResolverHelper* m_resolverHelper;
QWeakPointer< QWidget > m_configWidget; QPointer< QWidget > m_configWidget;
QList< QVariant > m_dataWidgets; QList< QVariant > m_dataWidgets;
}; };

View File

@@ -427,7 +427,7 @@ ScriptResolver::setupConfWidget( const QVariantMap& m )
if ( m.contains( "images" ) ) if ( m.contains( "images" ) )
uiData = fixDataImagePaths( uiData, compressed, m[ "images" ].toMap() ); uiData = fixDataImagePaths( uiData, compressed, m[ "images" ].toMap() );
m_configWidget = QWeakPointer< QWidget >( widgetFromData( uiData, 0 ) ); m_configWidget = QPointer< QWidget >( widgetFromData( uiData, 0 ) );
emit changed(); emit changed();
} }

View File

@@ -87,7 +87,7 @@ private:
QString m_name; QString m_name;
QPixmap m_icon; QPixmap m_icon;
unsigned int m_weight, m_preference, m_timeout, m_num_restarts; unsigned int m_weight, m_preference, m_timeout, m_num_restarts;
QWeakPointer< QWidget > m_configWidget; QPointer< QWidget > m_configWidget;
quint32 m_msgsize; quint32 m_msgsize;
QByteArray m_msg; QByteArray m_msg;

View File

@@ -7,6 +7,7 @@
#include <QDialog> #include <QDialog>
#include <QDialogButtonBox> #include <QDialogButtonBox>
#include <QDebug> #include <QDebug>
#include <QPointer>
class QToolbarTabDialogPrivate : public QObject { class QToolbarTabDialogPrivate : public QObject {
Q_OBJECT Q_OBJECT
@@ -45,8 +46,8 @@ public slots:
} }
public: public:
QWeakPointer<QDialog> dialog; QPointer<QDialog> dialog;
QWeakPointer<QToolbarTabDialog> q; QPointer<QToolbarTabDialog> q;
QVBoxLayout* layout; QVBoxLayout* layout;
QToolBar* toolbar; QToolBar* toolbar;

View File

@@ -27,7 +27,7 @@ BinaryInstallerHelper::BinaryInstallerHelper( QTemporaryFile* tempFile, const QS
, m_tempFile( tempFile ) , m_tempFile( tempFile )
, m_resolverId( resolverId ) , m_resolverId( resolverId )
, m_createAccount( createAccount ) , m_createAccount( createAccount )
, m_manager( QWeakPointer< AtticaManager >( manager ) ) , m_manager( QPointer< AtticaManager >( manager ) )
{ {
Q_ASSERT( m_tempFile ); Q_ASSERT( m_tempFile );
Q_ASSERT( !m_resolverId.isEmpty() ); Q_ASSERT( !m_resolverId.isEmpty() );

View File

@@ -20,7 +20,7 @@
#include "AtticaManager.h" #include "AtticaManager.h"
#include <QWeakPointer> #include <QPointer>
class QTemporaryFile; class QTemporaryFile;
class BinaryInstallerHelper : public QObject class BinaryInstallerHelper : public QObject
@@ -39,7 +39,7 @@ private:
QTemporaryFile* m_tempFile; QTemporaryFile* m_tempFile;
QString m_resolverId; QString m_resolverId;
bool m_createAccount; bool m_createAccount;
QWeakPointer<AtticaManager> m_manager; QPointer<AtticaManager> m_manager;
}; };
#endif #endif

View File

@@ -111,7 +111,7 @@ createAccountFromFactory( Tomahawk::Accounts::AccountFactory* factory, QWidget*
dialog->show(); dialog->show();
#else #else
DelegateConfigWrapper dialog( account->configurationWidget(), account->aboutWidget(), QObject::tr( "%1 Config" ).arg( account->accountFriendlyName() ), parent ); DelegateConfigWrapper dialog( account->configurationWidget(), account->aboutWidget(), QObject::tr( "%1 Config" ).arg( account->accountFriendlyName() ), parent );
QWeakPointer< DelegateConfigWrapper > watcher( &dialog ); QPointer< DelegateConfigWrapper > watcher( &dialog );
if( account->configurationWidget()->metaObject()->indexOfSignal( "dataError(bool)" ) > -1 ) if( account->configurationWidget()->metaObject()->indexOfSignal( "dataError(bool)" ) > -1 )
QObject::connect( account->configurationWidget(), SIGNAL( dataError( bool ) ), &dialog, SLOT( toggleOkButton( bool ) ), Qt::UniqueConnection ); QObject::connect( account->configurationWidget(), SIGNAL( dataError( bool ) ), &dialog, SLOT( toggleOkButton( bool ) ), Qt::UniqueConnection );
@@ -141,7 +141,7 @@ openAccountConfig( Tomahawk::Accounts::Account* account, QWidget* parent, bool s
#ifndef Q_OS_MAC #ifndef Q_OS_MAC
DelegateConfigWrapper dialog( account->configurationWidget(), account->aboutWidget(), QObject::tr("%1 Configuration" ).arg( account->accountFriendlyName() ), parent ); DelegateConfigWrapper dialog( account->configurationWidget(), account->aboutWidget(), QObject::tr("%1 Configuration" ).arg( account->accountFriendlyName() ), parent );
dialog.setShowDelete( showDelete ); dialog.setShowDelete( showDelete );
QWeakPointer< DelegateConfigWrapper > watcher( &dialog ); QPointer< DelegateConfigWrapper > watcher( &dialog );
int ret = dialog.exec(); int ret = dialog.exec();
if ( !watcher.isNull() && dialog.deleted() ) if ( !watcher.isNull() && dialog.deleted() )
{ {

View File

@@ -31,14 +31,14 @@
using namespace Tomahawk; using namespace Tomahawk;
QWeakPointer< TomahawkUtils::SharedTimeLine > PixmapDelegateFader::s_stlInstance = QWeakPointer< TomahawkUtils::SharedTimeLine >(); QPointer< TomahawkUtils::SharedTimeLine > PixmapDelegateFader::s_stlInstance = QPointer< TomahawkUtils::SharedTimeLine >();
QWeakPointer< TomahawkUtils::SharedTimeLine > QPointer< TomahawkUtils::SharedTimeLine >
PixmapDelegateFader::stlInstance() PixmapDelegateFader::stlInstance()
{ {
if ( s_stlInstance.isNull() ) if ( s_stlInstance.isNull() )
s_stlInstance = QWeakPointer< TomahawkUtils::SharedTimeLine> ( new TomahawkUtils::SharedTimeLine() ); s_stlInstance = QPointer< TomahawkUtils::SharedTimeLine> ( new TomahawkUtils::SharedTimeLine() );
return s_stlInstance; return s_stlInstance;
} }

View File

@@ -28,7 +28,7 @@
#include <QObject> #include <QObject>
#include <QTimeLine> #include <QTimeLine>
#include <QQueue> #include <QQueue>
#include <QWeakPointer> #include <QPointer>
namespace Tomahawk namespace Tomahawk
{ {
@@ -43,7 +43,7 @@ class PixmapDelegateFader : public QObject
{ {
Q_OBJECT Q_OBJECT
static QWeakPointer< TomahawkUtils::SharedTimeLine > stlInstance(); static QPointer< TomahawkUtils::SharedTimeLine > stlInstance();
public: public:
PixmapDelegateFader( const artist_ptr& artist, const QSize& size, TomahawkUtils::ImageMode mode = TomahawkUtils::Original, bool forceLoad = true ); PixmapDelegateFader( const artist_ptr& artist, const QSize& size, TomahawkUtils::ImageMode mode = TomahawkUtils::Original, bool forceLoad = true );
@@ -88,7 +88,7 @@ private:
QPixmap m_currentReference, m_oldReference, m_current; QPixmap m_currentReference, m_oldReference, m_current;
static QWeakPointer< TomahawkUtils::SharedTimeLine > s_stlInstance; static QPointer< TomahawkUtils::SharedTimeLine > s_stlInstance;
}; };
} }

View File

@@ -30,7 +30,7 @@ WidgetDragFilter::WidgetDragFilter( QObject* parent )
, m_dragStarted( false ) , m_dragStarted( false )
{ {
Q_ASSERT( parent->isWidgetType() ); Q_ASSERT( parent->isWidgetType() );
m_target = QWeakPointer<QWidget>(static_cast<QWidget*>(parent)); m_target = QPointer<QWidget>(static_cast<QWidget*>(parent));
m_target.data()->installEventFilter( this ); m_target.data()->installEventFilter( this );
} }

View File

@@ -19,11 +19,12 @@
#ifndef WIDGET_DRAG_FILTER_H #ifndef WIDGET_DRAG_FILTER_H
#define WIDGET_DRAG_FILTER_H #define WIDGET_DRAG_FILTER_H
#include "DllMacro.h"
#include <QObject> #include <QObject>
#include <QPoint> #include <QPoint>
#include <QWidget> #include <QWidget>
#include <QPointer>
#include "DllMacro.h"
class QMouseEvent; class QMouseEvent;
class QEvent; class QEvent;
@@ -42,7 +43,7 @@ public:
private: private:
bool canDrag( QObject* obj, QMouseEvent* ev ) const; bool canDrag( QObject* obj, QMouseEvent* ev ) const;
QWeakPointer<QWidget> m_target; // in case it's deleted under us QPointer<QWidget> m_target; // in case it's deleted under us
QPoint m_dragPoint; QPoint m_dragPoint;
bool m_dragStarted; bool m_dragStarted;
}; };

View File

@@ -23,7 +23,7 @@
#include <QTimeLine> #include <QTimeLine>
#include <QPropertyAnimation> #include <QPropertyAnimation>
#include <QEasingCurve> #include <QEasingCurve>
#include <cmath> #include <QPointer>
#include "DllMacro.h" #include "DllMacro.h"
@@ -52,7 +52,7 @@ private:
unsigned int m_val, m_oldval; unsigned int m_val, m_oldval;
QString m_format; QString m_format;
QWeakPointer<QLabel> m_diff; QPointer<QLabel> m_diff;
}; };
#endif // ANIMATEDCOUNTERLABEL_H #endif // ANIMATEDCOUNTERLABEL_H

View File

@@ -27,13 +27,13 @@
#define ANIMATION_TIME 1000 #define ANIMATION_TIME 1000
QWeakPointer< TomahawkUtils::SharedTimeLine > FadingPixmap::s_stlInstance = QWeakPointer< TomahawkUtils::SharedTimeLine >(); QPointer< TomahawkUtils::SharedTimeLine > FadingPixmap::s_stlInstance = QPointer< TomahawkUtils::SharedTimeLine >();
QWeakPointer< TomahawkUtils::SharedTimeLine > QPointer< TomahawkUtils::SharedTimeLine >
FadingPixmap::stlInstance() FadingPixmap::stlInstance()
{ {
if ( s_stlInstance.isNull() ) if ( s_stlInstance.isNull() )
s_stlInstance = QWeakPointer< TomahawkUtils::SharedTimeLine> ( new TomahawkUtils::SharedTimeLine() ); s_stlInstance = QPointer< TomahawkUtils::SharedTimeLine> ( new TomahawkUtils::SharedTimeLine() );
return s_stlInstance; return s_stlInstance;
} }

View File

@@ -26,7 +26,7 @@
#include <QLabel> #include <QLabel>
#include <QPaintEvent> #include <QPaintEvent>
#include <QTimeLine> #include <QTimeLine>
#include <QWeakPointer> #include <QPointer>
#include "DllMacro.h" #include "DllMacro.h"
@@ -38,7 +38,7 @@ class DLLEXPORT FadingPixmap : public QLabel
{ {
Q_OBJECT Q_OBJECT
static QWeakPointer< TomahawkUtils::SharedTimeLine > stlInstance(); static QPointer< TomahawkUtils::SharedTimeLine > stlInstance();
public: public:
FadingPixmap( QWidget* parent = 0 ); FadingPixmap( QWidget* parent = 0 );
@@ -70,7 +70,7 @@ private:
int m_startFrame; int m_startFrame;
bool m_isDefault; bool m_isDefault;
static QWeakPointer< TomahawkUtils::SharedTimeLine > s_stlInstance; static QPointer< TomahawkUtils::SharedTimeLine > s_stlInstance;
}; };
#endif #endif

Some files were not shown because too many files have changed in this diff Show More