• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ directoryChanged函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中directoryChanged函数的典型用法代码示例。如果您正苦于以下问题:C++ directoryChanged函数的具体用法?C++ directoryChanged怎么用?C++ directoryChanged使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了directoryChanged函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: QFileSystemWatcher

QFileSystemWatcher* KFileSystemWatcher::availableWatcher()
{
  QFileSystemWatcher* watcher = m_recentWatcher;
  if (!watcher || m_usedObjects.value(watcher) >= MAXIMUM_WAIT_OBJECTS) {
    uint i = 0;
    watcher = 0;
    for (QList<QFileSystemWatcher*>::ConstIterator watchersIt(m_watchers.constBegin());
      watchersIt!=m_watchers.constEnd(); ++watchersIt, i++)
    {
      if (m_usedObjects.value(*watchersIt) < MAXIMUM_WAIT_OBJECTS) {
        watcher = *watchersIt;
        m_recentWatcher = watcher;
        return watcher;
      }
    }
  }
  if (!watcher) { //new one needed
    watcher = new QFileSystemWatcher();
    connect(watcher, SIGNAL(directoryChanged(QString)), this, SIGNAL(directoryChanged(QString)));
    connect(watcher, SIGNAL(fileChanged(QString)), this, SIGNAL(fileChanged(QString)));
    m_watchers.append( watcher );
    m_usedObjects.insert(watcher, 0);
    m_recentWatcher = watcher;
  }
  return watcher;
}
开发者ID:crayonink,项目名称:calligra-2,代码行数:26,代码来源:kdirwatch_win.cpp


示例2: ioctl

void QInotifyFileSystemWatcherEngine::readFromInotify()
{
    // qDebug() << "QInotifyFileSystemWatcherEngine::readFromInotify";

    int buffSize = 0;
    ioctl(inotifyFd, FIONREAD, (char *) &buffSize);
    QVarLengthArray<char, 4096> buffer(buffSize);
    buffSize = read(inotifyFd, buffer.data(), buffSize);
    char *at = buffer.data();
    char * const end = at + buffSize;

    QHash<int, inotify_event *> eventForId;
    while (at < end) {
        inotify_event *event = reinterpret_cast<inotify_event *>(at);

        if (eventForId.contains(event->wd))
            eventForId[event->wd]->mask |= event->mask;
        else
            eventForId.insert(event->wd, event);

        at += sizeof(inotify_event) + event->len;
    }

    QHash<int, inotify_event *>::const_iterator it = eventForId.constBegin();
    while (it != eventForId.constEnd()) {
        const inotify_event &event = **it;
        ++it;

        // qDebug() << "inotify event, wd" << event.wd << "mask" << hex << event.mask;

        int id = event.wd;
        QString path = getPathFromID(id);
        if (path.isEmpty()) {
            // perhaps a directory?
            id = -id;
            path = getPathFromID(id);
            if (path.isEmpty())
                continue;
        }

        // qDebug() << "event for path" << path;

        if ((event.mask & (IN_DELETE_SELF | IN_MOVE_SELF | IN_UNMOUNT)) != 0) {
            pathToID.remove(path);
            idToPath.remove(id, getPathFromID(id));
            if (!idToPath.contains(id))
                inotify_rm_watch(inotifyFd, event.wd);

            if (id < 0)
                emit directoryChanged(path, true);
            else
                emit fileChanged(path, true);
        } else {
            if (id < 0)
                emit directoryChanged(path, false);
            else
                emit fileChanged(path, false);
        }
    }
}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:60,代码来源:qfilesystemwatcher_inotify.cpp


示例3: connect

Condition4DirMonitorAll::Condition4DirMonitorAll(void)
{
	m_QFileSystemWatcher = new QFileSystemWatcher;
	connect(m_QFileSystemWatcher, SIGNAL(directoryChanged(QString)), this, SLOT(directoryChanged(QString)), Qt::QueuedConnection);

	m_xmlEleName = "MonitorDirAll";
}
开发者ID:ice200117,项目名称:PTPS,代码行数:7,代码来源:Condition4DirMonitorAll.cpp


示例4: QObject

