[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: extragear/libs/libkexif
From: Renchi Raju <renchi () pooh ! tam ! uiuc ! edu>
Date: 2005-08-19 6:00:42
Message-ID: 1124431242.249147.11117.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 450804 by pahlibar:
applied patch from Owen Hirst to make simple
view actually simple. bump up version to 0.2.2
M +1 -1 kexifdialog.cpp
M +17 -0 kexiflistview.cpp
M +2 -0 kexiflistview.h
M +16 -1 kexiflistviewitem.cpp
M +59 -5 kexifwidget.cpp
M +1 -1 libkexif.lsm
M +1 -1 libkexif.pc.in
--- trunk/extragear/libs/libkexif/kexifdialog.cpp #450803:450804
@@ -64,7 +64,7 @@
// All bugs must be reported to Digikam account in bko.
KAboutData* about = new KAboutData("digikam",
I18N_NOOP("KExif"),
- "0.2.1",
+ "0.2.2",
I18N_NOOP("An Exif data viewer"),
KAboutData::License_GPL,
"(c) 2003-2004, Digikam team",
--- trunk/extragear/libs/libkexif/kexiflistview.cpp #450803:450804
@@ -86,6 +86,23 @@
}
}
+void KExifListView::setEntryList(const QPtrList<KExifEntry>& _entryList)
+{
+ QColor color = QColor(255,255,255);
+
+ QPtrList<KExifEntry> entryList(_entryList);
+ QPtrListIterator<KExifEntry> it(entryList);
+ KExifEntry* exifEntry = 0;
+
+ int sortKey = 0;
+ while ((exifEntry = it.current()) != 0)
+ {
+ KExifListViewItem* item = new KExifListViewItem(this, exifEntry, color);
+ item->setSortKey(++sortKey);
+ ++it;
+ }
+}
+
QString KExifListView::getCurrentItemName() const
{
if (currentItem())
--- trunk/extragear/libs/libkexif/kexiflistview.h #450803:450804
@@ -32,6 +32,7 @@
#include <qlistview.h>
class KExifIfd;
+class KExifEntry;
class KExifListViewItem;
class KExifListView : public QListView
@@ -44,6 +45,7 @@
~KExifListView();
void setIfdList(const QPtrList<KExifIfd>& ifdList);
+ void setEntryList(const QPtrList<KExifEntry>& entryList);
QString getCurrentItemName() const;
void setCurrentItem(const QString& itemName);
--- trunk/extragear/libs/libkexif/kexiflistviewitem.cpp #450803:450804
@@ -23,6 +23,8 @@
//////////////////////////////////////////////////////////////////////////////
#include <qpalette.h>
+#include <qfont.h>
+#include <qpainter.h>
#include "kexifentry.h"
#include "kexiflistviewitem.h"
@@ -35,7 +37,7 @@
{
if (m_exifEntry)
{
- setText(0, m_exifEntry->getName());
+ setText(0, m_exifEntry->getTitle());
setText(1, m_exifEntry->getValue());
}
}
@@ -65,5 +67,18 @@
QColorGroup cgMod(cg);
cgMod.setColor(QColorGroup::Base, m_color);
+ if (column == 0)
+ {
+ p->save();
+ QFont fn(p->font());
+ fn.setBold(true);
+ p->setFont(fn);
+ }
+
QListViewItem::paintCell(p, cgMod, column, width, align);
+
+ if (column == 0)
+ {
+ p->restore();
+ }
}
--- trunk/extragear/libs/libkexif/kexifwidget.cpp #450803:450804
@@ -20,15 +20,48 @@
* ============================================================ */
#include <qlayout.h>
+#include <qmap.h>
#include <klocale.h>
#include <kglobal.h>
+#include <kdebug.h>
+#include <libexif/exif-tag.h>
+#include <libexif/exif-entry.h>
+
#include "kexifdata.h"
#include "kexififd.h"
+#include "kexifentry.h"
#include "kexiflistview.h"
#include "kexifwidget.h"
+static int KExifHumanList[] =
+{
+ EXIF_TAG_MAKE ,
+ EXIF_TAG_MODEL ,
+ EXIF_TAG_DATE_TIME ,
+ EXIF_TAG_SHUTTER_SPEED_VALUE ,
+ EXIF_TAG_APERTURE_VALUE ,
+ EXIF_TAG_EXPOSURE_PROGRAM ,
+ EXIF_TAG_EXPOSURE_MODE ,
+ EXIF_TAG_EXPOSURE_BIAS_VALUE ,
+ EXIF_TAG_EXPOSURE_TIME ,
+ EXIF_TAG_WHITE_BALANCE ,
+ EXIF_TAG_ISO_SPEED_RATINGS ,
+ EXIF_TAG_FOCAL_LENGTH ,
+ EXIF_TAG_SUBJECT_DISTANCE ,
+ EXIF_TAG_METERING_MODE ,
+ EXIF_TAG_CONTRAST ,
+ EXIF_TAG_SATURATION ,
+ EXIF_TAG_SHARPNESS ,
+ EXIF_TAG_LIGHT_SOURCE ,
+ EXIF_TAG_FLASH ,
+ EXIF_TAG_IMAGE_DESCRIPTION ,
+ EXIF_TAG_COPYRIGHT ,
+ -1
+};
+
+
KExifWidget::KExifWidget(QWidget* parent, const char* name)
: QWidget(parent, name), m_mode(KExifWidget::SIMPLE)
{
@@ -96,17 +129,38 @@
m_view->clear();
if (m_mode == SIMPLE)
{
+
+ QMap<int, KExifEntry*> humanMap;
+ for (int i=0; KExifHumanList[i] != -1; i++)
+ {
+ humanMap.replace(KExifHumanList[i], 0);
+ }
+
QPtrList<KExifIfd> ifdList(m_data->ifdList());
for (KExifIfd* ifd = ifdList.first(); ifd; ifd = ifdList.next())
{
- if (ifd->getName().lower() == "exif")
+ QPtrList<KExifEntry> entryList = ifd->entryList();
+ for (KExifEntry* entry = entryList.first(); entry; entry = entryList.next())
{
- QPtrList<KExifIfd> ifds;
- ifds.append(ifd);
- m_view->setIfdList(ifds);
- break;
+ if (entry->exifEntry() &&
+ humanMap.contains(entry->exifEntry()->tag))
+ {
+ humanMap.replace(entry->exifEntry()->tag, entry);
+ }
}
}
+
+ QPtrList<KExifEntry> entryList;
+ for (int i=0; KExifHumanList[i] != -1; i++)
+ {
+ KExifEntry* entry = humanMap[KExifHumanList[i]];
+ if (entry)
+ {
+ entryList.append(entry);
+ }
+ }
+
+ m_view->setEntryList(entryList);
}
else
{
--- trunk/extragear/libs/libkexif/libkexif.lsm #450803:450804
@@ -1,6 +1,6 @@
Begin4
Title: libkexif
-Version: 0.2.1
+Version: 0.2.2
Entered-date: 2004-12-20
Description: A library to manipulate EXIF information
Keywords: kde image jpeg exif
--- trunk/extragear/libs/libkexif/libkexif.pc.in #450803:450804
@@ -6,6 +6,6 @@
Name: libkexif
Description: KDE wrapper library for libexif with some extras
Requires:
-Version: 0.2.1
+Version: 0.2.2
Libs: -L${libdir} -lkexif
Cflags: -I${includedir}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic