Commit ef26e8ea authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4- Playlist Model. Save the showColumn flags in the configuration ONLY...

Qt4- Playlist Model. Save the showColumn flags in the configuration ONLY during distruction and not while running.

parent c9ceb4ea
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#include "qt4.hpp" #include "qt4.hpp"
#include "components/playlist/playlist_model.hpp" #include "components/playlist/playlist_model.hpp"
#include "dialogs/mediainfo.hpp"
#include <vlc_intf_strings.h> #include <vlc_intf_strings.h>
#include "pixmaps/type_unknown.xpm" #include "pixmaps/type_unknown.xpm"
...@@ -60,7 +59,7 @@ void PLItem::init( int _i_id, int _i_input_id, PLItem *parent, PLModel *m ) ...@@ -60,7 +59,7 @@ void PLItem::init( int _i_id, int _i_input_id, PLItem *parent, PLModel *m )
/* No parent, should be the main one */ /* No parent, should be the main one */
if( parentItem == NULL ) if( parentItem == NULL )
{ {
i_showflags = config_GetInt( model->p_intf, "qt-pl-showflags" ); i_showflags = model->shownFlags();
updateColumnHeaders(); updateColumnHeaders();
} }
else else
...@@ -98,7 +97,7 @@ void PLItem::updateColumnHeaders() ...@@ -98,7 +97,7 @@ void PLItem::updateColumnHeaders()
{ {
item_col_strings.clear(); item_col_strings.clear();
if( model->i_depth == 1 ) /* Selector Panel */ if( model->i_depth == DEPTH_SEL ) /* Selector Panel */
{ {
item_col_strings.append( "" ); item_col_strings.append( "" );
return; return;
...@@ -175,6 +174,13 @@ int PLItem::row() const ...@@ -175,6 +174,13 @@ int PLItem::row() const
} }
/* update the PL Item, get the good names and so on */ /* update the PL Item, get the good names and so on */
/* This function may not be the best way to do it
It destroys everything and gets everything again instead of just
building the necessary columns.
This does extra work if you re-display the same column. Slower...
On the other hand, this way saves memory.
There must be a more clever way.
*/
void PLItem::update( playlist_item_t *p_item, bool iscurrent ) void PLItem::update( playlist_item_t *p_item, bool iscurrent )
{ {
char psz_duration[MSTRTIME_MAX_SIZE]; char psz_duration[MSTRTIME_MAX_SIZE];
......
...@@ -98,6 +98,8 @@ PLModel::PLModel( playlist_t *_p_playlist, /* THEPL */ ...@@ -98,6 +98,8 @@ PLModel::PLModel( playlist_t *_p_playlist, /* THEPL */
PLModel::~PLModel() PLModel::~PLModel()
{ {
config_PutInt( p_intf, "qt-pl-showflags", rootItem->i_showflags );
config_SaveConfigFile( p_intf, NULL );
delCallbacks(); delCallbacks();
delete rootItem; delete rootItem;
} }
...@@ -835,8 +837,6 @@ void PLModel::viewchanged( int meta ) ...@@ -835,8 +837,6 @@ void PLModel::viewchanged( int meta )
endInsertColumns(); endInsertColumns();
} }
rebuild(); rebuild();
config_PutInt( p_intf, "qt-pl-showflags", rootItem->i_showflags );
config_SaveConfigFile( p_intf, NULL );
} }
} }
......
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