summaryrefslogtreecommitdiffstats
path: root/ksquirrel/sq_viewcache.ui.h
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-22 19:31:25 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-22 19:31:25 +0000
commit6afd9d8dddbe9e450690e05d498a503c00333a5e (patch)
treeee3eaca74e8e33dd66f24f5fb6c1431d7a9ff429 /ksquirrel/sq_viewcache.ui.h
downloadksquirrel-6afd9d8dddbe9e450690e05d498a503c00333a5e.tar.gz
ksquirrel-6afd9d8dddbe9e450690e05d498a503c00333a5e.zip
Added KDE3 version of ksquirrel photo manager
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/ksquirrel@1094446 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'ksquirrel/sq_viewcache.ui.h')
-rw-r--r--ksquirrel/sq_viewcache.ui.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/ksquirrel/sq_viewcache.ui.h b/ksquirrel/sq_viewcache.ui.h
new file mode 100644
index 0000000..fa7dc8a
--- /dev/null
+++ b/ksquirrel/sq_viewcache.ui.h
@@ -0,0 +1,45 @@
+/****************************************************************************
+** ui.h extension file, included from the uic-generated form implementation.
+**
+** If you wish to add, delete or rename functions or slots use
+** Qt Designer which will update this file, preserving your code. Create an
+** init() function in place of a constructor, and a destroy() function in
+** place of a destructor.
+*****************************************************************************/
+
+void SQ_ViewCache::init()
+{
+ textTotal->setText(QString("<b>%1</b>").arg((int)SQ_PixmapCache::instance()->count()));
+
+ if(SQ_PixmapCache::instance()->isEmpty())
+ return;
+
+ listCache->setSorting(-1);
+
+ QListViewItem *itemafter = 0, *item;
+
+ SQ_PixmapCache::iterator itEnd = SQ_PixmapCache::instance()->end();
+ SQ_Thumbnail th;
+ KURL url;
+ QString s;
+
+ for(SQ_PixmapCache::iterator it = SQ_PixmapCache::instance()->begin();it != itEnd;++it)
+ {
+ th = it.data();
+ url = it.key();
+ s = url.isLocalFile() ? url.path() : url.prettyURL();
+
+ if(itemafter)
+ item = new QListViewItem(listCache, itemafter, s,
+ QString::null, QString::fromLatin1("%1x%2").arg(th.w).arg(th.h));
+ else
+ item = new QListViewItem(listCache, s,
+ QString::null, QString::fromLatin1("%1x%2").arg(th.w).arg(th.h));
+
+ item->setPixmap(1, it.data().mime);
+
+ itemafter = item;
+
+ listCache->insertItem(item);
+ }
+}