Changeset View
Changeset View
Standalone View
Standalone View
krusader/VFS/vfs.h
Context not available. | |||||
150 | // set the parent window to be used for dialogs | 150 | // set the parent window to be used for dialogs | ||
---|---|---|---|---|---|
151 | void setParentWindow(QWidget *widget) { parentWindow = widget; } | 151 | void setParentWindow(QWidget *widget) { parentWindow = widget; } | ||
152 | 152 | | |||
153 | bool startRefresh(const QUrl &directory = QUrl()); | ||||
154 | void stopRefresh(); | ||||
155 | | ||||
153 | public slots: | 156 | public slots: | ||
154 | /// Re-read the current directory files or change to another directory. Blocking. | 157 | /// Re-read the current directory files or change to another directory. Blocking. | ||
155 | /// Returns true if directory was read. Returns false if failed or refresh job was killed. | 158 | /// Returns true if directory was read. Returns false if failed or refresh job was killed. | ||
Context not available. | |||||
168 | /// Emitted before a directory path is opened for reading. Used for automounting. | 171 | /// Emitted before a directory path is opened for reading. Used for automounting. | ||
169 | void aboutToOpenDir(const QString &path); | 172 | void aboutToOpenDir(const QString &path); | ||
170 | 173 | | |||
174 | void refreshFinished(bool success); | ||||
175 | | ||||
171 | protected: | 176 | protected: | ||
172 | /// Fill the vfs dictionary with vfiles, must be implemented for each VFS. | 177 | /// Fill the vfs dictionary with vfiles, must be implemented for each VFS. | ||
173 | virtual bool refreshInternal(const QUrl &origin, bool showHidden) = 0; | 178 | virtual bool refreshInternal(const QUrl &origin, bool showHidden) = 0; | ||
179 | virtual bool startRefreshInternal(const QUrl &directory, bool showHidden) = 0; | ||||
174 | /// Returns true if this VFS implementation does not need to be notified about changes in the | 180 | /// Returns true if this VFS implementation does not need to be notified about changes in the | ||
175 | /// current directory. | 181 | /// current directory. | ||
176 | virtual bool ignoreRefresh() { return false; } | 182 | virtual bool ignoreRefresh() { return false; } | ||
Context not available. | |||||
178 | /// Returns true if showing hidden files is set in config. | 184 | /// Returns true if showing hidden files is set in config. | ||
179 | bool showHiddenFiles(); | 185 | bool showHiddenFiles(); | ||
180 | /// Add a new vfile to the internal dictionary (while refreshing). | 186 | /// Add a new vfile to the internal dictionary (while refreshing). | ||
181 | inline void addVfile(vfile *vf) { _vfiles.insert(vf->vfile_getName(), vf); } | 187 | inline void addVfile(vfile *vf) { _new_vfiles.insert(vf->vfile_getName(), vf); } | ||
182 | 188 | | |||
183 | /// Calculate the size of a file or directory (recursive). | 189 | /// Calculate the size of a file or directory (recursive). | ||
184 | void calcSpace(const QUrl &url, KIO::filesize_t *totalSize, unsigned long *totalFiles, | 190 | void calcSpace(const QUrl &url, KIO::filesize_t *totalSize, unsigned long *totalFiles, | ||
Context not available. | |||||
197 | static vfile *createVFileFromKIO(const KIO::UDSEntry &_calcEntry, const QUrl &directory, | 203 | static vfile *createVFileFromKIO(const KIO::UDSEntry &_calcEntry, const QUrl &directory, | ||
198 | bool virt = false); | 204 | bool virt = false); | ||
199 | 205 | | |||
206 | void refreshResult(bool success); | ||||
207 | | ||||
200 | VFS_TYPE _type; // the vfs type. | 208 | VFS_TYPE _type; // the vfs type. | ||
201 | QUrl _currentDirectory; // the path or file the VFS originates from. | 209 | QUrl _currentDirectory; // the path or file the VFS originates from. | ||
202 | bool _isRefreshing; // true if vfs is busy with refreshing | | |||
203 | QPointer<QWidget> parentWindow; | 210 | QPointer<QWidget> parentWindow; | ||
204 | 211 | | |||
205 | protected slots: | 212 | protected slots: | ||
Context not available. | |||||
217 | void clear(vfileDict &vfiles); | 224 | void clear(vfileDict &vfiles); | ||
218 | 225 | | |||
219 | vfileDict _vfiles; // The list of files in the current dictionary | 226 | vfileDict _vfiles; // The list of files in the current dictionary | ||
227 | vfileDict _new_vfiles; | ||||
228 | | ||||
229 | bool _isRefreshing = false; // true if vfs is busy with refreshing | ||||
230 | bool _dirChange = false; | ||||
220 | 231 | | |||
221 | // used in the calcSpace function | 232 | // used in the calcSpace function | ||
222 | bool *_calcKdsBusy; | 233 | bool *_calcKdsBusy; | ||
Context not available. |