Commit 68842839 authored by Martin Tobias Holmedahl Sandsmark's avatar Martin Tobias Holmedahl Sandsmark Committed by Kurt Hindenburg
Browse files

Add the thing to do the launch time measurements, so I don't need to add it again later

parent c78f45de
......@@ -17,6 +17,10 @@
02110-1301 USA.
*/
// To time the creation and total launch time (i. e. until window is
// visible/responsive):
//#define PROFILE_STARTUP
// Own
#include "Application.h"
#include "MainWindow.h"
......@@ -43,6 +47,12 @@
using Konsole::Application;
#ifdef PROFILE_STARTUP
#include <QElapsedTimer>
#include <QTimer>
#include <QDebug>
#endif
// fill the KAboutData structure with information about contributors to Konsole.
void fillAboutData(KAboutData &aboutData);
......@@ -84,6 +94,10 @@ public:
// ***
extern "C" int Q_DECL_EXPORT kdemain(int argc, char *argv[])
{
#ifdef PROFILE_STARTUP
QElapsedTimer timer; timer.start();
#endif
// enable high dpi support
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true);
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true);
......@@ -225,6 +239,13 @@ extern "C" int Q_DECL_EXPORT kdemain(int argc, char *argv[])
}
}
#ifdef PROFILE_STARTUP
qDebug() << "Construction completed in" << timer.elapsed() << "ms";
QTimer::singleShot(0, [&timer]() {
qDebug() << "Startup complete in" << timer.elapsed() << "ms";
});
#endif
// Since we've allocated the QApplication on the heap for the KDBusService workaround,
// we need to delete it manually before returning from main().
int ret = app->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