You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.8 KiB
52 lines
1.8 KiB
15 years ago
|
/***************************************************************************
|
||
|
kugarnopimport.cpp - description
|
||
|
-------------------
|
||
|
copyright : (C) 2002 by Joseph Wenninger
|
||
|
email : jowenn@kde.org
|
||
|
***************************************************************************/
|
||
|
|
||
|
/***************************************************************************
|
||
|
* *
|
||
|
* This program is free software; you can redistribute it and/or modify *
|
||
|
* it under the terms of the GNU General Public License verstion 2 as *
|
||
|
* published by the Free Software Foundation *
|
||
|
* *
|
||
|
***************************************************************************/
|
||
|
|
||
|
#include "kugarnopimport.h"
|
||
|
#include "kugarnopimport.moc"
|
||
|
#include <KoFilterChain.h>
|
||
|
#include <kgenericfactory.h>
|
||
|
#include <kdebug.h>
|
||
|
#include <qfile.h>
|
||
|
#include "KoDocument.h"
|
||
|
#include <qdom.h>
|
||
|
|
||
|
typedef KGenericFactory<KugarNOPImport, KoFilter> KugarNOPImportFactory;
|
||
|
K_EXPORT_COMPONENT_FACTORY( libkugarnopimport, KugarNOPImportFactory( "kugarnopimport" ) )
|
||
|
|
||
|
|
||
|
KugarNOPImport::KugarNOPImport( KoFilter *, const char *, const QStringList& )
|
||
|
: KoFilter()
|
||
|
{
|
||
|
}
|
||
|
|
||
|
KoFilter::ConversionStatus KugarNOPImport::convert( const QCString& /*from*/, const QCString& /*to*/ )
|
||
|
{
|
||
|
|
||
|
QFile in( m_chain->inputFile());
|
||
|
if (!in.open( IO_ReadOnly ))
|
||
|
{
|
||
|
kdError() << "Unable to open input file!" << endl;
|
||
|
in.close();
|
||
|
return KoFilter::FileNotFound;
|
||
|
}
|
||
|
|
||
|
KoDocument *doc=m_chain->outputDocument();
|
||
|
doc->loadXML(&in,QDomDocument());
|
||
|
in.close();
|
||
|
doc->resetURL();
|
||
|
|
||
|
return KoFilter::OK;
|
||
|
}
|