diff --git a/aboutdata.h b/aboutdata.h new file mode 100644 index 000000000..dea088d39 --- /dev/null +++ b/aboutdata.h @@ -0,0 +1,42 @@ +/*************************************************************************** + * Copyright (C) 2007 by Pino Toscano * + * * + * 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 + +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 diff --git a/part.cpp b/part.cpp index 775f34061..66f7f8040 100644 --- a/part.cpp +++ b/part.cpp @@ -55,6 +55,7 @@ #include // local includes +#include "aboutdata.h" #include "part.h" #include "ui/pageview.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 // which the part's rc file is installed ('partrcdir' in the // 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"); return aboutData; } diff --git a/shell/main.cpp b/shell/main.cpp index d188b7cb9..f216e9b7a 100644 --- a/shell/main.cpp +++ b/shell/main.cpp @@ -14,14 +14,9 @@ #include "shell.h" #include -#include #include #include - -static const char description[] = -I18N_NOOP("okular, a Universal document viewer"); - -static const char version[] = "0.5.82"; +#include "aboutdata.h" static KCmdLineOptions options[] = { @@ -34,26 +29,9 @@ static KCmdLineOptions options[] = int main(int argc, char** argv) { - KAboutData about( - "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"); + KAboutData * about = okularAboutData( "okular", I18N_NOOP( "okular" ) ); - KCmdLineArgs::init(argc, argv, &about); + KCmdLineArgs::init(argc, argv, about); KCmdLineArgs::addCmdLineOptions( options ); 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