move the about data in an own file, so it can be used from both the shell and the part

svn path=/trunk/playground/graphics/okular/; revision=641337
remotes/origin/KDE/4.0
Pino Toscano 19 years ago
parent f1fd2750e4
commit 9a10418505
  1. 42
      aboutdata.h
  2. 3
      part.cpp
  3. 32
      shell/main.cpp

@ -0,0 +1,42 @@
/***************************************************************************
* Copyright (C) 2007 by Pino Toscano <pino@kde.org> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#ifndef _ABOUTDATA_H_
#define _ABOUTDATA_H_
#include <kaboutdata.h>
inline KAboutData* okularAboutData( const char* name, const char* iname )
{
KAboutData *about = new KAboutData(
name, //"okular",
iname, //I18N_NOOP("okular"),
"0.5.82",
I18N_NOOP("okular, an universal document viewer"),
KAboutData::License_GPL,
"(C) 2002 Wilco Greven, Christophe Devriese\n"
"(C) 2004-2005 Albert Astals Cid, Enrico Ros\n"
"(C) 2005 Piotr Szymanski"
);
about->addAuthor("Pino Toscano", I18N_NOOP("Current mantainer"), "pino@kde.org");
about->addAuthor("Tobias Koenig", I18N_NOOP("Lots of framework work, ODT and FictionBook backends"), "tokoe@kde.org");
about->addAuthor("Albert Astals Cid", I18N_NOOP("Former mantainer"), "aacid@kde.org");
about->addAuthor("Piotr Szymanski", I18N_NOOP("Created okular from KPDF codebase"), "djurban@pld-dc.org");
about->addAuthor("Enrico Ros", 0, "eros.kde@email.it");
about->addAuthor("Wilco Greven", 0, "greven@kde.org");
about->addAuthor("Christophe Devriese", 0, "oelewapperke@oelewapperke.org");
about->addAuthor("Laurent Montel", 0, "montel@kde.org");
about->addCredit("Marco Martin", I18N_NOOP("Icon"), "m4rt@libero.it");
return about;
}
#endif

@ -55,6 +55,7 @@
#include <kfilterdev.h> #include <kfilterdev.h>
// local includes // local includes
#include "aboutdata.h"
#include "part.h" #include "part.h"
#include "ui/pageview.h" #include "ui/pageview.h"
#include "ui/toc.h" #include "ui/toc.h"
@ -590,7 +591,7 @@ KAboutData* Part::createAboutData()
// the non-i18n name here must be the same as the directory in // the non-i18n name here must be the same as the directory in
// which the part's rc file is installed ('partrcdir' in the // which the part's rc file is installed ('partrcdir' in the
// Makefile) // Makefile)
KAboutData* aboutData = new KAboutData("okularpart", I18N_NOOP("okular::Part"), "0.1"); KAboutData* aboutData = okularAboutData( "okularpart", I18N_NOOP( "okularpart" ) );
aboutData->addAuthor("Wilco Greven", 0, "greven@kde.org"); aboutData->addAuthor("Wilco Greven", 0, "greven@kde.org");
return aboutData; return aboutData;
} }

@ -14,14 +14,9 @@
#include "shell.h" #include "shell.h"
#include <kapplication.h> #include <kapplication.h>
#include <kaboutdata.h>
#include <kcmdlineargs.h> #include <kcmdlineargs.h>
#include <klocale.h> #include <klocale.h>
#include "aboutdata.h"
static const char description[] =
I18N_NOOP("okular, a Universal document viewer");
static const char version[] = "0.5.82";
static KCmdLineOptions options[] = static KCmdLineOptions options[] =
{ {
@ -34,26 +29,9 @@ static KCmdLineOptions options[] =
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
KAboutData about( KAboutData * about = okularAboutData( "okular", I18N_NOOP( "okular" ) );
"okular",
I18N_NOOP("okular"),
version,
description,
KAboutData::License_GPL,
"(C) 2002 Wilco Greven, Christophe Devriese\n(C) 2004-2005 Albert Astals Cid, Enrico Ros\n(C) 2005 Piotr Szymanski");
about.addAuthor("Pino Toscano", I18N_NOOP("Current mantainer"), "pino@kde.org");
about.addAuthor("Tobias Koenig", I18N_NOOP("Lots of framework work, ODT and FictionBook backends"), "tokoe@kde.org");
about.addAuthor("Albert Astals Cid", I18N_NOOP("Former mantainer"), "aacid@kde.org");
about.addAuthor("Piotr Szymanski", I18N_NOOP("Created okular from KPDF codebase"), "djurban@pld-dc.org");
about.addAuthor("Enrico Ros", 0, "eros.kde@email.it");
about.addAuthor("Wilco Greven", 0, "greven@kde.org");
about.addAuthor("Christophe Devriese", 0, "oelewapperke@oelewapperke.org");
about.addAuthor("Laurent Montel", 0, "montel@kde.org");
about.addCredit("Marco Martin", I18N_NOOP("Icon"), 0, "m4rt@libero.it");
KCmdLineArgs::init(argc, argv, &about); KCmdLineArgs::init(argc, argv, about);
KCmdLineArgs::addCmdLineOptions( options ); KCmdLineArgs::addCmdLineOptions( options );
KApplication app; KApplication app;
@ -80,7 +58,9 @@ int main(int argc, char** argv)
} }
} }
return app.exec(); int ret = app.exec();
delete about;
return ret;
} }
// vim:ts=2:sw=2:tw=78:et // vim:ts=2:sw=2:tw=78:et

Loading…
Cancel
Save