Example #1
0
DBusHandler::DBusHandler()
{
    qDBusRegisterMetaType<Status>();

    m_daemon = new QDBusInterface("org.wicd.daemon", "/org/wicd/daemon", "org.wicd.daemon", QDBusConnection::systemBus());
    m_wired = new QDBusInterface("org.wicd.daemon", "/org/wicd/daemon/wired", "org.wicd.daemon.wired", QDBusConnection::systemBus());
    m_wireless = new QDBusInterface("org.wicd.daemon", "/org/wicd/daemon/wireless", "org.wicd.daemon.wireless", QDBusConnection::systemBus());

    QDBusConnection::systemBus().connect("org.wicd.daemon",
                                         "/org/wicd/daemon",
                                         "org.wicd.daemon",
                                         "StatusChanged",
                                         this,
                                         SLOT(statusChanged(uint,QVariantList))
                                         );
    QDBusConnection::systemBus().connect("org.wicd.daemon",
                                         "/org/wicd/daemon",
                                         "org.wicd.daemon",
                                         "ConnectResultsSent",
                                         this,
                                         SIGNAL(connectionResultSend(QString))
                                         );
    QDBusConnection::systemBus().connect("org.wicd.daemon",
                                         "/org/wicd/daemon",
                                         "org.wicd.daemon",
                                         "LaunchChooser",
                                         this,
                                         SIGNAL(launchChooser())
                                         );
    QDBusConnection::systemBus().connect("org.wicd.daemon",
                                         "/org/wicd/daemon/wireless",
                                         "org.wicd.daemon.wireless",
                                         "SendStartScanSignal",
                                         this,
                                         SIGNAL(scanStarted())
                                         );
    QDBusConnection::systemBus().connect("org.wicd.daemon",
                                         "/org/wicd/daemon/wireless",
                                         "org.wicd.daemon.wireless",
                                         "SendEndScanSignal",
                                         this,
                                         SIGNAL(scanEnded())
                                         );
    QDBusConnection::systemBus().connect("org.wicd.daemon",
                                         "/org/wicd/daemon",
                                         "org.wicd.daemon",
                                         "DaemonStarting",
                                         this,
                                         SIGNAL(daemonStarting())
                                         );
    QDBusConnection::systemBus().connect("org.wicd.daemon",
                                         "/org/wicd/daemon",
                                         "org.wicd.daemon",
                                         "DaemonClosing",
                                         this,
                                         SIGNAL(daemonClosing())
                                         );

    s_instance = this;
}
void SMPPPDCSPrefs::determineCSType() {

    // while we search, we'll disable the button
    autoCSTest->setEnabled(false);
    //kapp->processEvents();

    /* broadcast network for a smpppd.
       If one is available set to smpppd method */

    SMPPPDSearcher searcher;
    m_curSearcher = &searcher;

    connect(&searcher, SIGNAL(smpppdFound(const QString&)), this, SLOT(smpppdFound(const QString&)));
    connect(&searcher, SIGNAL(smpppdNotFound()), this, SLOT(smpppdNotFound()));
    connect(&searcher, SIGNAL(scanStarted(uint)), this, SLOT(scanStarted(uint)));
    connect(&searcher, SIGNAL(scanProgress(uint)), this, SLOT(scanProgress(uint)));
    connect(&searcher, SIGNAL(scanFinished()), this, SLOT(scanFinished()));

    searcher.searchNetwork();
    m_curSearcher = NULL;
}
void LibraryManagerPrivate::fullScan()
{
    cancel    = false;
    mustClean = false;

    totalFiles  = 0;
    currentFile = 0;

    emit scanStarted();

    DataBase::instance()->clean();

    QStringList paths = LibraryManager::searchPaths();

    for ( QString path : paths ) {
        QDirIterator it(path, QDir::Files | QDir::NoDotAndDotDot, QDirIterator::FollowSymlinks | QDirIterator::Subdirectories);
        while ( it.hasNext() ) {
            totalFiles++;
            it.next();
        }
    }

    for ( QString path : paths ) {
            folderScan(path);

        QDirIterator it(path, QDir::Dirs | QDir::NoDotAndDotDot, QDirIterator::FollowSymlinks | QDirIterator::Subdirectories);
        while ( it.hasNext() ) {
            if ( cancel ) {
                mustClean = true;
                emit scanFinished();
                return;
            }

            folderScan( it.next() );
        }
    }

    totalFiles  = 0;
    currentFile = 0;
    mustClean   = true;

    emit scanFinished();
}
ScanWidget* MainWidget::createScan( const QString& scanName, const bool useTargetHost, const QString& profileName )
{	ScanWidget* scanWidget = new ScanWidget( scanName, useTargetHost, this, "scan widget" );

	m_scanStack->appendAndRaiseWidget( scanWidget );
	m_scanStack->wrapText( m_wrapText );

	if( profileName == QString::null )
		scanWidget->readSettings( );
	else
		scanWidget->setProfileName( profileName );

	connect( scanWidget,
			 SIGNAL( displayHelp( const QString& )),
			 SLOT( slotDisplayHelp( const QString& )));

	connect( scanWidget,
			 SIGNAL( optionsDirty( )),
			 SLOT( slotOptionsDirty( )));

	connect( scanWidget,
			 SIGNAL( outputAvailable( const bool, const bool )),
			 SIGNAL( outputAvailable( const bool, const bool )));

	connect( scanWidget,
			 SIGNAL( scanRename( const QString& )),
			 SLOT( slotScanRename( const QString& )));

	connect( scanWidget,
			 SIGNAL( scanStarted( )),
			 m_indexWidget,
			 SLOT( slotScanStarted( )));

	connect( scanWidget,
			 SIGNAL( scanStopped( ScanWidget* )),
			 m_indexWidget,
			 SLOT( slotScanStopped( ScanWidget* )));

	connect( scanWidget,
			 SIGNAL( statusBarText( const QString& )),
			 SIGNAL( statusBarText( const QString& )));

	return scanWidget;
}
Example #5
0
	//--------------------------------------------------------------------------
	ScanView::ScanView(Scanner* scanner, QWidget* parent) :
		QSplitter(parent),
		scanner(scanner),
		library(new Library(this)),
		metaForm(new MetaDataForm(this)),
		imageViewer(new ImageViewer(this))
	{
		// Connect signals for scan progress
		connect(scanner, SIGNAL(started()), this, SLOT(scanStarted()));
		connect(scanner, SIGNAL(finished(Scanner::ScanResult)),
			this, SLOT(scanFinished(Scanner::ScanResult)));

		createButtons();
		QHBoxLayout* buttonsLayout = new QHBoxLayout;
		buttonsLayout->addWidget(scanPreviewButton);
		buttonsLayout->addWidget(cancelButton);
		buttonsLayout->addWidget(acceptScanButton);
		buttonsLayout->addWidget(rejectScanButton);
		buttonsLayout->addWidget(resetButton);

		// Connect signals for form states
		connect(metaForm, SIGNAL(isEmpty(bool)), this, SLOT(formIsEmpty(bool)));
		connect(metaForm, SIGNAL(isValid(bool)),
			scanPreviewButton, SLOT(setEnabled(bool)));

		QVBoxLayout* leftLayout = new QVBoxLayout;
		leftLayout->addWidget(metaForm);
		leftLayout->addLayout(buttonsLayout);

		QWidget* leftWidget = new QWidget(this);
		leftWidget->setLayout(leftLayout);

		addWidget(leftWidget);
		addWidget(imageViewer);
		setStretchFactor(1, 2); // Give more weight to the viewer
	}
Example #6
0
	void LocalCollection::InitiateScan (const QSet<QString>& newPaths)
	{
		auto resolver = Core::Instance ().GetLocalFileResolver ();

		emit scanStarted (newPaths.size ());
		auto worker = [resolver] (const QString& path) -> MediaInfo
		{
			try
			{
				return resolver->ResolveInfo (path);
			}
			catch (const ResolveError& error)
			{
				qWarning () << Q_FUNC_INFO
						<< "error resolving media info for"
						<< error.GetPath ()
						<< error.what ();
				return MediaInfo ();
			}
		};
		const auto& future = QtConcurrent::mapped (newPaths,
				std::function<MediaInfo (const QString&)> (worker));
		Watcher_->setFuture (future);
	}
Example #7
0
LibraryScanner::LibraryScanner(QWidget* pParentWidget, TrackCollection* collection)
              : m_pCollection(collection),
                m_libraryHashDao(m_database),
                m_cueDao(m_database),
                m_playlistDao(m_database),
                m_crateDao(m_database),
                m_directoryDao(m_database),
                m_analysisDao(m_database, collection->getConfig()),
                m_trackDao(m_database, m_cueDao, m_playlistDao,
                           m_crateDao, m_analysisDao, m_libraryHashDao,
                           collection->getConfig()) {
    // Don't initialize m_database here, we need to do it in run() so the DB
    // conn is in the right thread.
    qDebug() << "Starting LibraryScanner thread.";

    // Move LibraryScanner to its own thread so that our signals/slots will
    // queue to our event loop.
    moveToThread(this);
    m_pool.moveToThread(this);

    unsigned static id = 0; // the id of this LibraryScanner, for debugging purposes
    setObjectName(QString("LibraryScanner %1").arg(++id));

    m_pool.setMaxThreadCount(kScannerThreadPoolSize);

    // Listen to signals from our public methods (invoked by other threads) and
    // connect them to our slots to run the command on the scanner thread.
    connect(this, SIGNAL(startScan()),
            this, SLOT(slotStartScan()));

    // Force the GUI thread's TrackInfoObject cache to be cleared when a library
    // scan is finished, because we might have modified the database directly
    // when we detected moved files, and the TIOs corresponding to the moved
    // files would then have the wrong track location.
    connect(this, SIGNAL(scanFinished()),
            &(collection->getTrackDAO()), SLOT(clearCache()));
    connect(this, SIGNAL(trackAdded(TrackPointer)),
            &(collection->getTrackDAO()), SLOT(databaseTrackAdded(TrackPointer)));
    connect(this, SIGNAL(tracksMoved(QSet<int>, QSet<int>)),
            &(collection->getTrackDAO()), SLOT(databaseTracksMoved(QSet<int>, QSet<int>)));
    connect(this, SIGNAL(tracksChanged(QSet<int>)),
            &(collection->getTrackDAO()), SLOT(databaseTracksChanged(QSet<int>)));

    // Parented to pParentWidget so we don't need to delete it.
    LibraryScannerDlg* pProgress = new LibraryScannerDlg(pParentWidget);
    connect(this, SIGNAL(progressLoading(QString)),
            pProgress, SLOT(slotUpdate(QString)));
    connect(this, SIGNAL(progressHashing(QString)),
            pProgress, SLOT(slotUpdate(QString)));
    connect(this, SIGNAL(scanStarted()),
            pProgress, SLOT(slotScanStarted()));
    connect(this, SIGNAL(scanFinished()),
            pProgress, SLOT(slotScanFinished()));
    connect(pProgress, SIGNAL(scanCancelled()),
            this, SLOT(cancel()));
    connect(&m_trackDao, SIGNAL(progressVerifyTracksOutside(QString)),
            pProgress, SLOT(slotUpdate(QString)));
    connect(&m_trackDao, SIGNAL(progressCoverArt(QString)),
            pProgress, SLOT(slotUpdateCover(QString)));

    start();
}
Example #8
0
void LibraryScanner::slotStartScan() {
    qDebug() << "LibraryScanner::slotStartScan";
    QSet<QString> trackLocations = m_trackDao.getTrackLocations();
    QHash<QString, int> directoryHashes = m_libraryHashDao.getDirectoryHashes();
    QRegExp extensionFilter =
            QRegExp(SoundSourceProxy::supportedFileExtensionsRegex(),
                    Qt::CaseInsensitive);
    QRegExp coverExtensionFilter =
            QRegExp(CoverArtUtils::supportedCoverArtExtensionsRegex(),
                    Qt::CaseInsensitive);
    QStringList directoryBlacklist = ScannerUtil::getDirectoryBlacklist();

    m_scannerGlobal = ScannerGlobalPointer(
        new ScannerGlobal(trackLocations, directoryHashes, extensionFilter,
                          coverExtensionFilter, directoryBlacklist));
    m_scannerGlobal->startTimer();

    emit(scanStarted());

    // Try to upgrade the library from 1.7 (XML) to 1.8+ (DB) if needed. If the
    // upgrade_filename already exists, then do not try to upgrade since we have
    // already done it.
    // TODO(XXX) SETTINGS_PATH may change in new Mixxx Versions. Here we need
    // the SETTINGS_PATH from Mixxx V <= 1.7
    QString upgrade_filename = QDir::homePath().append("/").append(SETTINGS_PATH).append("DBUPGRADED");
    qDebug() << "upgrade filename is " << upgrade_filename;
    QFile upgradefile(upgrade_filename);
    if (!upgradefile.exists()) {
        QTime t2;
        t2.start();
        LegacyLibraryImporter libImport(m_trackDao, m_playlistDao);
        connect(&libImport, SIGNAL(progress(QString)),
                this, SIGNAL(progressLoading(QString)));
        ScopedTransaction transaction(m_database);
        libImport.import();
        transaction.commit();
        qDebug("Legacy importer took %d ms", t2.elapsed());
    }

    // First, we're going to mark all the directories that we've previously
    // hashed as needing verification. As we search through the directory tree
    // when we rescan, we'll mark any directory that does still exist as
    // verified.
    m_libraryHashDao.invalidateAllDirectories();

    // Mark all the tracks in the library as needing verification of their
    // existence. (ie. we want to check they're still on your hard drive where
    // we think they are)
    m_trackDao.invalidateTrackLocationsInLibrary();

    qDebug() << "Recursively scanning library.";

    // Start scanning the library. This prepares insertion queries in TrackDAO
    // (must be called before calling addTracksAdd) and begins a transaction.
    m_trackDao.addTracksPrepare();

    // Recursivly scan each directory in the directories table.
    QStringList dirs = m_directoryDao.getDirs();

    // If there are no directories then we have nothing to do. Cleanup and
    // finish the scan immediately.
    if (dirs.isEmpty()) {
        slotFinishScan();
        return;
    }

    // Queue up recursive scan tasks for every directory. When all tasks are
    // done, TaskWatcher will signal slotFinishScan.
    TaskWatcher* pWatcher = &m_scannerGlobal->getTaskWatcher();
    connect(pWatcher, SIGNAL(allTasksDone()),
            this, SLOT(slotFinishScan()));

    foreach (const QString& dirPath, dirs) {
        // Acquire a security bookmark for this directory if we are in a
        // sandbox. For speed we avoid opening security bookmarks when recursive
        // scanning so that relies on having an open bookmark for the containing
        // directory.
        MDir dir(dirPath);

        queueTask(new RecursiveScanDirectoryTask(this, m_scannerGlobal, dir.dir(),
                                                 dir.token()));
    }
Example #9
0
Library::Library(
        QObject* parent,
        UserSettingsPointer pConfig,
        mixxx::DbConnectionPoolPtr pDbConnectionPool,
        PlayerManagerInterface* pPlayerManager,
        RecordingManager* pRecordingManager)
    : m_pConfig(pConfig),
      m_pDbConnectionPool(pDbConnectionPool),
      m_pSidebarModel(new SidebarModel(parent)),
      m_pTrackCollection(new TrackCollection(pConfig)),
      m_pLibraryControl(new LibraryControl(this)),
      m_pMixxxLibraryFeature(nullptr),
      m_pPlaylistFeature(nullptr),
      m_pCrateFeature(nullptr),
      m_pAnalysisFeature(nullptr),
      m_scanner(pDbConnectionPool, m_pTrackCollection, pConfig) {

    QSqlDatabase dbConnection = mixxx::DbConnectionPooled(m_pDbConnectionPool);

    // TODO(XXX): Add a checkbox in the library preferences for checking
    // and repairing the database on the next restart of the application.
    if (pConfig->getValue(kConfigKeyRepairDatabaseOnNextRestart, false)) {
        kLogger.info() << "Checking and repairing database (if necessary)";
        m_pTrackCollection->repairDatabase(dbConnection);
        // Reset config value
        pConfig->setValue(kConfigKeyRepairDatabaseOnNextRestart, false);
    }

    kLogger.info() << "Connecting database";
    m_pTrackCollection->connectDatabase(dbConnection);

    qRegisterMetaType<Library::RemovalType>("Library::RemovalType");

    m_pKeyNotation.reset(new ControlObject(ConfigKey(kConfigGroup, "key_notation")));

    connect(&m_scanner, SIGNAL(scanStarted()),
            this, SIGNAL(scanStarted()));
    connect(&m_scanner, SIGNAL(scanFinished()),
            this, SIGNAL(scanFinished()));
    // Refresh the library models when the library (re)scan is finished.
    connect(&m_scanner, SIGNAL(scanFinished()),
            this, SLOT(slotRefreshLibraryModels()));

    // TODO(rryan) -- turn this construction / adding of features into a static
    // method or something -- CreateDefaultLibrary
    m_pMixxxLibraryFeature = new MixxxLibraryFeature(this, m_pTrackCollection,m_pConfig);
    addFeature(m_pMixxxLibraryFeature);

    addFeature(new AutoDJFeature(this, pConfig, pPlayerManager, m_pTrackCollection));
    m_pPlaylistFeature = new PlaylistFeature(this, m_pTrackCollection, m_pConfig);
    addFeature(m_pPlaylistFeature);
    m_pCrateFeature = new CrateFeature(this, m_pTrackCollection, m_pConfig);
    addFeature(m_pCrateFeature);
    BrowseFeature* browseFeature = new BrowseFeature(
        this, pConfig, m_pTrackCollection, pRecordingManager);
    connect(browseFeature, SIGNAL(scanLibrary()),
            &m_scanner, SLOT(scan()));
    connect(&m_scanner, SIGNAL(scanStarted()),
            browseFeature, SLOT(slotLibraryScanStarted()));
    connect(&m_scanner, SIGNAL(scanFinished()),
            browseFeature, SLOT(slotLibraryScanFinished()));

    addFeature(browseFeature);
    addFeature(new RecordingFeature(this, pConfig, m_pTrackCollection, pRecordingManager));
    addFeature(new SetlogFeature(this, pConfig, m_pTrackCollection));
    m_pAnalysisFeature = new AnalysisFeature(this, pConfig, m_pTrackCollection);
    connect(m_pPlaylistFeature, SIGNAL(analyzeTracks(QList<TrackId>)),
            m_pAnalysisFeature, SLOT(analyzeTracks(QList<TrackId>)));
    connect(m_pCrateFeature, SIGNAL(analyzeTracks(QList<TrackId>)),
            m_pAnalysisFeature, SLOT(analyzeTracks(QList<TrackId>)));
    addFeature(m_pAnalysisFeature);
    //iTunes and Rhythmbox should be last until we no longer have an obnoxious
    //messagebox popup when you select them. (This forces you to reach for your
    //mouse or keyboard if you're using MIDI control and you scroll through them...)
    if (RhythmboxFeature::isSupported() &&
        pConfig->getValue(ConfigKey(kConfigGroup,"ShowRhythmboxLibrary"), true)) {
        addFeature(new RhythmboxFeature(this, m_pTrackCollection));
    }
    if (pConfig->getValue(ConfigKey(kConfigGroup,"ShowBansheeLibrary"), true)) {
        BansheeFeature::prepareDbPath(pConfig);
        if (BansheeFeature::isSupported()) {
            addFeature(new BansheeFeature(this, m_pTrackCollection, pConfig));
        }
    }
    if (ITunesFeature::isSupported() &&
        pConfig->getValue(ConfigKey(kConfigGroup,"ShowITunesLibrary"), true)) {
        addFeature(new ITunesFeature(this, m_pTrackCollection));
    }
    if (TraktorFeature::isSupported() &&
        pConfig->getValue(ConfigKey(kConfigGroup,"ShowTraktorLibrary"), true)) {
        addFeature(new TraktorFeature(this, m_pTrackCollection));
    }

    // On startup we need to check if all of the user's library folders are
    // accessible to us. If the user is using a database from <1.12.0 with
    // sandboxing then we will need them to give us permission.
    QStringList directories = m_pTrackCollection->getDirectoryDAO().getDirs();

    qDebug() << "Checking for access to user's library directories:";
    foreach (QString directoryPath, directories) {
        QFileInfo directory(directoryPath);
        bool hasAccess = Sandbox::askForAccess(directory.canonicalFilePath());
        qDebug() << "Checking for access to" << directoryPath << ":" << hasAccess;
    }
/*!
 Stub function.
 */
void MpMpxHarvesterFrameworkWrapper::emitScanStarted()
{
    mScanning = true;
    emit scanStarted();
}
Example #11
0
void LibraryScanner::slotStartScan() {
    qDebug() << "LibraryScanner::slotStartScan";
    DEBUG_ASSERT(m_state == STARTING);

    // Recursively scan each directory in the directories table.
    m_libraryRootDirs = m_directoryDao.getDirs();
    // If there are no directories then we have nothing to do. Cleanup and
    // finish the scan immediately.
    if (m_libraryRootDirs.isEmpty()) {
        changeScannerState(IDLE);
        return;
    }
    changeScannerState(SCANNING);

    QSet<QString> trackLocations = m_trackDao.getTrackLocations();
    QHash<QString, int> directoryHashes = m_libraryHashDao.getDirectoryHashes();
    QRegExp extensionFilter(SoundSourceProxy::getSupportedFileNamesRegex());
    QRegExp coverExtensionFilter =
            QRegExp(CoverArtUtils::supportedCoverArtExtensionsRegex(),
                    Qt::CaseInsensitive);
    QStringList directoryBlacklist = ScannerUtil::getDirectoryBlacklist();

    m_scannerGlobal = ScannerGlobalPointer(
            new ScannerGlobal(trackLocations, directoryHashes, extensionFilter,
                              coverExtensionFilter, directoryBlacklist));

    m_scannerGlobal->startTimer();

    emit(scanStarted());

    // First, we're going to mark all the directories that we've previously
    // hashed as needing verification. As we search through the directory tree
    // when we rescan, we'll mark any directory that does still exist as
    // verified.
    m_libraryHashDao.invalidateAllDirectories();

    // Mark all the tracks in the library as needing verification of their
    // existence. (ie. we want to check they're still on your hard drive where
    // we think they are)
    m_trackDao.invalidateTrackLocationsInLibrary();

    qDebug() << "Recursively scanning library.";

    // Start scanning the library. This prepares insertion queries in TrackDAO
    // (must be called before calling addTracksAdd) and begins a transaction.
    m_trackDao.addTracksPrepare();

    // First Scan all known directories we have a hash for.
    // In a second stage, we scan all new directories. This guarantees,
    // that we discover always the same folder, in case of duplicated folders
    // by symlinks

    // Queue up recursive scan tasks for every hashed directory. When all tasks
    // are done, TaskWatcher will signal slotFinishHashedScan.
    TaskWatcher* pWatcher = &m_scannerGlobal->getTaskWatcher();
    pWatcher->watchTask();
    connect(pWatcher, SIGNAL(allTasksDone()),
            this, SLOT(slotFinishHashedScan()));

    foreach (const QString& dirPath, m_libraryRootDirs) {
        // Acquire a security bookmark for this directory if we are in a
        // sandbox. For speed we avoid opening security bookmarks when recursive
        // scanning so that relies on having an open bookmark for the containing
        // directory.
        MDir dir(dirPath);
        if (!m_scannerGlobal->testAndMarkDirectoryScanned(dir.dir())) {
            queueTask(new RecursiveScanDirectoryTask(this, m_scannerGlobal,
                                                     dir.dir(),
                                                     dir.token(),
                                                     false));
        }
    }
Example #12
0
UBFeaturesWidget::UBFeaturesWidget(QWidget *parent, const char *name)
    : UBDockPaletteWidget(parent)
    , imageGatherer(NULL)
{
    setObjectName(name);
    mName = "FeaturesWidget";
    mVisibleState = true;

    SET_STYLE_SHEET();

    mIconToLeft = QPixmap(":images/library_open.png");
    mIconToRight = QPixmap(":images/library_close.png");
    setAcceptDrops(true);

    //Main UBFeature functionality
    controller = new UBFeaturesController(this);

    //Main layout including all the widgets in palette
    layout = new QVBoxLayout(this);

    //Path icon view on the top of the palette
    pathListView = new UBFeaturesListView(this, objNamePathList);
    controller->assignPathListView(pathListView);

    centralWidget = new UBFeaturesCentralWidget(this);
    controller->assignFeaturesListView(centralWidget->listView());
    centralWidget->setSliderPosition(UBSettings::settings()->featureSliderPosition->get().toInt());

    //Bottom actionbar for DnD, quick search etc
    mActionBar = new UBFeaturesActionBar(controller, this);

    //Filling main layout
    layout->addWidget(pathListView);
    layout->addWidget(centralWidget);
    layout->addWidget(mActionBar);

    connect(centralWidget->listView(), SIGNAL(clicked(const QModelIndex &)), this, SLOT(currentSelected(const QModelIndex &)));
    connect(this, SIGNAL(sendFileNameList(QStringList)), centralWidget, SIGNAL(sendFileNameList(QStringList)));
    connect(mActionBar, SIGNAL(searchElement(const QString &)), this, SLOT( searchStarted(const QString &)));
    connect(mActionBar, SIGNAL(newFolderToCreate()), this, SLOT(createNewFolder()));
    connect(mActionBar, SIGNAL(deleteElements(const UBFeaturesMimeData *)), this, SLOT(deleteElements(const UBFeaturesMimeData *)));
    connect(mActionBar, SIGNAL(deleteSelectedElements()), this, SLOT(deleteSelectedElements()));
    connect(mActionBar, SIGNAL(addToFavorite(const UBFeaturesMimeData *)), this, SLOT(addToFavorite(const UBFeaturesMimeData *)));
    connect(mActionBar, SIGNAL(removeFromFavorite(const UBFeaturesMimeData *)), this, SLOT(removeFromFavorite(const UBFeaturesMimeData *)));
    connect(mActionBar, SIGNAL(addElementsToFavorite() ), this, SLOT ( addElementsToFavorite()) );
    connect(mActionBar, SIGNAL(removeElementsFromFavorite()), this, SLOT (removeElementsFromFavorite()));

    connect(mActionBar, SIGNAL(rescanModel()), this, SLOT(rescanModel()));
    connect(pathListView, SIGNAL(clicked(const QModelIndex &)), this, SLOT(currentSelected(const QModelIndex &)));
    connect(UBApplication::boardController, SIGNAL(displayMetadata(QMap<QString,QString>)), this, SLOT(onDisplayMetadata( QMap<QString,QString>)));
    connect(UBDownloadManager::downloadManager(), SIGNAL( addDownloadedFileToLibrary( bool, QUrl, QString, QByteArray, QString))
             , this, SLOT(onAddDownloadedFileToLibrary(bool, QUrl, QString,QByteArray, QString)));
    connect(centralWidget, SIGNAL(lockMainWidget(bool)), this, SLOT(lockIt(bool)));
    connect(centralWidget, SIGNAL(createNewFolderSignal(QString)), controller, SLOT(addNewFolder(QString)));
    connect(controller, SIGNAL(scanStarted()), centralWidget, SLOT(scanStarted()));
    connect(controller, SIGNAL(scanFinished()), centralWidget, SLOT(scanFinished()));
    connect(controller, SIGNAL(scanStarted()), mActionBar, SLOT(lockIt()));
    connect(controller, SIGNAL(scanFinished()), mActionBar, SLOT(unlockIt()));
    connect(controller, SIGNAL(maxFilesCountEvaluated(int)), centralWidget, SIGNAL(maxFilesCountEvaluated(int)));
    connect(controller, SIGNAL(featureAddedFromThread()), centralWidget, SIGNAL(increaseStatusBarValue()));
    connect(controller, SIGNAL(scanCategory(QString)), centralWidget, SIGNAL(scanCategory(QString)));
    connect(controller, SIGNAL(scanPath(QString)), centralWidget, SIGNAL(scanPath(QString)));
}
/* start scanning for new bluetooth devices
 */
void BluetoothAdapter::scanForNewDevices()
{
    discoveryAgent->start();
    emit scanStarted();
}