1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-14 18:14:50 +02:00

Use TomahawkSettings set/lastChartIds instead of QSettings

This commit is contained in:
Hugo Lindström
2012-09-24 14:40:37 +02:00
parent c1c40cac37
commit 46772ee261
3 changed files with 19 additions and 3 deletions

View File

@@ -1368,6 +1368,19 @@ TomahawkSettings::setPlaylistUpdaters( const SerializedUpdaters& updaters )
}
void
TomahawkSettings::setLastChartIds( const QVariant& ids ){
setValue( "chartIds", ids );
}
QVariant TomahawkSettings::lastChartIds(){
return value( "chartIds" ).value<QVariant>();
}
void
TomahawkSettings::registerCustomSettingsHandlers()
{

View File

@@ -211,6 +211,10 @@ public:
static void registerCustomSettingsHandlers();
// Charts
void setLastChartIds( const QVariant& ids );
QVariant lastChartIds();
signals:
void changed();
void recentlyPlayedPlaylistAdded( const QString& playlistId, int sourceId );

View File

@@ -104,7 +104,7 @@ WhatsHotWidget::WhatsHotWidget( QWidget* parent )
connect( Tomahawk::InfoSystem::InfoSystem::instance(), SIGNAL( finished( QString ) ), SLOT( infoSystemFinished( QString ) ) );
// Read last viewed charts, to be used as defaults
m_currentVIds = QSettings().value( "chartIds" ).toMap();
m_currentVIds = TomahawkSettings::instance()->lastChartIds().toMap();
}
@@ -112,8 +112,7 @@ WhatsHotWidget::~WhatsHotWidget()
{
qDebug() << "Deleting whatshot";
// Write the settings
QSettings().setValue( "chartIds", m_currentVIds );
TomahawkSettings::instance()->setLastChartIds( m_currentVIds );
qDeleteAll( m_workers );
m_workers.clear();
m_workerThread->exit( 0 );