[vlmc-devel] [PATCH 1/2] RecentProjects: Use a child Settings

yikei lu luyikei.qmltu at gmail.com
Sun Apr 10 11:16:11 CEST 2016


Well I think we don't have to use it necessarily, but if we don't want
to expose the list to the parent settings, it will be a choice.

Sorry for deletion, I added it in the latter commit. I'll amend both.

2016-04-10 18:10 GMT+09:00 Hugo Beauzée-Luyssen <hugo at beauzee.fr>:
>
>> On 10 Apr 2016, at 09:26, Yikai Lu <luyikei.qmltu at gmail.com> wrote:
>>
>> ---
>> src/Project/RecentProjects.cpp | 9 +++++----
>> 1 file changed, 5 insertions(+), 4 deletions(-)
>>
>> diff --git a/src/Project/RecentProjects.cpp b/src/Project/RecentProjects.cpp
>> index 70c5a95..ec4df43 100644
>> --- a/src/Project/RecentProjects.cpp
>> +++ b/src/Project/RecentProjects.cpp
>> @@ -30,10 +30,11 @@
>>
>> RecentProjects::RecentProjects( Settings* vlmcSettings, QObject *parent )
>>     : QObject(parent)
>> -    , m_settings( vlmcSettings )
>> +    , m_settings( new Settings )
>
> This is lacking a delete
>
>> {
>> -     SettingValue* recentProjects = vlmcSettings->createVar( SettingValue::String, "private/RecentsProjects", "",
>> +    SettingValue* recentProjects = m_settings->createVar( SettingValue::String, "private/RecentsProjects", "",
>>                                                 "", "", SettingValue::Private );
>> +    vlmcSettings->addSettings( "RecentProjects", *m_settings );
>>
>>       connect( recentProjects, SIGNAL( changed( QVariant ) ), this, SLOT( loadRecentProjects( QVariant ) ) );
>> }
>> @@ -49,7 +50,7 @@ RecentProjects::projectLoaded(const QString& projectName, const QString& project
>>     while ( m_recentsProjects.count() > 15 )
>>         m_recentsProjects.removeLast();
>>
>> -    Core::instance()->settings()->setValue( "private/RecentsProjects", flattenProjectList() );
>> +    m_settings->setValue( "private/RecentsProjects", flattenProjectList() );
>> }
>>
>> const RecentProjects::List&
>> @@ -91,7 +92,7 @@ void
>> RecentProjects::remove( const QString& projectPath )
>> {
>>     removeFromRecentProjects( projectPath );
>> -    Core::instance()->settings()->setValue( "private/RecentsProjects", flattenProjectList() );
>> +    m_settings->setValue( "private/RecentsProjects", flattenProjectList() );
>> }
>>
>> void
>> --
>> 1.9.1
>>
>> _______________________________________________
>> Vlmc-devel mailing list
>> Vlmc-devel at videolan.org
>> https://mailman.videolan.org/listinfo/vlmc-devel
>
> What’s the idea behind this?
>
> _______________________________________________
> Vlmc-devel mailing list
> Vlmc-devel at videolan.org
> https://mailman.videolan.org/listinfo/vlmc-devel


More information about the Vlmc-devel mailing list