Skip to content
Snippets Groups Projects
Commit 1c5715de authored by luyikei's avatar luyikei Committed by Hugo Beauzée-Luyssen
Browse files

RecentProjects: Use const QVariant& for toVariant()


I totally forgot that SettingValue::get() is already QVariant, which should be used directly to save some memory.

Signed-off-by: default avatarHugo Beauzée-Luyssen <hugo@beauzee.fr>
parent 5d95d9c5
No related branches found
No related tags found
No related merge requests found
......@@ -30,16 +30,16 @@ RecentProjects::RecentProjects( Settings* vlmcSettings, QObject *parent )
"", "", SettingValue::Private );
}
QVariant
const QVariant&
RecentProjects::toVariant() const
{
return QVariant( m_recentsProjects->get().toList() );
return m_recentsProjects->get();
}
void
RecentProjects::remove( const QString &projectFile )
{
QVariantList l = m_recentsProjects->get().toList();
QVariantList l = toVariant().toList();
for ( int i = 0; i < l.count(); ++i )
{
if ( l[i].toMap()["file"].toString() == projectFile )
......@@ -54,7 +54,7 @@ RecentProjects::remove( const QString &projectFile )
void
RecentProjects::projectLoaded( const QString& projectName, const QString& projectFile )
{
QVariantList l = m_recentsProjects->get().toList();
QVariantList l = toVariant().toList();
QVariantMap var {
{ "name", projectName },
{ "file", projectFile }
......
......@@ -36,7 +36,7 @@ class RecentProjects : public QObject
public:
explicit RecentProjects(Settings* vlmcSettings, QObject *parent = 0 );
QVariant toVariant() const;
const QVariant& toVariant() const;
void remove( const QString& projectFile );
public slots:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment