Auto-conversion to new KCmdLineArgs/KAboutData/KComponentData API (trunk/KDE). Watch for the few remaining QString to QByteArray assignments that will not compile without extra specification (typically needs .toLocal8Bit() or .toUtf8()).

svn path=/trunk/KDE/kdegraphics/okular/; revision=682260
remotes/origin/KDE/4.0
Chusslove Illich 19 years ago
parent 3a71fdc9be
commit 968760cb6c
  1. 25
      aboutdata.h
  2. 2
      core/document.cpp
  3. 10
      core/generator.h
  4. 2
      part.cpp
  5. 15
      shell/main.cpp
  6. 2
      shell/shell.cpp

@ -16,23 +16,24 @@ inline KAboutData* okularAboutData( const char* name, const char* iname )
{
KAboutData *about = new KAboutData(
name, //"okular",
iname, //I18N_NOOP("okular"),
0, // catalog name also "okular"
ki18n(iname), //I18N_NOOP("okular"),
"0.5.83",
I18N_NOOP("okular, an universal document viewer"),
ki18n("okular, an universal document viewer"),
KAboutData::License_GPL,
"(C) 2002 Wilco Greven, Christophe Devriese\n"
ki18n("(C) 2002 Wilco Greven, Christophe Devriese\n"
"(C) 2004-2005 Albert Astals Cid, Enrico Ros\n"
"(C) 2005 Piotr Szymanski"
"(C) 2005 Piotr Szymanski")
);
about->addAuthor("Pino Toscano", I18N_NOOP("Current maintainer"), "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 maintainer"), "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->addAuthor(ki18n("Pino Toscano"), ki18n("Current maintainer"), "pino@kde.org");
about->addAuthor(ki18n("Tobias Koenig"), ki18n("Lots of framework work, ODT and FictionBook backends"), "tokoe@kde.org");
about->addAuthor(ki18n("Albert Astals Cid"), ki18n("Former maintainer"), "aacid@kde.org");
about->addAuthor(ki18n("Piotr Szymanski"), ki18n("Created okular from KPDF codebase"), "djurban@pld-dc.org");
about->addAuthor(ki18n("Enrico Ros"), KLocalizedString(), "eros.kde@email.it");
about->addAuthor(ki18n("Wilco Greven"), KLocalizedString(), "greven@kde.org");
about->addAuthor(ki18n("Christophe Devriese"), KLocalizedString(), "oelewapperke@oelewapperke.org");
about->addAuthor(ki18n("Laurent Montel"), KLocalizedString(), "montel@kde.org");
return about;
}

@ -502,7 +502,7 @@ Generator * DocumentPrivate::loadGeneratorLibrary( const QString& name, const QS
info.generator = generator;
info.library = lib;
if ( generator->componentData() && generator->componentData()->aboutData() )
info.appName = QLatin1String( generator->componentData()->aboutData()->appName() );
info.appName = generator->componentData()->aboutData()->appName();
m_loadedGenerators.insert( name, info );
return generator;
}

@ -416,12 +416,12 @@ class OKULAR_EXPORT Generator : public QObject
* data like:
* @code
KAboutData *about = new KAboutData(
"generator_foo", // we reccomend to use okular_xxx for the component name
I18N_NOOP( "Foo Backend" ), "0.1",
I18N_NOOP( "A foo backend" ),
"generator_foo", 0, // we reccomend to use okular_xxx for the component name
ki18n( "Foo Backend" ), "0.1",
ki18n( "A foo backend" ),
KAboutData::License_GPL,
I18N_NOOP( "Copyright (c) 2007 Developer" ) );
about->addAuthor( "Joe Developer", I18N_NOOP( "Developer" ), " joe@host.com" );
ki18n( "Copyright (c) 2007 Developer" ) );
about->addAuthor( ki18n("Joe Developer"), ki18n( "Developer" ), " joe@host.com" );
setAboutData( about );
* @endcode
*/

@ -642,7 +642,7 @@ KAboutData* Part::createAboutData()
// which the part's rc file is installed ('partrcdir' in the
// Makefile)
KAboutData* aboutData = okularAboutData( "okularpart", I18N_NOOP( "okularpart" ) );
aboutData->addAuthor("Wilco Greven", 0, "greven@kde.org");
aboutData->addAuthor(ki18n("Wilco Greven"), KLocalizedString(), "greven@kde.org");
return aboutData;
}

@ -18,20 +18,17 @@
#include <klocale.h>
#include "aboutdata.h"
static KCmdLineOptions options[] =
{
{ "p", 0, 0 },
{ "page <number>", I18N_NOOP("Page of the document to be shown"), 0 },
{ "presentation", I18N_NOOP("Start the document in presentation mode"), 0 },
{ "+[URL]", I18N_NOOP("Document to open"), 0 },
KCmdLineLastOption
};
int main(int argc, char** argv)
{
KAboutData * about = okularAboutData( "okular", I18N_NOOP( "okular" ) );
KCmdLineArgs::init(argc, argv, about);
KCmdLineOptions options;
options.add("p");
options.add("page <number>", ki18n("Page of the document to be shown"));
options.add("presentation", ki18n("Start the document in presentation mode"));
options.add("+[URL]", ki18n("Document to open"));
KCmdLineArgs::addCmdLineOptions( options );
KApplication app;

@ -110,7 +110,7 @@ void Shell::delayedOpen()
uint page = 0;
if (m_args && m_doc)
{
QByteArray pageopt = m_args->getOption("page");
QString pageopt = m_args->getOption("page");
page = pageopt.toUInt();
}
openUrl(m_openUrl, page);

Loading…
Cancel
Save