summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregorio Guidi <greg_g@gentoo.org>2005-10-07 15:10:01 +0000
committerGregorio Guidi <greg_g@gentoo.org>2005-10-07 15:10:01 +0000
commitbc31af90ef50b5ec7fe1ab6baba5723a67624f12 (patch)
tree8c86ce3e67789eda49be4cd79a7e59aefc90b9cf /kde-base/kdelibs
parentBetter description. (diff)
downloadgentoo-2-bc31af90ef50b5ec7fe1ab6baba5723a67624f12.tar.gz
gentoo-2-bc31af90ef50b5ec7fe1ab6baba5723a67624f12.tar.bz2
gentoo-2-bc31af90ef50b5ec7fe1ab6baba5723a67624f12.zip
Remove KDE 3.2.3.
(Portage version: 2.0.51.22-r3)
Diffstat (limited to 'kde-base/kdelibs')
-rw-r--r--kde-base/kdelibs/files/digest-kdelibs-3.2.3-r77
-rw-r--r--kde-base/kdelibs/files/digest-kdelibs-3.2.3-r98
-rw-r--r--kde-base/kdelibs/files/post-3.2.3-kdelibs-htmlframes.patch429
-rw-r--r--kde-base/kdelibs/files/post-3.2.3-kdelibs-idn.patch89
-rw-r--r--kde-base/kdelibs/files/post-3.2.3-kdelibs-khtml.diff67
-rw-r--r--kde-base/kdelibs/files/post-3.2.3-kdelibs-kimgio.diff1404
-rw-r--r--kde-base/kdelibs/kdelibs-3.2.3-r7.ebuild110
-rw-r--r--kde-base/kdelibs/kdelibs-3.2.3-r9.ebuild118
8 files changed, 0 insertions, 2232 deletions
diff --git a/kde-base/kdelibs/files/digest-kdelibs-3.2.3-r7 b/kde-base/kdelibs/files/digest-kdelibs-3.2.3-r7
deleted file mode 100644
index 981c0f696e0a..000000000000
--- a/kde-base/kdelibs/files/digest-kdelibs-3.2.3-r7
+++ /dev/null
@@ -1,7 +0,0 @@
-MD5 d9d1c4bd2016a96f156b491ca908dc16 kdelibs-3.2.3.tar.bz2 12737024
-MD5 ca12b078c7288ce9b2653e639a5b3ee0 post-3.2.3-kdelibs-kcookiejar.patch 5384
-MD5 345ce2e01cfdfa4754c47894c0271dcc post-3.2.3-kdelibs-kstandarddirs.patch 1417
-MD5 4d61d568e822d781308caa73050930bd post-3.2.3-kdelibs-htmlframes2.patch 1186
-MD5 94e76ec98cd58ce27cad8f886d241986 post-3.2.3-kdelibs-kio.diff 1509
-MD5 0046c691fa833b2ff8d7eac15312a68b post-3.2.3-kdelibs-dcopserver.patch 4751
-MD5 a639b7b592f005e911c454a0a8c9c542 post-3.2.3-kdelibs-kioslave.patch 549
diff --git a/kde-base/kdelibs/files/digest-kdelibs-3.2.3-r9 b/kde-base/kdelibs/files/digest-kdelibs-3.2.3-r9
deleted file mode 100644
index 398e57208f1a..000000000000
--- a/kde-base/kdelibs/files/digest-kdelibs-3.2.3-r9
+++ /dev/null
@@ -1,8 +0,0 @@
-MD5 d9d1c4bd2016a96f156b491ca908dc16 kdelibs-3.2.3.tar.bz2 12737024
-MD5 ca12b078c7288ce9b2653e639a5b3ee0 post-3.2.3-kdelibs-kcookiejar.patch 5384
-MD5 345ce2e01cfdfa4754c47894c0271dcc post-3.2.3-kdelibs-kstandarddirs.patch 1417
-MD5 4d61d568e822d781308caa73050930bd post-3.2.3-kdelibs-htmlframes2.patch 1186
-MD5 94e76ec98cd58ce27cad8f886d241986 post-3.2.3-kdelibs-kio.diff 1509
-MD5 0046c691fa833b2ff8d7eac15312a68b post-3.2.3-kdelibs-dcopserver.patch 4751
-MD5 0948701bffb082c65784dc8a2b648ef0 post-3.2.3-kdelibs-dcop.patch 1901
-MD5 a639b7b592f005e911c454a0a8c9c542 post-3.2.3-kdelibs-kioslave.patch 549
diff --git a/kde-base/kdelibs/files/post-3.2.3-kdelibs-htmlframes.patch b/kde-base/kdelibs/files/post-3.2.3-kdelibs-htmlframes.patch
deleted file mode 100644
index ee204eba2174..000000000000
--- a/kde-base/kdelibs/files/post-3.2.3-kdelibs-htmlframes.patch
+++ /dev/null
@@ -1,429 +0,0 @@
---- khtml/khtml_ext.cpp 24 Apr 2004 08:20:46 -0000 1.85.2.2
-+++ khtml/khtml_ext.cpp 3 Aug 2004 14:36:43 -0000
-@@ -646,6 +646,19 @@ bool KHTMLPartBrowserHostExtension::open
- return m_part->openURLInFrame( url, urlArgs );
- }
-
-+void KHTMLPartBrowserHostExtension::virtual_hook( int id, void *data )
-+{
-+ if (id == VIRTUAL_FIND_FRAME_PARENT)
-+ {
-+ FindFrameParentParams *param = static_cast<FindFrameParentParams*>(data);
-+ KHTMLPart *parentPart = m_part->findFrameParent(param->callingPart, param->frame);
-+ if (parentPart)
-+ param->parent = parentPart->browserHostExtension();
-+ return;
-+ }
-+ BrowserHostExtension::virtual_hook( id, data );
-+}
-+
- // BCI: remove in KDE 4
- KHTMLZoomFactorAction::KHTMLZoomFactorAction( KHTMLPart *part, bool direction, const QString &text, const QString &icon, const QObject *receiver, const char *slot, QObject *parent, const char *name )
- : KAction( text, icon, 0, receiver, slot, parent, name )
-Index: khtml/khtml_ext.h
-===================================================================
-RCS file: /home/kde/kdelibs/khtml/khtml_ext.h,v
-retrieving revision 1.26.2.1
-diff -u -p -r1.26.2.1 khtml_ext.h
---- khtml/khtml_ext.h 29 Feb 2004 15:27:43 -0000 1.26.2.1
-+++ khtml/khtml_ext.h 3 Aug 2004 14:36:43 -0000
-@@ -98,6 +98,9 @@ public:
- virtual const QPtrList<KParts::ReadOnlyPart> frames() const;
-
- virtual bool openURLInFrame( const KURL &url, const KParts::URLArgs &urlArgs );
-+
-+protected:
-+ virtual void virtual_hook( int id, void* data );
- private:
- KHTMLPart *m_part;
- };
-Index: khtml/khtml_part.cpp
-===================================================================
-RCS file: /home/kde/kdelibs/khtml/khtml_part.cpp,v
-retrieving revision 1.959.2.20
-diff -u -p -r1.959.2.20 khtml_part.cpp
---- khtml/khtml_part.cpp 29 Jun 2004 09:08:16 -0000 1.959.2.20
-+++ khtml/khtml_part.cpp 3 Aug 2004 14:36:46 -0000
-@@ -757,12 +757,16 @@ DOM::Document KHTMLPart::document() cons
- return d->m_doc;
- }
-
--
- KParts::BrowserExtension *KHTMLPart::browserExtension() const
- {
- return d->m_extension;
- }
-
-+KParts::BrowserHostExtension *KHTMLPart::browserHostExtension() const
-+{
-+ return d->m_hostExtension;
-+}
-+
- KHTMLView *KHTMLPart::view() const
- {
- return d->m_view;
-@@ -880,29 +884,18 @@ QVariant KHTMLPart::crossFrameExecuteScr
- // we always allow these
- }
- else {
-- while (destpart->parentPart())
-- destpart = destpart->parentPart();
-- destpart = destpart->findFrame(target);
--
-+ destpart = findFrame(target);
- if (!destpart)
-- destpart = this; // ### doesn't make sense, does it?
-+ destpart = this;
- }
-
- // easy way out?
- if (destpart == this)
- return executeScript(DOM::Node(), script);
-
--
- // now compare the domains
-- if (!destpart->htmlDocument().isNull() &&
-- !htmlDocument().isNull()) {
-- DOM::DOMString actDomain = htmlDocument().domain();
-- DOM::DOMString destDomain = destpart->htmlDocument().domain();
--
-- if (actDomain == destDomain)
-- return destpart->executeScript(DOM::Node(), script);
-- }
--
-+ if (destpart->checkFrameAccess(this))
-+ return destpart->executeScript(DOM::Node(), script);
-
- // eww, something went wrong. better execute it in our frame
- return executeScript(DOM::Node(), script);
-@@ -3358,7 +3351,7 @@ void KHTMLPart::urlSelected( const QStri
- if ( hasTarget )
- {
- // unknown frame names should open in a new window.
-- khtml::ChildFrame *frame = recursiveFrameRequest( cURL, args, false );
-+ khtml::ChildFrame *frame = recursiveFrameRequest( this, cURL, args, false );
- if ( frame )
- {
- args.metaData()["referrer"] = d->m_referrer;
-@@ -4364,6 +4357,7 @@ void KHTMLPart::slotChildDocCreated()
- void KHTMLPart::slotChildURLRequest( const KURL &url, const KParts::URLArgs &args )
- {
- khtml::ChildFrame *child = frame( sender()->parent() );
-+ KHTMLPart *callingHtmlPart = const_cast<KHTMLPart *>(dynamic_cast<const KHTMLPart *>(sender()));
-
- // TODO: handle child target correctly! currently the script are always executed fur the parent
- QString urlStr = url.url();
-@@ -4395,7 +4389,7 @@ void KHTMLPart::slotChildURLRequest( con
- }
- else if ( frameName != QString::fromLatin1( "_self" ) )
- {
-- khtml::ChildFrame *_frame = recursiveFrameRequest( url, args );
-+ khtml::ChildFrame *_frame = recursiveFrameRequest( callingHtmlPart, url, args );
-
- if ( !_frame )
- {
-@@ -4437,46 +4431,92 @@ khtml::ChildFrame *KHTMLPart::frame( con
- return 0L;
- }
-
--//#define DEBUG_FINDFRAME
-+//#define DEBUG_FINDFRAME
-
--KHTMLPart *KHTMLPart::findFrame( const QString &f )
-+bool KHTMLPart::checkFrameAccess(KHTMLPart *callingHtmlPart)
- {
-+ if (callingHtmlPart == this)
-+ return true; // trivial
-+
-+ if (htmlDocument().isNull()) {
- #ifdef DEBUG_FINDFRAME
-- kdDebug(6050) << "KHTMLPart::findFrame '" << f << "'" << endl;
-- FrameIt it2 = d->m_frames.begin();
-- FrameIt end = d->m_frames.end();
-- for (; it2 != end; ++it2 )
-- kdDebug(6050) << " - having frame '" << (*it2).m_name << "'" << endl;
-+ kdDebug(6050) << "KHTMLPart::checkFrameAccess: Empty part " << this << " URL = " << m_url << endl;
- #endif
-- // ### http://www.w3.org/TR/html4/appendix/notes.html#notes-frames
-- ConstFrameIt it = d->m_frames.find( f );
-- if ( it == d->m_frames.end() )
-- {
-+ return false; // we are empty?
-+ }
-+
-+ // now compare the domains
-+ if (callingHtmlPart && !callingHtmlPart->htmlDocument().isNull() &&
-+ !htmlDocument().isNull()) {
-+ DOM::DOMString actDomain = callingHtmlPart->htmlDocument().domain();
-+ DOM::DOMString destDomain = htmlDocument().domain();
-+
- #ifdef DEBUG_FINDFRAME
-- kdDebug(6050) << "KHTMLPart::findFrame frame " << f << " not found" << endl;
-+ kdDebug(6050) << "KHTMLPart::checkFrameAccess: actDomain = '" << actDomain.string() << "' destDomain = '" << destDomain.string() << "'" << endl;
- #endif
-- return 0L;
-+
-+ if (actDomain == destDomain)
-+ return true;
- }
-- else {
-- KParts::ReadOnlyPart *p = (*it).m_part;
-- if ( p && p->inherits( "KHTMLPart" ))
-- {
- #ifdef DEBUG_FINDFRAME
-- kdDebug(6050) << "KHTMLPart::findFrame frame " << f << " is a KHTMLPart, ok" << endl;
-+ else
-+ {
-+ kdDebug(6050) << "KHTMLPart::checkFrameAccess: Unknown part/domain " << callingHtmlPart << " tries to access part " << this << endl;
-+ }
- #endif
-- return (KHTMLPart*)p;
-- }
-- else
-- {
-+ return false;
-+}
-+
-+KHTMLPart *
-+KHTMLPart::findFrameParent( KParts::ReadOnlyPart *callingPart, const QString &f, khtml::ChildFrame **childFrame )
-+{
- #ifdef DEBUG_FINDFRAME
-- if (p)
-- kdWarning() << "KHTMLPart::findFrame frame " << f << " found but isn't a KHTMLPart ! " << p->className() << endl;
-- else
-- kdWarning() << "KHTMLPart::findFrame frame " << f << " found but m_part=0L" << endl;
-+ kdDebug(6050) << "KHTMLPart::findFrameParent: this = " << this << " URL = " << m_url << " findFrameParent( " << f << " )" << endl;
-+#endif
-+ // Check access
-+ KHTMLPart *callingHtmlPart = dynamic_cast<KHTMLPart *>(callingPart);
-+
-+ if (!checkFrameAccess(callingHtmlPart))
-+ return 0;
-+
-+ FrameIt it = d->m_frames.find( f );
-+ FrameIt end = d->m_frames.end();
-+ if ( it != end )
-+ {
-+#ifdef DEBUG_FINDFRAME
-+ kdDebug(6050) << "KHTMLPart::findFrameParent: FOUND!" << endl;
- #endif
-- return 0L;
-+ if (childFrame)
-+ *childFrame = &(*it);
-+ return this;
-+ }
-+
-+ it = d->m_frames.begin();
-+ for (; it != end; ++it )
-+ {
-+ KParts::ReadOnlyPart *p = (*it).m_part;
-+ if ( p && p->inherits( "KHTMLPart" ))
-+ {
-+ KHTMLPart *frameParent = static_cast<KHTMLPart*>(p)->findFrameParent(callingPart, f, childFrame);
-+ if (frameParent)
-+ return frameParent;
- }
- }
-+ return 0;
-+}
-+
-+
-+KHTMLPart *KHTMLPart::findFrame( const QString &f )
-+{
-+ khtml::ChildFrame *childFrame;
-+ KHTMLPart *parentFrame = findFrameParent(this, f, &childFrame);
-+ if (parentFrame)
-+ {
-+ KParts::ReadOnlyPart *p = childFrame->m_part;
-+ if ( p && p->inherits( "KHTMLPart" ))
-+ return static_cast<KHTMLPart *>(p);
-+ }
-+ return 0;
- }
-
- KParts::ReadOnlyPart *KHTMLPart::currentFrame() const
-@@ -4514,37 +4554,29 @@ KHTMLPart *KHTMLPart::parentPart()
- return (KHTMLPart *)parent();
- }
-
--khtml::ChildFrame *KHTMLPart::recursiveFrameRequest( const KURL &url, const KParts::URLArgs &args,
-- bool callParent )
-+khtml::ChildFrame *KHTMLPart::recursiveFrameRequest( KHTMLPart *callingHtmlPart, const KURL &url,
-+ const KParts::URLArgs &args, bool callParent )
- {
-- FrameIt it = d->m_frames.find( args.frameName );
--
-- if ( it != d->m_frames.end() )
-- return &(*it);
--
-- it = d->m_frames.begin();
-- FrameIt end = d->m_frames.end();
-- for (; it != end; ++it )
-- if ( (*it).m_part && (*it).m_part->inherits( "KHTMLPart" ) )
-- {
-- KHTMLPart *childPart = (KHTMLPart *)(KParts::ReadOnlyPart *)(*it).m_part;
--
-- khtml::ChildFrame *res = childPart->recursiveFrameRequest( url, args, false );
-- if ( !res )
-- continue;
--
-- childPart->requestObject( res, url, args );
-- return 0L;
-- }
-+#ifdef DEBUG_FINDFRAME
-+ kdDebug( 6050 ) << "KHTMLPart::recursiveFrameRequest this = " << this << ", frame = " << args.frameName << ", url = " << url << endl;
-+#endif
-+ khtml::ChildFrame *childFrame;
-+ KHTMLPart *childPart = findFrameParent(callingHtmlPart, args.frameName, &childFrame);
-+ if (childPart)
-+ {
-+ if (childPart == this)
-+ return childFrame;
-+
-+ childPart->requestObject( childFrame, url, args );
-+ return 0;
-+ }
-
- if ( parentPart() && callParent )
- {
-- khtml::ChildFrame *res = parentPart()->recursiveFrameRequest( url, args );
-+ khtml::ChildFrame *res = parentPart()->recursiveFrameRequest( callingHtmlPart, url, args, callParent );
-
-- if ( res )
-- parentPart()->requestObject( res, url, args );
--
-- return 0L;
-+ if ( res )
-+ parentPart()->requestObject( res, url, args );
- }
-
- return 0L;
-@@ -4552,7 +4584,7 @@ khtml::ChildFrame *KHTMLPart::recursiveF
-
- void KHTMLPart::saveState( QDataStream &stream )
- {
-- kdDebug( 6050 ) << "KHTMLPart::saveState saving URL " << m_url.url() << endl;
-+ kdDebug( 6050 ) << "KHTMLPart::saveState this = " << this << " saving URL " << m_url.url() << endl;
-
- stream << m_url << (Q_INT32)d->m_view->contentsX() << (Q_INT32)d->m_view->contentsY()
- << (Q_INT32) d->m_view->contentsWidth() << (Q_INT32) d->m_view->contentsHeight() << (Q_INT32) d->m_view->marginWidth() << (Q_INT32) d->m_view->marginHeight();
-Index: khtml/khtml_part.h
-===================================================================
-RCS file: /home/kde/kdelibs/khtml/khtml_part.h,v
-retrieving revision 1.248.2.5
-diff -u -p -r1.248.2.5 khtml_part.h
---- khtml/khtml_part.h 29 Jun 2004 09:08:16 -0000 1.248.2.5
-+++ khtml/khtml_part.h 3 Aug 2004 14:36:47 -0000
-@@ -287,6 +287,7 @@ public:
- */
- KParts::BrowserExtension *browserExtension() const;
- KParts::LiveConnectExtension *liveConnectExtension( const khtml::RenderPart *) const;
-+ KParts::BrowserHostExtension *browserHostExtension() const;
-
- /**
- * Returns a pointer to the HTML document's view.
-@@ -812,6 +813,16 @@ public:
- KHTMLPart *findFrame( const QString &f );
-
- /**
-+ * @internal
-+ * Recursively finds the part containing the frame with name @p f
-+ * and checks if it is accessible by @p callingPart
-+ * Returns 0L if no suitable frame can't be found.
-+ * Returns parent part if a suitable frame was found and
-+ * frame info in @p *childFrame
-+ */
-+ KHTMLPart *findFrameParent( KParts::ReadOnlyPart *callingPart, const QString &f, khtml::ChildFrame **childFrame=0 );
-+
-+ /**
- * Return the current frame (the one that has focus)
- * Not necessarily a direct child of ours, framesets can be nested.
- * Returns "this" if this part isn't a frameset.
-@@ -1376,6 +1387,8 @@ private:
-
- bool restoreURL( const KURL &url );
- void emitSelectionChanged();
-+ // Returns whether callingHtmlPart may access this part
-+ bool checkFrameAccess(KHTMLPart *callingHtmlPart);
- bool openURLInFrame( const KURL &url, const KParts::URLArgs &urlArgs );
- void startAutoScroll();
- void stopAutoScroll();
-@@ -1434,7 +1447,7 @@ private:
- DOM::DocumentImpl *xmlDocImpl() const;
- khtml::ChildFrame *frame( const QObject *obj );
-
-- khtml::ChildFrame *recursiveFrameRequest( const KURL &url, const KParts::URLArgs &args, bool callParent = true );
-+ khtml::ChildFrame *recursiveFrameRequest( KHTMLPart *callingHtmlPart, const KURL &url, const KParts::URLArgs &args, bool callParent = true );
-
- bool checkLinkSecurity( const KURL &linkURL,const QString &message = QString::null, const QString &button = QString::null );
- QVariant executeScript( const QString& filename, int baseLine, const DOM::Node &n, const QString& script );
-Index: kparts/browserextension.cpp
-===================================================================
-RCS file: /home/kde/kdelibs/kparts/browserextension.cpp,v
-retrieving revision 1.60.2.1
-diff -u -p -r1.60.2.1 browserextension.cpp
---- kparts/browserextension.cpp 10 Apr 2004 15:08:49 -0000 1.60.2.1
-+++ kparts/browserextension.cpp 3 Aug 2004 14:36:48 -0000
-@@ -636,6 +636,17 @@ BrowserHostExtension *BrowserHostExtensi
- void BrowserExtension::virtual_hook( int, void* )
- { /*BASE::virtual_hook( id, data );*/ }
-
-+BrowserHostExtension *
-+BrowserHostExtension::findFrameParent(KParts::ReadOnlyPart *callingPart, const QString &frame)
-+{
-+ FindFrameParentParams param;
-+ param.parent = 0;
-+ param.callingPart = callingPart;
-+ param.frame = frame;
-+ virtual_hook(VIRTUAL_FIND_FRAME_PARENT, &param);
-+ return param.parent;
-+}
-+
- void BrowserHostExtension::virtual_hook( int, void* )
- { /*BASE::virtual_hook( id, data );*/ }
-
-Index: kparts/browserextension.h
-===================================================================
-RCS file: /home/kde/kdelibs/kparts/browserextension.h,v
-retrieving revision 1.110
-diff -u -p -r1.110 browserextension.h
---- kparts/browserextension.h 26 Sep 2003 07:13:13 -0000 1.110
-+++ kparts/browserextension.h 3 Aug 2004 14:36:48 -0000
-@@ -671,10 +671,16 @@ public:
- *
- * Note that this method does not query the child objects recursively.
- */
--
- virtual const QPtrList<KParts::ReadOnlyPart> frames() const;
-
- /**
-+ * @internal
-+ * Returns the part that contains @p frame and that may be accessed
-+ * by @p callingPart
-+ */
-+ BrowserHostExtension *findFrameParent(KParts::ReadOnlyPart *callingPart, const QString &frame);
-+
-+ /**
- * Opens the given url in a hosted child frame. The frame name is specified in the
- * frameName variable in the urlArgs argument structure (see KParts::URLArgs ) .
- */
-@@ -687,6 +693,19 @@ public:
- static BrowserHostExtension *childObject( QObject *obj );
-
- protected:
-+ /** This 'enum' along with the structure below is NOT part of the public API.
-+ * It's going to disappear in KDE 4.0 and is likely to change inbetween.
-+ *
-+ * @internal
-+ */
-+ enum { VIRTUAL_FIND_FRAME_PARENT = 0x10 };
-+ struct FindFrameParentParams
-+ {
-+ BrowserHostExtension *parent;
-+ KParts::ReadOnlyPart *callingPart;
-+ QString frame;
-+ };
-+
- virtual void virtual_hook( int id, void* data );
- private:
- class BrowserHostExtensionPrivate;
diff --git a/kde-base/kdelibs/files/post-3.2.3-kdelibs-idn.patch b/kde-base/kdelibs/files/post-3.2.3-kdelibs-idn.patch
deleted file mode 100644
index d5781b5dc7ff..000000000000
--- a/kde-base/kdelibs/files/post-3.2.3-kdelibs-idn.patch
+++ /dev/null
@@ -1,89 +0,0 @@
-===================================================================
-RCS file: /home/kde/kdelibs/kdecore/kidna.cpp,v
-retrieving revision 1.9.4.1
-retrieving revision 1.9.4.2
-diff -u -r1.9.4.1 -r1.9.4.2
---- kdecore/kidna.cpp 2004/02/04 11:43:34 1.9.4.1
-+++ kdecore/kidna.cpp 2005/03/03 13:19:45 1.9.4.2
-@@ -21,6 +21,7 @@
-
- #include "kidna.h"
-
-+#include <qstringlist.h>
- #include <kdebug.h>
-
- #include "ltdl.h"
-@@ -65,6 +66,22 @@
- KIDNA_lib_load_failed = false; // Succes
- }
-
-+static QStringList *KIDNA_idnDomains = 0;
-+
-+static bool idnSupportForHost(const QString &host)
-+{
-+ if (!KIDNA_idnDomains)
-+ {
-+ const char *kde_use_idn = getenv("KDE_USE_IDN");
-+ if (!kde_use_idn)
-+ kde_use_idn = "at:ch:cn:de:dk:kr:jp:li:no:se:tw";
-+ KIDNA_idnDomains = new QStringList(QStringList::split(':', QString::fromLatin1(kde_use_idn).lower()));
-+ }
-+
-+ QString tld = host.mid(host.findRev('.')+1).lower();
-+ return KIDNA_idnDomains->contains(tld);
-+}
-+
- QCString KIDNA::toAsciiCString(const QString &idna)
- {
- int l = idna.length();
-@@ -86,7 +103,7 @@
- KIDNA_load_lib();
- }
-
-- if (KIDNA_lib_load_failed)
-+ if (KIDNA_lib_load_failed || !idnSupportForHost(idna))
- {
- return 0; // Can't convert
- }
-@@ -132,7 +149,7 @@
- KIDNA_load_lib();
- }
-
-- if (KIDNA_lib_load_failed)
-+ if (KIDNA_lib_load_failed || !idnSupportForHost(idna))
- {
- return QString::null; // Can't convert
- }
-@@ -164,7 +181,7 @@
- KIDNA_load_lib();
- }
-
-- if (KIDNA_lib_load_failed)
-+ if (KIDNA_lib_load_failed || !idnSupportForHost(idna))
- {
- return idna.lower(); // Return as is
- }
-===================================================================
-RCS file: /home/kde/kdelibs/kio/kssl/ksslpeerinfo.cc,v
-retrieving revision 1.44
-retrieving revision 1.44.2.1
-diff -u -r1.44 -r1.44.2.1
---- kio/kssl/ksslpeerinfo.cc 2003/05/29 16:50:21 1.44
-+++ kio/kssl/ksslpeerinfo.cc 2005/03/04 12:13:28 1.44.2.1
-@@ -30,6 +30,7 @@
- #include <ksockaddr.h>
- #include <kextsock.h>
- #include <netsupp.h>
-+#include "kidna.h"
-
- #include "ksslx509map.h"
-
-@@ -59,7 +60,7 @@
- while(d->peerHost.endsWith("."))
- d->peerHost.truncate(d->peerHost.length()-1);
-
-- d->peerHost = d->peerHost.lower();
-+ d->peerHost = KIDNA::toAscii(d->peerHost);
- }
-
- bool KSSLPeerInfo::certMatchesAddress() {
diff --git a/kde-base/kdelibs/files/post-3.2.3-kdelibs-khtml.diff b/kde-base/kdelibs/files/post-3.2.3-kdelibs-khtml.diff
deleted file mode 100644
index 810f4a5f6faf..000000000000
--- a/kde-base/kdelibs/files/post-3.2.3-kdelibs-khtml.diff
+++ /dev/null
@@ -1,67 +0,0 @@
---- khtml/khtml_ext.cpp 3 Aug 2004 14:38:41 -0000 1.85.2.3
-+++ khtml/khtml_ext.cpp 8 Dec 2004 02:09:29 -0000
-@@ -442,40 +442,44 @@ void KHTMLPopupGUIClient::slotSaveImageA
- saveURL( d->m_khtml->widget(), i18n( "Save Image As" ), d->m_imageURL, metaData );
- }
-
- void KHTMLPopupGUIClient::slotCopyLinkLocation()
- {
-+ KURL safeURL(d->m_url);
-+ safeURL.setPass(QString::null);
- #ifndef QT_NO_MIMECLIPBOARD
- // Set it in both the mouse selection and in the clipboard
- KURL::List lst;
-- lst.append( d->m_url );
-+ lst.append( safeURL );
- QApplication::clipboard()->setSelectionMode(true);
- QApplication::clipboard()->setData( new KURLDrag( lst ) );
- QApplication::clipboard()->setSelectionMode(false);
- QApplication::clipboard()->setData( new KURLDrag( lst ) );
- #else
-- QApplication::clipboard()->setText( d->m_url.url() ); //FIXME(E): Handle multiple entries
-+ QApplication::clipboard()->setText( safeURL.url() ); //FIXME(E): Handle multiple entries
- #endif
- }
-
- void KHTMLPopupGUIClient::slotStopAnimations()
- {
- d->m_khtml->stopAnimations();
- }
-
- void KHTMLPopupGUIClient::slotCopyImageLocation()
- {
-+ KURL safeURL(d->m_imageURL);
-+ safeURL.setPass(QString::null);
- #ifndef QT_NO_MIMECLIPBOARD
- // Set it in both the mouse selection and in the clipboard
- KURL::List lst;
-- lst.append( d->m_imageURL);
-+ lst.append( safeURL );
- QApplication::clipboard()->setSelectionMode(true);
- QApplication::clipboard()->setData( new KURLDrag( lst ) );
- QApplication::clipboard()->setSelectionMode(false);
- QApplication::clipboard()->setData( new KURLDrag( lst ) );
- #else
-- QApplication::clipboard()->setText(d->m_imageURL.url()); //FIXME(E): Handle multiple entries
-+ QApplication::clipboard()->setText( safeURL.url() ); //FIXME(E): Handle multiple entries
- #endif
- }
-
- void KHTMLPopupGUIClient::slotViewImage()
- {
---- khtml/khtml_part.cpp 8 Aug 2004 11:10:55 -0000 1.959.2.23
-+++ khtml/khtml_part.cpp 8 Dec 2004 02:09:32 -0000
-@@ -5465,10 +5465,12 @@ void KHTMLPart::khtmlMouseMoveEvent( kht
- // Text or image link...
- u = completeURL( d->m_strSelectedURL );
- pix = KMimeType::pixmapForURL(u, 0, KIcon::Desktop, KIcon::SizeMedium);
- }
-
-+ u.setPass(QString::null);
-+
- KURLDrag* urlDrag = new KURLDrag( u, img ? 0 : d->m_view->viewport() );
- if ( !d->m_referrer.isEmpty() )
- urlDrag->metaData()["referrer"] = d->m_referrer;
-
- if( img ) {
-
diff --git a/kde-base/kdelibs/files/post-3.2.3-kdelibs-kimgio.diff b/kde-base/kdelibs/files/post-3.2.3-kdelibs-kimgio.diff
deleted file mode 100644
index b7fb6d8790fd..000000000000
--- a/kde-base/kdelibs/files/post-3.2.3-kdelibs-kimgio.diff
+++ /dev/null
@@ -1,1404 +0,0 @@
-diff -u -p -b kdelibs-3.2.3-r9/work/kdelibs-3.2.3/kimgio/eps.cpp kdelibs-3.2.5/work/kdelibs/kimgio/eps.cpp
---- kdelibs-3.2.3-r9/work/kdelibs-3.2.3/kimgio/eps.cpp 2003-09-21 10:39:17.000000000 +0200
-+++ kdelibs-3.2.5/work/kdelibs/kimgio/eps.cpp 2005-04-20 14:07:22.000000000 +0200
-@@ -121,7 +121,7 @@ static bool bbox ( QIODevice *io, int *x
- return ret;
- }
-
--void kimgio_eps_read (QImageIO *image)
-+void kimgio_eps_read (QImageIO *image)
- {
- kdDebug(399) << "kimgio EPS: starting..." << endl;
-
-@@ -245,39 +245,34 @@ void kimgio_eps_read (QImageIO *image)
- }
-
- // Sven Wiegand <SWiegand@tfh-berlin.de> -- eps output filter (from KSnapshot)
--void kimgio_eps_write( QImageIO *imageio )
-+void kimgio_eps_write( QImageIO *imageio )
- {
-- QPrinter psOut;
-+ QPrinter psOut(QPrinter::PrinterResolution);
- QPainter p;
-
- // making some definitions (papersize, output to file, filename):
- psOut.setCreator( "KDE " KDE_VERSION_STRING );
- psOut.setOutputToFile( true );
-
-- KTempFile tmpFile;
-+ // Extension must be .eps so that Qt generates EPS file
-+ KTempFile tmpFile(QString::null, ".eps");
- tmpFile.setAutoDelete(true);
- if ( tmpFile.status() != 0)
- return;
- tmpFile.close(); // Close the file, we just want the filename
-
- psOut.setOutputFileName(tmpFile.name());
-+ psOut.setFullPage(true);
-
- // painting the pixmap to the "printer" which is a file
- p.begin( &psOut );
--
-- p.translate( -36, 820 - imageio->image().height() );
--
-+ // Qt uses the clip rect for the bounding box
-+ p.setClipRect( 0, 0, imageio->image().width(), imageio->image().height(), QPainter::CoordPainter);
- p.drawImage( QPoint( 0, 0 ), imageio->image() );
- p.end();
-
-- // write BoundingBox to File
-+ // Copy file to imageio struct
- QFile inFile(tmpFile.name());
-- QString szBoxInfo;
--
-- szBoxInfo.sprintf("%%%%BoundingBox: 0 0 %d %d\n",
-- imageio->image().width(),
-- imageio->image().height());
--
- inFile.open( IO_ReadOnly );
-
- QTextStream in( &inFile );
-@@ -287,7 +282,6 @@ void kimgio_eps_write( QImageIO *imageio
-
- QString szInLine = in.readLine();
- out << szInLine << '\n';
-- out << szBoxInfo;
-
- while( !in.atEnd() ){
- szInLine = in.readLine();
-@@ -298,4 +292,3 @@ void kimgio_eps_write( QImageIO *imageio
-
- imageio->setStatus(0);
- }
--
-diff -u -p -b kdelibs-3.2.3-r9/work/kdelibs-3.2.3/kimgio/g3r.cpp kdelibs-3.2.5/work/kdelibs/kimgio/g3r.cpp
---- kdelibs-3.2.3-r9/work/kdelibs-3.2.3/kimgio/g3r.cpp 2000-07-03 18:37:32.000000000 +0200
-+++ kdelibs-3.2.5/work/kdelibs/kimgio/g3r.cpp 2005-04-20 14:07:22.000000000 +0200
-@@ -11,8 +11,9 @@
-
- #include "g3r.h"
-
--void kimgio_g3_read( QImageIO *io )
-+void kimgio_g3_read( QImageIO *io )
- {
-+ // This won't work if io is not a QFile !
- TIFF *tiff = TIFFOpen(QFile::encodeName(io->fileName()), "r");
- if (!tiff)
- return;
-@@ -20,13 +21,14 @@ void kimgio_g3_read( QImageIO *io )
- uint32 width, height;
- tsize_t scanlength;
-
-- TIFFGetField( tiff, TIFFTAG_IMAGEWIDTH, &width );
-- TIFFGetField( tiff, TIFFTAG_IMAGELENGTH, &height );
-+ if( TIFFGetField( tiff, TIFFTAG_IMAGEWIDTH, &width ) != 1
-+ || TIFFGetField( tiff, TIFFTAG_IMAGELENGTH, &height ) != 1 )
-+ return;
- scanlength = TIFFScanlineSize(tiff);
-
- QImage image(width, height, 1, 0, QImage::BigEndian);
-
-- if (scanlength != image.bytesPerLine())
-+ if (image.isNull() || scanlength != image.bytesPerLine())
- {
- TIFFClose(tiff);
- return;
-@@ -42,7 +44,7 @@ void kimgio_g3_read( QImageIO *io )
- }
-
-
--void kimgio_g3_write(QImageIO *)
-+void kimgio_g3_write(QImageIO *)
- {
- // TODO: stub
- }
-diff -u -p -b kdelibs-3.2.3-r9/work/kdelibs-3.2.3/kimgio/ico.cpp kdelibs-3.2.5/work/kdelibs/kimgio/ico.cpp
---- kdelibs-3.2.3-r9/work/kdelibs-3.2.3/kimgio/ico.cpp 2003-09-07 14:17:55.000000000 +0200
-+++ kdelibs-3.2.5/work/kdelibs/kimgio/ico.cpp 2005-04-20 14:07:22.000000000 +0200
-@@ -113,6 +115,8 @@ namespace
- // closest size match precedes everything else
- if ( std::abs( int( lhs.width - size ) ) <
- std::abs( int( rhs.width - size ) ) ) return true;
-+ else if ( std::abs( int( lhs.width - size ) ) >
-+ std::abs( int( rhs.width - size ) ) ) return false;
- else if ( colors == 0 )
- {
- // high/true color requested
-@@ -137,24 +141,38 @@ namespace
- {
- BMP_INFOHDR header;
- stream >> header;
-- if ( header.biSize != BMP_INFOHDR::Size ||
-+ if ( stream.atEnd() || header.biSize != BMP_INFOHDR::Size ||
- header.biSize > rec.size ||
- header.biCompression != BMP_INFOHDR::RGB ||
- ( header.biBitCount != 1 && header.biBitCount != 4 &&
- header.biBitCount != 8 && header.biBitCount != 24 &&
- header.biBitCount != 32 ) ) return false;
-
-- unsigned colors = header.biBitCount >= 24 ?
-- 0 : header.biClrUsed ?
-- header.biClrUsed : 1 << header.biBitCount;
-+ unsigned paletteSize, paletteEntries;
-+
-+ if (header.biBitCount > 8)
-+ {
-+ paletteEntries = 0;
-+ paletteSize = 0;
-+ }
-+ else
-+ {
-+ paletteSize = (1 << header.biBitCount);
-+ paletteEntries = paletteSize;
-+ if (header.biClrUsed && header.biClrUsed < paletteSize)
-+ paletteEntries = header.biClrUsed;
-+ }
-+
- // Always create a 32-bit image to get the mask right
-+ // Note: this is safe as rec.width, rec.height are bytes
- icon.create( rec.width, rec.height, 32 );
- if ( icon.isNull() ) return false;
- icon.setAlphaBuffer( true );
-
-- QMemArray< QRgb > colorTable( 1 << header.biBitCount );
-+ QMemArray< QRgb > colorTable( paletteSize );
-+
- colorTable.fill( QRgb( 0 ) );
-- for ( unsigned i = 0; i < colors; ++i )
-+ for ( unsigned i = 0; i < paletteEntries; ++i )
- {
- unsigned char rgb[ 4 ];
- stream.readRawBytes( reinterpret_cast< char* >( &rgb ),
-@@ -163,9 +181,10 @@ namespace
- }
-
- unsigned bpl = ( rec.width * header.biBitCount + 31 ) / 32 * 4;
-+
- unsigned char* buf = new unsigned char[ bpl ];
- unsigned char** lines = icon.jumpTable();
-- for ( unsigned y = rec.height; y--; )
-+ for ( unsigned y = rec.height; !stream.atEnd() && y--; )
- {
- stream.readRawBytes( reinterpret_cast< char* >( buf ), bpl );
- unsigned char* pixel = buf;
-@@ -230,7 +249,7 @@ extern "C" void kimgio_ico_read( QImageI
- stream.setByteOrder( QDataStream::LittleEndian );
- IcoHeader header;
- stream >> header;
-- if ( !header.count ||
-+ if ( stream.atEnd() || !header.count ||
- ( header.type != IcoHeader::Icon && header.type != IcoHeader::Cursor) )
- return;
-
-@@ -265,12 +284,14 @@ extern "C" void kimgio_ico_read( QImageI
- stream >> rec;
- icons.push_back( rec );
- }
-- IconList::const_iterator selected =
-- requestedIndex >= 0 ?
-- std::min( icons.begin() + requestedIndex, icons.end() ) :
-- std::min_element( icons.begin(), icons.end(),
-+ IconList::const_iterator selected;
-+ if (requestedIndex >= 0) {
-+ selected = std::min( icons.begin() + requestedIndex, icons.end() );
-+ } else {
-+ selected = std::min_element( icons.begin(), icons.end(),
- LessDifference( requestedSize, requestedColors ) );
-- if ( selected == icons.end() ||
-+ }
-+ if ( stream.atEnd() || selected == icons.end() ||
- offset + selected->offset > io->ioDevice()->size() )
- return;
-
-diff -u -p -b kdelibs-3.2.3-r9/work/kdelibs-3.2.3/kimgio/jp2.cpp kdelibs-3.2.5/work/kdelibs/kimgio/jp2.cpp
---- kdelibs-3.2.3-r9/work/kdelibs-3.2.3/kimgio/jp2.cpp 2003-10-26 11:54:06.000000000 +0100
-+++ kdelibs-3.2.5/work/kdelibs/kimgio/jp2.cpp 2005-04-20 14:07:22.000000000 +0200
-@@ -157,8 +157,9 @@ namespace {
- void
- draw_view_gray( gs_t& gs, QImage& qti )
- {
-- qti.create( jas_image_width( gs.image ), jas_image_height( gs.image ),
-- 8, 256 );
-+ if( !qti.create( jas_image_width( gs.image ), jas_image_height( gs.image ),
-+ 8, 256 ))
-+ return;
- for( int i = 0; i < 256; ++i )
- qti.setColor( i, qRgb( i, i, i ) );
-
-diff -u -p -b kdelibs-3.2.3-r9/work/kdelibs-3.2.3/kimgio/pcx.cpp kdelibs-3.2.5/work/kdelibs/kimgio/pcx.cpp
---- kdelibs-3.2.3-r9/work/kdelibs-3.2.3/kimgio/pcx.cpp 2003-10-26 11:54:06.000000000 +0100
-+++ kdelibs-3.2.5/work/kdelibs/kimgio/pcx.cpp 2005-04-20 14:07:22.000000000 +0200
-@@ -1,5 +1,5 @@
- /* This file is part of the KDE project
-- Copyright (C) 2002-2003 Nadeem Hasan <nhasan@kde.org>
-+ Copyright (C) 2002-2005 Nadeem Hasan <nhasan@kde.org>
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
-@@ -44,6 +44,11 @@ static QDataStream &operator>>( QDataStr
- s >> ph.HScreenSize;
- s >> ph.VScreenSize;
-
-+ // Skip the rest of the header
-+ Q_UINT8 byte;
-+ while ( s.device()->at() < 128 )
-+ s >> byte;
-+
- return s;
- }
-
-@@ -85,25 +90,22 @@ static QDataStream &operator<<( QDataStr
- return s;
- }
-
--static PCXHEADER header;
--static QImage img;
--static Q_UINT16 w, h;
--
--void PCXHEADER::reset()
-+PCXHEADER::PCXHEADER()
- {
-+ // Initialize all data to zero
- QByteArray dummy( 128 );
- dummy.fill( 0 );
- QDataStream s( dummy, IO_ReadOnly );
- s >> *this;
- }
-
--static void readLine( QDataStream &s, QByteArray &buf )
-+static void readLine( QDataStream &s, QByteArray &buf, const PCXHEADER &header )
- {
- Q_UINT32 i=0;
- Q_UINT32 size = buf.size();
- Q_UINT8 byte, count;
-
-- if ( header.Encoding == 1 )
-+ if ( header.isCompressed() )
- {
- // Uncompress the image data
- while ( i < size )
-@@ -130,13 +132,14 @@ static void readLine( QDataStream &s, QB
- }
- }
-
--static void readImage1( QDataStream &s )
-+static void readImage1( QImage &img, QDataStream &s, const PCXHEADER &header )
- {
- QByteArray buf( header.BytesPerLine );
-
-- img.create( w, h, 1, 2, QImage::BigEndian );
-+ if(!img.create( header.width(), header.height(), 1, 2, QImage::BigEndian ))
-+ return;
-
-- for ( int y=0; y<h; ++y )
-+ for ( int y=0; y<header.height(); ++y )
- {
- if ( s.atEnd() )
- {
-@@ -144,10 +147,11 @@ static void readImage1( QDataStream &s )
- return;
- }
-
-- readLine( s, buf );
--
-- for ( int x=0; x<header.BytesPerLine; ++x )
-- *( img.scanLine( y )+x ) = buf[ x ];
-+ readLine( s, buf, header );
-+ uchar *p = img.scanLine( y );
-+ unsigned int bpl = QMIN((header.width()+7)/8, header.BytesPerLine);
-+ for ( unsigned int x=0; x< bpl; ++x )
-+ p[ x ] = buf[x];
- }
-
- // Set the color palette
-@@ -155,14 +159,15 @@ static void readImage1( QDataStream &s )
- img.setColor( 1, qRgb( 255, 255, 255 ) );
- }
-
--static void readImage4( QDataStream &s )
-+static void readImage4( QImage &img, QDataStream &s, const PCXHEADER &header )
- {
- QByteArray buf( header.BytesPerLine*4 );
-- QByteArray pixbuf( w );
-+ QByteArray pixbuf( header.width() );
-
-- img.create( w, h, 8, 16, QImage::IgnoreEndian );
-+ if(!img.create( header.width(), header.height(), 8, 16 ))
-+ return;
-
-- for ( int y=0; y<h; ++y )
-+ for ( int y=0; y<header.height(); ++y )
- {
- if ( s.atEnd() )
- {
-@@ -171,20 +176,19 @@ static void readImage4( QDataStream &s )
- }
-
- pixbuf.fill( 0 );
-- readLine( s, buf );
-+ readLine( s, buf, header );
-
- for ( int i=0; i<4; i++ )
- {
- Q_UINT32 offset = i*header.BytesPerLine;
-- for ( int x=0; x<w; ++x )
-+ for ( unsigned int x=0; x<header.width(); ++x )
- if ( buf[ offset + ( x/8 ) ] & ( 128 >> ( x%8 ) ) )
- pixbuf[ x ] += ( 1 << i );
- }
-
- uchar *p = img.scanLine( y );
--
-- for ( int x=0; x<w; ++x )
-- *p++ = pixbuf[ x ];
-+ for ( unsigned int x=0; x<header.width(); ++x )
-+ p[ x ] = pixbuf[ x ];
- }
-
- // Read the palette
-@@ -192,13 +196,14 @@ static void readImage4( QDataStream &s )
- img.setColor( i, header.ColorMap.color( i ) );
- }
-
--static void readImage8( QDataStream &s )
-+static void readImage8( QImage &img, QDataStream &s, const PCXHEADER &header )
- {
- QByteArray buf( header.BytesPerLine );
-
-- img.create( w, h, 8, 256, QImage::IgnoreEndian );
-+ if(!img.create( header.width(), header.height(), 8, 256 ))
-+ return;
-
-- for ( int y=0; y<h; ++y )
-+ for ( int y=0; y<header.height(); ++y )
- {
- if ( s.atEnd() )
- {
-@@ -206,19 +211,19 @@ static void readImage8( QDataStream &s )
- return;
- }
-
-- readLine( s, buf );
-+ readLine( s, buf, header );
-
- uchar *p = img.scanLine( y );
--
-- for ( int x=0; x<header.BytesPerLine; ++x )
-- *p++ = buf[ x ];
-+ unsigned int bpl = QMIN(header.BytesPerLine, header.width());
-+ for ( unsigned int x=0; x<bpl; ++x )
-+ p[ x ] = buf[ x ];
- }
-
- Q_UINT8 flag;
- s >> flag;
-- kdDebug() << "Flag: " << flag << endl;
-+ kdDebug( 399 ) << "Palette Flag: " << flag << endl;
-
-- if ( flag == 12 && header.Version == 5 )
-+ if ( flag == 12 && ( header.Version == 5 || header.Version == 2 ) )
- {
- // Read the palette
- Q_UINT8 r, g, b;
-@@ -230,15 +235,16 @@ static void readImage8( QDataStream &s )
- }
- }
-
--static void readImage24( QDataStream &s )
-+static void readImage24( QImage &img, QDataStream &s, const PCXHEADER &header )
- {
- QByteArray r_buf( header.BytesPerLine );
- QByteArray g_buf( header.BytesPerLine );
- QByteArray b_buf( header.BytesPerLine );
-
-- img.create( w, h, 32 );
-+ if(!img.create( header.width(), header.height(), 32 ))
-+ return;
-
-- for ( int y=0; y<h; ++y )
-+ for ( int y=0; y<header.height(); ++y )
- {
- if ( s.atEnd() )
- {
-@@ -246,18 +252,17 @@ static void readImage24( QDataStream &s
- return;
- }
-
-- readLine( s, r_buf );
-- readLine( s, g_buf );
-- readLine( s, b_buf );
-+ readLine( s, r_buf, header );
-+ readLine( s, g_buf, header );
-+ readLine( s, b_buf, header );
-
- uint *p = ( uint * )img.scanLine( y );
--
-- for ( int x=0; x<header.BytesPerLine; ++x )
-- *p++ = qRgb( r_buf[ x ], g_buf[ x ], b_buf[ x ] );
-+ for ( unsigned int x=0; x<header.width(); ++x )
-+ p[ x ] = qRgb( r_buf[ x ], g_buf[ x ], b_buf[ x ] );
- }
- }
-
--void kimgio_pcx_read( QImageIO *io )
-+void kimgio_pcx_read( QImageIO *io )
- {
- QDataStream s( io->ioDevice() );
- s.setByteOrder( QDataStream::LittleEndian );
-@@ -268,6 +273,8 @@ void kimgio_pcx_read( QImageIO *io )
- return;
- }
-
-+ PCXHEADER header;
-+
- s >> header;
-
- if ( header.Manufacturer != 10 || s.atEnd())
-@@ -276,10 +283,8 @@ void kimgio_pcx_read( QImageIO *io )
- return;
- }
-
-- w = ( header.XMax-header.XMin ) + 1;
-- h = ( header.YMax-header.YMin ) + 1;
--
-- img.reset();
-+ int w = header.width();
-+ int h = header.height();
-
- kdDebug( 399 ) << "Manufacturer: " << header.Manufacturer << endl;
- kdDebug( 399 ) << "Version: " << header.Version << endl;
-@@ -292,26 +297,23 @@ void kimgio_pcx_read( QImageIO *io )
- kdDebug( 399 ) << "BytesPerLine: " << header.BytesPerLine << endl;
- kdDebug( 399 ) << "NPlanes: " << header.NPlanes << endl;
-
-- // Skip the rest of the header
-- Q_UINT8 byte;
-- while ( s.device()->at() < 128 )
-- s >> byte;
-+ QImage img;
-
- if ( header.Bpp == 1 && header.NPlanes == 1 )
- {
-- readImage1( s );
-+ readImage1( img, s, header );
- }
- else if ( header.Bpp == 1 && header.NPlanes == 4 )
- {
-- readImage4( s );
-+ readImage4( img, s, header );
- }
- else if ( header.Bpp == 8 && header.NPlanes == 1 )
- {
-- readImage8( s );
-+ readImage8( img, s, header );
- }
- else if ( header.Bpp == 8 && header.NPlanes == 3 )
- {
-- readImage24( s );
-+ readImage24( img, s, header );
- }
-
- kdDebug( 399 ) << "Image Bytes: " << img.numBytes() << endl;
-@@ -359,7 +361,7 @@ static void writeLine( QDataStream &s, Q
- }
- }
-
--static void writeImage1( QDataStream &s )
-+static void writeImage1( QImage &img, QDataStream &s, PCXHEADER &header )
- {
- img = img.convertBitOrder( QImage::BigEndian );
-
-@@ -367,29 +369,27 @@ static void writeImage1( QDataStream &s
- header.NPlanes = 1;
- header.BytesPerLine = img.bytesPerLine();
-
-- header.ColorMap.setColor( 0, qRgb( 0, 0, 0 ) );
-- header.ColorMap.setColor( 1, qRgb( 255, 255, 255 ) );
--
- s << header;
-
- QByteArray buf( header.BytesPerLine );
-
-- for ( int y=0; y<h; ++y )
-+ for ( int y=0; y<header.height(); ++y )
- {
- Q_UINT8 *p = img.scanLine( y );
-
-+ // Invert as QImage uses reverse palette for monochrome images?
- for ( int i=0; i<header.BytesPerLine; ++i )
-- buf[ i ] = p[ i ];
-+ buf[ i ] = ~p[ i ];
-
- writeLine( s, buf );
- }
- }
-
--static void writeImage4( QDataStream &s )
-+static void writeImage4( QImage &img, QDataStream &s, PCXHEADER &header )
- {
- header.Bpp = 1;
- header.NPlanes = 4;
-- header.BytesPerLine = w/8;
-+ header.BytesPerLine = header.width()/8;
-
- for ( int i=0; i<16; ++i )
- header.ColorMap.setColor( i, img.color( i ) );
-@@ -401,14 +401,14 @@ static void writeImage4( QDataStream &s
- for ( int i=0; i<4; ++i )
- buf[ i ].resize( header.BytesPerLine );
-
-- for ( int y=0; y<h; ++y )
-+ for ( int y=0; y<header.height(); ++y )
- {
- Q_UINT8 *p = img.scanLine( y );
-
- for ( int i=0; i<4; ++i )
- buf[ i ].fill( 0 );
-
-- for ( int x=0; x<w; ++x )
-+ for ( unsigned int x=0; x<header.width(); ++x )
- {
- for ( int i=0; i<4; ++i )
- if ( *( p+x ) & ( 1 << i ) )
-@@ -420,7 +420,7 @@ static void writeImage4( QDataStream &s
- }
- }
-
--static void writeImage8( QDataStream &s )
-+static void writeImage8( QImage &img, QDataStream &s, PCXHEADER &header )
- {
- header.Bpp = 8;
- header.NPlanes = 1;
-@@ -430,7 +430,7 @@ static void writeImage8( QDataStream &s
-
- QByteArray buf( header.BytesPerLine );
-
-- for ( int y=0; y<h; ++y )
-+ for ( int y=0; y<header.height(); ++y )
- {
- Q_UINT8 *p = img.scanLine( y );
-
-@@ -449,23 +449,23 @@ static void writeImage8( QDataStream &s
- s << RGB( img.color( i ) );
- }
-
--static void writeImage24( QDataStream &s )
-+static void writeImage24( QImage &img, QDataStream &s, PCXHEADER &header )
- {
- header.Bpp = 8;
- header.NPlanes = 3;
-- header.BytesPerLine = w;
-+ header.BytesPerLine = header.width();
-
- s << header;
-
-- QByteArray r_buf( w );
-- QByteArray g_buf( w );
-- QByteArray b_buf( w );
-+ QByteArray r_buf( header.width() );
-+ QByteArray g_buf( header.width() );
-+ QByteArray b_buf( header.width() );
-
-- for ( int y=0; y<h; ++y )
-+ for ( int y=0; y<header.height(); ++y )
- {
- uint *p = ( uint * )img.scanLine( y );
-
-- for ( int x=0; x<w; ++x )
-+ for ( unsigned int x=0; x<header.width(); ++x )
- {
- QRgb rgb = *p++;
- r_buf[ x ] = qRed( rgb );
-@@ -479,15 +479,15 @@ static void writeImage24( QDataStream &s
- }
- }
-
--void kimgio_pcx_write( QImageIO *io )
-+void kimgio_pcx_write( QImageIO *io )
- {
- QDataStream s( io->ioDevice() );
- s.setByteOrder( QDataStream::LittleEndian );
-
-- img = io->image();
-+ QImage img = io->image();
-
-- w = img.width();
-- h = img.height();
-+ int w = img.width();
-+ int h = img.height();
-
- kdDebug( 399 ) << "Width: " << w << endl;
- kdDebug( 399 ) << "Height: " << h << endl;
-@@ -495,6 +495,8 @@ void kimgio_pcx_write( QImageIO *io )
- kdDebug( 399 ) << "BytesPerLine: " << img.bytesPerLine() << endl;
- kdDebug( 399 ) << "Num Colors: " << img.numColors() << endl;
-
-+ PCXHEADER header;
-+
- header.Manufacturer = 10;
- header.Version = 5;
- header.Encoding = 1;
-@@ -509,19 +511,19 @@ void kimgio_pcx_write( QImageIO *io )
-
- if ( img.depth() == 1 )
- {
-- writeImage1( s );
-+ writeImage1( img, s, header );
- }
- else if ( img.depth() == 8 && img.numColors() <= 16 )
- {
-- writeImage4( s );
-+ writeImage4( img, s, header );
- }
- else if ( img.depth() == 8 )
- {
-- writeImage8( s );
-+ writeImage8( img, s, header );
- }
- else if ( img.depth() == 32 )
- {
-- writeImage24( s );
-+ writeImage24( img, s, header );
- }
-
- io->setStatus( 0 );
-diff -u -p -b kdelibs-3.2.3-r9/work/kdelibs-3.2.3/kimgio/pcx.h kdelibs-3.2.5/work/kdelibs/kimgio/pcx.h
---- kdelibs-3.2.3-r9/work/kdelibs-3.2.3/kimgio/pcx.h 2003-01-04 01:48:25.000000000 +0100
-+++ kdelibs-3.2.5/work/kdelibs/kimgio/pcx.h 2005-04-20 14:07:22.000000000 +0200
-@@ -49,7 +49,7 @@ class Palette
- rgb[ i ] = RGB( color );
- }
-
-- QRgb color( int i )
-+ QRgb color( int i ) const
- {
- return qRgb( rgb[ i ].r, rgb[ i ].g, rgb[ i ].b );
- }
-@@ -60,12 +60,11 @@ class Palette
- class PCXHEADER
- {
- public:
-- PCXHEADER()
-- {
-- reset();
-- }
-+ PCXHEADER();
-
-- void reset();
-+ inline int width() const { return ( XMax-XMin ) + 1; }
-+ inline int height() const { return ( YMax-YMin ) + 1; }
-+ inline bool isCompressed() const { return ( Encoding==1 ); }
-
- Q_UINT8 Manufacturer; // Constant Flag, 10 = ZSoft .pcx
- Q_UINT8 Version; // Version information·
-@@ -99,7 +98,7 @@ class PCXHEADER
- // found only in PB IV/IV Plus
- Q_UINT16 VScreenSize; // Vertical screen size in pixels. New field
- // found only in PB IV/IV Plus
--};
-+} KDE_PACKED;
-
- #endif // PCX_H
-
-diff -u -p -b kdelibs-3.2.3-r9/work/kdelibs-3.2.3/kimgio/tga.cpp kdelibs-3.2.5/work/kdelibs/kimgio/tga.cpp
---- kdelibs-3.2.3-r9/work/kdelibs-3.2.3/kimgio/tga.cpp 2003-03-02 13:59:11.000000000 +0100
-+++ kdelibs-3.2.5/work/kdelibs/kimgio/tga.cpp 2005-04-20 14:07:22.000000000 +0200
-@@ -1,5 +1,6 @@
- /* This file is part of the KDE project
- Copyright (C) 2003 Dominik Seichter <domseichter@web.de>
-+ Copyright (C) 2004 Ignacio Castaño <castano@ludicon.com>
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the Lesser GNU General Public
-@@ -9,238 +10,376 @@
-
- /* this code supports:
- * reading:
-- * run length encoded true color tga files
-- * uncompressed true color tga files
-+ * uncompressed and run length encoded indexed, grey and color tga files.
-+ * image types 1, 2, 3, 9, 10 and 11.
-+ * only RGB color maps with no more than 256 colors.
-+ * pixel formats 8, 15, 24 and 32.
- * writing:
- * uncompressed true color tga files
- */
-
- #include "tga.h"
-
-+#include <assert.h>
-+
- #include <qimage.h>
- #include <qdatastream.h>
-
--/*
-- * uncompressed TGA magic header
-- */
--unsigned char targaMagic[12] = { 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-+#include <kdebug.h>
-
--/*
-- * compressed TGA magic header
-- */
--unsigned char compMagic[12] = { 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-+typedef Q_UINT32 uint;
-+typedef Q_UINT16 ushort;
-+typedef Q_UINT8 uchar;
-+
-+namespace { // Private.
-+
-+ // Header format of saved files.
-+ uchar targaMagic[12] = { 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-+
-+ enum TGAType {
-+ TGA_TYPE_INDEXED = 1,
-+ TGA_TYPE_RGB = 2,
-+ TGA_TYPE_GREY = 3,
-+ TGA_TYPE_RLE_INDEXED = 9,
-+ TGA_TYPE_RLE_RGB = 10,
-+ TGA_TYPE_RLE_GREY = 11
-+ };
-+
-+#define TGA_INTERLEAVE_MASK 0xc0
-+#define TGA_INTERLEAVE_NONE 0x00
-+#define TGA_INTERLEAVE_2WAY 0x40
-+#define TGA_INTERLEAVE_4WAY 0x80
-+
-+#define TGA_ORIGIN_MASK 0x30
-+#define TGA_ORIGIN_LEFT 0x00
-+#define TGA_ORIGIN_RIGHT 0x10
-+#define TGA_ORIGIN_LOWER 0x00
-+#define TGA_ORIGIN_UPPER 0x20
-+
-+ /** Tga Header. */
-+ struct TgaHeader {
-+ uchar id_length;
-+ uchar colormap_type;
-+ uchar image_type;
-+ ushort colormap_index;
-+ ushort colormap_length;
-+ uchar colormap_size;
-+ ushort x_origin;
-+ ushort y_origin;
-+ ushort width;
-+ ushort height;
-+ uchar pixel_size;
-+ uchar flags;
-
--/*
-- * the origin of the image (default is TOP_LEFT)
-- */
--enum { TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_RIGHT };
-+ enum { SIZE = 18 }; // const static int SIZE = 18;
-+ };
-
--/*
-- * Read one pixel and return its color
-- */
--int getData( QDataStream* s, int bpp )
--{
-- unsigned char* data = new unsigned char[bpp];
-+ static QDataStream & operator>> ( QDataStream & s, TgaHeader & head )
-+ {
-+ s >> head.id_length;
-+ s >> head.colormap_type;
-+ s >> head.image_type;
-+ s >> head.colormap_index;
-+ s >> head.colormap_length;
-+ s >> head.colormap_size;
-+ s >> head.x_origin;
-+ s >> head.y_origin;
-+ s >> head.width;
-+ s >> head.height;
-+ s >> head.pixel_size;
-+ s >> head.flags;
-+ return s;
-+ }
-
-- for( int d = 0; d < bpp; d++ )
-- *s >> data[d];
-+ static bool IsSupported( const TgaHeader & head )
-+ {
-+ if( head.image_type != TGA_TYPE_INDEXED &&
-+ head.image_type != TGA_TYPE_RGB &&
-+ head.image_type != TGA_TYPE_GREY &&
-+ head.image_type != TGA_TYPE_RLE_INDEXED &&
-+ head.image_type != TGA_TYPE_RLE_RGB &&
-+ head.image_type != TGA_TYPE_RLE_GREY )
-+ {
-+ return false;
-+ }
-+ if( head.image_type == TGA_TYPE_INDEXED ||
-+ head.image_type == TGA_TYPE_RLE_INDEXED )
-+ {
-+ if( head.colormap_length > 256 || head.colormap_size != 24 )
-+ {
-+ return false;
-+ }
-+ }
-+ if( head.width == 0 || head.height == 0 )
-+ {
-+ return false;
-+ }
-+ if( head.pixel_size != 8 && head.pixel_size != 16 &&
-+ head.pixel_size != 24 && head.pixel_size != 32 )
-+ {
-+ return false;
-+ }
-+ return true;
-+ }
-
-- int color = 0;
-- if( bpp == 4 )
-- color = qRgba( data[0], data[1], data[2], data[3] );
-- else
-- color = qRgb( data[0], data[1], data[2] );
-+ struct Color555 {
-+ ushort b : 5;
-+ ushort g : 5;
-+ ushort r : 5;
-+ };
-
-- delete [] data;
-- return color;
--}
-+ static bool HasAlpha( const TgaHeader & tga )
-+ {
-+ return tga.pixel_size == 32;
-+ }
-
--/*
-- * checks wether y is inside of the image
-- * when origin is of mode m
-- */
--bool checky( int y, int h, int m )
--{
-- if( m == TOP_LEFT )
-- return (y < h);
-- else if( m == BOTTOM_LEFT || m == BOTTOM_RIGHT )
-- return ( y >= 0 );
-+ struct TgaHeaderInfo {
-+ bool rle;
-+ bool pal;
-+ bool rgb;
-+ bool grey;
-+ bool supported;
-
-- return false;
--}
-+ TgaHeaderInfo( const TgaHeader & tga ) : rle(false), pal(false), rgb(false), grey(false), supported(true)
-+ {
-+ switch( tga.image_type ) {
-+ case TGA_TYPE_RLE_INDEXED:
-+ rle = true;
-+ // no break is intended!
-+ case TGA_TYPE_INDEXED:
-+ if( tga.colormap_type!=1 || tga.colormap_size!=24 || tga.colormap_length>256 ) {
-+ supported = false;
-+ }
-+ pal = true;
-+ break;
-
-- /*
-- * checks wether x is inside of the image
-- * when origin is of mode m
-- */
-- bool checkx( int x, int w, int m )
-+ case TGA_TYPE_RLE_RGB:
-+ rle = true;
-+ // no break is intended!
-+ case TGA_TYPE_RGB:
-+ rgb = true;
-+ break;
-+
-+ case TGA_TYPE_RLE_GREY:
-+ rle = true;
-+ // no break is intended!
-+ case TGA_TYPE_GREY:
-+ grey = true;
-+ break;
-+
-+ default:
-+ // Error, unknown image type.
-+ supported = false;
-+ }
-+ }
-+ };
-+
-+
-+
-+ static bool LoadTGA( QDataStream & s, const TgaHeader & tga, QImage &img )
- {
-- if( m == TOP_LEFT || m == BOTTOM_LEFT )
-- return (x < w);
-- else if( m == BOTTOM_RIGHT )
-- return ( x >= 0 );
-+ // Create image.
-+ if( !img.create( tga.width, tga.height, 32 )) {
-+ return false;
-+ }
-
-+ TgaHeaderInfo info(tga);
-+ if( !info.supported ) {
-+ // File not supported.
-+ kdDebug(399) << "This TGA file is not supported." << endl;
- return false;
- }
-
-- void kimgio_tga_read( QImageIO *io )
-- {
-- unsigned char header[6];
-- bool compressed = false;
-+ // Enable alpha buffer for transparent images.
-+ if( HasAlpha( tga ) ) {
-+ img.setAlphaBuffer( true );
-+ }
-
-- QDataStream s( io->ioDevice() );
-- s.setByteOrder( QDataStream::LittleEndian );
-+ uint pixel_size = (tga.pixel_size/8);
-+ uint size = tga.width * tga.height * pixel_size;
-
-- /*
-- * check whether it is a targa file or not
-- */
-- for( int i = 0; i < 12; i++ ) {
-- unsigned char a;
-- s >> a;
-- if( a != targaMagic[i] && a!= compMagic[i]) {
-- io->setImage( 0 );
-- io->setStatus( -1 );
-- return;
-+
-+ // Read palette.
-+ char palette[768];
-+ if( info.pal ) {
-+ // @todo Support palettes in other formats!
-+ s.readRawBytes( palette, 3 * tga.colormap_length );
- }
-
-- // check if it is a compressed targa file
-- if( i == 2 && a == compMagic[i] )
-- compressed = true;
-- }
--
-- for( int i = 0; i < 6; i++ )
-- s >> header[i];
--
-- int width = header[1] * 256 + header[0];
-- int height = header[3] * 256 + header[2];
-- int bpp = header[4];
-- int bit = header[5];
-- int bytesPerPixel = bpp / 8;
--
-- /* Bit values:
-- * bit 0-3: number of alpha bits per fixel
-- * bit 4-5: origin of image:
-- * - 0 0 bottom left
-- * - 1 0 bottom right
-- * - 0 1 top left // that's what we write
-- * - 1 1 top right
-- */
-+ // Allocate image.
-+ uchar * const image = new uchar[size];
-
-- int mode;
-- if( (bit | 0) == 0 )
-- mode = BOTTOM_LEFT;
-- else if( (bit & 8) == 8 )
-- /*
-- * should be BOTTOM_RIGHT,
-- * but GIMP writes them this way.
-- */
-- mode = BOTTOM_LEFT;
-- else if( (bit & 32) == 32 )
-- mode = TOP_LEFT;
-- else
-- mode = TOP_LEFT;
-+ if( info.rle ) {
-+ // Decode image.
-+ char * dst = (char *)image;
-+ int num = size;
-+
-+ while (num > 0) {
-+ // Get packet header.
-+ uchar c;
-+ s >> c;
-+
-+ uint count = (c & 0x7f) + 1;
-+ num -= count * pixel_size;
-+
-+ if (c & 0x80) {
-+ // RLE pixels.
-+ assert(pixel_size <= 8);
-+ char pixel[8];
-+ s.readRawBytes( pixel, pixel_size );
-+ do {
-+ memcpy(dst, pixel, pixel_size);
-+ dst += pixel_size;
-+ } while (--count);
-+ }
-+ else {
-+ // Raw pixels.
-+ count *= pixel_size;
-+ s.readRawBytes( dst, count );
-+ dst += count;
-+ }
-+ }
-+ }
-+ else {
-+ // Read raw image.
-+ s.readRawBytes( (char *)image, size );
-+ }
-+
-+ // Convert image to internal format.
-+ int y_start, y_step, y_end;
-+ if( tga.flags & TGA_ORIGIN_UPPER ) {
-+ y_start = 0;
-+ y_step = 1;
-+ y_end = tga.height - 1;
-+ }
-+ else {
-+ y_start = tga.height - 1;
-+ y_step = -1;
-+ y_end = 0;
-+ }
-+
-+ uchar * src = image;
-
-- if( bytesPerPixel != 3 && bytesPerPixel != 4 ) {
-+ for( int y = y_start; y != y_end; y += y_step ) {
-+ QRgb * scanline = (QRgb *) img.scanLine( y );
-+
-+ if( info.pal ) {
-+ // Paletted.
-+ for( int x = 0; x < tga.width; x++ ) {
-+ uchar idx = *src++;
-+ scanline[x] = qRgb( palette[3*idx+2], palette[3*idx+1], palette[3*idx+0] );
-+ }
-+ }
-+ else if( info.grey ) {
-+ // Greyscale.
-+ for( int x = 0; x < tga.width; x++ ) {
-+ scanline[x] = qRgb( *src, *src, *src );
-+ src++;
-+ }
-+ }
-+ else {
-+ // True Color.
-+ if( tga.pixel_size == 16 ) {
-+ for( int x = 0; x < tga.width; x++ ) {
-+ Color555 c = *reinterpret_cast<Color555 *>(src);
-+ scanline[x] = qRgb( (c.r << 3) | (c.r >> 2), (c.g << 3) | (c.g >> 2), (c.b << 3) | (c.b >> 2) );
-+ src += 2;
-+ }
-+ }
-+ else if( tga.pixel_size == 24 ) {
-+ for( int x = 0; x < tga.width; x++ ) {
-+ scanline[x] = qRgb( src[2], src[1], src[0] );
-+ src += 3;
-+ }
-+ }
-+ else if( tga.pixel_size == 32 ) {
-+ for( int x = 0; x < tga.width; x++ ) {
-+ scanline[x] = qRgba( src[2], src[1], src[0], src[3] );
-+ src += 4;
-+ }
-+ }
-+ }
-+ }
-+
-+ // Free image.
-+ delete [] image;
-+
-+ return true;
-+ }
-+
-+} // namespace
-+
-+
-+void kimgio_tga_read( QImageIO *io )
-+{
-+ //kdDebug(399) << "Loading TGA file!" << endl;
-+
-+ QDataStream s( io->ioDevice() );
-+ s.setByteOrder( QDataStream::LittleEndian );
-+
-+
-+ // Read image header.
-+ TgaHeader tga;
-+ s >> tga;
-+ s.device()->at( TgaHeader::SIZE + tga.id_length );
-+
-+ // Check image file format.
-+ if( s.atEnd() ) {
-+ kdDebug(399) << "This TGA file is not valid." << endl;
- io->setImage( 0 );
- io->setStatus( -1 );
- return;
- }
-
-- QImage img;
-- if( !img.create( width, height, (bpp == 24 ? 32 : bpp) )) {
-+ // Check supported file types.
-+ if( !IsSupported(tga) ) {
-+ kdDebug(399) << "This TGA file is not supported." << endl;
- io->setImage( 0 );
- io->setStatus( -1 );
- return;
- }
-
-- /*
-- * Enable alpha buffer for transparent images
-- */
-- if( img.depth() == 32 )
-- img.setAlphaBuffer( true );
-
-+ QImage img;
-+ bool result = LoadTGA(s, tga, img);
-
-- int x = 0;
-- int y = 0;
-- int addy = 1;
-- int addx = 1;
-- if( mode == BOTTOM_LEFT || mode == BOTTOM_RIGHT ) {
-- y = height - 1;
-- addy = -1;
-- }
--
-- if( mode == BOTTOM_RIGHT || mode == TOP_RIGHT ) {
-- x = width - 1;
-- addx = -1;
-- }
--
-- /*
-- * we have to restore the value of x after each loop
-- */
-- int oldx = x;
-- if( !compressed ) {
-- for( ; checky( y, height, mode ); y += addy )
-- for( x = oldx; checkx( x, width, mode ); x += addx ) {
-- img.setPixel( x, y, getData( &s, bytesPerPixel ) );
-- }
-- } else {
-- unsigned char cur;
-- while( checky( y, height, mode ) ) {
-- while( checkx( x, width, mode ) ) {
-- s >> cur;
-- if( (cur & 128) == 128 ) {
-- // found a RLE chunk
-- int length = (cur & 127) + 1;
-- int color = getData( &s, bytesPerPixel );
-- for( int i = 0; i < length; i++ ) {
-- img.setPixel( x, y, color );
-- x += addx;
-- }
-- } else {
-- int length = (cur & 127) + 1;
-- for( int i = 0; i < length; i++ ) {
-- img.setPixel( x, y, getData( &s, bytesPerPixel ) );
-- x += addx;
-- }
-- }
-- }
-- y += addy;
-- x = oldx;
-- }
-+ if( result == false ) {
-+ kdDebug(399) << "Error loading TGA file." << endl;
-+ io->setImage( 0 );
-+ io->setStatus( -1 );
-+ return;
- }
-
-- img = img.swapRGB();
-
- io->setImage( img );
- io->setStatus( 0 );
- }
-
-
--void kimgio_tga_write( QImageIO *io )
-+void kimgio_tga_write( QImageIO *io )
- {
- QDataStream s( io->ioDevice() );
- s.setByteOrder( QDataStream::LittleEndian );
-
-- QImage img = io->image().swapRGB();
-+ const QImage img = io->image();
-+ const bool hasAlpha = img.hasAlphaBuffer();
- for( int i = 0; i < 12; i++ )
- s << targaMagic[i];
-
- // write header
-- s << (unsigned char)0;
-- s << (unsigned char)(img.width() / 256); // width
-- s << (unsigned char)0;
-- s << (unsigned char)(img.height() / 256); // height
-- s << (unsigned char)img.depth(); // depth
-- s << (unsigned char)36;
-+ s << Q_UINT16( img.width() ); // width
-+ s << Q_UINT16( img.height() ); // height
-+ s << Q_UINT8( hasAlpha ? 32 : 24 ); // depth (24 bit RGB + 8 bit alpha)
-+ s << Q_UINT8( hasAlpha ? 0x24 : 0x20 ); // top left image (0x20) + 8 bit alpha (0x4)
-
- for( int y = 0; y < img.height(); y++ )
- for( int x = 0; x < img.width(); x++ ) {
-- int color = img.pixel( x, y );
-- s << (unsigned char)qRed( color );
-- s << (unsigned char)qGreen( color );
-- s << (unsigned char)qBlue( color );
-- if( img.depth() == 32 )
-- s << (unsigned char)qAlpha( color );
-+ const QRgb color = img.pixel( x, y );
-+ s << Q_UINT8( qBlue( color ) );
-+ s << Q_UINT8( qGreen( color ) );
-+ s << Q_UINT8( qRed( color ) );
-+ if( hasAlpha )
-+ s << Q_UINT8( qAlpha( color ) );
- }
-
- io->setStatus( 0 );
-diff -u -p -b kdelibs-3.2.3-r9/work/kdelibs-3.2.3/kimgio/tiffr.cpp kdelibs-3.2.5/work/kdelibs/kimgio/tiffr.cpp
---- kdelibs-3.2.3-r9/work/kdelibs-3.2.3/kimgio/tiffr.cpp 2002-09-30 09:23:07.000000000 +0200
-+++ kdelibs-3.2.5/work/kdelibs/kimgio/tiffr.cpp 2005-04-20 14:07:22.000000000 +0200
-@@ -8,6 +8,7 @@
-
- #include <qimage.h>
- #include <qfile.h>
-+
-
- #include <assert.h>
-
-@@ -59,7 +60,7 @@ static void tiff_unmap( thandle_t, tdata
- {
- }
-
--void kimgio_tiff_read( QImageIO *io )
-+void kimgio_tiff_read( QImageIO *io )
- {
- TIFF *tiff;
- uint32 width, height;
-@@ -78,10 +79,15 @@ void kimgio_tiff_read( QImageIO *io )
- }
-
- // create image with loaded dimensions
-- TIFFGetField( tiff, TIFFTAG_IMAGEWIDTH, &width );
-- TIFFGetField( tiff, TIFFTAG_IMAGELENGTH, &height );
-+ if( TIFFGetField( tiff, TIFFTAG_IMAGEWIDTH, &width ) != 1
-+ || TIFFGetField( tiff, TIFFTAG_IMAGELENGTH, &height ) != 1 )
-+ return;
-
- QImage image( width, height, 32 );
-+ if( image.isNull()) {
-+ TIFFClose( tiff );
-+ return;
-+ }
- data = (uint32 *)image.bits();
-
- //Sven: changed to %ld for 64bit machines
-@@ -137,7 +143,7 @@ void kimgio_tiff_read( QImageIO *io )
- io->setStatus ( 0 );
- }
-
--void kimgio_tiff_write( QImageIO * )
-+void kimgio_tiff_write( QImageIO * )
- {
- // TODO: stub
- }
-diff -u -p -b kdelibs-3.2.3-r9/work/kdelibs-3.2.3/kimgio/xview.cpp kdelibs-3.2.5/work/kdelibs/kimgio/xview.cpp
---- kdelibs-3.2.3-r9/work/kdelibs-3.2.3/kimgio/xview.cpp 2003-09-07 14:17:55.000000000 +0200
-+++ kdelibs-3.2.5/work/kdelibs/kimgio/xview.cpp 2005-04-20 14:07:22.000000000 +0200
-@@ -7,13 +7,19 @@
-
- #include <stdio.h>
- #include <string.h>
-+#include <stdlib.h>
- #include <qimage.h>
-
-+
-+
- #include "xview.h"
-
- #define BUFSIZE 1024
-
--void kimgio_xv_read( QImageIO *_imageio )
-+static const int b_255_3[]= {0,85,170,255}, // index*255/3
-+ rg_255_7[]={0,36,72,109,145,182,218,255}; // index *255/7
-+
-+void kimgio_xv_read( QImageIO *_imageio )
- {
- int x=-1;
- int y=-1;
-@@ -48,10 +54,14 @@ void kimgio_xv_read( QImageIO *_imageio
- sscanf(str, "%d %d %d", &x, &y, &maxval);
-
- if (maxval != 255) return;
-+ int blocksize = x*y;
-+ if(x < 0 || y < 0 || blocksize < x || blocksize < y)
-+ return;
-
- // now follows a binary block of x*y bytes.
-- int blocksize = x*y;
-- char *block = new char[ blocksize ];
-+ char *block = (char*) malloc(blocksize);
-+ if(!block)
-+ return;
-
- if (iodev->readBlock(block, blocksize) != blocksize )
- {
-@@ -60,6 +70,10 @@ void kimgio_xv_read( QImageIO *_imageio
-
- // Create the image
- QImage image( x, y, 8, maxval + 1, QImage::BigEndian );
-+ if( image.isNull()) {
-+ free(block);
-+ return;
-+ }
-
- // how do the color handling? they are absolute 24bpp
- // or at least can be calculated as such.
-@@ -67,29 +81,9 @@ void kimgio_xv_read( QImageIO *_imageio
-
- for ( int j = 0; j < 256; j++ )
- {
--// ----------- OLIVER EIDEN
--// That is the old-code !
--/* r = ((int) ((j >> 5) & 0x07)) << 5;
-- g = ((int) ((j >> 2) & 0x07)) << 5;
-- b = ((int) ((j >> 0) & 0x03)) << 6;*/
--
--
--// That is the code-how xv, decode 3-3-2 pixmaps, it is slighly different,
--// but yields much better visuals results
--/* r = (((int) ((j >> 5) & 0x07)) *255) / 7;
-- g = (((int) ((j >> 2) & 0x07)) *255) / 7;
-- b = (((int) ((j >> 0) & 0x03)) *255) / 3;*/
--
--// This is the same as xv, with multiplications/divisions replaced by indexing
--
--// Look-up table to avoid multiplications and divisons
-- static int b_255_3[]= {0,85,170,255}, // index*255/3
-- rg_255_7[]={0,36,72,109,145,182,218,255}; // index *255/7
--
- r = rg_255_7[((j >> 5) & 0x07)];
- g = rg_255_7[((j >> 2) & 0x07)];
- b = b_255_3[((j >> 0) & 0x03)];
--// ---------------
- image.setColor( j, qRgb( r, g, b ) );
- }
-
-@@ -102,11 +96,11 @@ void kimgio_xv_read( QImageIO *_imageio
- _imageio->setImage( image );
- _imageio->setStatus( 0 );
-
-- delete [] block;
-+ free(block);
- return;
- }
-
--void kimgio_xv_write( QImageIO *imageio )
-+void kimgio_xv_write( QImageIO *imageio )
- {
- QIODevice& f = *( imageio->ioDevice() );
-
diff --git a/kde-base/kdelibs/kdelibs-3.2.3-r7.ebuild b/kde-base/kdelibs/kdelibs-3.2.3-r7.ebuild
deleted file mode 100644
index 75288e8f66a3..000000000000
--- a/kde-base/kdelibs/kdelibs-3.2.3-r7.ebuild
+++ /dev/null
@@ -1,110 +0,0 @@
-# Copyright 1999-2005 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/kde-base/kdelibs/kdelibs-3.2.3-r7.ebuild,v 1.9 2005/07/25 15:19:25 caleb Exp $
-
-inherit kde eutils
-
-need-autoconf 2.5
-set-kdedir ${PV}
-
-DESCRIPTION="KDE libraries needed by all kde programs"
-HOMEPAGE="http://www.kde.org/"
-SRC_URI="mirror://kde/stable/${PV}/src/${P}.tar.bz2
- mirror://kde/security_patches/post-3.2.3-kdelibs-kcookiejar.patch
- mirror://kde/security_patches/post-3.2.3-kdelibs-kstandarddirs.patch
- mirror://kde/security_patches/post-3.2.3-kdelibs-htmlframes2.patch
- mirror://kde/security_patches/post-3.2.3-kdelibs-kio.diff
- mirror://kde/security_patches/post-3.2.3-kdelibs-dcopserver.patch
- mirror://kde/security_patches/post-3.2.3-kdelibs-kioslave.patch"
-
-LICENSE="GPL-2 LGPL-2"
-SLOT="3.2"
-KEYWORDS="alpha amd64 hppa ~ia64 ~mips ppc sparc x86"
-IUSE="alsa cups ipv6 ssl doc ldap"
-
-# kde.eclass has kdelibs in DEPEND, and we can't have that in here.
-# so we recreate the entire DEPEND from scratch.
-DEPEND=">=sys-devel/autoconf-2.58
- >=sys-devel/automake-1.8
- >=app-arch/bzip2-1.0.2
- >=dev-libs/libxslt-1.0.31
- >=dev-libs/libxml2-2.5.8
- >=dev-libs/libpcre-3.9
- ssl? ( >=dev-libs/openssl-0.9.6k )
- alsa? ( media-libs/alsa-lib virtual/alsa )
- cups? ( >=net-print/cups-1.1.19 )
- ldap? ( >=net-nds/openldap-2.0.25 )
- media-libs/tiff
- >=app-admin/fam-2.6.10
- virtual/ghostscript
- media-libs/libart_lgpl
- sys-devel/gettext
- ~kde-base/arts-1.2.3
- $(qt_min_version 3.2.3)"
-RDEPEND="${DEPEND}
- app-text/sgml-common
- cups? ( net-print/cups )
- doc? ( app-doc/doxygen )
- dev-lang/python"
-
-src_unpack() {
- unpack ${P}.tar.bz2
- # This is an ugly hack: it makes base_src_unpack do nothing, but still lets us enjoy
- # the other things kde_src_unpack does.
- kde_src_unpack nounpack
-
- epatch ${DISTDIR}/post-3.2.3-kdelibs-kcookiejar.patch
- epatch ${DISTDIR}/post-3.2.3-kdelibs-kstandarddirs.patch
- epatch ${FILESDIR}/post-3.2.3-kdelibs-htmlframes.patch
- epatch ${DISTDIR}/post-3.2.3-kdelibs-htmlframes2.patch
- epatch ${FILESDIR}/post-3.2.3-kdelibs-khtml.diff
- epatch ${DISTDIR}/post-3.2.3-kdelibs-kioslave.patch
- epatch ${FILESDIR}/kde3-dcopidlng.patch
- cd ${S}/kio && patch -p0 < ${DISTDIR}/post-3.2.3-kdelibs-kio.diff
- cd ${S}/dcop && patch -p0 < ${DISTDIR}/post-3.2.3-kdelibs-dcopserver.patch
- cd ${S}
- make -f admin/Makefile.common || die
-}
-
-src_compile() {
- kde_src_compile myconf
-
- myconf="$myconf --with-distribution=Gentoo --enable-libfam --enable-dnotify"
- myconf="$myconf `use_with alsa` `use_enable cups`"
-
- use ipv6 || myconf="$myconf --with-ipv6-lookup=no"
- use ssl && myconf="$myconf --with-ssl-dir=/usr" || myconf="$myconf --without-ssl"
- use alsa && myconf="$myconf --with-alsa" || myconf="$myconf --without-alsa"
- use cups && myconf="$myconf --enable-cups" || myconf="$myconf --disable-cups"
-
- use x86 && myconf="$myconf --enable-fast-malloc=full"
-
- kde_src_compile configure make
-
- use doc && make apidox
-}
-
-src_install() {
- kde_src_install
- dohtml *.html
-
- if use doc ; then
- einfo "Copying API documentation..."
- dodir ${KDEDIR}/share/doc/HTML/en/kdelibs-apidocs
- cp -r ${S}/apidocs/* ${D}/$KDEDIR/share/doc/HTML/en/kdelibs-apidocs
- else
- rm -r ${D}/$KDEDIR/share/doc/HTML/en/kdelibs-apidocs
- fi
-
- # needed to fix lib64 issues on amd64, see bug #45669
- use amd64 && ln -s ${KDEDIR}/lib ${D}/${KDEDIR}/lib64
-
-}
-
-pkg_postinst() {
- if use doc ; then
- rm $KDEDIR/share/doc/HTML/en/kdelibs-apidocs/common
- ln -sf $KDEDIR/share/doc/HTML/en/common \
- $KDEDIR/share/doc/HTML/en/kdelibs-apidocs/common
- fi
-}
diff --git a/kde-base/kdelibs/kdelibs-3.2.3-r9.ebuild b/kde-base/kdelibs/kdelibs-3.2.3-r9.ebuild
deleted file mode 100644
index 2078c2087554..000000000000
--- a/kde-base/kdelibs/kdelibs-3.2.3-r9.ebuild
+++ /dev/null
@@ -1,118 +0,0 @@
-# Copyright 1999-2005 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/kde-base/kdelibs/kdelibs-3.2.3-r9.ebuild,v 1.8 2005/07/25 15:19:25 caleb Exp $
-
-inherit kde eutils
-
-need-autoconf 2.5
-set-kdedir ${PV}
-
-DESCRIPTION="KDE libraries needed by all kde programs"
-HOMEPAGE="http://www.kde.org/"
-SRC_URI="mirror://kde/stable/${PV}/src/${P}.tar.bz2
- mirror://kde/security_patches/post-3.2.3-kdelibs-kcookiejar.patch
- mirror://kde/security_patches/post-3.2.3-kdelibs-kstandarddirs.patch
- mirror://kde/security_patches/post-3.2.3-kdelibs-htmlframes2.patch
- mirror://kde/security_patches/post-3.2.3-kdelibs-kio.diff
- mirror://kde/security_patches/post-3.2.3-kdelibs-dcopserver.patch
- mirror://kde/security_patches/post-3.2.3-kdelibs-dcop.patch
- mirror://kde/security_patches/post-3.2.3-kdelibs-kioslave.patch"
-
-LICENSE="GPL-2 LGPL-2"
-SLOT="3.2"
-KEYWORDS="alpha amd64 ~hppa ia64 ~mips ppc sparc x86"
-IUSE="alsa cups ipv6 ssl doc ldap"
-
-# kde.eclass has kdelibs in DEPEND, and we can't have that in here.
-# so we recreate the entire DEPEND from scratch.
-DEPEND=">=sys-devel/autoconf-2.58
- >=sys-devel/automake-1.8
- >=app-arch/bzip2-1.0.2
- >=dev-libs/libxslt-1.0.31
- >=dev-libs/libxml2-2.5.8
- >=dev-libs/libpcre-3.9
- ssl? ( >=dev-libs/openssl-0.9.6k )
- alsa? ( media-libs/alsa-lib virtual/alsa )
- cups? ( >=net-print/cups-1.1.19 )
- ldap? ( >=net-nds/openldap-2.0.25 )
- media-libs/tiff
- >=app-admin/fam-2.6.10
- virtual/ghostscript
- media-libs/libart_lgpl
- sys-devel/gettext
- ~kde-base/arts-1.2.3
- $(qt_min_version 3.2.3)"
-RDEPEND="${DEPEND}
- app-text/sgml-common
- cups? ( net-print/cups )
- doc? ( app-doc/doxygen )
- dev-lang/python"
-
-src_unpack() {
- unpack ${P}.tar.bz2
- # This is an ugly hack: it makes base_src_unpack do nothing, but still lets us enjoy
- # the other things kde_src_unpack does.
- kde_src_unpack nounpack
-
- epatch ${DISTDIR}/post-3.2.3-kdelibs-kcookiejar.patch
- epatch ${DISTDIR}/post-3.2.3-kdelibs-kstandarddirs.patch
- epatch ${FILESDIR}/post-3.2.3-kdelibs-htmlframes.patch
- epatch ${DISTDIR}/post-3.2.3-kdelibs-htmlframes2.patch
- epatch ${FILESDIR}/post-3.2.3-kdelibs-khtml.diff
- epatch ${DISTDIR}/post-3.2.3-kdelibs-kioslave.patch
- epatch ${FILESDIR}/kde3-dcopidlng.patch
- cd ${S}/kio && patch -p0 < ${DISTDIR}/post-3.2.3-kdelibs-kio.diff
- cd ${S}/dcop && patch -p0 < ${DISTDIR}/post-3.2.3-kdelibs-dcopserver.patch
- cd ${S}
- epatch ${DISTDIR}/post-3.2.3-kdelibs-dcop.patch
- epatch ${FILESDIR}/post-3.2.3-kdelibs-idn.patch
-
- # kimgio input validation errors, see bug #88862
- epatch "${FILESDIR}/post-3.2.3-kdelibs-kimgio.diff"
- make -f admin/Makefile.common || die
-}
-
-src_compile() {
- kde_src_compile myconf
-
- myconf="$myconf --with-distribution=Gentoo --enable-libfam --enable-dnotify"
- myconf="$myconf `use_with alsa` `use_enable cups`"
-
- use ipv6 || myconf="$myconf --with-ipv6-lookup=no"
- use ssl && myconf="$myconf --with-ssl-dir=/usr" || myconf="$myconf --without-ssl"
- use alsa && myconf="$myconf --with-alsa" || myconf="$myconf --without-alsa"
- use cups && myconf="$myconf --enable-cups" || myconf="$myconf --disable-cups"
-
- use x86 && myconf="$myconf --enable-fast-malloc=full"
-
- kde_src_compile configure make
-
- use doc && make apidox
-}
-
-src_install() {
- kde_src_install
- dohtml *.html
-
- if use doc ; then
- einfo "Copying API documentation..."
- dodir ${KDEDIR}/share/doc/HTML/en/kdelibs-apidocs
- cp -r ${S}/apidocs/* ${D}/$KDEDIR/share/doc/HTML/en/kdelibs-apidocs
- else
- rm -r ${D}/$KDEDIR/share/doc/HTML/en/kdelibs-apidocs
- fi
-
- # needed to fix lib64 issues on amd64, see bug #45669
- use amd64 && ln -s ${KDEDIR}/lib ${D}/${KDEDIR}/lib64
-
-}
-
-pkg_postinst() {
- if use doc ; then
- rm $KDEDIR/share/doc/HTML/en/kdelibs-apidocs/common
- ln -sf $KDEDIR/share/doc/HTML/en/common \
- $KDEDIR/share/doc/HTML/en/kdelibs-apidocs/common
- fi
-}
-
-