// ================= // PRIVATE // ================= void DirWidget::setupConnections(){ //Info routines connect(treeWidget, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(OpenContextMenu()) ); connect(listWidget, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(OpenContextMenu()) ); connect(treeWidget, SIGNAL(itemSelectionChanged()), this, SLOT(SelectionChanged()) ); connect(listWidget, SIGNAL(itemSelectionChanged()), this, SLOT(SelectionChanged()) ); //Activation routines connect(treeWidget, SIGNAL(itemActivated(QTreeWidgetItem*,int)), this, SLOT(on_tool_act_run_clicked()) ); connect(treeWidget, SIGNAL(DataDropped(QString, QStringList)), this, SIGNAL(PasteFiles(QString, QStringList)) ); connect(listWidget, SIGNAL(itemActivated(QListWidgetItem*)), this, SLOT(on_tool_act_run_clicked()) ); connect(listWidget, SIGNAL(DataDropped(QString, QStringList)), this, SIGNAL(PasteFiles(QString, QStringList)) ); connect(line_dir, SIGNAL(returnPressed()), this, SLOT(dir_changed()) ); //Keyboard Shortcuts /*connect(copyFilesShort, SIGNAL(activated()), this, SLOT( on_tool_act_copy_clicked() ) ); connect(cutFilesShort, SIGNAL(activated()), this, SLOT( on_tool_act_cut_clicked() ) ); connect(pasteFilesShort, SIGNAL(activated()), this, SLOT( on_tool_act_paste_clicked() ) ); connect(deleteFilesShort, SIGNAL(activated()), this, SLOT( on_tool_act_rm_clicked() ) );*/ //Filesystem Watcher connect(watcher, SIGNAL(directoryChanged(const QString&)), this, SLOT(startSync(const QString &)) ); connect(watcher, SIGNAL(fileChanged(const QString&)), this, SLOT(startSync(const QString &)) ); //just in case connect(synctimer, SIGNAL(timeout()), this, SLOT(refresh()) ); }
void diskfs_notice_dirchange (struct node *dp, enum dir_changed_type type, const char *name) { error_t err; struct modreq **preq; dp->dirmod_tick++; preq = &dp->dirmod_reqs; while (*preq) { struct modreq *req = *preq; err = dir_changed (req->port, dp->dirmod_tick, type, name); if (err && err != MACH_SEND_TIMED_OUT) { /* Remove notify port. */ *preq = req->next; mach_port_deallocate (mach_task_self (), req->port); free (req); } else preq = &req->next; } }
kern_return_t diskfs_S_dir_notice_changes (struct protid *cred, mach_port_t notify) { error_t err; struct modreq *req; struct node *np; if (!cred) return EOPNOTSUPP; np = cred->po->np; pthread_mutex_lock (&np->lock); if (!S_ISDIR (np->dn_stat.st_mode)) { pthread_mutex_unlock (&np->lock); return ENOTDIR; } err = dir_changed (notify, np->dirmod_tick, DIR_CHANGED_NULL, ""); if (err) { pthread_mutex_unlock (&np->lock); return err; } req = malloc (sizeof (struct modreq)); if (! req) { pthread_mutex_unlock (&np->lock); return ENOMEM; } req->port = notify; req->next = np->dirmod_reqs; np->dirmod_reqs = req; pthread_mutex_unlock (&np->lock); return 0; }