diff options
author | Arno <am@disconnect.de> | 2010-05-28 19:18:46 +0200 |
---|---|---|
committer | Arno <am@disconnect.de> | 2010-05-28 19:18:46 +0200 |
commit | 9ab30cc1d7d5362a826f89dda5cb14f7716c2908 (patch) | |
tree | 837ff4e642fcfde434781e6e05f9105958d2a433 | |
parent | 4536e03b7c2f96431aa5aeba61bda0b93896b106 (diff) | |
download | SheMov-9ab30cc1d7d5362a826f89dda5cb14f7716c2908.tar.gz SheMov-9ab30cc1d7d5362a826f89dda5cb14f7716c2908.tar.bz2 SheMov-9ab30cc1d7d5362a826f89dda5cb14f7716c2908.zip |
Make directory browsing optional for PictureViewer
Make directory browsing optional in preparation for new
ArchiveItemEditDialog. There will be a button to view the selected
picture, but it needn't be able to browse the directory of the picture.
-rw-r--r-- | pictureviewer.cpp | 9 | ||||
-rw-r--r-- | pictureviewer.h | 2 |
2 files changed, 8 insertions, 3 deletions
diff --git a/pictureviewer.cpp b/pictureviewer.cpp index 74a06c5..a59b62d 100644 --- a/pictureviewer.cpp +++ b/pictureviewer.cpp @@ -25,7 +25,7 @@ PictureViewer::PictureViewer(QWidget *parent) : QGraphicsView(parent), mCurrentP setScene(mScene); } -void PictureViewer::showPic(const QString &path){ +void PictureViewer::showPic(const QString &path, bool enableDirEntries){ QFileInfo fi(path); if(!fi.exists() || fi.isDir()){ return; @@ -44,7 +44,12 @@ void PictureViewer::showPic(const QString &path){ mInfoItem = 0; } - setDir(path); + if(enableDirEntries){ + setDir(path); + }else{ + mDirEntries = QFileInfoList(); + mCurrentEntry = mDirEntries.constEnd(); + } if(!isVisible()){ show(); } diff --git a/pictureviewer.h b/pictureviewer.h index 2791bbe..2a8374a 100644 --- a/pictureviewer.h +++ b/pictureviewer.h @@ -22,7 +22,7 @@ class PictureViewer : public QGraphicsView { PictureViewer(QWidget *parent = 0); public slots: - void showPic(const QString &path); + void showPic(const QString &path, bool enableDirEntries = true); void next(); void previous(); |