Commit 28b5e483 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

[Qt] RecentMRLs: Simplification and adding some debug.

parent 190e7875
...@@ -50,7 +50,6 @@ RecentsMRL::RecentsMRL( intf_thread_t *_p_intf ) : p_intf( _p_intf ) ...@@ -50,7 +50,6 @@ RecentsMRL::RecentsMRL( intf_thread_t *_p_intf ) : p_intf( _p_intf )
RecentsMRL::~RecentsMRL() RecentsMRL::~RecentsMRL()
{ {
delete stack; delete stack;
delete signalMapper;
} }
void RecentsMRL::addRecent( const QString &mrl ) void RecentsMRL::addRecent( const QString &mrl )
...@@ -58,6 +57,7 @@ void RecentsMRL::addRecent( const QString &mrl ) ...@@ -58,6 +57,7 @@ void RecentsMRL::addRecent( const QString &mrl )
if ( !isActive || filter->indexIn( mrl ) >= 0 ) if ( !isActive || filter->indexIn( mrl ) >= 0 )
return; return;
msg_Dbg( p_intf, "Adding a new MRL to recent ones: %s", qtu( mrl ) );
if( stack->contains( mrl ) ) if( stack->contains( mrl ) )
{ {
stack->removeOne( mrl ); stack->removeOne( mrl );
...@@ -89,11 +89,7 @@ QList<QString> RecentsMRL::recents() ...@@ -89,11 +89,7 @@ QList<QString> RecentsMRL::recents()
void RecentsMRL::load() void RecentsMRL::load()
{ {
QStringList list; QStringList list = getSettings()->value( "RecentsMRL/list" ).toStringList();
getSettings()->beginGroup( "RecentsMRL" );
list = getSettings()->value( "list" ).toStringList();
getSettings()->endGroup();
for( int i = 0; i < list.size(); ++i ) for( int i = 0; i < list.size(); ++i )
{ {
...@@ -109,7 +105,6 @@ void RecentsMRL::save() ...@@ -109,7 +105,6 @@ void RecentsMRL::save()
for( int i = 0; i < stack->size(); ++i ) for( int i = 0; i < stack->size(); ++i )
list << stack->at(i); list << stack->at(i);
getSettings()->beginGroup( "RecentsMRL" ); getSettings()->setValue( "RecentsMRL/list", list );
getSettings()->setValue( "list", list );
getSettings()->endGroup();
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment