Directory::Directory(Core *c, QString p_uri) : Core_ally(c), uri(p_uri) { connect(this, SIGNAL(watch(QString)), core->get_directory_watcher(), SLOT(add(QString))); connect(this, SIGNAL(unwatch(QString)), core->get_directory_watcher(), SLOT(remove(QString))); connect(core->get_directory_watcher(), SIGNAL(directory_changed(QString)), this, SLOT(directory_changed(QString))); async_result_type = async_result_unexpected; gcancellable = 0; need_update = false; watcher_created = false; uri = canonize(uri); Special_uri special_uri(uri); if (special_uri.name() == Special_uri::places) { connect(core->get_mount_manager(), SIGNAL(mounts_changed(QList<Gio_mount>)), this, SLOT(refresh())); connect(core->get_bookmarks(), SIGNAL(changed()), this, SLOT(refresh())); connect(core->get_user_dirs(), SIGNAL(changed()), this, SLOT(refresh())); } QTimer* t = new QTimer(this); connect(t, SIGNAL(timeout()), this, SLOT(refresh_timeout())); t->start(watcher_refresh_timeout); refresh_timer.restart(); }
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(); }
Directory_watcher::Directory_watcher(QObject *parent) : QObject(parent) { connect(&watcher, SIGNAL(directoryChanged(QString)), this, SIGNAL(directory_changed(QString))); }
void Directory_watcher::slot_directory_changed(QString real_path) { emit directory_changed(real_paths.key(real_path)); }