~carlos-mazieri/ubuntu-filemanager-app/samba-actions-04

« back to all changes in this revision

Viewing changes to src/plugin/folderlistmodel/filesystemaction.h

  • Committer: carlos-mazieri
  • Date: 2015-07-13 17:29:25 UTC
  • Revision ID: carlos.mazieri@gmail.com-20150713172925-sezvuzewvs9h9qr4
FileSystemAction needs to interact with Locations, it now depends from LocationsFactory and Locations classes.

The following methods were removed because the Location where the Action was performed needs to create its DirIteminfo for its items:
   * Removed signals FileSystemAction::added(QString) and FileSystemAction::removed(QString)
   * Removed slots   DirModel::onItemAdded(QString) and DirModel::onItemRemoved(QString)

FileSystemAction::isThereDiskSpace() was removed and Location::isThereDiskSpace() is used.

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
class DirModelMimeData;
52
52
class QFile;
53
53
class QTemporaryFile;
54
 
 
 
54
class Location;
 
55
class LocationsFactory;
55
56
 
56
57
/*!
57
58
 * \brief The FileSystemAction class does file system operations copy/cut/paste/remove items
95
96
{
96
97
    Q_OBJECT
97
98
public:  
98
 
    explicit FileSystemAction(QObject *parent = 0);
 
99
    explicit FileSystemAction(LocationsFactory *locationsFactory, QObject *parent = 0);
99
100
    ~FileSystemAction();
100
101
 
101
102
public:
116
117
 
117
118
signals:
118
119
    void     error(const QString& errorTitle, const QString &errorMessage);
119
 
    void     removed(const QString& item);
120
120
    void     removed(const DirItemInfo&);
121
 
    void     added(const QString& );
122
121
    void     added(const DirItemInfo& );
123
122
    void     changed(const DirItemInfo&);
124
123
    void     progress(int curItem, int totalItems, int percent);
131
130
    bool     processCopySingleFile();
132
131
 
133
132
 private:
 
133
   enum ActionNotification
 
134
   {
 
135
        ItemAdded,
 
136
        ItemRemoved,
 
137
        ItemChanged
 
138
   };
 
139
 
134
140
   enum ActionType
135
141
   {
136
142
       ActionRemove,
213
219
   QString                 m_errorTitle;
214
220
   QString                 m_errorMsg;
215
221
   bool                    m_clipboardChanged; //!< this is set to false in \ref moveIntoCurrentPath() and \ref copyIntoCurrentPath();
 
222
   LocationsFactory *      m_locationsFactory;
216
223
 
217
224
 
218
225
private:  
236
243
   void     queueAction(Action *myAction);
237
244
   void     createTrashInfoFileFromEntry(ActionEntry *entry);
238
245
   void     removeTrashInfoFileFromEntry(ActionEntry *entry);
 
246
   void     notifyActionOnItem(const DirItemInfo& item, ActionNotification action);
239
247
 
240
248
#if defined(REGRESSION_TEST_FOLDERLISTMODEL) //used in Unit/Regression tests
241
249
   bool     m_forceUsingOtherFS;