[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: extragear/graphics/kphotoalbum/ImportExport
From: Jesper Pedersen <blackie () blackie ! dk>
Date: 2006-08-18 4:06:03
Message-ID: 1155873963.060304.20939.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 574088 by blackie:
now import/export also works with videos.
M +8 -14 Export.cpp
M +2 -1 Import.cpp
--- trunk/extragear/graphics/kphotoalbum/ImportExport/Export.cpp \
#574087:574088 @@ -236,7 +236,7 @@
QString file = *it;
QString zippedName = _nameMap[file];
- if ( _maxSize == -1 ) {
+ if ( _maxSize == -1 || Utilities::isVideo( file ) ) {
if ( QFileInfo( file ).isSymLink() )
file = QFileInfo(file).readLink();
@@ -261,12 +261,7 @@
// Test if the cancel button was pressed.
qApp->eventLoop()->processEvents( QEventLoop::AllEvents );
-#if QT_VERSION < 0x030104
- bool canceled = _progressDialog->wasCancelled();
-#else
- bool canceled = _progressDialog->wasCanceled();
-#endif
- if ( canceled ) {
+ if ( _progressDialog->wasCanceled() ) {
_ok = false;
return;
}
@@ -281,9 +276,12 @@
{
if ( !loadedOK )
return;
+
+ const QString ext = Utilities::isVideo( fileName ) ? \
QString::fromLatin1( "jpg" ) : QFileInfo( _nameMap[fileName] ).extension(); \
+ // Add the file to the zip archive
- QString zipFileName = QString::fromLatin1( "%1/%2.%3" ).arg( \
Utilities::stripSlash(_subdir)).arg(QFileInfo( _nameMap[fileName] \
).baseName())
- .arg(QFileInfo( _nameMap[fileName] ).extension() \
); + QString zipFileName = QString::fromLatin1( "%1/%2.%3" ).arg( \
Utilities::stripSlash(_subdir)) + .arg(QFileInfo( \
_nameMap[fileName] ).baseName()).arg( ext ); QByteArray data;
QBuffer buffer( data );
buffer.open( IO_WriteOnly );
@@ -304,11 +302,7 @@
qApp->eventLoop()->processEvents( QEventLoop::AllEvents );
-#if QT_VERSION < 0x030104
- bool canceled = (!_ok || _progressDialog->wasCancelled());
-#else
bool canceled = (!_ok || _progressDialog->wasCanceled());
-#endif
if ( canceled ) {
_ok = false;
@@ -321,7 +315,7 @@
_filesRemaining--;
_progressDialog->setProgress( _steps );
- if ( _filesRemaining == 0 )
+ if ( _filesRemaining == 0 && _loopEntered )
qApp->eventLoop()->exitLoop();
}
--- trunk/extragear/graphics/kphotoalbum/ImportExport/Import.cpp \
#574087:574088 @@ -609,7 +609,8 @@
const KArchiveDirectory* thumbnailDir = static_cast<const \
KArchiveDirectory*>( thumbnails );
- fileName = QFileInfo( fileName ).fileName();
+ const QString ext = Utilities::isVideo( fileName ) ? \
QString::fromLatin1( "jpg" ) : QFileInfo( fileName ).extension(); + \
fileName = QString::fromLatin1("%1.%2").arg( Utilities::stripSlash( \
QFileInfo( fileName ).baseName() ) ).arg(ext); const KArchiveEntry* \
fileEntry = thumbnailDir->entry( fileName ); if ( fileEntry == 0 || \
!fileEntry->isFile() ) {
KMessageBox::error( this, i18n("No thumbnail existed in export \
file for %1").arg( fileName ) );
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic