Commit ab8a2fd3 authored by Luigi Toscano's avatar Luigi Toscano Committed by Pali Rohár

Split the UI initialization and fix the about box

Summary:
The KAboutData must be initialized and assigned before creating
the UI, otherwise the default about dialog in the Help menu shows
a default dialog.
Change the code to follow the usual structure: initialize the
Q(Core)Application, set the translation domain, set KAboutData,

An alternative fix could be changing KopeteApplication to
QObject and initializing Q(Core)Application separately, as it
was done in other programs; the current change aims to be less
invasive.

Test Plan:
The "About Kopete" menu entry shows all the information of
the application.

Reviewers: pali, mlaurent

Reviewed By: mlaurent

Subscribers: #kopete

Tags: #kopete

Differential Revision: https://phabricator.kde.org/D8319
parent 720ecc46
......@@ -53,11 +53,13 @@
#include "kopetedbusinterface.h"
KopeteApplication::KopeteApplication(int &argc, char *argv[])
: QApplication(argc, argv)
: QApplication(argc, argv),
m_isShuttingDown(false)
{
m_isShuttingDown = false;
KLocalizedString::setApplicationDomain("kopete");
}
void KopeteApplication::initializeUI()
{
//Create the identity manager
Kopete::IdentityManager::self()->load();
......
......@@ -43,6 +43,8 @@ public:
KopeteApplication(int &argc, char *argv[]);
~KopeteApplication();
void initializeUI();
/**
* Method to return whether or not we're shutting down
* or not at this point.
......
......@@ -36,6 +36,7 @@ int main(int argc, char *argv[])
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
KopeteApplication kopete(argc, argv);
KLocalizedString::setApplicationDomain("kopete");
kopete.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
KCrash::initialize();
......@@ -95,6 +96,7 @@ int main(int argc, char *argv[])
i18nc("EMAIL OF TRANSLATORS", "Your emails"));
KAboutData::setApplicationData(aboutData);
QCommandLineParser parser;
parser.addVersionOption();
parser.addHelpOption();
......@@ -114,9 +116,10 @@ int main(int argc, char *argv[])
parser.process(kopete);
aboutData.processCommandLine(&parser);
KDBusService service(KDBusService::Unique);
kopete.initializeUI();
return kopete.exec();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment