diff options
author | Arno <am@disconnect.de> | 2010-12-21 19:12:40 +0100 |
---|---|---|
committer | Arno <am@disconnect.de> | 2010-12-21 19:12:40 +0100 |
commit | f3d62ad86a1def4d11d132af7366874f43a438b9 (patch) | |
tree | fd46290dfc6da30be98b9bfe7d4566a7f4785312 /filesystemwidget.h | |
parent | 8abf0a7882dbd1c80e24e5d01b79cd1cf60925e2 (diff) | |
download | SheMov-f3d62ad86a1def4d11d132af7366874f43a438b9.tar.gz SheMov-f3d62ad86a1def4d11d132af7366874f43a438b9.tar.bz2 SheMov-f3d62ad86a1def4d11d132af7366874f43a438b9.zip |
Fix copy, cut and paste files
Make this options in the context and edit menu of FilesystemWidget
behave a lot more as expected. Copy and cut just copies the file names
to the clipboard, and paste paste moves them if they were cut and copies
them when the action was copy.
Still need to fix the colors when something is marked somehow. Should be
configurable :)
Diffstat (limited to 'filesystemwidget.h')
-rw-r--r-- | filesystemwidget.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/filesystemwidget.h b/filesystemwidget.h index ee0b9b3..b54fdad 100644 --- a/filesystemwidget.h +++ b/filesystemwidget.h @@ -32,6 +32,7 @@ class QSqlQuery; class FilesystemWidget : public QWidget { Q_OBJECT public: + enum ClipboardMode { Copy, Cut, None }; FilesystemWidget(QWidget *parent = 0); ~FilesystemWidget() {} FileView *fileView() { return mFileView; } @@ -54,8 +55,8 @@ class FilesystemWidget : public QWidget { void parentDir(); void goBack(); void deleteFiles(); - void copyFiles(); - void moveFiles(); + void toClipboard(int clipmode); + void fromClipboard(); void renameFile(); void renameCover(const QString &infix); void setTemplate(); @@ -73,7 +74,10 @@ class FilesystemWidget : public QWidget { private: void setWindowTitle(const QString &dir); void deleteRecursive(const QFileInfo &start); + void copyFiles(const QStringList &files, const QString &dest); + void moveFiles(const QStringList &files, const QString &dest); void copyRecursive(const QFileInfo &start, const QString &destdir); + const QString selectedDir(); QPair<QString, QStringList> programData(const QString &prefix, const QString &preferred); QStringList selectedFiles(); QStringList mExpandedDirs; @@ -88,6 +92,7 @@ class FilesystemWidget : public QWidget { qint64 mSize; PictureViewer *mPicViewer; QString mLastDir; + int mClipboardMode; }; class FileSystemModel : public QFileSystemModel { @@ -100,6 +105,8 @@ class FileSystemModel : public QFileSystemModel { public slots: void markAsSeen(const QString &path, bool seen); + void markForClipboard(const QPersistentModelIndex &idx); + void clearClipboardList(); private: void cleanup(); @@ -107,6 +114,7 @@ class FileSystemModel : public QFileSystemModel { QSqlDatabase mDb; QSqlQuery *mDeleteFromSeenQuery; QSqlQuery *mMarkAsSeenQuery; + QList<QPersistentModelIndex> mClipEntries; }; #endif |