LocalFileMonitor::LocalFileMonitor(QObject *parent) :
    QObject(parent)
{
    this->refreshTimer.start(30000000);
    this->fsWatch = new QFileSystemWatcher(this);
    connect(&refreshTimer, SIGNAL(timeout()), this, SLOT(refreshTimerEvent()));
    connect(this->fsWatch, SIGNAL(fileChanged(QString)), this, SLOT(fileChanged(QString)));
    connect(this->fsWatch, SIGNAL(directoryChanged(QString)), this, SLOT(directoryChanged(QString)));
}
开发者ID:csutanyu,项目名称:FilePirate,代码行数:9,代码来源:localfilemonitor.cpp


示例5: ImageViewer

PicManager::PicManager(QWidget *parent)
    : ImageViewer(parent), curImage(ImageFactory::getImageWrapper(QString::null)),
      listMode(FileNameListMode), currentIndex(-1), fsWatcher(this)
{
//    state = NoFileNoPicture;
    connect(&fsWatcher, SIGNAL(directoryChanged(QString)),
            SLOT(directoryChanged()));
    connect(&fsWatcher, SIGNAL(fileChanged(QString)),
            SLOT(fileChanged(QString)));
}
开发者ID:tangwing,项目名称:ezviewer,代码行数:10,代码来源:picmanager.cpp


示例6: d_ptr

MFileDataStore::MFileDataStore(const QString &filePath) :
    d_ptr(new MFileDataStorePrivate(filePath))
{
    Q_D(MFileDataStore);
    takeSnapshot();
    addPathsToWatcher(filePath, d->watcher);
    connect(d->watcher.data(), SIGNAL(fileChanged(QString)),
            this, SLOT(fileChanged(QString)));
    connect(d->watcher.data(), SIGNAL(directoryChanged(QString)),
            this, SLOT(directoryChanged(QString)));
}
开发者ID:SamuelNevala,项目名称:mlite,代码行数:11,代码来源:mfiledatastore.cpp


示例7: QAbstractListModel

ModList::ModList ( const QString& dir, const QString& list_file )
: QAbstractListModel(), m_dir(dir), m_list_file(list_file)
{
	m_dir.setFilter(QDir::Readable | QDir::NoDotAndDotDot | QDir::Files | QDir::Dirs | QDir::NoSymLinks);
	m_dir.setSorting(QDir::Name);
	m_list_id = QUuid::createUuid().toString();
	m_watcher = new QFileSystemWatcher(this);
	is_watching = false;
	connect(m_watcher,SIGNAL(directoryChanged(QString)), this, SLOT(directoryChanged(QString)));
	update();
}
开发者ID:Apocalypsing,项目名称:MultiMC5,代码行数:11,代码来源:ModList.cpp


示例8: connect

void MainWindow::start(bool isTrue)
{
	if (isTrue) {
		isStart_ = true;
		pbStart_->setText(tr("Stop"));
		connect(watcher_, SIGNAL(fileChanged(QString)), this, SLOT(slotFileChanged(QString)));
		connect(watcher_, SIGNAL(directoryChanged(QString)), this, SLOT(slotDirectoryChanged(QString)));
		Common::asyncCopy(leFrom_->text(), leTo_->text());
	} else {
		isStart_ = false;
		pbStart_->setText(tr("Start"));
		disconnect(watcher_, SIGNAL(fileChanged(QString)), this, SLOT(slotFileChanged(QString)));
		disconnect(watcher_, SIGNAL(directoryChanged(QString)), this, SLOT(slotDirectoryChanged(QString)));
	}
}
开发者ID:tujiaw,项目名称:syncfile,代码行数:15,代码来源:MainWindow.cpp


示例9: setupGoodExtension

void Ut_MApplicationExtensionManager::testMonitorRemoveExtension()
{
    gDesktopEntryList.clear();

    // Fire up a couple of extensions
    gDesktopEntryList << "test1.desktop" << "test2.desktop";

    gDefaultMApplicationExtensionMetaDataStub.stubSetReturnValue("isValid", true);
    gDefaultMApplicationExtensionMetaDataStub.stubSetReturnValue("interface", interfaceName);
    gDefaultMApplicationExtensionMetaDataStub.stubSetExtensionBinaryMultiple("test1");
    gDefaultMApplicationExtensionMetaDataStub.stubSetExtensionBinaryMultiple("test2");
    setupGoodExtension(true, NULL, "1st extension");
    setupGoodExtension(true, NULL, "2nd extension");

    setupTestSubject();

    // Remove one extension from the file system
    gDesktopEntryList.clear();
    gDesktopEntryList << "test1.desktop";

    // The test subject asks the library name from the removed meta data
    gDefaultMApplicationExtensionMetaDataStub.stubSetReturnValue("extensionBinary", QString("test2"));

    // Notify about a file system change
    emit directoryChanged(APPLICATION_EXTENSION_DATA_DIR);

    // Observe that the correct extension was removed
    QCOMPARE(signalListener.removedExtensions.count(), 1);
    QCOMPARE(signalListener.removedExtensions.at(0).second, QString("2nd extension"));
}
开发者ID:arcean,项目名称:libmeegotouch-framework,代码行数:30,代码来源:ut_mapplicationextensionmanager.cpp


示例10: mOutDated

XdgMenuPrivate::XdgMenuPrivate(XdgMenu *parent):
    mOutDated(true),
    q_ptr(parent)
{
    this->connect(&mWatcher, SIGNAL(fileChanged(QString)), this, SLOT(fileChanged(QString)));
    this->connect(&mWatcher, SIGNAL(directoryChanged(QString)), this, SLOT(fileChanged(QString)));
}
开发者ID:Alexandr-Galko,项目名称:razor-qt,代码行数:7,代码来源:xdgmenu.cpp


示例11: MApplicationExtensionManager

void Ut_MApplicationExtensionManager::setupTestSubject(const QString &inProcessFilter, const QString &outOfProcessFilter,
                                                       const QStringList &order)
{
    delete manager;
    manager = new MApplicationExtensionManager(interfaceName);
    if (!inProcessFilter.isEmpty()) {
        manager->setInProcessFilter(QRegExp(inProcessFilter));
    }
    if (!outOfProcessFilter.isEmpty()) {
        manager->setOutOfProcessFilter(QRegExp(outOfProcessFilter));
    }
    if (!order.isEmpty()) {
        manager->setOrder(order);
    }
    manager->init();
    connect(this, SIGNAL(directoryChanged(QString)), manager, SLOT(updateAvailableExtensions(QString)));

    connect(manager, SIGNAL(extensionInstantiated(MApplicationExtensionInterface *)), &signalListener, SLOT(extensionInstantiated(MApplicationExtensionInterface *)));
    connect(manager, SIGNAL(extensionRemoved(MApplicationExtensionInterface *)), &signalListener, SLOT(extensionRemoved(MApplicationExtensionInterface *)));
    connect(manager, SIGNAL(widgetCreated(QGraphicsWidget*, MDataStore&)), &signalListener, SLOT(widgetCreated(QGraphicsWidget*, MDataStore&)));
    connect(manager, SIGNAL(widgetRemoved(QGraphicsWidget*)), &signalListener, SLOT(widgetRemoved(QGraphicsWidget*)));
    connect(this,
            SIGNAL(extensionChanged(
                       const MDesktopEntry &)),
            manager,
            SLOT(updateExtension(
                     const MDesktopEntry &)));
}
开发者ID:arcean,项目名称:libmeegotouch-framework,代码行数:28,代码来源:ut_mapplicationextensionmanager.cpp


示例12: QObject

FsWatcher::FsWatcher(boost::asio::io_service& io, QString dirPath, LocalFile_Change_Callback onChange,
                     LocalFile_Change_Callback onDelete, QObject* parent)
  : QObject(parent)
  , m_watcher(new QFileSystemWatcher(this))
  , m_scheduler(io)
  , m_dirPath(dirPath)
  , m_onChange(onChange)
  , m_onDelete(onDelete)
{
  _LOG_DEBUG("Monitor dir: " << m_dirPath.toStdString());
  // add main directory to monitor

  initFileStateDb();

  m_watcher->addPath(m_dirPath);

  // register signals(callback functions)
  connect(m_watcher, SIGNAL(directoryChanged(QString)), this, SLOT(DidDirectoryChanged(QString)));
  connect(m_watcher, SIGNAL(fileChanged(QString)), this, SLOT(DidFileChanged(QString)));

  rescheduleEvent("rescan", m_dirPath.toStdString(), time::seconds(0),
                  bind(&FsWatcher::ScanDirectory_NotifyUpdates_Execute, this, m_dirPath));

  rescheduleEvent("rescan-r", m_dirPath.toStdString(), time::seconds(0),
                  bind(&FsWatcher::ScanDirectory_NotifyRemovals_Execute, this, m_dirPath));
}
开发者ID:named-data,项目名称:ChronoShare,代码行数:26,代码来源:fs-watcher.cpp


示例13: QObject

Directory_watcher::Directory_watcher(Core *c) :
  QObject(0)
