SVN commit 568373 by mueller: compile++ M +1 -0 exception.cpp M +15 -13 object.h --- branches/koffice/1.6/koffice/lib/kross/api/exception.cpp #568372:568373 @@ -17,6 +17,7 @@ * Boston, MA 02110-1301, USA. ***************************************************************************/ +#include "object.h" #include "exception.h" //#include --- branches/koffice/1.6/koffice/lib/kross/api/object.h #568372:568373 @@ -34,12 +34,6 @@ // Forward declaration. class List; - //FIXME We forward declare class Exception here while it's - // used at the static fromObject() template-method. - // Could that provide probs on !=gcc? Maybe that method - // should go into it's own sourcefile anyway... - class Exception; - /** * The common Object class all other object-classes are * inheritated from. @@ -124,13 +118,7 @@ * \return The to a instance from template type T * casted Object. */ - template static T* fromObject(Object::Ptr object) - { - T* t = (T*) object.data(); - if(! t) - throw KSharedPtr( new Exception(QString("Object \"%1\" invalid.").arg(object ? object->getClassName() : "")) ); - return t; - } + template static T* fromObject(Object::Ptr object); /** * This method got used by the \a ProxyFunction classes @@ -146,5 +134,19 @@ }} +#include "exception.h" + +namespace Kross { namespace Api { + +template inline T* Object::fromObject(Object::Ptr object) +{ + T* t = (T*) object.data(); + if(! t) + throw KSharedPtr( new Exception(QString("Object \"%1\" invalid.").arg(object ? object->getClassName() : "")) ); + return t; +} + +}} + #endif