[Kde-imaging] kdeextragear-libs-1/kipi-plugins/batchprocessimages
Gilles Caulier
caulier.gilles at free.fr
Wed Sep 22 16:43:38 CEST 2004
CVS commit by cgilles:
BatchRenameImage plugin : Restored old filter file name method. TODO support KURL.
CCMAIL: kde-imaging at kde.org
M +25 -44 renameimagesdialog.cpp 1.24
--- kdeextragear-libs-1/kipi-plugins/batchprocessimages/renameimagesdialog.cpp #1.23:1.24
@@ -602,27 +602,4 @@ void RenameImagesDialog::listImageFiles(
BatchProcessImagesDialog::listImageFiles();
- KURL::List images;
- for ( QListViewItem* it = m_listFiles->firstChild(); it; it = it->nextSibling() )
- {
- BatchProcessImagesItem *pitem = static_cast<BatchProcessImagesItem*>(it);
- images.append( pitem->pathSrc() );
- }
-
- m_listFiles->clear();
-
- int imageIndex = 0;
- for( KURL::List::Iterator urlIt = images.begin(); urlIt != images.end(); ++urlIt )
- {
- QFileInfo fi( (*urlIt).path() ); // PENDING(blackie) handle remote URLS
- new BatchProcessImagesItem(m_listFiles, fi.filePath(), fi.fileName(),
- oldFileName2NewFileName(&fi, imageIndex), "" );
- ++imageIndex;
- }
-
- // PENDING(blackie) This is the old code for this function.
- // This code also includes sorting, but that needs some work to work with remote URL's
-#ifdef TEMPORARILY_REMOVED
- BatchProcessImagesDialog::listImageFiles();
-
int sortMethod;
@@ -653,20 +630,25 @@ void RenameImagesDialog::listImageFiles(
QStringList AlbumItemListed;
- QListViewItemIterator it2( m_listFiles );
- int imageIndex = 0;
+ KURL::List images;
- while ( it2.current() )
+ for ( QListViewItem* it = m_listFiles->firstChild(); it; it = it->nextSibling() )
{
- BatchProcessImagesItem *pitem = static_cast<BatchProcessImagesItem*>(it2.current());
+ BatchProcessImagesItem *pitem = static_cast<BatchProcessImagesItem*>(it);
+ images.append( pitem->pathSrc() );
QString currentAlbumName = pitem->pathSrc().section('/', 0, -2);
if ( AlbumItemListed.find(currentAlbumName) == AlbumItemListed.end() )
AlbumItemListed.append(currentAlbumName);
-
- ++it2;
}
m_listFiles->clear();
+ int imageIndex = 0;
+
+ QStringList selectedImageFiles;
+
+ for( KURL::List::Iterator urlIt = images.begin(); urlIt != images.end(); ++urlIt )
+ selectedImageFiles.append( (*urlIt).path() ); // PENDING(blackie) handle remote URLS
+
for( QStringList::Iterator itAlbum = AlbumItemListed.begin() ; itAlbum != AlbumItemListed.end() ; ++itAlbum )
{
@@ -691,7 +673,7 @@ void RenameImagesDialog::listImageFiles(
}
- if ( m_selectedImageFiles.find(fi->filePath()) != m_selectedImageFiles.end() )
+ if ( selectedImageFiles.find(fi->filePath()) != selectedImageFiles.end() )
{
- /*BatchProcessImagesItem *item = */new BatchProcessImagesItem(m_listFiles,
+ new BatchProcessImagesItem(m_listFiles,
fi->filePath(),
fi->fileName(),
@@ -705,5 +687,4 @@ void RenameImagesDialog::listImageFiles(
}
}
-#endif
}
More information about the Kde-imaging
mailing list