Esempio n. 1
0
void
Part::configFilelight()
{
    QWidget *dialog = new SettingsDialog( widget(), "settings_dialog" );

    connect( dialog, SIGNAL(canvasIsDirty( int )), m_map, SLOT(refresh( int )) );
    connect( dialog, SIGNAL(mapIsInvalid()), m_manager, SLOT(emptyCache()) );

    dialog->show(); //deletes itself
}
Esempio n. 2
0
SqlRegistry::SqlRegistry( Collections::SqlCollection* collection )
    : QObject( 0 )
    , m_collection( collection )
    , m_blockDatabaseUpdateCount( 0 )
    , m_collectionChanged( false )
{
    DEBUG_BLOCK
    setObjectName( "SqlRegistry" );

    // -- remove unneeded entries from the database.
    // we have to do this now before anyone can hold references
    // to those objects.
    DatabaseUpdater databaseUpdater( m_collection );

    // url entries without associated directory just stick around and cannot be processed
    // by SqlScanResultProcessor. Delete them before checking tracks
    databaseUpdater.deleteOrphanedByDirectory( "urls" );

    // tracks with no associated url entry are useless, just a bunch of medatada with
    // nothing to associate them to; remove those first
    databaseUpdater.deleteOrphanedByUrl( "tracks" );

    databaseUpdater.deleteAllRedundant( "album" ); // what about cover images in database and disk cache?
    databaseUpdater.deleteAllRedundant( "artist" );
    databaseUpdater.deleteAllRedundant( "genre" );
    databaseUpdater.deleteAllRedundant( "composer" );
    databaseUpdater.deleteAllRedundant( "url" );
    databaseUpdater.deleteAllRedundant( "year" );

    databaseUpdater.deleteOrphanedByUrl( "lyrics" );
    databaseUpdater.deleteOrphanedByUrl( "statistics" );
    databaseUpdater.deleteOrphanedByUrl( "urls_labels" );

    m_timer = new QTimer( this );
    m_timer->setInterval( 30 * 1000 );  //try to clean up every 30 seconds, change if necessary
    m_timer->setSingleShot( false );
    connect( m_timer, SIGNAL(timeout()), this, SLOT(emptyCache()) );
    m_timer->start();
}