Simplify the handling of the contributor list in AboutDlg
authorManuel Nickschas <sputnick@quassel-irc.org>
Wed, 4 Feb 2015 23:20:06 +0000 (00:20 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Wed, 4 Feb 2015 23:20:06 +0000 (00:20 +0100)
This introduces an AboutData class akin to KAboutData from KDE
Frameworks. Together with brace initialization, which we can now
use thanks to C++11, this makes specifying the (huge!) list of
contributors to Quassel much nicer, compared to editing a long
HTML string.

AboutData also can create a KAboutData object that can be used for
KF5 integration, and later for showing the native KAboutDialog
instead of our own if KDE integration is enabled.

The list of contributors has also been synced with the Git history
again. If you find your name missing, or want changes, please
let us know.

CMakeLists.txt
src/CMakeLists.txt
src/common/main.cpp
src/qtui/aboutdlg.cpp
src/qtui/aboutdlg.h
src/uisupport/CMakeLists.txt
src/uisupport/aboutdata.cpp [new file with mode: 0644]
src/uisupport/aboutdata.h [new file with mode: 0644]

index 69424f6..2e152a5 100644 (file)
@@ -252,6 +252,13 @@ if (USE_QT5)
         endif()
 
         if (WITH_KDE)
+            find_package(KF5CoreAddons QUIET)
+            set_package_properties(KF5CoreAddons PROPERTIES TYPE REQUIRED
+                URL "http://inqlude.org/libraries/kcoreaddons.html"
+                DESCRIPTION "framework for solving common problems such as caching, randomization, and more"
+                PURPOSE     "Required for KDE Frameworks integration"
+            )
+
             find_package(KF5TextWidgets QUIET)
             set_package_properties(KF5TextWidgets PROPERTIES TYPE REQUIRED
                 URL "http://inqlude.org/libraries/ktextwidgets.html"
index 2e24ea4..6221930 100644 (file)
@@ -30,6 +30,11 @@ if (WITH_OXYGEN)
     add_definitions(-DWITH_OXYGEN)
 endif()
 
+# For KAboutData
+if (WITH_KF5)
+    set(CLIENT_LIBRARIES ${CLIENT_LIBRARIES} KF5::CoreAddons)
+endif()
+
 # Needed for showing the cli option if appropriate
 if (HAVE_SYSLOG)
     add_definitions(-DHAVE_SYSLOG)
index 9d87c4b..9d75da4 100644 (file)
 #ifdef BUILD_CORE
 #  include "coreapplication.h"
 #elif defined BUILD_QTUI
+#  include "aboutdata.h"
 #  include "qtuiapplication.h"
 #elif defined BUILD_MONO
+#  include "aboutdata.h"
 #  include "monoapplication.h"
 
 #else
 #if defined HAVE_KDE4 && defined BUILD_CORE
 #  undef HAVE_KDE4
 #endif
+// We don't want quasselcore to depend on KDE
+#if defined HAVE_KF5 && defined BUILD_CORE
+#  undef HAVE_KF5
+#endif
 
 #ifdef HAVE_KDE4
 #  include <KAboutData>
 #  include "kcmdlinewrapper.h"
+#elif defined HAVE_KF5
+#  include <KCoreAddons/KAboutData>
+#  include "qt5cliparser.h"
 #elif defined HAVE_QT5
 #  include "qt5cliparser.h"
 #else
@@ -97,7 +106,6 @@ int main(int argc, char **argv)
 
 #ifdef HAVE_KDE4
     // We need to init KCmdLineArgs first
-    // TODO: build an AboutData compat class to replace our aboutDlg strings
     KAboutData aboutData("quassel", "kdelibs4", ki18n("Quassel IRC"), Quassel::buildInfo().plainVersionString.toUtf8(),
         ki18n("A modern, distributed IRC client"));
     aboutData.addLicense(KAboutData::License_GPL_V2);
@@ -116,6 +124,7 @@ int main(int argc, char **argv)
 
     // Initialize CLI arguments
     // NOTE: We can't use tr() at this point, since app is not yet created
+    // TODO: Change this once we get rid of KDE4 and can initialize the parser after creating the app
 
     // put shared client&core arguments here
     cliParser->addSwitch("debug", 'd', "Enable debug output");
@@ -181,6 +190,15 @@ int main(int argc, char **argv)
     }
 #endif
 
-    if (!app.init()) return EXIT_FAILURE;
+    if (!app.init())
+        return EXIT_FAILURE;
+
+#ifdef HAVE_KF5
+    // FIXME: This should be done after loading the translation catalogue, but still in main()
+    AboutData aboutData;
+    AboutData::setQuasselPersons(&aboutData);
+    KAboutData::setApplicationData(aboutData.kAboutData());
+#endif
+
     return app.exec();
 }
index 68fd655..582fe93 100644 (file)
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
+#include "aboutdlg.h"
+
 #include <QDateTime>
 #include <QIcon>
 
-#include "aboutdlg.h"
+#include "aboutdata.h"
 #include "quassel.h"
 
-AboutDlg::AboutDlg(QWidget *parent) : QDialog(parent)
+AboutDlg::AboutDlg(QWidget *parent)
+    : QDialog(parent)
+    , _aboutData(new AboutData(this))
 {
+    AboutData::setQuasselPersons(_aboutData);
+
     ui.setupUi(this);
     ui.quasselLogo->setPixmap(QIcon(":/icons/quassel-64.png").pixmap(64)); // don't let the icon theme affect our logo here
 
@@ -63,16 +69,14 @@ QString AboutDlg::about() const
 QString AboutDlg::authors() const
 {
     QString res;
-    res = tr("Quassel IRC is mainly developed by:") +
-          "<dl>"
-          "<dt><b>Manuel \"Sputnick\" Nickschas</b></dt><dd><a href=\"mailto:sput@quassel-irc.org\">sput@quassel-irc.org</a><br>"
-          "Project Founder, Lead Developer</dd>"
-          "<dt><b>Marcus \"EgS\" Eggenberger</b></dt><dd><a href=\"mailto:egs@quassel-irc.org\">egs@quassel-irc.org</a><br>"
-          "Project Motivator, Lead Developer, Mac Maintainer</dd>"
-          "<dt><b>Alexander \"phon\" von Renteln</b></dt><dd><a href=\"mailto:phon@quassel-irc.org\">phon@quassel-irc.org</a><br>"
-          "Developer, Windows Maintainer</dd>"
-          "</dl>";
-
+    res = tr("Quassel IRC is mainly developed by:") + "<dl>";
+    for (const auto &person : _aboutData->authors()) {
+        res.append("<dt><b>" + person.prettyName() + "</b></dt><dd>");
+        if (!person.emailAddress().isEmpty())
+            res.append("<a href=\"mailto:" + person.emailAddress() + "\">" + person.emailAddress() + "</a><br>");
+        res.append(person.task() + "</dd>");
+    }
+    res.append("</dl>");
     return res;
 }
 
@@ -80,126 +84,11 @@ QString AboutDlg::authors() const
 QString AboutDlg::contributors() const
 {
     QString res;
-    res = tr("We would like to thank the following contributors (in alphabetical order) and everybody we forgot to mention here:")
-          + QString::fromUtf8("<br>"
-                              "<dl>"
-                              "<dt><b>Daniel \"al\" Albers</b></dt><dd>Master Of Translation, many fixes and enhancements</dd>"
-                              "<dt><b>Liudas Alisauskas</b></dt><dd>Lithuanian translation</dd>"
-                              "<dt><b>Terje \"tan\" Andersen</b></dt><dd>Norwegian translation, documentation</dd>"
-                              "<dt><b>Jens \"amiconn\" Arnold</b></dt><dd>Postgres migration fixes</dd>"
-                              "<dt><b>Adolfo Jayme Barrientos</b></dt><dd>Spanish translation</dd>"
-                              "<dt><b>Mattia Basaglia</b></dt><dd>Fixes</dd>"
-                              "<dt><b>Pete \"elbeardmorez\" Beardmore</b></dt><dd>Linewrap for input line</dd>"
-                              "<dt><b>Rafael \"EagleScreen\" Belmonte</b></dt><dd>Spanish translation</dd>"
-                              "<dt><b>Sergiu Bivol</b></dt><dd>Romanian translation</dd>"
-                              "<dt><b>Bruno Brigras</b></dt><dd>Crash fixes</dd>"
-                              "<dt><b>Florent Castelli</b></dt><dd>Sanitize topic handling</dd>"
-                              "<dt><b>Theo \"tampakrap\" Chatzimichos</b></dt><dd>Greek translation</dd>"
-                              "<dt><b>Yuri Chornoivan</b></dt><dd>Ukrainian translation</dd>"
-                              "<dt><b>Tomáš \"scarabeus\" Chvátal</b></dt><dd>Czech translation</dd>"
-                              "<dt><b>\"Condex\"</b></dt><dd>Galician translation</dd>"
-                              "<dt><b>Joshua \"tvakah\" Corbin</b></dt><dd>Various fixes</dd>"
-                              "<dt><b>\"cordata\"</b></dt><dd>Esperanto translation</dd>"
-                              "<dt><b>Matthias \"pennywise\" Coy</b></dt><dd>German translation</dd>"
-                              "<dt><b>\"derpella\"</b></dt><dd>Polish translation</dd>"
-                              "<dt><b>\"Dorian\"</b></dt><dd>French translation</dd>"
-                              "<dt><b>Luke Faraone</b></dt><dd>Doc fixes</dd>"
-                              "<dt><b>Chris \"stitch\" Fuenty</b></dt><dd>SASL support</dd>"
-                              "<dt><b>Kevin \"KRF\" Funk</b></dt><dd>German translation</dd>"
-                              "<dt><b>Fabiano \"elbryan\" Francesconi</b></dt><dd>Italian translation</dd>"
-                              "<dt><b>Leo Franchi</b></dt><dd>OSX improvements</dd>"
-                              "<dt><b>Sebastien Fricker</b></dt><dd>Audio backend improvements</dd>"
-                              "<dt><b>Alf Gaida</b></dt><dd>Language improvements</dd>"
-                              "<dt><b>Aurélien \"agateau\" Gâteau</b></dt><dd>Message Indicator support</dd>"
-                              "<dt><b>Marco \"kaffeedoktor\" Genise</b></dt><dd>Ideas, hacking, motivation</dd>"
-                              "<dt><b>Felix \"debfx\" Geyer</b></dt><dd>Certificate handling improvements</dd>"
-                              "<dt><b>Volkan Gezer</b></dt><dd>Turkish translation</dd>"
-                              "<dt><b>Sjors \"dazjorz\" Gielen</b></dt><dd>Fixes</dd>"
-                              "<dt><b>Sebastian \"seezer\" Goth</b></dt><dd>Many improvements and features</dd>"
-                              "<dt><b>Michael \"brot\" Groh</b></dt><dd>German translation, fixes</dd>"
-                              "<dt><b>\"Gryllida\"</b></dt><dd>IRC parser improvements</dd>"
-                              "<dt><b>H. İbrahim \"igungor\" Güngör</b></dt><dd>Turkish translation</dd>"
-                              "<dt><b>Jiri Grönroos</b></dt><dd>Finnish translation</dd>"
-                              "<dt><b>Chris \"Zren\" H</b></dt><dd>Various improvements</dd>"
-                              "<dt><b>Edward Hades</b></dt><dd>Russian translation</dd>"
-                              "<dt><b>John \"nox\" Hand</b></dt><dd>Former All-Seeing Eye logo</dd>"
-                              "<dt><b>Adam \"2kah\" Harwood</b></dt><dd>ChatView improvements</dd>"
-                              "<dt><b>Jonas \"Dante\" Heese</b></dt><dd>Project founder, various improvements</dd>"
-                              "<dt><b>Thomas \"Datafreak\" Hogh</b></dt><dd>Windows builder</dd>"
-                              "<dt><b>Johannes \"j0hu\" Huber</b></dt><dd>Many fixes and features, bug triaging</dd>"
-                              "<dt><b>Theofilos Intzoglou</b></dt><dd>Greek translation</dd>"
-                              "<dt><b>Jovan Jojkić</b></dt><dd>Serbian translation</dd>"
-                              "<dt><b>Allan Jude</b></dt><dd>Documentation improvements</dd>"
-                              "<dt><b>Michael \"ycros\" Kedzierski</b></dt><dd>Mac fixes</dd>"
-                              "<dt><b>Scott \"ScottK\" Kitterman<b></dt><dd>Kubuntu nightly packager, (packaging/build system) bughunter</dd>"
-                              "<dt><b>Paul \"Haudrauf\" Klumpp</b></dt><dd>Initial design and mainwindow layout</dd>"
-                              "<dt><b>Maia Kozheva</b></dt><dd>Russian translation</dd>"
-                              "<dt><b>Tae-Hoon Kwon</b></dt><dd>Korean translation</dd>"
-                              "<dt><b>\"Larso\"</b></dt><dd>Finnish translation</dd>"
-                              "<dt><b>Patrick \"bonsaikitten\" Lauer</b></dt><dd>Gentoo packaging</dd>"
-                              "<dt><b>Chris \"Fish-Face\" Le Sueur</b></dt><dd>Various fixes and improvements</dd>"
-                              "<dt><b>Jerome \"Adys\" Leclanche</b></dt><dd>Context menu fixes</dd>"
-                              "<dt><b>Hendrik \"nevcairiel\" Leppkes</b></dt><dd>Various features</dd>"
-                              "<dt><b>Jason Lynch</b></dt><dd>Bugfixes</dd>"
-                              "<dt><b>Awad \"firesock\" Mackie</b></dt><dd>ChatView improvements</dd>"
-                              "<dt><b>Michael \"mamarley\" Marley</b></dt><dd>Various fixes and improvements</dd>"
-                              "<dt><b>Martin \"m4yer\" Mayer</b></dt><dd>German translation</dd>"
-                              "<dt><b>Daniel \"hydrogen\" Meltzer</b></dt><dd>Various fixes and improvements</dd>"
-                              "<dt><b>Sebastian Meyer</b></dt><dd>Fixes</dd>"
-                              "<dt><b>Daniel E. Moctezuma</b></dt><dd>Japanese translation</dd>"
-                              "<dt><b>Chris \"kode54\" Moeller</b></dt><dd>Various fixes and improvements</dd>"
-                              "<dt><b>Thomas Müller</b></dt><dd>Fixes, Debian packaging</dd>"
-                              "<dt><b>Gábor \"ELITE_x\" Németh</b></dt><dd>Hungarian translation</dd>"
-                              "<dt><b>Per Nielsen</b></dt><dd>Danish translation</dd>"
-                              "<dt><b>J-P Nurmi</b></dt><dd>Fixes</dd>"
-                              "<dt><b>Marco \"Quizzlo\" Paolone</b></dt><dd>Italian translation</dd>"
-                              "<dt><b>Bas \"Tucos\" Pape</b></dt><dd>Many fixes and improvements, bug and patch triaging, tireless community support</dd>"
-                              "<dt><b>Bruno Patri</b></dt><dd>French translation</dd>"
-                              "<dt><b>Drew \"LinuxDolt\" Patridge</b></dt><dd>BluesTheme stylesheet</dd>"
-                              "<dt><b>Celeste \"seele\" Paul</b></dt><dd>Usability Queen</dd>"
-                              "<dt><b>Vit Pelcak</b></dt><dd>Czech translation</dd>"
-                              "<dt><b>Regis \"ZRegis\" Perrin</b></dt><dd>French translation</dd>"
-                              "<dt><b>Diego \"Flameeyes\" Petten&ograve;</b></dt><dd>Gentoo maintainer, build system improvements</dd>"
-                              "<dt><b>Simon Philips</b></dt><dd>Dutch translation</dd>"
-                              "<dt><b>Daniel \"billie\" Pielmeier</b></dt><dd>Gentoo maintainer</dd>"
-                              "<dt><b>Nuno \"pinheiro\" Pinheiro</b></dt><dd>Tons of Oxygen icons including our application icon</dd>"
-                              "<dt><b>David Planella</b></dt><dd>Translation system fixes</dd>"
-                              "<dt><b>Jure \"JLP\" Repinc</b></dt><dd>Slovenian translation</dd>"
-                              "<dt><b>Patrick \"TheOneRing\" von Reth</b></dt><dd>MinGW support, SNORE backend, Windows packager</dd>"
-                              "<dt><b>Dirk \"MarcLandis\" Rettschlag</b></dt><dd>Various fixes and new features</dd>"
-                              "<dt><b>Miguel Revilla</b></dt><dd>Spanish translation</dd>"
-                              "<dt><b>Jaak Ristioja</b></dt><dd>Fixes</dd>"
-                              "<dt><b>David \"Bombe\" Roden</b></dt><dd>Fixes</dd>"
-                              "<dt><b>Henning \"honk\" Rohlfs</b></dt><dd>Various fixes</dd>"
-                              "<dt><b>Stella \"differentreality\" Rouzi</b></dt><dd>Greek translation</dd>"
-                              "<dt><b>\"salnx\"</b></dt><dd>Highlight configuration improvements</dd>"
-                              "<dt><b>Martin \"sandsmark\" Sandsmark</b></dt><dd>Core fixes, Quasseldroid</dd>"
-                              "<dt><b>David Sansome</b></dt><dd>OSX Notification Center support</dd>"
-                              "<dt><b>Dennis \"DevUrandom\" Schridde</b></dt><dd>D-Bus notifications</dd>"
-                              "<dt><b>Jussi \"jussi01\" Schultink</b></dt><dd>Tireless tester, {ku|U}buntu tester and lobbyist, liters of delicious Finnish alcohol</dd>"
-                              "<dt><b>Tim \"xAFFE\" Schumacher</b></dt><dd>Fixes and feedback</dd>"
-                              "<dt><b>\"sfionov\"</b></dt><dd>Russian translation</dd>"
-                              "<dt><b>Harald \"apachelogger\" Sitter</b></dt><dd>{ku|U}buntu packager, motivator, promoter</dd>"
-                              "<dt><b>Ramanathan Sivagurunathan</b></dt><dd>Fixes</dd>"
-                              "<dt><b>Stefanos Sofroniou</b></dt><dd>Greek translation</dd>"
-                              "<dt><b>Rüdiger \"ruediger\" Sonderfeld</b></dt><dd>Emacs keybindings</dd>"
-                              "<dt><b>Alexander Stein</b></dt><dd>Tray icon fix</dd>"
-                              "<dt><b>Daniel \"son\" Steinmetz</b></dt><dd>Early beta tester and bughunter (on Vista&trade;!)</dd>"
-                              "<dt><b>Jesper Thomschütz</b></dt><dd>Various fixes</dd>"
-                              "<dt><b>Arthur \"roentgen\" Titeica</b></dt><dd>Romanian translation</dd>"
-                              "<dt><b>\"ToBeFree\"</b></dt><dd>German translation</dd>"
-                              "<dt><b>Edward \"Aides\" Toroshchin</b></dt><dd>Russian translation</dd>"
-                              "<dt><b>Adam \"adamt\" Tulinius</b></dt><dd>Early beta tester and bughunter, Danish translation</dd>"
-                              "<dt><b>Deniz Türkoglu</b></dt><dd>Mac fixes</dd>"
-                              "<dt><b>Frederik M.J. \"freqmod\" Vestre</b></dt><dd>Norwegian translation</dd>"
-                              "<dt><b>Atte Virtanen</b></dt><dd>Finnish translation</dd>"
-                              "<dt><b>Pavel \"int\" Volkovitskiy</b></dt><dd>Early beta tester and bughunter</dd>"
-                              "<dt><b>Roscoe van Wyk</b></dt><dd>Fixes</dd>"
-                              "<dt><b>Zé</b></dt><dd>Portuguese translation</dd>"
-                              "<dt><b>Benjamin \"zbenjamin\" Zeller</b></dt><dd>Windows build system fixes</dd>"
-                              "<dt><b>\"zeugma\"</b></dt><dd>Turkish translation</dd>"
-                              "</dl><br>"
-                              "...and anybody else finding and reporting bugs, giving feedback, helping others and being part of the community!");
+    res = tr("We would like to thank the following contributors (in alphabetical order) and everybody we forgot to mention here:") + "<br><dl>";
+    for (const auto &person : _aboutData->credits()) {
+        res.append("<dt><b>" + person.prettyName() + "</b></dt><dd>" + person.task() + "</dd>");
+    }
+    res.append("</dl><br>" + tr("...and anybody else finding and reporting bugs, giving feedback, helping others and being part of the community!"));
 
     return res;
 }
index d9fe3c2..d54df8c 100644 (file)
@@ -25,6 +25,8 @@
 
 #include "ui_aboutdlg.h"
 
+class AboutData;
+
 class AboutDlg : public QDialog
 {
     Q_OBJECT
@@ -39,6 +41,8 @@ private:
     QString authors() const;
     QString contributors() const;
     QString thanksTo() const;
+
+    AboutData *_aboutData;
 };
 
 
index c0d6e4b..0b78acc 100644 (file)
@@ -1,6 +1,7 @@
 # Builds the uisupport module
 
 set(SOURCES
+    aboutdata.cpp
     abstractbuffercontainer.cpp
     abstractitemview.cpp
     action.cpp
@@ -58,5 +59,5 @@ if (WITH_KDE4)
 endif()
 
 if (WITH_KF5)
-    target_link_libraries(mod_uisupport KF5::TextWidgets)
+    target_link_libraries(mod_uisupport KF5::CoreAddons KF5::TextWidgets)
 endif()
diff --git a/src/uisupport/aboutdata.cpp b/src/uisupport/aboutdata.cpp
new file mode 100644 (file)
index 0000000..561f5e8
--- /dev/null
@@ -0,0 +1,299 @@
+/***************************************************************************
+ *   Copyright (C) 2005-2015 by the Quassel Project                        *
+ *   devel@quassel-irc.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) version 3.                                           *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
+ ***************************************************************************/
+
+#include "aboutdata.h"
+
+#include <QImage>
+
+#include "quassel.h"
+
+
+AboutPerson::AboutPerson(const QString &name, const QString &nick, const QString &task, const QString &emailAddress, QLocale::Language translatedLanguage)
+    : _name(name)
+    , _nick(nick)
+    , _task(task)
+    , _emailAddress(emailAddress)
+    , _language(translatedLanguage)
+{
+
+}
+
+
+QString AboutPerson::name() const
+{
+    return _name;
+}
+
+
+QString AboutPerson::nick() const
+{
+    return _nick;
+}
+
+
+QString AboutPerson::task() const
+{
+    return _task;
+}
+
+
+QString AboutPerson::emailAddress() const
+{
+    return _emailAddress;
+}
+
+
+QLocale::Language AboutPerson::translatedLanguage() const
+{
+    return _language;
+}
+
+
+QString AboutPerson::prettyName() const
+{
+    if (!name().isEmpty() && !nick().isEmpty())
+        return name() + " (" + nick() + ')';
+
+    if (name().isEmpty() && !nick().isEmpty())
+        return nick();
+
+    return name();
+}
+
+
+/**************************************************************************************************/
+
+
+AboutData::AboutData(QObject *parent)
+    : QObject(parent)
+{
+
+}
+
+
+QList<AboutPerson> AboutData::authors() const
+{
+    return _authors;
+}
+
+
+QList< AboutPerson > AboutData::credits() const
+{
+    return _credits;
+}
+
+
+AboutData &AboutData::addAuthor(const AboutPerson &author)
+{
+    _authors.append(author);
+    return *this;
+}
+
+
+AboutData &AboutData::addAuthors(std::initializer_list<AboutPerson> authors)
+{
+    _authors.append(authors);
+    return *this;
+}
+
+
+AboutData &AboutData::addCredit(const AboutPerson &credit)
+{
+    _credits.append(credit);
+    return *this;
+}
+
+
+AboutData &AboutData::addCredits(std::initializer_list<AboutPerson> credits)
+{
+    _credits.append(credits);
+    return *this;
+}
+
+#ifdef HAVE_KF5
+
+KAboutData AboutData::kAboutData() const
+{
+    KAboutData aboutData(
+        Quassel::buildInfo().applicationName,
+        tr("Quassel IRC"),
+        Quassel::buildInfo().plainVersionString
+    );
+    aboutData.addLicense(KAboutLicense::GPL_V2);
+    aboutData.addLicense(KAboutLicense::GPL_V3);
+    aboutData.setShortDescription(tr("A modern, distributed IRC client"));
+    aboutData.setProgramLogo(QVariant::fromValue(QImage(":/pics/quassel-logo.png")));
+    aboutData.setBugAddress("http://bugs.quassel-irc.org/projects/quassel-irc/issues/new");
+    aboutData.setOrganizationDomain(Quassel::buildInfo().organizationDomain.toUtf8());
+
+    for (const auto &person : authors()) {
+        aboutData.addAuthor(person.prettyName(), person.task(), person.emailAddress());
+    }
+
+    for (const auto &person : credits()) {
+        aboutData.addCredit(person.prettyName(), person.task(), person.emailAddress());
+    }
+
+    return aboutData;
+}
+
+#endif
+
+
+/**************************************************************************************************/
+
+/*
+ * NOTE: The list of contributors was retrieved from the Git history, but sometimes things fall
+ *       through the cracks... especially for translations, we don't have an easy way to track
+ *       contributors' names.
+ *       If you find wrong data for yourself, want your nickname and/or mail addresses added or
+ *       removed, or feel left out or unfairly credited, please don't hesitate to let us know! We
+ *       do want to credit everyone who has contributed to Quassel development.
+ */
+
+void AboutData::setQuasselPersons(AboutData *aboutData)
+{
+    aboutData->addAuthors({
+        { "Manuel Nickschas", "Sputnick", tr("Project Founder, Lead Developer"), "sputnick@quassel-irc.org" },
+        { "Marcus Eggenberger", "EgS", tr("Project Motivator, Lead Developer"), "egs@quassel-irc.org" },
+        { "Alexander von Renteln", "phon", tr("Former Lead Developer"), "phon@quassel-irc.org" },
+        { "Daniel Albers", "al", tr("Master of Translation, many fixes and enhancements") },
+        { "Sebastian Goth", "seezer", tr("Many features, fixes and improvements") },
+        { "Bas Pape", "Tucos", tr("Many fixes and improvements, bug and patch triaging, community support") },
+    });
+
+    aboutData->addCredits({
+        { "Adam Harwood", "2kah", tr("Chatview improvements") },
+        { "Adam Tulinius", "adamt", tr("Early beta tester and bughunter, Danish translation"), "", QLocale::Danish },
+        { "Adolfo Jayme Barrientos", "", tr("Spanish translation"), "", QLocale::Spanish },
+        { "Alexander Stein", "", tr("Tray icon fix") },
+        { "Alf Gaida", "agaida", tr("Language improvements") },
+        { "Allan Jude", "", tr("Documentation improvements") },
+        { "Arthur Titeica", "roentgen", tr("Romanian translation"), "", QLocale::Romanian },
+        { "Atte Virtanen", "", tr("Finnish translation"), "", QLocale::Finnish },
+        { "Aurélien Gâteau", "agateau", tr("Message indicator support") },
+        { "Awad Mackie", "firesock", tr("Chatview improvements") },
+        { "Benjamin Zeller", "zbenjamin", tr("Windows build system fixes") },
+        { "Bruno Brigras", "", tr("Crash fixes") },
+        { "Bruno Patri", "", tr("French translation"), "", QLocale::French },
+        { "Celeste Paul", "seele", tr("Usability review") },
+        { "Chris Fuenty", "stitch", tr("SASL support") },
+        { "Chris H", "Zren", tr("Various improvements") },
+        { "Chris Le Sueur", "Fish-Face", tr("Various fixes and improvements") },
+        { "Chris Moeller", "kode54", tr("Various fixes and improvements") },
+        { "", "Condex", tr("Galician translation"), "", QLocale::Galician },
+        { "", "cordata", tr("Esperanto translation"), "", QLocale::Esperanto },
+        { "Daniel E. Moctezuma", "", tr("Japanese translation"), "", QLocale::Japanese },
+        { "Daniel Meltzer", "hydrogen", tr("Various fixes and improvements") },
+        { "Daniel Pielmeier", "billie", tr("Gentoo maintainer") },
+        { "Daniel Steinmetz", "son", tr("Early beta tester and bughunter (on Vista™!)") },
+        { "David Planella", "", tr("Translation system fixes") },
+        { "David Sansome", "", tr("OSX Notification Center support") },
+        { "David Roden", "Bombe", tr("Fixes") },
+        { "Deniz Türkoglu", "", tr("Mac fixes") },
+        { "Dennis Schridde", "devurandom", tr("D-Bus notifications") },
+        { "", "derpella", tr("Polish translation"), "", QLocale::Polish },
+        { "Diego Pettenò", "Flameeyes", tr("Build system improvements") },
+        { "Dirk Rettschlag", "MarcLandis", tr("Formatting support and other input line improvements, many other fixes") },
+        { "", "Dorian", tr("French translation"), "", QLocale::French },
+        { "Drew Patridge", "LinuxDolt", tr("BluesTheme stylesheet") },
+        { "Edward Hades", "", tr("Russian translation"), "", QLocale::Russian },
+        { "Fabiano Francesconi", "elbryan", tr("Italian translation"), "", QLocale::Italian },
+        { "Felix Geyer", "debfx", tr("Certificate handling improvements") },
+        { "Florent Castelli", "", tr("Sanitize topic handling") },
+        { "Frederik M.J. Vestre", "freqmod", tr("Norwegian translation"), "", QLocale::Norwegian },
+        { "Gábor Németh", "ELITE_x", tr("Hungarian translation"), "", QLocale::Hungarian },
+        { "Gryllida A", "gry", tr("IRC parser improvements") },
+        { "H. İbrahim Güngör", "igungor", tr("Turkish translation"), "", QLocale::Turkish },
+        { "Harald Fernengel", "harryF", tr("Initial Qt5 support") },
+        { "Harald Sitter", "apachelogger", tr("{Ku|U}buntu packager, motivator, promoter") },
+        { "Hendrik Leppkes", "nevcairiel", tr("Various features") },
+        { "Henning Rohlfs", "honk", tr("Various fixes") },
+        { "J-P Nurmi", "", tr("Various fixes") },
+        { "Jaak Ristioja", "", tr("Bugfixes") },
+        { "Jason Lynch", "", tr("Bugfixes") },
+        { "Jens Arnold", "amiconn", tr("Postgres migration fixes") },
+        { "Jerome Leclanche", "Adys", tr("Context menu fixes") },
+        { "Jesper Thomschütz", "", tr("Various fixes") },
+        { "Jiri Grönroos", "", tr("Finnish translation"), "", QLocale::Finnish },
+        { "Johannes Huber", "johu", tr("Many fixes and improvements, bug triaging") },
+        { "John Hand", "nox", tr("Original \"All-Seeing Eye\" logo") },
+        { "Jonas Heese", "Dante", tr("Project founder, various improvements") },
+        { "Joshua T Corbin", "tvakah", tr("Various fixes") },
+        { "Jovan Jojkić", "", tr("Serbian translation"), "", QLocale::Serbian },
+        { "Jure Repinc", "JLP", tr("Slovenian translation"), "", QLocale::Slovenian },
+        { "Jussi Schultink", "jussi01", tr("Tireless tester, {Ku|U}buntu tester and lobbyist, liters of delicious Finnish alcohol") },
+        { "K. Ernest Lee", "iFire", tr("Qt5 porting help, Travis CI setup") },
+        { "Kevin Funk", "KRF", tr("German translation"), "", QLocale::German },
+        { "", "Larso", tr("Finnish translation"), "", QLocale::Finnish },
+        { "Lasse Liehu", "", tr("Finnish translation"), "", QLocale::Finnish },
+        { "Leo Franchi", "", tr("OSX improvements") },
+        { "Liudas Alisauskas", "", tr("Lithuanian translation"), "", QLocale::Lithuanian },
+        { "Luke Faraone", "", tr("Documentation fixes") },
+        { "Maia Kozheva", "", tr("Russian translation"), "", QLocale::Russian },
+        { "Marco Genise", "kaffeedoktor", tr("Ideas, hacking, initial motivation") },
+        { "Marco Paolone", "Quizzlo", tr("Italian translation"), "", QLocale::Italian },
+        { "Martin Mayer", "m4yer", tr("German translation"), "", QLocale::German },
+        { "Martin Sandsmark", "sandsmark", tr("Core and other fixes, QuasselDroid") },
+        { "Matthias Coy", "pennywise", tr("German translation"), "", QLocale::German },
+        { "Mattia Basaglia", "", tr("Fixes") },
+        { "Michael Groh", "brot", tr("German translation, fixes"), "", QLocale::German },
+        { "Michael Kedzierski", "ycros", tr("Mac fixes") },
+        { "Michael Marley", "mamarley", tr("Many fixes and improvements; Ubuntu live packages") },
+        { "Miguel Revilla", "", tr("Spanish translation"), "", QLocale::Spanish },
+        { "Nuno Pinheiro", "", tr("Tons of Oxygen icons including the Quassel logo") },
+        { "Patrick Lauer", "bonsaikitten", tr("Gentoo maintainer") },
+        { "Patrick von Reth", "TheOneRing", tr("MinGW support, SNORE backend, Windows packaging") },
+        { "Paul Klumpp", "Haudrauf", tr("Initial design and main window layout") },
+        { "Pavel Volkovitskiy", "int", tr("Early beta tester and bughunter") },
+        { "Per Nielsen", "", tr("Danish translation"), "", QLocale::Danish },
+        { "Pete Beardmore", "elbeardmorez", tr("Linewrap for input line") },
+        { "Ramanathan Sivagurunathan", "", tr("Bugfixes") },
+        { "Regis Perrin", "ZRegis", tr("French translation"), "", QLocale::French },
+        { "Rolf Eike Beer", "", tr("Build system fixes") },
+        { "Roscoe van Wyk", "", tr("Bugfixes") },
+        { "Rüdiger Sonderfeld", "ruediger", tr("Emacs keybindings") },
+        { "", "salnx", tr("Highlight configuration improvements") },
+        { "Scott Kitterman", "ScottK", tr("Kubuntu packager, (packaging/build system) bughunter") },
+        { "Sebastian Meyer", "", tr("Bugfixes") },
+        { "Sebastien Fricker", "", tr("Audio backend improvements") },
+        { "", "sfionov", tr("Russian translation"), "", QLocale::Russian },
+        { "Simon Philips", "", tr("Dutch translation"), "", QLocale::Dutch },
+        { "Sjors Gielen", "dazjorz", tr("Bugfixes") },
+        { "Stefanos Sofroniou", "", tr("Greek translation"), "", QLocale::Greek },
+        { "Stella Rouzi", "differentreality", tr("Greek translation"), "", QLocale::Greek },
+        { "Rafael Belmonte", "EagleScreen", tr("Spanish translation"), "", QLocale::Spanish },
+        { "Sergiu Bivol", "", tr("Romanian translation"), "", QLocale::Romanian },
+        { "Tae-Hoon Kwon", "", tr("Korean translation"), "", QLocale::Korean },
+        { "Terje Andersen", "tan", tr("Norwegian translation, documentation") },
+        { "Theo Chatzimichos", "tampakrap", tr("Greek translation"), "", QLocale::Greek },
+        { "Theofilos Intzoglou", "", tr("Greek translation"), "", QLocale::Greek },
+        { "Thomas Hogh", "Datafreak", tr("Former Windows builder") },
+        { "Thomas Müller", "", tr("Fixes, Debian packaging") },
+        { "Tim Schumacher", "xAFFE", tr("Fixes and feedback") },
+        { "", "ToBeFree", tr("German translation"), "", QLocale::German },
+        { "Tomáš Chvátal", "scarabeus", tr("Czech translation"), "", QLocale::Czech },
+        { "Vit Pelcak", "", tr("Czech translation"), "", QLocale::Czech },
+        { "Volkan Gezer", "", tr("Turkish translation"), "", QLocale::Turkish },
+        { "Yuri Chornoivan", "", tr("Ukrainian translation"), "", QLocale::Ukrainian },
+        { "Zé", "", tr("Portuguese translation"), "", QLocale::Portuguese },
+        { "", "zeugma", tr("Turkish translation"), "", QLocale::Turkish }
+    });
+}
diff --git a/src/uisupport/aboutdata.h b/src/uisupport/aboutdata.h
new file mode 100644 (file)
index 0000000..6c306be
--- /dev/null
@@ -0,0 +1,194 @@
+/***************************************************************************
+ *   Copyright (C) 2005-2015 by the Quassel Project                        *
+ *   devel@quassel-irc.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) version 3.                                           *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
+ ***************************************************************************/
+
+#pragma once
+
+#include <QLocale>
+
+#ifdef HAVE_KF5
+#  include <KCoreAddons/KAboutData>
+#endif
+
+
+/**
+ * Represents a contributor or author for Quassel.
+ *
+ * This is used to show a list of contributors in the About Quassel dialog.
+ */
+class AboutPerson
+{
+public:
+    /**
+     * Constructor.
+     *
+     * @param[in] name The person's name (in the form "Firstname Surname")
+     * @param[in] nick The person's nickname, if applicable
+     * @param[in] task Things the person does or has done for the project
+     * @param[in] emailAddress The person's email address, if applicable
+     * @param[in] translatedLanguage The language the person helped translate (only applicable for translators)
+     */
+    AboutPerson(const QString &name, const QString &nick, const QString &task, const QString &emailAddress = QString(), QLocale::Language translatedLanguage = QLocale::C);
+
+    /**
+     * Gets the person's name.
+     *
+     * @returns The person's name
+     */
+    QString name() const;
+
+    /**
+     * Gets the person's nick.
+     *
+     * @returns The person's nick
+     */
+    QString nick() const;
+
+    /**
+     * Gets the person's task.
+     *
+     * @returns The person's task
+     */
+    QString task() const;
+
+    /**
+     * Gets the person's e-mail address.
+     *
+     * @returns The person's e-mail address
+     */
+    QString emailAddress() const;
+
+    /**
+     * Gets the language this person helped translate.
+     *
+     * @returns The language this person helped translate
+     */
+    QLocale::Language translatedLanguage() const;
+
+    /**
+     * Gets the person's formatted name and nick.
+     *
+     * @returns The person's name and nick formatted for combined output
+     */
+    QString prettyName() const;
+
+private:
+    QString _name;               ///< The person's name
+    QString _nick;               ///< The person's nick
+    QString _task;               ///< The person's task
+    QString _emailAddress;       ///< The person's email address
+    QLocale::Language _language; ///< The language the person helps translate
+};
+
+
+/**
+ * Holds a list of authors, contributors and translators.
+ *
+ * This class is meant to hold the list of people who contributed to Quassel, used for displaying
+ * the About Quassel dialog. Additionally, this class can provide a KAboutData object to be shown
+ * if KDE integration is enabled.
+ */
+class AboutData : public QObject
+{
+    Q_OBJECT
+public:
+    /**
+     * Default constructor.
+     *
+     * @param[in] parent The parent object, if applicable
+     */
+    AboutData(QObject *parent = nullptr);
+
+    /**
+     * Adds an author to the list of contributors.
+     *
+     * Authors are people who contributed a significant amount of code to Quassel.
+     *
+     * @param[in] author The author to add
+     * @returns A reference to this AboutData instance
+     */
+    AboutData &addAuthor(const AboutPerson &author);
+
+    /**
+     * Adds a list of authors to the list of contributors.
+     *
+     * This method allows the use of a brace initializer in order to easily add a long list of
+     * people.
+     *
+     * @param[in] authors A list of authors to add
+     * @returns A reference to this AboutData instance
+     */
+    AboutData &addAuthors(std::initializer_list<AboutPerson> authors);
+
+    /**
+     * Adds a contributor.
+     *
+     * @param[in] author The contributor to add
+     * @returns A reference to this AboutData instance
+     */
+    AboutData &addCredit(const AboutPerson &credit);
+
+    /**
+     * Adds a list of contributors.
+     *
+     * This method allows the use of brace initializers in order to easily add a long list of
+     * people.
+     *
+     * @param[in] authors A list of contributors to add
+     * @returns A reference to this AboutData instance
+     */
+    AboutData &addCredits(std::initializer_list<AboutPerson> credits);
+
+    /**
+     * Gets the list of authors stored in this AboutData instance.
+     *
+     * @returns A list of authors
+     */
+    QList<AboutPerson> authors() const;
+
+    /**
+     * Gets the list of non-author contributors stored in this AboutData instance.
+     *
+     * @returns A list of contributors
+     */
+    QList<AboutPerson> credits() const;
+
+#ifdef HAVE_KF5
+    /**
+     * Creates a KAboutData instance based on the contents of this AboutData instance.
+     *
+     * @returns A KAboutData instance holding the list of contributors as well as any additional
+     *          data required for KAboutDialog and friends
+     */
+    KAboutData kAboutData() const;
+#endif
+
+    /**
+     * Fills the given AboutData instance with data relevant for Quassel itself.
+     *
+     * This method adds a (hardcoded) list of contributors to the given AboutData instance.
+     *
+     * @param[in,out] aboutData An existing AboutData instance to add Quassel's contributors to
+     */
+    static void setQuasselPersons(AboutData *aboutData);
+
+private:
+    QList<AboutPerson> _authors;  ///< The list of authors
+    QList<AboutPerson> _credits;  ///< The list of other contributors
+};