亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? qfilesystemwatcher.cpp

?? QT 開發環境里面一個很重要的文件
?? CPP
字號:
/******************************************************************************** Copyright (C) 1992-2006 Trolltech ASA. All rights reserved.**** This file is part of the QtCore module of the Qt Toolkit.**** This file may be used under the terms of the GNU General Public** License version 2.0 as published by the Free Software Foundation** and appearing in the file LICENSE.GPL included in the packaging of** this file.  Please review the following information to ensure GNU** General Public Licensing requirements will be met:** http://www.trolltech.com/products/qt/opensource.html**** If you are unsure which license is appropriate for your use, please** review the following information:** http://www.trolltech.com/products/qt/licensing.html or contact the** sales department at sales@trolltech.com.**** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.******************************************************************************/#include "qfilesystemwatcher.h"#include "qfilesystemwatcher_p.h"#ifndef QT_NO_FILESYSTEMWATCHER#include <qdatetime.h>#include <qdebug.h>#include <qfileinfo.h>#include <qmutex.h>#include <qset.h>#include <qtimer.h>#if defined(Q_OS_WIN)#  include "qfilesystemwatcher_win_p.h"#elif defined(Q_OS_LINUX)#  include "qfilesystemwatcher_inotify_p.h"#elif defined(Q_OS_FREEBSD) || defined(Q_OS_MAC)#  include "qfilesystemwatcher_kqueue_p.h"#endifenum { PollingInterval = 1000 };class QPollingFileSystemWatcherEngine : public QFileSystemWatcherEngine{    Q_OBJECT    mutable QMutex mutex;    QHash<QString, QDateTime> files, directories;public:    QPollingFileSystemWatcherEngine();        void run();    QStringList addPaths(const QStringList &paths, QStringList *files, QStringList *directories);    QStringList removePaths(const QStringList &paths, QStringList *files, QStringList *directories);    void stop();private slots:    void timeout();};QPollingFileSystemWatcherEngine::QPollingFileSystemWatcherEngine(){    moveToThread(this);}void QPollingFileSystemWatcherEngine::run(){    QTimer timer;    connect(&timer, SIGNAL(timeout()), SLOT(timeout()));    timer.start(PollingInterval);    (void) exec();}QStringList QPollingFileSystemWatcherEngine::addPaths(const QStringList &paths,                                                      QStringList *files,                                                      QStringList *directories){    QMutexLocker locker(&mutex);    QStringList p = paths;    QMutableListIterator<QString> it(p);    while (it.hasNext()) {        QString path = it.next();        QFileInfo fi(path);        if (!fi.exists())            continue;        if (fi.isDir()) {            if (!directories->contains(path))                directories->append(path);            this->directories.insert(path, fi.lastModified());        } else {            if (!files->contains(path))                files->append(path);            this->files.insert(path, fi.lastModified());        }        it.remove();    }    start();    return p;}QStringList QPollingFileSystemWatcherEngine::removePaths(const QStringList &paths,                                                         QStringList *files,                                                         QStringList *directories){    QMutexLocker locker(&mutex);    QStringList p = paths;    QMutableListIterator<QString> it(p);    while (it.hasNext()) {        QString path = it.next();        if (this->directories.remove(path)) {            directories->removeAll(path);            it.remove();        } else if (this->files.remove(path)) {            files->removeAll(path);            it.remove();        }    }    if (this->files.isEmpty() && this->directories.isEmpty()) {        locker.unlock();        stop();        wait();    }    return p;}void QPollingFileSystemWatcherEngine::stop(){    QMetaObject::invokeMethod(this, "quit");}void QPollingFileSystemWatcherEngine::timeout(){    QMutexLocker locker(&mutex);    QMutableHashIterator<QString, QDateTime> fit(files);    while (fit.hasNext()) {        QHash<QString, QDateTime>::iterator x = fit.next();        QString path = x.key();        QFileInfo fi(path);        if (!fi.exists()) {            fit.remove();            emit fileChanged(path, true);        } else if (x.value() != fi.lastModified()) {            x.value() = fi.lastModified();            emit fileChanged(path, false);        }    }    QMutableHashIterator<QString, QDateTime> dit(directories);    while (dit.hasNext()) {        QHash<QString, QDateTime>::iterator x = dit.next();        QString path = x.key();        QFileInfo fi(path);        if (!fi.exists()) {            dit.remove();            emit directoryChanged(path, true);        } else if (x.value() != fi.lastModified()) {            x.value() = fi.lastModified();            emit directoryChanged(path, false);        }    }}QFileSystemWatcherEngine *QFileSystemWatcherPrivate::createNativeEngine(){#if defined(Q_OS_WIN)    return new QWindowsFileSystemWatcherEngine;#elif defined(Q_OS_LINUX)    return QInotifyFileSystemWatcherEngine::create();#elif defined(Q_OS_FREEBSD) || defined(Q_OS_MAC)    return QKqueueFileSystemWatcherEngine::create();#else    return 0;#endif}QFileSystemWatcherPrivate::QFileSystemWatcherPrivate()    : native(0), poller(0){}void QFileSystemWatcherPrivate::init(){    Q_Q(QFileSystemWatcher);    native = createNativeEngine();    if (native) {        QObject::connect(native,                         SIGNAL(fileChanged(QString,bool)),                         q,                         SLOT(_q_fileChanged(QString,bool)));        QObject::connect(native,                         SIGNAL(directoryChanged(QString,bool)),                         q,                         SLOT(_q_directoryChanged(QString,bool)));    }}void QFileSystemWatcherPrivate::_q_fileChanged(const QString &path, bool removed){    Q_Q(QFileSystemWatcher);    if (!files.contains(path)) {        // the path was removed after a change was detected, but before we delivered the signal        return;    }    if (removed)        files.removeAll(path);    emit q->fileChanged(path);}void QFileSystemWatcherPrivate::_q_directoryChanged(const QString &path, bool removed){    Q_Q(QFileSystemWatcher);    if (!directories.contains(path)) {        // perhaps the path was removed after a change was detected, but before we delivered the signal        return;    }    if (removed)        directories.removeAll(path);    emit q->directoryChanged(path);}/*!    \class QFileSystemWatcher    \brief The QFileSystemWatcher class provides an interface for monitoring files and directories for modifications.    \ingroup io    \since 4.2    \reentrant    QFileSystemWatcher monitors the file system for changes to files    and directories by watching a list of specified paths.    Call addPath() to watch a particular file or directory. Multiple    paths can be added using the addPaths() function. Existing paths can    be removed by using the removePath() and removePaths() functions.    QFileSystemWatcher examines each path added to it. Files that have    been added to the QFileSystemWatcher can be accessed using the    files() function, and directories using the directories() function.    The fileChanged() signal is emitted when a file has been modified    or removed from disk. Similarly, the directoryChanged() signal    is emitted when a directory is modified or removed. Note that    QFileSystemWatcher stops monitoring files and directories once they    have been removed from disk.    \sa QFile, QDir*//*!    Constructs a new file system watcher object with the given \a parent.*/QFileSystemWatcher::QFileSystemWatcher(QObject *parent)    : QObject(*new QFileSystemWatcherPrivate, parent){    d_func()->init();}/*!    Constructs a new file system watcher object with the given \a parent    which monitors the specified \a paths list.*/QFileSystemWatcher::QFileSystemWatcher(const QStringList &paths, QObject *parent)    : QObject(*new QFileSystemWatcherPrivate, parent){    d_func()->init();    addPaths(paths);}/*!    Destroys the file system watcher.*/QFileSystemWatcher::~QFileSystemWatcher(){    Q_D(QFileSystemWatcher);    if (d->native) {        d->native->stop();        d->native->wait();        delete d->native;        d->native = 0;    }    if (d->poller) {        d->poller->stop();        d->poller->wait();        delete d->poller;        d->poller = 0;    }}/*!    Adds \a path to the file system watcher if \a path exists. The path is    not added if it does not exist, or if it is already being monitored by    the file system watcher.    If \a path specifies a directory, the directoryChanged() signal    will be emitted when \a path is modified or removed from disk;    otherwise the fileChanged() signal is emitted when \a path is    modified or removed.    \sa addPaths(), removePath()*/void QFileSystemWatcher::addPath(const QString &path){    addPaths(QStringList(path));}/*!    Adds each path in \a paths to the file system watcher. Paths are not    added if they not exist, or if they are already being monitored by the    file system watcher.    If a path specifies a directory, the directoryChanged() signal will    be emitted when the path is modified or removed from disk; otherwise    the fileChanged() signal is emitted when the path is modified or    removed.    \sa addPath(), removePaths()*/void QFileSystemWatcher::addPaths(const QStringList &paths){    Q_D(QFileSystemWatcher);    if (paths.isEmpty())        return;    QStringList p = paths;    if (objectName() != QLatin1String("_qt_autotest_force_engine_poller")) {        if (d->native)            p = d->native->addPaths(p, &d->files, &d->directories);        if (p.isEmpty())            return;    } else {        qDebug() << "QFileSystemWatcher: skipping native engine, using only polling engine";    }    if (objectName() != QLatin1String("_qt_autotest_force_engine_native")) {        // try polling instead        if (!d->poller) {            d->poller = new QPollingFileSystemWatcherEngine; // that was a mouthful            QObject::connect(d->poller,                             SIGNAL(fileChanged(QString,bool)),                             this,                             SLOT(_q_fileChanged(QString,bool)));            QObject::connect(d->poller,                             SIGNAL(directoryChanged(QString,bool)),                             this,                             SLOT(_q_directoryChanged(QString,bool)));        }        p = d->poller->addPaths(p, &d->files, &d->directories);    } else{        qDebug("QFileSystemWatcher: skipping polling engine, using only native engine");    }    if (!p.isEmpty())        qWarning("QFileSystemWatcher: failed to add paths: %s",                 qPrintable(p.join(", ")));}/*!    Removes the specified \a path from the file system watcher.    \sa removePaths(), addPath()*/void QFileSystemWatcher::removePath(const QString &path){    removePaths(QStringList(path));}/*!    Removes the specified \a paths from the file system watcher.    \sa removePath(), addPaths()*/void QFileSystemWatcher::removePaths(const QStringList &paths){    Q_D(QFileSystemWatcher);    QStringList p = paths;    if (d->native)        p = d->native->removePaths(p, &d->files, &d->directories);    if (d->poller)        (void) d->poller->removePaths(p, &d->files, &d->directories);}/*!    \fn void QFileSystemWatcher::fileChanged(const QString &path)    This signal is emitted when the file at the specified \a path is modified    or removed from disk.    \sa directoryChanged()*//*!    \fn void QFileSystemWatcher::directoryChanged(const QString &path)    This signal is emitted when the directory at the specified \a path is    modified or removed from disk.    \sa fileChanged()*//*!    \fn QStringList QFileSystemWatcher::directories() const    Returns a list of paths to directories that are being watched.    \sa files()*//*!    \fn QStringList QFileSystemWatcher::files() const    Returns a list of paths to files that are being watched.    \sa directories()*/QStringList QFileSystemWatcher::directories() const{    Q_D(const QFileSystemWatcher);    return d->directories;}QStringList QFileSystemWatcher::files() const{    Q_D(const QFileSystemWatcher);    return d->files;}#include "moc_qfilesystemwatcher.cpp"#include "qfilesystemwatcher.moc"#endif // QT_NO_FILESYSTEMWATCHER

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
这里只有精品电影| 日韩黄色在线观看| 麻豆精品在线看| 99精品国产视频| 26uuu亚洲婷婷狠狠天堂| 亚洲人妖av一区二区| 精品在线你懂的| 欧美日韩一级片网站| 国产精品国产a级| 国产毛片精品国产一区二区三区| 在线观看亚洲专区| 自拍偷拍亚洲综合| 成人性生交大片免费看视频在线 | 国产成人av影院| 欧美精品v国产精品v日韩精品| 1000部国产精品成人观看| 激情五月婷婷综合| 日韩一二三区视频| 国产91丝袜在线播放0| 日韩午夜激情视频| 丁香六月综合激情| 亚洲美女免费视频| 成人免费视频app| 久久综合色天天久久综合图片| 日韩经典中文字幕一区| 欧洲亚洲国产日韩| 亚洲韩国一区二区三区| 欧洲av在线精品| 亚洲综合无码一区二区| 91蝌蚪porny| 亚洲精品国产成人久久av盗摄 | 成人精品国产一区二区4080| 久久综合色播五月| 国产成人自拍高清视频在线免费播放| ww久久中文字幕| 成人中文字幕在线| 《视频一区视频二区| 91美女视频网站| 亚洲网友自拍偷拍| 91麻豆精品国产91久久久久久久久 | 久久久另类综合| 懂色一区二区三区免费观看| 国产女人18毛片水真多成人如厕 | 中文字幕一区二区不卡| 色综合久久综合网欧美综合网| 亚洲女与黑人做爰| 欧美日本韩国一区| 黑人精品欧美一区二区蜜桃 | 欧美色图免费看| 天堂av在线一区| www精品美女久久久tv| 成人深夜在线观看| 亚洲一二三四久久| 日韩亚洲欧美成人一区| 国产精品一区二区果冻传媒| 国产精品进线69影院| 欧美在线观看你懂的| 麻豆91在线播放| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 制服丝袜av成人在线看| 国内久久精品视频| 亚洲丝袜自拍清纯另类| 制服丝袜国产精品| 99视频精品全部免费在线| 亚洲伊人色欲综合网| www国产精品av| 在线观看成人小视频| 久久91精品国产91久久小草 | 久久综合成人精品亚洲另类欧美| 懂色av中文字幕一区二区三区 | 欧美高清性hdvideosex| 国产麻豆成人传媒免费观看| 一区二区三区四区五区视频在线观看 | 日本一区二区视频在线| 欧美精品vⅰdeose4hd| 不卡区在线中文字幕| 日韩精品一级中文字幕精品视频免费观看 | 国产曰批免费观看久久久| 亚洲黄色av一区| 精品电影一区二区| 欧美伊人精品成人久久综合97| 国产精品亚洲第一| 日韩电影在线观看网站| 亚洲美女屁股眼交| 欧美经典一区二区三区| 日韩欧美一级精品久久| 色婷婷综合久久久久中文一区二区| 激情综合色综合久久综合| 亚洲第一主播视频| 一区二区欧美在线观看| 国产精品剧情在线亚洲| 久久久久久毛片| 精品国产一区二区亚洲人成毛片| 在线观看成人小视频| 91免费小视频| av电影天堂一区二区在线| 国产呦萝稀缺另类资源| 久久精品国产成人一区二区三区| 亚洲午夜成aⅴ人片| 亚洲激情一二三区| 亚洲欧美国产三级| 综合色天天鬼久久鬼色| 国产精品你懂的| 中文字幕国产一区| 国产精品色一区二区三区| 欧美国产欧美亚州国产日韩mv天天看完整| 日韩欧美的一区| 日韩一区二区三区免费看| 制服丝袜在线91| 91麻豆精品国产91久久久久久久久 | 99这里只有久久精品视频| 国产成人啪免费观看软件| 国产精品一区二区久久精品爱涩| 激情伊人五月天久久综合| 激情欧美日韩一区二区| 精品系列免费在线观看| 国产九色精品成人porny| 国产美女视频一区| 国产精品一区免费在线观看| 久久99精品国产麻豆婷婷洗澡| 蜜桃久久久久久| 国产一区二区三区免费观看| 国产精品影音先锋| 成人av免费在线观看| 色哟哟一区二区| 精品视频在线免费看| 91麻豆精品国产91久久久资源速度| 欧美一区二区三区的| 日韩欧美成人午夜| 国产片一区二区| 一区二区三区在线免费| 午夜视频一区二区| 国产在线观看免费一区| 成人午夜电影久久影院| 色呦呦日韩精品| 91精品在线免费| 久久久久99精品国产片| 亚洲欧洲日韩在线| 午夜电影网一区| 国产一区二三区好的| 99视频一区二区| 日韩视频免费观看高清完整版| 久久久久国产精品麻豆ai换脸 | 精品综合久久久久久8888| 成人美女在线视频| 欧美日韩亚洲国产综合| 欧美tickling网站挠脚心| 国产精品国产馆在线真实露脸 | 精品欧美久久久| 国产精品久久网站| 日本免费在线视频不卡一不卡二 | 日韩中文字幕1| 丁香婷婷综合色啪| 欧美日产在线观看| 亚洲国产精品激情在线观看| 午夜精品久久久久久久蜜桃app| 精品一区二区三区在线观看| 99久久99久久精品免费看蜜桃| 欧美日韩午夜在线视频| 日本一区二区免费在线| 香蕉成人啪国产精品视频综合网| 国产成人啪午夜精品网站男同| 欧美私模裸体表演在线观看| 国产午夜亚洲精品午夜鲁丝片| 亚洲大型综合色站| 99这里只有久久精品视频| 精品国产乱码久久久久久老虎| 亚洲精品菠萝久久久久久久| 久久精品av麻豆的观看方式| 91激情在线视频| 国产欧美一区二区精品久导航| 五月婷婷激情综合网| 99久久精品情趣| 久久天天做天天爱综合色| 视频一区二区三区中文字幕| 91麻豆精品视频| 国产婷婷色一区二区三区四区| 日韩av电影免费观看高清完整版 | 大白屁股一区二区视频| 精品欧美一区二区三区精品久久| 亚洲v日本v欧美v久久精品| 91在线视频播放地址| 欧美激情中文字幕一区二区| 精品一区二区三区免费毛片爱| 欧美日韩午夜精品| 亚洲综合视频在线| 91欧美激情一区二区三区成人| 久久久久久亚洲综合| 国产自产v一区二区三区c| 欧美一级在线视频| 奇米影视一区二区三区小说| 在线成人免费视频| 婷婷开心久久网| 欧美女孩性生活视频| 亚洲第一狼人社区| 欧美老年两性高潮| 日韩avvvv在线播放| 欧美一区二区视频在线观看| 日本成人在线视频网站| 欧美一级片免费看|