, Core_ally(c)
{
  connect(&watcher, SIGNAL(directoryChanged(QString)), this, SIGNAL(directory_changed(QString)));
  fs = core->get_file_system_engine();
}
开发者ID:Riateche,项目名称:ridual,代码行数:7,代码来源:Directory_watcher.cpp


示例14: AbstractFileInfoGatherer

/*!
    Creates thread
*/
RemoteFileInfoGatherer::RemoteFileInfoGatherer(QObject *parent)
    : AbstractFileInfoGatherer(parent), abort(false)
#ifndef QT_NO_FILESYSTEMWATCHER
    , watcher(0)
#endif
{
    qDebug() << "new RemoteFileInfoGatherer";
#ifndef QT_NO_FILESYSTEMWATCHER
    watcher = new QFileSystemWatcher(this);
    connect(watcher, SIGNAL(directoryChanged(QString)), this, SLOT(list(QString)));
    connect(watcher, SIGNAL(fileChanged(QString)), this, SLOT(updateFile(QString)));

#  if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
    const QVariant listener = watcher->property("_q_driveListener");
    if (listener.canConvert<QObject *>()) {
        if (QObject *driveListener = listener.value<QObject *>()) {
            connect(driveListener, SIGNAL(driveAdded()), this, SLOT(driveAdded()));
            connect(driveListener, SIGNAL(driveRemoved()), this, SLOT(driveRemoved()));
        }
    }
#  endif // Q_OS_WIN && !Q_OS_WINRT
#endif
    start(LowPriority);

    emit initialized();
}
开发者ID:vistle,项目名称:vistle,代码行数:29,代码来源:remotefileinfogatherer.cpp


示例15: QRegExp

void OutputDirectory::selectDir()
{
    QString dir = cDir->currentText();
    QString startDir = dir;
    QString params;
    int i = dir.indexOf( QRegExp("%[aAbBcCdDfFgGnNpPtTyY]{1,1}") );
    if( i != -1 && cMode->currentIndex() == 0 )
    {
        i = dir.lastIndexOf( "/", i );
        startDir = dir.left( i );
        params = dir.mid( i );
    }

    QString directory = KFileDialog::getExistingDirectory( startDir, this, i18n("Choose an output directory") );
    if( !directory.isEmpty() )
    {
        if( i != -1 && cMode->currentIndex() == 0 )
        {
            cDir->setEditText( directory + params );
        }
        else
        {
            cDir->setEditText( directory );
        }
        emit directoryChanged( cDir->currentText() );
    }
}
开发者ID:unwork-inc,项目名称:soundkonverter,代码行数:27,代码来源:outputdirectory.cpp


示例16: QDockWidget

AppDockWidget::AppDockWidget(MainWindow *main_window, QWidget *parent)
    : QDockWidget(parent)
{
    ui.setupUi(this);

    mainwindow = main_window;

    // 获取当前工作路径
    workPath = mainwindow->GetCurrentWorkDir();

    // 初始化所有表格和文件
    clearAll();

    QString signalThreadInfoFile = workPath + "/test/info_threads.txt";
    signalThreadInfoWatcher = new QFileSystemWatcher;
    signalThreadInfoWatcher->addPath(signalThreadInfoFile);
    connect(signalThreadInfoWatcher, SIGNAL(fileChanged(QString)), this, SLOT(loadThreadInfoData(QString)));
    connect(signalThreadInfoWatcher, SIGNAL(directoryChanged(QString)), this, SLOT(loadThreadInfoData(QString)));

    QString signalfromepdb = workPath + "/test/sigtogui.txt";
    signalEpdbWatcher = new QFileSystemWatcher;
    signalEpdbWatcher->addPath(signalfromepdb);
    connect(signalEpdbWatcher, SIGNAL(fileChanged(QString)), this, SLOT(recieveEpdbSigData(QString)));

    connect(ui.tabWidget, SIGNAL(currentChanged(int)), this, SLOT(loadTabWidgetData(int)));
    connect(ui.variableTableWidget, SIGNAL(itemChanged(QTableWidgetItem*)), this, SLOT(modifyVariable(QTableWidgetItem*)));
    connect(ui.registerTableWidget, SIGNAL(itemChanged(QTableWidgetItem*)), this, SLOT(modifyRegister(QTableWidgetItem*)));

    signalLoadData = false;
    datacanread = 0;
    showtabwidgetclickable = 0;
    reactvariable = 1;
    reactregister = 1;
}
开发者ID:DefineSun,项目名称:Hust_Debug_v3.0,代码行数:34,代码来源:appdockwidget.cpp


