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:
@@ -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()
|
||||
{
|
||||
|
@@ -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 );
|
||||
|
@@ -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 );
|
||||
|
Reference in New Issue
Block a user