void LibraryManagerPrivate::fileScan(QString file)
{
    if ( mustClean ) {
        DataBase::instance()->clean();
    }

    Media *m = Media::specializedObjectForFile(file);

    if ( totalFiles != 0 ) {
        currentFile++;
        emit processingFile(file, currentFile, totalFiles);
    }

    if ( m ) {
        if ( m->isValid() ) {
            QStringList paths = LibraryManager::searchPaths();
            QString     shortestPath;

            for ( QString dpath : paths ) {
                dpath = QDir(dpath).canonicalPath();

                if ( file.startsWith(dpath) && ( ( dpath.size() < shortestPath.size() ) || shortestPath.isEmpty() ) ) {
                    shortestPath = dpath;
                }
            }

            DataBase::instance()->save(m, shortestPath);
        } else {
            m->deleteLater();
        }
    }
}
Ejemplo n.º 2
0
void FtpUpload::dataTransferProgress ( qint64 done, qint64 total ){
    //qDebug() << "transfered " << done << " / " << total << "bytes";
    emit processingFile(m_strCurrentFile,done,total);
}