summaryrefslogtreecommitdiffabout
path: root/microkde/kdeui/kxmlguiclient.cpp
authorMichael Krelin <hacker@klever.net>2007-07-04 11:23:42 (UTC)
committer Michael Krelin <hacker@klever.net>2007-07-04 11:23:42 (UTC)
commita08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (side-by-side diff)
tree8ee90d686081c52e7c69b5ce946e9b1a7d690001 /microkde/kdeui/kxmlguiclient.cpp
parent11edc920afe4f274c0964436633aa632c8288a40 (diff)
downloadkdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip
kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz
kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2
initial public commit of qt4 portp1
Diffstat (limited to 'microkde/kdeui/kxmlguiclient.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kdeui/kxmlguiclient.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/microkde/kdeui/kxmlguiclient.cpp b/microkde/kdeui/kxmlguiclient.cpp
index 073e30b..8740bde 100644
--- a/microkde/kdeui/kxmlguiclient.cpp
+++ b/microkde/kdeui/kxmlguiclient.cpp
@@ -10,125 +10,127 @@
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "kxmlguiclient.h"
/*US
#include "kxmlguifactory.h"
#include "kxmlguibuilder.h"
*/
/*US
#include <qdir.h>
#include <qfile.h>
#include <qdom.h>
#include <qtextstream.h>
#include <qregexp.h>
*/
//US #include <kinstance.h>
#include <kstandarddirs.h>
#include <kdebug.h>
#include <kaction.h>
#include <kapplication.h>
#include <assert.h>
+//Added by qt3to4:
+#include <Q3PtrList>
class KXMLGUIClientPrivate
{
public:
KXMLGUIClientPrivate()
{
//US m_instance = KGlobal::instance();
//US m_factory = 0L;
m_parent = 0L;
//US m_builder = 0L;
m_actionCollection = 0;
}
~KXMLGUIClientPrivate()
{
}
//US KInstance *m_instance;
//US QDomDocument m_doc;
KActionCollection *m_actionCollection;
//US QDomDocument m_buildDocument;
//US KXMLGUIFactory *m_factory;
KXMLGUIClient *m_parent;
//QPtrList<KXMLGUIClient> m_supers;
- QPtrList<KXMLGUIClient> m_children;
+ Q3PtrList<KXMLGUIClient> m_children;
//US KXMLGUIBuilder *m_builder;
//US QString m_xmlFile;
//US QString m_localXMLFile;
};
KXMLGUIClient::KXMLGUIClient()
{
d = new KXMLGUIClientPrivate;
}
KXMLGUIClient::KXMLGUIClient( KXMLGUIClient *parent )
{
d = new KXMLGUIClientPrivate;
parent->insertChildClient( this );
}
KXMLGUIClient::~KXMLGUIClient()
{
if ( d->m_parent )
d->m_parent->removeChildClient( this );
- QPtrListIterator<KXMLGUIClient> it( d->m_children );
+ Q3PtrListIterator<KXMLGUIClient> it( d->m_children );
for ( ; it.current(); ++it ) {
assert( it.current()->d->m_parent == this );
it.current()->d->m_parent = 0;
}
delete d->m_actionCollection;
delete d;
}
KAction *KXMLGUIClient::action( const char *name ) const
{
KAction* act = actionCollection()->action( name );
if ( !act ) {
- QPtrListIterator<KXMLGUIClient> childIt( d->m_children );
+ Q3PtrListIterator<KXMLGUIClient> childIt( d->m_children );
for (; childIt.current(); ++childIt ) {
act = childIt.current()->actionCollection()->action( name );
if ( act )
break;
}
}
return act;
}
KActionCollection *KXMLGUIClient::actionCollection() const
{
if ( !d->m_actionCollection )
d->m_actionCollection = new KActionCollection( 0, 0,
"KXMLGUILClient-KActionCollection" );
return d->m_actionCollection;
}
/*US
KAction *KXMLGUIClient::action( const QDomElement &element ) const
{
static const QString &attrName = KGlobal::staticQString( "name" );
return actionCollection()->action( element.attribute( attrName ).latin1() );
}
KInstance *KXMLGUIClient::instance() const
{
return d->m_instance;
}
QDomDocument KXMLGUIClient::domDocument() const
{
return d->m_doc;
@@ -559,83 +561,83 @@ KXMLGUIFactory *KXMLGUIClient::factory() const
{
return d->m_factory;
}
*/
KXMLGUIClient *KXMLGUIClient::parentClient() const
{
return d->m_parent;
}
void KXMLGUIClient::insertChildClient( KXMLGUIClient *child )
{
if ( child->d->m_parent )
child->d->m_parent->removeChildClient( child );
d->m_children.append( child );
child->d->m_parent = this;
}
void KXMLGUIClient::removeChildClient( KXMLGUIClient *child )
{
assert( d->m_children.containsRef( child ) );
d->m_children.removeRef( child );
child->d->m_parent = 0;
}
/*bool KXMLGUIClient::addSuperClient( KXMLGUIClient *super )
{
if ( d->m_supers.contains( super ) )
return false;
d->m_supers.append( super );
return true;
}*/
-const QPtrList<KXMLGUIClient> *KXMLGUIClient::childClients()
+const Q3PtrList<KXMLGUIClient> *KXMLGUIClient::childClients()
{
return &d->m_children;
}
/*US
void KXMLGUIClient::setClientBuilder( KXMLGUIBuilder *builder )
{
d->m_builder = builder;
if ( builder )
builder->setBuilderInstance( instance() );
}
KXMLGUIBuilder *KXMLGUIClient::clientBuilder() const
{
return d->m_builder;
}
*/
-void KXMLGUIClient::plugActionList( const QString &name, const QPtrList<KAction> &actionList )
+void KXMLGUIClient::plugActionList( const QString &name, const Q3PtrList<KAction> &actionList )
{
/*US
if ( !d->m_factory )
return;
d->m_factory->plugActionList( this, name, actionList );
*/
}
void KXMLGUIClient::unplugActionList( const QString &name )
{
/*US
if ( !d->m_factory )
return;
d->m_factory->unplugActionList( this, name );
*/
}
/*US
QString KXMLGUIClient::findMostRecentXMLFile( const QStringList &files, QString &doc )
{
QValueList<DocStruct> allDocuments;
QStringList::ConstIterator it = files.begin();
QStringList::ConstIterator end = files.end();
for (; it != end; ++it )
{
//kdDebug() << "KXMLGUIClient::findMostRecentXMLFile " << *it << endl;
QString data = KXMLGUIFactory::readConfigFile( *it );
DocStruct d;