Commit de21afa3 authored by Michael Reeves's avatar Michael Reeves

*manually set about data for KPart plugin.

*#if class that is not normally used
 TODO: Reexamine KREPLACEMENTS_H and attendent #ifdefs
*set some things based on kate code as referance.
parent 8aa66b68
......@@ -37,7 +37,7 @@
#include "version.h"
/*static KAboutData createAboutData()
static KAboutData createAboutData()
{
QByteArray appVersion = QByteArray( VERSION );
if ( sizeof(void*)==8 )
......@@ -51,15 +51,15 @@
i18n( "Copyright 2007, Aurélien Gâteau <aurelien.gateau@free.fr>" ) );
aboutData.addAuthor( i18n( "Joachim Eibl" ), QString(), QByteArray( "joachim.eibl at gmx.de" ) );
return aboutData;
}*/
}
K_PLUGIN_FACTORY( KDiff3PartFactory, registerPlugin<KDiff3Part>(); )
//K_EXPORT_PLUGIN( KDiff3PartFactory(createAboutData()))
KDiff3Part::KDiff3Part( QWidget *parentWidget, QObject *parent, const QVariantList &args )
: KParts::ReadWritePart( parent ) {
// we need an instance
//setComponentData( KPluginFactory::componentData() );
//set AboutData
setComponentData(createAboutData());
const char *widgetName = args[0].toString().toUtf8().data();
// this should be your custom internal widget
......
......@@ -93,7 +93,8 @@ static bool isOptionUsed( const QString& s, int argc, char* argv[] ) {
}
#endif
/*class ContextFreeTranslator : public QTranslator
#ifdef KREPLACEMENTS_H
class ContextFreeTranslator : public QTranslator
{
public:
ContextFreeTranslator( QObject* pParent ) : QTranslator(pParent) {}
......@@ -104,10 +105,11 @@ public:
else
return QString();
}
};*/
};
#endif
int main( int argc, char *argv[] ) {
QApplication app( argc, argv ); // PORTING SCRIPT: move this to before the KAboutData initialization
QApplication app( argc, argv ); // KAboutData and QCommandLineParser depend on this being setup.
#ifdef _WIN32
/* KDiff3 can be used as replacement for the text-diff and merge tool provided by
Clearcase. This is experimental and so far has only been tested under Windows.
......@@ -196,6 +198,8 @@ int main( int argc, char *argv[] ) {
QCommandLineParser parser;
KAboutData::setApplicationData( aboutData );
parser.setApplicationDescription(aboutData.shortDescription());
parser.addVersionOption();
parser.addHelpOption();
initialiseCmdLineArgs( parser );
......@@ -222,7 +226,14 @@ int main( int argc, char *argv[] ) {
parser.process( app ); // PORTING SCRIPT: move this to after any parser.addOption
//must be after process or parse call
aboutData.setupCommandLine( &parser );
/**
* take component name and org. name from KAboutData
*/
app.setApplicationName(aboutData.componentName());
app.setApplicationDisplayName(aboutData.displayName());
app.setOrganizationDomain(aboutData.organizationDomain());
app.setApplicationVersion(aboutData.version());
#ifdef KREPLACEMENTS_H
QString locale;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment