[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/office/komacro/lib
From: Sebastian Sauer <mail () dipe ! org>
Date: 2005-12-19 16:11:19
Message-ID: 1135008679.979367.10338.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 489727 by sebsauer:
Cleanup.
M +34 -5 exception.cpp
M +4 -8 exception.h
M +0 -21 macro.cpp
M +0 -10 macro.h
--- trunk/playground/office/komacro/lib/exception.cpp #489726:489727
@@ -21,28 +21,57 @@
using namespace KoMacro;
+namespace KoMacro {
+
+ /**
+ * @internal d-pointer class to be more flexible on future extension of the
+ * functionality without to much risk to break the binary compatibility.
+ */
+ class Exception::Private
+ {
+ public:
+
+ /// A describing errormessage.
+ const QString errormessage;
+
+ /// A more detailed list of tracemessages.
+ QStringList tracemessages;
+
+ /**
+ * Constructor.
+ */
+ Private(const QString& errormessage)
+ : errormessage(errormessage)
+ {
+ }
+
+ };
+
+}
+
Exception::Exception(const QString& tracemessage, const QString& errormessage)
- : m_errormessage(errormessage)
+ : d( new Private(errormessage) ) // create the private d-pointer instance.
{
- m_tracemessages.append(tracemessage);
+ d->tracemessages.append(tracemessage);
}
Exception::~Exception()
{
+ delete d;
}
const QString& Exception::errorMessage()
{
- return m_errormessage;
+ return d->errormessage;
}
const QStringList& Exception::traceMessages()
{
- return m_tracemessages;
+ return d->tracemessages;
}
void Exception::addTraceMessage(const QString& tracemessage)
{
- m_tracemessages.append(tracemessage);
+ d->tracemessages.append(tracemessage);
}
--- trunk/playground/office/komacro/lib/exception.h #489726:489727
@@ -68,16 +68,12 @@
void addTraceMessage(const QString& tracemessage);
private:
- /// A describing errormessage.
- QString m_errormessage;
- /// A more detailed list of tracemessages.
- QStringList m_tracemessages;
+ /// @internal d-pointer class.
+ class Private;
+ /// @internal d-pointer instance.
+ Private* const d;
};
- //class MacroException : public Exception {};
- //class RuntimeException : public Exception {};
- //class FatalException : public Exception {};
-
}
#endif
--- trunk/playground/office/komacro/lib/macro.cpp #489726:489727
@@ -122,27 +122,6 @@
context->activate();
}
-void Macro::activate(QValueList< KSharedPtr<Variable> > args)
-{
- //TODO
- kdDebug()<<"KoMacro::Macro::activate(QValueList< KSharedPtr<Variable> >)"<<endl;
-
- for(KoMacro::Variable::List::Iterator it = args.begin(); it != args.end(); ++it) \
{
- switch( (*it)->type() ) {
- case KoMacro::MetaParameter::TypeVariant: {
- kdDebug() << "KoMacro::Macro::activate variant tostring=" << \
(*it)->variant().toString() << endl;
- } break;
- case KoMacro::MetaParameter::TypeObject: {
- kdDebug() << "KoMacro::Macro::activate object name=" << \
(*it)->object()->name() << endl;
- } break;
- default: {
- kdDebug() << "KoMacro::Macro::activate NULL !!!" << endl;
- } break;
- }
- }
-
-}
-
void Macro::activate(Context::Ptr context)
{
Context* c = new Context(this);
--- trunk/playground/office/komacro/lib/macro.h #489726:489727
@@ -114,16 +114,6 @@
/**
* Called if the @a Macro should be executed.
- *
- * @param args List of @a Variable arguments passed to
- * the activation. Those variables will be used within
- * the activation @a Context this @a Macro provides on
- * execution.
- */
- virtual void activate(QValueList< KSharedPtr<Variable> > args);
-
- /**
- * Called if the @a Macro should be executed.
*
* @param context The @a Context this @a Macro should
* be executed in.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic