summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaymond Wooninck <tittiatcoke@gmail.com>2014-09-18 20:17:10 (GMT)
committerRaymond Wooninck <tittiatcoke@gmail.com>2014-09-18 20:17:10 (GMT)
commitf4badbc117bf4e801c333e84b1390a9892b3cf51 (patch)
tree8100ee298512e8d6addff41e9ed5a414541f0cb4
parent6bb0668d9d397961b993af4b1485fee5e1c413bb (diff)
Port the aboutData to the new methods. Next would be to bring back
to About Backend dialog
-rw-r--r--aboutdata.h2
-rw-r--r--core/document.cpp2
-rw-r--r--generators/chm/generator_chm.cpp19
-rw-r--r--generators/comicbook/generator_comicbook.cpp2
-rw-r--r--generators/djvu/generator_djvu.cpp11
-rw-r--r--generators/dvi/generator_dvi.cpp2
-rw-r--r--generators/epub/generator_epub.cpp18
-rw-r--r--generators/fax/generator_fax.cpp2
-rw-r--r--generators/fictionbook/generator_fb.cpp2
-rw-r--r--generators/kimgio/generator_kimgio.cpp37
-rw-r--r--generators/kimgio/tests/kimgiotest.cpp3
-rw-r--r--generators/mobipocket/generator_mobi.cpp13
-rw-r--r--generators/ooo/generator_ooo.cpp2
-rw-r--r--generators/plucker/generator_plucker.cpp2
-rw-r--r--generators/poppler/generator_pdf.cpp16
-rw-r--r--generators/spectre/generator_ghostview.cpp13
-rw-r--r--generators/txt/generator_txt.cpp2
-rw-r--r--generators/xps/generator_xps.cpp2
-rw-r--r--tests/parttest.cpp5
19 files changed, 75 insertions, 80 deletions
diff --git a/aboutdata.h b/aboutdata.h
index 97d9746..bb2011f 100644
--- a/aboutdata.h
+++ b/aboutdata.h
@@ -10,7 +10,7 @@
#ifndef _ABOUTDATA_H_
#define _ABOUTDATA_H_
-#include <kaboutdata.h>
+#include <KAboutData>
#include "core/version.h"
diff --git a/core/document.cpp b/core/document.cpp
index a07e6de..55fc739 100644
--- a/core/document.cpp
+++ b/core/document.cpp
@@ -37,7 +37,7 @@
#include <QtPrintSupport/QPrintDialog>
#include <QUndoCommand>
-#include <kaboutdata.h>
+#include <KAboutData>
#include <k4aboutdata.h>
#include <kauthorized.h>
#include <kconfigdialog.h>
diff --git a/generators/chm/generator_chm.cpp b/generators/chm/generator_chm.cpp
index 49efafc..c1dc5b8 100644
--- a/generators/chm/generator_chm.cpp
+++ b/generators/chm/generator_chm.cpp
@@ -15,7 +15,7 @@
#include <QtGui/QPainter>
#include <QtXml/QDomElement>
-#include <k4aboutdata.h>
+#include <KAboutData>
#include <khtml_part.h>
#include <khtmlview.h>
#include <klocale.h>
@@ -29,19 +29,18 @@
#include <core/textpage.h>
#include <core/utils.h>
-static K4AboutData createAboutData()
+static KAboutData createAboutData()
{
- K4AboutData aboutData(
+ KAboutData aboutData(
"okular_chm",
- "okular_chm",
- ki18n( "CHM Backend" ),
+ i18n( "CHM Backend" ),
"0.1.4",
- ki18n( "A Microsoft Windows help file renderer" ),
- K4AboutData::License_GPL,
- ki18n( "© 2005-2007 Piotr Szymański\n© 2008 Albert Astals Cid" )
+ i18n( "A Microsoft Windows help file renderer" ),
+ KAboutLicense::GPL,
+ i18n( "© 2005-2007 Piotr Szymański\n© 2008 Albert Astals Cid" )
);
- aboutData.addAuthor( ki18n( "Piotr Szymański" ), KLocalizedString(), "niedakh@gmail.com" );
- aboutData.addAuthor( ki18n( "Albert Astals Cid" ), KLocalizedString(), "aacid@kde.org" );
+ aboutData.addAuthor( i18n( "Piotr Szymański" ), QString(), "niedakh@gmail.com" );
+ aboutData.addAuthor( i18n( "Albert Astals Cid" ), QString(), "aacid@kde.org" );
return aboutData;
}
diff --git a/generators/comicbook/generator_comicbook.cpp b/generators/comicbook/generator_comicbook.cpp
index cf2e4d9..8cde0d7 100644
--- a/generators/comicbook/generator_comicbook.cpp
+++ b/generators/comicbook/generator_comicbook.cpp
@@ -12,7 +12,7 @@
#include <QtGui/QPainter>
#include <QtPrintSupport/QPrinter>
-#include <kaboutdata.h>
+#include <KAboutData>
#include <klocale.h>
#include <core/document.h>
diff --git a/generators/djvu/generator_djvu.cpp b/generators/djvu/generator_djvu.cpp
index 5190965..f5b1c13 100644
--- a/generators/djvu/generator_djvu.cpp
+++ b/generators/djvu/generator_djvu.cpp
@@ -25,7 +25,7 @@
#include <quuid.h>
#include <QtGui/QPrinter>
-#include <kaboutdata.h>
+#include <KAboutData>
#include <QtCore/QDebug>
#include <klocale.h>
#include <qtemporaryfile.h>
@@ -70,12 +70,11 @@ static KAboutData createAboutData()
{
KAboutData aboutData(
"okular_djvu",
- "okular_djvu",
- ki18n( "DjVu Backend" ),
+ i18n( "DjVu Backend" ),
"0.2.3",
- ki18n( "DjVu backend based on DjVuLibre." ),
- KAboutData::License_GPL,
- ki18n( "© 2006-2008 Pino Toscano" )
+ i18n( "DjVu backend based on DjVuLibre." ),
+ KAboutLicense::GPL
+ i18n( "© 2006-2008 Pino Toscano" )
);
aboutData.addAuthor( ki18n( "Pino Toscano" ), KLocalizedString(), "pino@kde.org" );
return aboutData;
diff --git a/generators/dvi/generator_dvi.cpp b/generators/dvi/generator_dvi.cpp
index 0d555d4..3611e6b 100644
--- a/generators/dvi/generator_dvi.cpp
+++ b/generators/dvi/generator_dvi.cpp
@@ -33,7 +33,7 @@
#include <qtemporaryfile.h>
#include <qmutex.h>
-#include <kaboutdata.h>
+#include <KAboutData>
#include <QtCore/QDebug>
#include <klocale.h>
diff --git a/generators/epub/generator_epub.cpp b/generators/epub/generator_epub.cpp
index 6fe2213..462ec34 100644
--- a/generators/epub/generator_epub.cpp
+++ b/generators/epub/generator_epub.cpp
@@ -11,21 +11,21 @@
#include "converter.h"
-#include <k4aboutdata.h>
+#include <KAboutData>
+#include <KLocale>
#include <kconfigdialog.h>
-static K4AboutData createAboutData()
+static KAboutData createAboutData()
{
- K4AboutData aboutData(
+ KAboutData aboutData(
"okular_epub",
- "okular_epub",
- ki18n("EPub Backend"),
+ i18n("EPub Backend"),
"0.2.3",
- ki18n("An EPub backend"),
- K4AboutData::License_GPL,
- ki18n("© 2008 Ely Levy")
+ i18n("An EPub backend"),
+ KAboutLicense::GPL,
+ i18n("© 2008 Ely Levy")
);
- aboutData.addAuthor(ki18n("Ely Levy"), KLocalizedString(),
+ aboutData.addAuthor(i18n("Ely Levy"), QString(),
"elylevy@cs.huji.ac.il");
return aboutData;
diff --git a/generators/fax/generator_fax.cpp b/generators/fax/generator_fax.cpp
index 0dee357..7d189e1 100644
--- a/generators/fax/generator_fax.cpp
+++ b/generators/fax/generator_fax.cpp
@@ -12,7 +12,7 @@
#include <QtGui/QPainter>
#include <QtPrintSupport/QPrinter>
-#include <kaboutdata.h>
+#include <KAboutData>
#include <klocale.h>
#include <core/document.h>
diff --git a/generators/fictionbook/generator_fb.cpp b/generators/fictionbook/generator_fb.cpp
index 8704986..ce3e367 100644
--- a/generators/fictionbook/generator_fb.cpp
+++ b/generators/fictionbook/generator_fb.cpp
@@ -11,7 +11,7 @@
#include "converter.h"
-#include <kaboutdata.h>
+#include <KAboutData>
#include <klocale.h>
#include <kconfigdialog.h>
diff --git a/generators/kimgio/generator_kimgio.cpp b/generators/kimgio/generator_kimgio.cpp
index 6868877..c7ca260 100644
--- a/generators/kimgio/generator_kimgio.cpp
+++ b/generators/kimgio/generator_kimgio.cpp
@@ -11,12 +11,14 @@
#include "generator_kimgio.h"
-#include <QtCore/QBuffer>
-#include <QtGui/QImageReader>
-#include <QtGui/QPainter>
-#include <QtGui/QPrinter>
-
-#include <k4aboutdata.h>
+#include <QBuffer>
+#include <QImageReader>
+#include <QPainter>
+#include <QPrinter>
+#include <QMimeType>
+#include <QMimeDatabase>
+
+#include <KAboutData>
#include <kaction.h>
#include <kactioncollection.h>
#include <kicon.h>
@@ -27,22 +29,19 @@
#include <core/page.h>
-static K4AboutData createAboutData()
+static KAboutData createAboutData()
{
- K4AboutData aboutData(
- "okular_kimgio",
+ KAboutData aboutData(
"okular_kimgio",
- ki18n( "Image Backend" ),
+ i18n( "Image Backend" ),
"0.1.2",
- ki18n( "A simple image backend" ),
- K4AboutData::License_GPL,
- ki18n( "© 2005, 2009 Albert Astals Cid\n"
- "© 2006-2007 Pino Toscano\n"
- "© 2006-2007 Tobias Koenig" )
+ i18n( "A simple image backend" ),
+ KAboutLicense::GPL,
+ i18n( "© 2005, 2009 Albert Astals Cid\n© 2006-2007 Pino Toscano\n© 2006-2007 Tobias Koenig" )
);
- aboutData.addAuthor( ki18n( "Albert Astals Cid" ), KLocalizedString(), "aacid@kde.org" );
- aboutData.addAuthor( ki18n( "Pino Toscano" ), KLocalizedString(), "pino@kde.org" );
- aboutData.addAuthor( ki18n( "Tobias Koenig" ), KLocalizedString(), "tokoe@kde.org" );
+ aboutData.addAuthor( i18n( "Albert Astals Cid" ), QString(), "aacid@kde.org" );
+ aboutData.addAuthor( i18n( "Pino Toscano" ), QString(), "pino@kde.org" );
+ aboutData.addAuthor( i18n( "Tobias Koenig" ), QString(), "tokoe@kde.org" );
return aboutData;
}
@@ -64,6 +63,7 @@ KIMGIOGenerator::~KIMGIOGenerator()
bool KIMGIOGenerator::loadDocument( const QString & fileName, QVector<Okular::Page*> & pagesVector )
{
+ QMimeDatabase db;
const QString mime = db.mimeTypeForFile(fileName, QMimeDatabase::MatchContent).name();
const QStringList types = KImageIO::typeForMime(mime);
const QByteArray type = !types.isEmpty() ? types[0].toAscii() : QByteArray();
@@ -90,6 +90,7 @@ bool KIMGIOGenerator::loadDocument( const QString & fileName, QVector<Okular::Pa
bool KIMGIOGenerator::loadDocumentFromData( const QByteArray & fileData, QVector<Okular::Page*> & pagesVector )
{
+ QMimeDatabase db;
const QString mime = db.mimeTypeForData(fileData).name();
const QStringList types = KImageIO::typeForMime(mime);
const QByteArray type = !types.isEmpty() ? types[0].toAscii() : QByteArray();
diff --git a/generators/kimgio/tests/kimgiotest.cpp b/generators/kimgio/tests/kimgiotest.cpp
index f5649e0..826c0f6 100644
--- a/generators/kimgio/tests/kimgiotest.cpp
+++ b/generators/kimgio/tests/kimgiotest.cpp
@@ -60,7 +60,8 @@ void KIMGIOTest::testExifOrientation_data()
void KIMGIOTest::testExifOrientation()
{
QFETCH( QString, imgPath );
-
+ QMimeDatabase db;
+
Okular::SettingsCore::instance( "kimgiotest" );
Okular::Document *m_document = new Okular::Document( 0 );
const QMimeType mime = db.mimeTypeForFile( imgPath );
diff --git a/generators/mobipocket/generator_mobi.cpp b/generators/mobipocket/generator_mobi.cpp
index 3040745..3dbadcb 100644
--- a/generators/mobipocket/generator_mobi.cpp
+++ b/generators/mobipocket/generator_mobi.cpp
@@ -10,21 +10,20 @@
#include "converter.h"
-#include <kaboutdata.h>
+#include <KAboutData>
#include <kconfigdialog.h>
static KAboutData createAboutData()
{
KAboutData aboutData(
"okular_mobi",
- "okular_mobi",
- ki18n("Mobipocket Backend"),
+ i18n("Mobipocket Backend"),
"0.1.1",
- ki18n("A mobipocket backend"),
- KAboutData::License_GPL,
- ki18n("© 2008-2009 Jakub Stachowski")
+ i18n("A mobipocket backend"),
+ KAboutLicense::GPL,
+ i18n("© 2008-2009 Jakub Stachowski")
);
- aboutData.addAuthor(ki18n("Jakub Stachowski"), KLocalizedString(),
+ aboutData.addAuthor(i18n("Jakub Stachowski"), KLocalizedString(),
"qbast@go2.pl");
return aboutData;
diff --git a/generators/ooo/generator_ooo.cpp b/generators/ooo/generator_ooo.cpp
index 87f71c3..d6fbdcf 100644
--- a/generators/ooo/generator_ooo.cpp
+++ b/generators/ooo/generator_ooo.cpp
@@ -11,7 +11,7 @@
#include "converter.h"
-#include <kaboutdata.h>
+#include <KAboutData>
#include <klocale.h>
#include <kconfigdialog.h>
#include <kwallet.h>
diff --git a/generators/plucker/generator_plucker.cpp b/generators/plucker/generator_plucker.cpp
index 5f0b2c3..ab11fff 100644
--- a/generators/plucker/generator_plucker.cpp
+++ b/generators/plucker/generator_plucker.cpp
@@ -15,7 +15,7 @@
#include <QtPrintSupport/QPrinter>
#include <QtGui/QTextDocument>
-#include <kaboutdata.h>
+#include <KAboutData>
#include <klocale.h>
#include <core/page.h>
diff --git a/generators/poppler/generator_pdf.cpp b/generators/poppler/generator_pdf.cpp
index 4140a55..073f61b 100644
--- a/generators/poppler/generator_pdf.cpp
+++ b/generators/poppler/generator_pdf.cpp
@@ -27,7 +27,7 @@
#include <QPainter>
#include <QtCore/QDebug>
-#include <k4aboutdata.h>
+#include <KAboutData>
#include <kconfigdialog.h>
#include <klocale.h>
#include <kmessagebox.h>
@@ -380,16 +380,14 @@ static QLinkedList<Okular::ObjectRect*> generateLinks( const QList<Poppler::Link
static KAboutData createAboutData()
{
- K4AboutData aboutData(
- "okular_poppler",
- "okular_poppler",
- ki18n( "PDF Backend" ),
+ KAboutData aboutData( "okular_poppler",
+ i18n( "PDF Backend" ),
"0.6.5",
- ki18n( "A PDF file renderer" ),
- K4AboutData::License_GPL,
- ki18n( "© 2005-2008 Albert Astals Cid" )
+ i18n( "A PDF file renderer" ),
+ KAboutLicense::GPL,
+ i18n( "© 2005-2008 Albert Astals Cid" )
);
- aboutData.addAuthor( ki18n( "Albert Astals Cid" ), KLocalizedString(), "aacid@kde.org" );
+ aboutData.addAuthor( i18n( "Albert Astals Cid" ), QString(), "aacid@kde.org" );
return aboutData;
}
diff --git a/generators/spectre/generator_ghostview.cpp b/generators/spectre/generator_ghostview.cpp
index e951e44..b71f43f 100644
--- a/generators/spectre/generator_ghostview.cpp
+++ b/generators/spectre/generator_ghostview.cpp
@@ -17,7 +17,7 @@
#include <qsize.h>
#include <QtGui/QPrinter>
-#include <kaboutdata.h>
+#include <KAboutData>
#include <kconfigdialog.h>
#include <QtCore/QDebug>
#include <QMimeType>
@@ -38,13 +38,12 @@ static KAboutData createAboutData()
{
KAboutData aboutData(
"okular_ghostview",
- "okular_ghostview",
- ki18n( "PS Backend" ),
+ i18n( "PS Backend" ),
"0.1.7",
- ki18n( "A PostScript file renderer." ),
- KAboutData::License_GPL,
- ki18n( "© 2007-2008 Albert Astals Cid" ),
- ki18n( "Based on the Spectre library." )
+ i18n( "A PostScript file renderer." ),
+ KAboutLicense::GPL,
+ i18n( "© 2007-2008 Albert Astals Cid" ),
+ i18n( "Based on the Spectre library." )
);
aboutData.addAuthor( ki18n( "Albert Astals Cid" ), KLocalizedString(), "aacid@kde.org" );
return aboutData;
diff --git a/generators/txt/generator_txt.cpp b/generators/txt/generator_txt.cpp
index 94bf19c..9bc3d75 100644
--- a/generators/txt/generator_txt.cpp
+++ b/generators/txt/generator_txt.cpp
@@ -11,7 +11,7 @@
#include "generator_txt.h"
#include "converter.h"
-#include <kaboutdata.h>
+#include <KAboutData>
#include <klocalizedstring.h>
#include <KConfigDialog>
diff --git a/generators/xps/generator_xps.cpp b/generators/xps/generator_xps.cpp
index 7b2d40d..9acf3a4 100644
--- a/generators/xps/generator_xps.cpp
+++ b/generators/xps/generator_xps.cpp
@@ -24,7 +24,7 @@
#include <qlist.h>
#include <qpainter.h>
#include <qprinter.h>
-#include <kaboutdata.h>
+#include <KAboutData>
#include <kglobal.h>
#include <klocale.h>
#include <kurl.h>
diff --git a/tests/parttest.cpp b/tests/parttest.cpp
index dab23f6..0b5156f 100644
--- a/tests/parttest.cpp
+++ b/tests/parttest.cpp
@@ -16,7 +16,7 @@
#include <KGlobal>
#include <KStandardDirs>
#include <KTempDir>
-#include <K4AboutData>
+#include <KAboutData>
#include <QTreeView>
@@ -185,8 +185,7 @@ int main(int argc, char *argv[])
setenv("KDE_SKIP_KDERC", "1", 1);
unsetenv("KDE_COLOR_DEBUG");
QFile::remove(QDir::homePath() + QString::fromLatin1("/.kde-unit-test/share/config/qttestrc"));
- K4AboutData aboutData( QByteArray("qttest"), QByteArray(), ki18n("KDE Test Program"), QByteArray("version") );
- KComponentData cData(&aboutData);
+ KAboutData aboutData( QByteArray("qttest"), i18n("KDE Test Program"), QByteArray("version") );
QApplication app( argc, argv );
app.setApplicationName( QLatin1String("qttest") );
qRegisterMetaType<KUrl>(); /*as done by kapplication*/