From f4a2553aa56939721bcd82d8ad9bffbaecd0647a Mon Sep 17 00:00:00 2001 From: Arno Date: Sun, 9 Jan 2011 12:52:09 +0100 Subject: Use pictureViewer in NewMovieWizard Optionally show a frame or the picture in PictureViewer when clicking an item in the file list. Added a new function to SmGlobals::FrameCache: make it possible to retrieve the path of the frame, also. --- smglobals.cpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'smglobals.cpp') diff --git a/smglobals.cpp b/smglobals.cpp index 52b3805..c21cea4 100644 --- a/smglobals.cpp +++ b/smglobals.cpp @@ -164,15 +164,24 @@ void SmGlobals::FrameCache::readConfig(){ } const QPixmap SmGlobals::FrameCache::entry(const QString &sourcePath, const QString &when){ - QString realWhen = when; - if(realWhen.isEmpty()){ - realWhen = mWhen; + const QPair source = prepFrame(sourcePath, when); + return QPixmap(mFrameCache.value(source)); +} + +const QString SmGlobals::FrameCache::entryPath(const QString &sourcePath, const QString &when){ + const QPair source = prepFrame(sourcePath, when); + return mFrameCache.value(source); +} + +const QPair SmGlobals::FrameCache::prepFrame(const QString &sourceFile, QString when){ + if(when.isEmpty()){ + when = mWhen; } - const QPair source(sourcePath, realWhen); + const QPair source(sourceFile, when); if(!mFrameCache.contains(source)){ - grabFrame(sourcePath, realWhen); + grabFrame(sourceFile, when); } - return QPixmap(mFrameCache.value(source)); + return source; } void SmGlobals::FrameCache::grabFrame(const QString &sourceFile, QString when){ -- cgit v1.2.3-70-g09d2