Ejemplo n.º 1
0
void ImageScanThread<DBFS>::CountFiles(const QStringList &paths)
{
    // Get exclusions as comma-seperated list using glob chars * and ?
    QString excPattern = gCoreContext->GetSetting("GalleryIgnoreFilter", "");

    // Combine into a single regexp
    excPattern.replace(".", "\\."); // Preserve "."
    excPattern.replace("*", ".*");  // Convert glob wildcard "*"
    excPattern.replace("?", ".");   // Convert glob wildcard "?"
    excPattern.replace(",", "|");   // Convert list to OR's

    QString pattern = QString("^(%1)$").arg(excPattern);
    m_exclusions = REGEXP(pattern);

    LOG(VB_FILE, LOG_DEBUG, QString("Exclude regexp is \"%1\"").arg(pattern));

    // Lock counts until counting complete
    QMutexLocker locker(&m_mutexProgress);
    m_progressCount       = 0;
    m_progressTotalCount  = 0;

    // Use global image filters
    QDir dir = m_dir;
    foreach(const QString &sgDir, paths)
    {
        // Ignore missing dirs
        if (dir.cd(sgDir))
            CountTree(dir);
    }
    // 0 signifies a scan start
    Broadcast(0);
}
Ejemplo n.º 2
0
Archivo: regex.c Proyecto: 8l/xedit
LispObj *
Lisp_Rep(LispBuiltin *builtin)
/*
 re-p object
 */
{
    LispObj *object;

    object = ARGUMENT(0);

    return (REGEXP(object) ? T : NIL);
}
Ejemplo n.º 3
0
Archivo: regex.c Proyecto: 8l/xedit
LispObj *
Lisp_Recomp(LispBuiltin *builtin)
/*
 re-comp pattern &key nospec icase nosub newline
 */
{
    re_cod *regex;
    int cflags = 0;

    LispObj *result;

    LispObj *pattern, *nospec, *icase, *nosub, *newline;

    newline = ARGUMENT(4);
    nosub = ARGUMENT(3);
    icase = ARGUMENT(2);
    nospec = ARGUMENT(1);
    pattern = ARGUMENT(0);

    /* Don't generate an error if it is already a compiled regex. */
    if (REGEXP(pattern))
	return (pattern);

    CHECK_STRING(pattern);

    if (nospec != UNSPEC && nospec != NIL)
	cflags |= RE_NOSPEC;
    if (icase != UNSPEC && icase != NIL)
	cflags |= RE_ICASE;
    if (nosub != UNSPEC && nosub != NIL)
	cflags |= RE_NOSUB;
    if (newline != UNSPEC && newline != NIL)
	cflags |= RE_NEWLINE;

    regex = LispRecomp(builtin, THESTR(pattern), cflags);
    result = LispNew(pattern, NIL);
    result->type = LispRegex_t;
    result->data.regex.regex = regex;
    result->data.regex.pattern = pattern;
    result->data.regex.options = cflags;
    LispMused(regex);

    return (result);
}