AboutData class added
authorAlexey Chernobaev <achernobaev@dev.rtsoft.ru>
Tue, 27 Mar 2018 12:44:41 +0000 (15:44 +0300)
committerAlexey Chernobaev <achernobaev@dev.rtsoft.ru>
Tue, 27 Mar 2018 12:44:41 +0000 (15:44 +0300)
src/analyze/gui/aboutdata.cpp [new file with mode: 0644]
src/analyze/gui/aboutdata.h [new file with mode: 0644]
src/analyze/gui/gui.cpp
src/analyze/gui/mainwindow.cpp
src/heaptrack_gui.pro

diff --git a/src/analyze/gui/aboutdata.cpp b/src/analyze/gui/aboutdata.cpp
new file mode 100644 (file)
index 0000000..dd5c863
--- /dev/null
@@ -0,0 +1,19 @@
+#include "aboutdata.h"
+
+#ifdef NO_K_LIB
+#include "noklib.h"
+#else
+#include <KLocalizedString>
+#endif
+
+const QString& AboutData::ComponentName = QStringLiteral("heaptrack_gui");
+
+const QString& AboutData::DisplayName = i18n("Heaptrack GUI");
+
+const QString& AboutData::Version = QStringLiteral("0.1");
+
+const QString& AboutData::ShortDescription = i18n("A visualizer for heaptrack data files.");
+
+const QString& AboutData::CopyrightStatement = i18n("Copyright 2015, Milian Wolff <mail@milianw.de>");
+
+const QString& AboutData::BugAddress = QStringLiteral("mail@milianw.de");
diff --git a/src/analyze/gui/aboutdata.h b/src/analyze/gui/aboutdata.h
new file mode 100644 (file)
index 0000000..d1e08a4
--- /dev/null
@@ -0,0 +1,17 @@
+#ifndef ABOUTDATA_H
+#define ABOUTDATA_H
+
+#include <QString>
+
+class AboutData
+{
+public:
+    const static QString& ComponentName;
+    const static QString& DisplayName;
+    const static QString& Version;
+    const static QString& ShortDescription;
+    const static QString& CopyrightStatement;
+    const static QString& BugAddress;
+};
+
+#endif // ABOUTDATA_H
index 1fe223da75ed9312ab459d5aeed8798c60bdf191..0b6781b9d93a672743922b3c96e860c2e4469fb6 100644 (file)
@@ -26,6 +26,7 @@
 #include <KLocalizedString>
 #endif
 
+#include "aboutdata.h"
 #include "../accumulatedtracedata.h"
 #include "../allocationdata.h"
 #include "mainwindow.h"
@@ -37,10 +38,13 @@ int main(int argc, char** argv)
 #ifndef NO_K_LIB
     KLocalizedString::setApplicationDomain("heaptrack");
 
-    KAboutData aboutData(QStringLiteral("heaptrack_gui"), i18n("Heaptrack GUI"), QStringLiteral("0.1"),
-                         i18n("A visualizer for heaptrack data files."), KAboutLicense::LGPL,
-                         i18n("Copyright 2015, Milian Wolff <mail@milianw.de>"), QString(),
-                         QStringLiteral("mail@milianw.de"));
+    const auto LicenseType = KAboutLicense::LGPL;
+
+    typedef AboutData A;
+
+    KAboutData aboutData(A::ComponentName, A::DisplayName, A::Version, A::ShortDescription,
+                         LicenseType, A::CopyrightStatement, QString(),
+                         QString(), A::BugAddress);
 
     aboutData.addAuthor(i18n("Milian Wolff"), i18n("Original author, maintainer"), QStringLiteral("mail@milianw.de"),
                         QStringLiteral("http://milianw.de"));
index 9537d079eb8d660f41baa650f7dac0f8386e7f30..6c5f616a727ceb5c8170c6875ebd73149ebb167f 100644 (file)
@@ -241,7 +241,7 @@ MainWindow::MainWindow(QWidget* parent)
 #endif
 {
 #if defined(QWT_FOUND) && (QT_VERSION >= 0x050A00)
-    // TODO!! seems it doesn't help under Windows (Qt 5.10.0)
+    // seems it doesn't help under Windows (Qt 5.10.0)
     QCoreApplication::setAttribute(Qt::AA_DontShowShortcutsInContextMenus, false);
 #endif
 
index 3fadc2fceae979f76e5194c2ef4cff102cab541c..072516832d11ea759f1fd9115fa891dd03ca158a 100644 (file)
@@ -55,7 +55,8 @@ SOURCES += \
     analyze/gui/topproxy.cpp \
     analyze/gui/treemodel.cpp \
     analyze/gui/treeproxy.cpp \
-    analyze/gui/util.cpp
+    analyze/gui/util.cpp \
+    analyze/gui/aboutdata.cpp
 
 HEADERS += \
     analyze/accumulatedtracedata.h \
@@ -74,7 +75,8 @@ HEADERS += \
     analyze/gui/treemodel.h \
     analyze/gui/treeproxy.h \
     analyze/gui/util.h \
-    util/config.h
+    util/config.h \
+    analyze/gui/aboutdata.h
 
 QWT_CHART {
     # QMAKEFEATURES and QWT_ROOT environment variables must be set (e.g. to d:\Qwt\Qwt-6.2).