示例17: XOpenDisplay

GlobalShortcutX::GlobalShortcutX() {
	iXIopcode =  -1;
	bRunning = false;

	display = XOpenDisplay(NULL);

	if (! display) {
		qWarning("GlobalShortcutX: Unable to open dedicated display connection.");
		return;
	}

#ifdef Q_OS_LINUX
	if (g.s.bEnableEvdev) {
		QString dir = QLatin1String("/dev/input");
		QFileSystemWatcher *fsw = new QFileSystemWatcher(QStringList(dir), this);
		connect(fsw, SIGNAL(directoryChanged(const QString &)), this, SLOT(directoryChanged(const QString &)));
		directoryChanged(dir);

		if (qsKeyboards.isEmpty()) {
			foreach(QFile *f, qmInputDevices)
				delete f;
			qmInputDevices.clear();

			delete fsw;
			qWarning("GlobalShortcutX: Unable to open any keyboard input devices under /dev/input, falling back to XInput");
		} else {
			return;
		}
	}
开发者ID:Githlar,项目名称:mumble,代码行数:29,代码来源:GlobalShortcut_unix.cpp


示例18: QString

void Ut_MApplicationExtensionManager::testMonitorRemoveExtensionWithTwoExtensionInstancesFromTheSameExtension()
{
    gDesktopEntryList.clear();

    // Fire up a couple of extensions
    gDesktopEntryList << "test1.desktop" << "test2.desktop";

    gDefaultMApplicationExtensionMetaDataStub.stubSetReturnValue("isValid", true);
    gDefaultMApplicationExtensionMetaDataStub.stubSetReturnValue("interface", interfaceName);
    gMApplicationExtensionMetaDataStub->stubSetReturnValue("extensionBinary", QString("test"));
    setupGoodExtension(true, NULL, "extension");
    // Put the same extension a second time to the list
    gQPluginLoaderInstances.append(gQPluginLoaderInstances.first());

    setupTestSubject();

    // Remove one extension from the file system
    gDesktopEntryList.clear();
    gDesktopEntryList << "test1.desktop";

    // Notify about a file system change
    emit directoryChanged(APPLICATION_EXTENSION_DATA_DIR);

    // Observe that the correct extension was removed
    QCOMPARE(signalListener.removedExtensions.count(), 1);
    QCOMPARE(signalListener.removedExtensions.at(0).second, QString("extension"));
}
开发者ID:arcean,项目名称:libmeegotouch-framework,代码行数:27,代码来源:ut_mapplicationextensionmanager.cpp


示例19: directoryChanged

void IconList::settingChanged(const Setting &setting, QVariant value)
{
	if(setting.id() != "IconsDir")
		return;

	directoryChanged(value.toString());
}
开发者ID:Mattia98,项目名称:MultiMC5,代码行数:7,代码来源:IconList.cpp


示例20: qfi

  void LocalProcess::processError(QProcess::ProcessError t_e)
  {
    m_fileCheckTimer.stop();
    QFileInfo qfi(toQString(m_tool.localBinPath));
    QFileInfo outdirfi(toQString(m_outdir));
    LOG(Error, "LocalProcess processError: " << t_e 
        << " exe: " << toString(m_tool.localBinPath)
        << " workingdir: " << toString(m_outdir)
        << " fileexists: " << qfi.isFile()
        << " fileexecutable: " << qfi.isExecutable()
        << " ErrorValue: " << t_e
        << " outdirexists: " << outdirfi.isFile()
        << " outdirisdirectory: " << outdirfi.isDir());

    QCoreApplication::processEvents();
    directoryChanged(openstudio::toQString(m_outdir));

    QProcess::ProcessState state = m_process.state();

    if (state != QProcess::Running
        && t_e == QProcess::WriteError)
    {
      LOG(Info, "WriteError occured when process was not running, ignoring it");
    } else {
      //directoryChanged(openstudio::toQString(m_outdir));
      emit error(t_e);
    }

 }
开发者ID:CUEBoxer,项目名称:OpenStudio,代码行数:29,代码来源:LocalProcess.cpp



注:本文中的directoryChanged函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ dirfd函数代码示例发布时间:2022-05-30
下一篇:
C++ directive_failed函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap