void SvnUpdateHandler::Process(const wxString& output) { bool conflictFound ( false ); wxString svnOutput ( output ); svnOutput.MakeLower(); if (svnOutput.Contains(wxT("summary of conflicts:"))) { // A conflict was found conflictFound = true; } // Reload any modified files EventNotifier::Get()->PostReloadExternallyModifiedEvent( false ); // After 'Update' we usually want to do the following: // Reload workspace (if a project file or the workspace were modified) // or retag the workspace if ( !conflictFound ) { // Retag workspace only if no conflict were found // send an event to the main frame indicating that a re-tag is required if( GetPlugin()->GetSettings().GetFlags() & SvnRetagWorkspace ) { wxCommandEvent e(wxEVT_COMMAND_MENU_SELECTED, XRCID("retag_workspace")); GetPlugin()->GetManager()->GetTheApp()->GetTopWindow()->GetEventHandler()->AddPendingEvent(e); } } // Post event about file system updated clFileSystemEvent fsEvent(wxEVT_FILE_SYSTEM_UPDATED); fsEvent.SetPath(GetPlugin()->GetSvnView()->GetRootDir()); EventNotifier::Get()->AddPendingEvent(fsEvent); // And finally, update the Subversion view SvnDefaultCommandHandler::Process(output); }
void Inotify::readEventsFromBuffer( uint8_t* buffer, int length, std::vector<inotify::FileSystemEvent>& events) { int i = 0; while (i < length) { inotify_event* event = ((struct inotify_event*)&buffer[i]); if(event->mask & IN_IGNORED){ i += EVENT_SIZE + event->len; mDirectorieMap.left.erase(event->wd); continue; } auto path = wdToPath(event->wd) / std::string(event->name); if (fs::is_directory(path)) { event->mask |= IN_ISDIR; } FileSystemEvent fsEvent(event->wd, event->mask, path, std::chrono::steady_clock::now()); if (!fsEvent.path.empty()) { events.push_back(fsEvent); } else { // Event is not complete --> ignore } i += EVENT_SIZE + event->len; } }