mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-15 10:33:59 +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
|
void
|
||||||
TomahawkSettings::registerCustomSettingsHandlers()
|
TomahawkSettings::registerCustomSettingsHandlers()
|
||||||
{
|
{
|
||||||
|
@@ -211,6 +211,10 @@ public:
|
|||||||
|
|
||||||
static void registerCustomSettingsHandlers();
|
static void registerCustomSettingsHandlers();
|
||||||
|
|
||||||
|
// Charts
|
||||||
|
void setLastChartIds( const QVariant& ids );
|
||||||
|
QVariant lastChartIds();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void changed();
|
void changed();
|
||||||
void recentlyPlayedPlaylistAdded( const QString& playlistId, int sourceId );
|
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 ) ) );
|
connect( Tomahawk::InfoSystem::InfoSystem::instance(), SIGNAL( finished( QString ) ), SLOT( infoSystemFinished( QString ) ) );
|
||||||
|
|
||||||
// Read last viewed charts, to be used as defaults
|
// 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";
|
qDebug() << "Deleting whatshot";
|
||||||
// Write the settings
|
// Write the settings
|
||||||
QSettings().setValue( "chartIds", m_currentVIds );
|
TomahawkSettings::instance()->setLastChartIds( m_currentVIds );
|
||||||
|
|
||||||
qDeleteAll( m_workers );
|
qDeleteAll( m_workers );
|
||||||
m_workers.clear();
|
m_workers.clear();
|
||||||
m_workerThread->exit( 0 );
|
m_workerThread->exit( 0 );
|
||||||
|
Reference in New Issue
Block a user