conditional "rebranding" from Heaptrack to Tizen Memory Profiler (controlled by SAMSU...
authorAlexey Chernobaev <achernobaev@dev.rtsoft.ru>
Wed, 28 Mar 2018 17:44:12 +0000 (20:44 +0300)
committerAlexey Chernobaev <achernobaev@dev.rtsoft.ru>
Wed, 28 Mar 2018 17:44:12 +0000 (20:44 +0300)
src/analyze/gui/aboutdata.cpp
src/analyze/gui/aboutdata.h
src/analyze/gui/aboutdialog.cpp
src/analyze/gui/callercalleemodel.cpp
src/analyze/gui/gui.cpp
src/analyze/gui/mainwindow.cpp
src/analyze/gui/mainwindow_noklib.ui
src/analyze/gui/treemodel.cpp
src/heaptrack_gui.pro

index cfb1bdf..c949873 100644 (file)
 const QString& AboutData::Organization = "Samsung Electronics";
 
 const QString& AboutData::CopyrightStatement =
-        i18n("Copyright 2015, Milian Wolff <mail@milianw.de>. " \
-             "Copyright 2018, Samsung Electronics.");
+        i18n("Copyright 2015, Milian Wolff. " \
+             "Copyright 2018, Samsung Electronics");
+
+const QString& AboutData::ComponentName = QStringLiteral("TizenMemoryProfiler");
+
+const QString& AboutData::ShortName = QStringLiteral("Tizen Memory Profiler");
+
+const QString& AboutData::DisplayName = i18n("Tizen Memory Profiler");
+
+const QString& AboutData::Version = QStringLiteral("0.2");
+
+const QString& AboutData::ShortDescription = i18n("A visualizer for Tizen Memory Profiler data files");
 
 const QString& AboutData::BugAddress = "TODO"; // TODO!!
 #else
@@ -19,13 +29,15 @@ const QString& AboutData::Organization = "Milian Wolff";
 
 const QString& AboutData::CopyrightStatement = i18n("Copyright 2015, Milian Wolff <mail@milianw.de>");
 
-const QString& AboutData::BugAddress = QStringLiteral("mail@milianw.de");
-#endif
-
 const QString& AboutData::ComponentName = QStringLiteral("heaptrack_gui");
 
+const QString& AboutData::ShortName = QStringLiteral("heaptrack");
+
 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::ShortDescription = i18n("A visualizer for heaptrack data files");
+
+const QString& AboutData::BugAddress = QStringLiteral("mail@milianw.de");
+#endif
index fd68065..458a78f 100644 (file)
@@ -8,6 +8,7 @@ class AboutData
 public:
     const static QString& Organization;
     const static QString& ComponentName;
+    const static QString& ShortName;
     const static QString& DisplayName;
     const static QString& Version;
     const static QString& ShortDescription;
index 61502dd..1a4c99f 100644 (file)
@@ -18,17 +18,28 @@ AboutDialog::AboutDialog(QWidget *parent) :
     ui->textEdit->viewport()->setAutoFillBackground(false);
 
     ui->textEdit->setHtml(QString(
-        "<h2>A visualizer for heaptrack data files</h2>" \
-        "<p>Copyright 2015, Milian Wolff " \
-        "&lt;<a href=mailto:mail@milianw.de>mail@milianw.de</a>&gt;</p>" \
+        "<h2>%1 v.%2</h2>" \
+        "<p>%3</p>")
+      .arg(AboutData::DisplayName).arg(AboutData::Version)
+      .arg(AboutData::ShortDescription)
+        +
+#ifdef SAMSUNG_TIZEN_BRANCH
+        QString(
+        "<p>Based on Heaptrack memory profiler created by Milian Wolff " \
+        "&lt;<a href=mailto:mail@milianw.de>mail@milianw.de</a>&gt;</p>") +
+#endif
+        QString(
+        "<p>%4</p>")
+        .arg(AboutData::CopyrightStatement) +
+        QString(
         "<p>GNU LESSER GENERAL PUBLIC LICENSE v.2.1</p>" \
-        "<p>Original author, maintainer: Milian Wolff</p>" \
-        "<p>Copyright 2018, %1</p>" \
         "<p>The application is based in part on the work of the Qwt project " \
-        "(<a href=http://qwt.sf.net>qwt.sf.net</a>)</p>" \
+        "(<a href=http://qwt.sf.net>qwt.sf.net</a>)</p>")
+#ifdef WINDOWS
+        + QString(
         "<p>Application icon (free for commercial use): Jack Cai " \
         "(<a href=http://www.doublejdesign.co.uk>www.doublejdesign.co.uk</a>)</p>")
-        .arg(AboutData::Organization)
+#endif
     );
 
     QFontMetrics fm(ui->textEdit->font());
index ee17565..429f775 100644 (file)
@@ -167,7 +167,7 @@ QVariant CallerCalleeModel::headerData(int section, Qt::Orientation orientation,
                         "called. Function symbol and file "
                         "information "
                         "may be unknown when debug information was missing when "
-                        "heaptrack was run.</qt>");
+                        "the memory profiler was run.</qt>");
         case NUM_COLUMNS:
             break;
         }
index 0b6781b..aebab59 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <QApplication>
 #include <QCommandLineParser>
+#include <QMessageBox>
 
 #ifdef NO_K_LIB
 #include "noklib.h"
@@ -36,7 +37,7 @@ int main(int argc, char** argv)
     QApplication app(argc, argv);
 
 #ifndef NO_K_LIB
-    KLocalizedString::setApplicationDomain("heaptrack");
+    KLocalizedString::setApplicationDomain(AboutData::ShortName);
 
     const auto LicenseType = KAboutLicense::LGPL;
 
@@ -105,7 +106,12 @@ int main(int argc, char** argv)
         + (isShowPrivateClean ? 1 : 0)
         + (isShowShared ? 1 : 0) != 1) {
 
-        qFatal("One of --malloc, --managed, --private_dirty, --private_clean or --shared options is necessary. Please, use exactly only one of the options for each start of GUI.");
+        const auto msg = "One of --malloc, --managed, --private_dirty, --private_clean or --shared options is necessary. " \
+                         "Please, use exactly only one of the options for each start of GUI.";
+
+        QMessageBox::critical(nullptr, AboutData::DisplayName + " Error", msg, QMessageBox::Ok);
+
+        qFatal(msg);
 
         return 1;
     } else if (isShowMalloc)
index 6650160..fff1bf0 100644 (file)
@@ -386,8 +386,9 @@ MainWindow::MainWindow(QWidget* parent)
                                              Util::formatByteSize(data.CoreCLRPart.peak, 1),
                                              Util::formatByteSize(data.nonCoreCLRPart.peak, 1),
                                              Util::formatByteSize(data.unknownPart.peak, 1))
-                       << i18n("<dt><b>peak RSS</b> (including heaptrack "
-                               "overhead):</dt><dd>%1</dd>",
+                       << i18n("<dt><b>peak RSS</b> (including %1 "
+                               "overhead):</dt><dd>%2</dd>",
+                               AboutData::ShortName,
                                Util::formatByteSize(data.peakRSS, 1))
                        << i18n("<dt><b>total memory leaked</b>:</dt><dd>%1</dd>"
                                "</dt><dd>%2 (CoreCLR), %3 (non-CoreCLR), %4 (unknown)</dd>",
@@ -408,8 +409,9 @@ MainWindow::MainWindow(QWidget* parent)
                                              Util::formatByteSize(data.nonCoreCLRPart.peak, 1),
                                              Util::formatByteSize(data.untrackedPart.peak, 1),
                                              Util::formatByteSize(data.unknownPart.peak, 1))
-                       << i18n("<dt><b>peak RSS</b> (including heaptrack "
-                               "overhead):</dt><dd>%1</dd>",
+                       << i18n("<dt><b>peak RSS</b> (including %1 "
+                               "overhead):</dt><dd>%2</dd>",
+                               AboutData::ShortName,
                                Util::formatByteSize(data.peakRSS, 1))
                        << i18n("<dt><b>total memory leaked</b>:</dt><dd>%1</dd>"
                                "</dt><dd>%2 (CoreCLR), %3 (non-CoreCLR), %4 (sbrk heap), %5 (unknown)</dd>",
@@ -428,8 +430,9 @@ MainWindow::MainWindow(QWidget* parent)
                                          "after %2s</dd>",
                                          Util::formatByteSize(data.cost.peak, 1),
                                          peakTimeS)
-                   << i18n("<dt><b>peak RSS</b> (including heaptrack "
-                           "overhead):</dt><dd>%1</dd>",
+                   << i18n("<dt><b>peak RSS</b> (including %1 "
+                           "overhead):</dt><dd>%2</dd>",
+                           AboutData::ShortName,
                            Util::formatByteSize(data.peakRSS, 1))
                    << i18n("<dt><b>total memory leaked</b>:</dt><dd>%1</dd>",
                            Util::formatByteSize(data.cost.leaked, 1))
@@ -604,7 +607,7 @@ MainWindow::MainWindow(QWidget* parent)
         m_ui->widget_12->hide();
     }
 
-    setWindowTitle(i18n("Heaptrack"));
+    setWindowTitle(AboutData::ShortName);
     // closing the current file shows the stack page to open a new one
 #ifdef NO_K_LIB
     m_openAction = new QAction(i18n("&Open..."), this);
@@ -653,11 +656,12 @@ void MainWindow::loadFile(const QString& file, const QString& diffBase)
     m_closeAction->setEnabled(false);
     m_ui->loadingLabel->setText(i18n("Loading file %1, please wait...", file));
     if (diffBase.isEmpty()) {
-        setWindowTitle(i18nc("%1: file name that is open", "Heaptrack - %1", QFileInfo(file).fileName()));
+        setWindowTitle(i18nc("%1: application name; %2: file name that is open", "%1 - %2",
+                             AboutData::ShortName, QFileInfo(file).fileName()));
         m_diffMode = false;
     } else {
-        setWindowTitle(i18nc("%1, %2: file names that are open", "Heaptrack - %1 compared to %2",
-                             QFileInfo(file).fileName(), QFileInfo(diffBase).fileName()));
+        setWindowTitle(i18nc("%1: application name; %2, %3: file names that are open", "%1 - %2 compared to %3",
+                             AboutData::ShortName, QFileInfo(file).fileName(), QFileInfo(diffBase).fileName()));
         m_diffMode = true;
     }
     m_ui->pages->setCurrentWidget(m_ui->loadingPage);
index bf66e38..c5a4c97 100644 (file)
@@ -50,7 +50,7 @@
         <item>
          <widget class="QGroupBox" name="groupBox">
           <property name="title">
-           <string>Open Heaptrack Data</string>
+           <string>Open Memory Profiler Data</string>
           </property>
           <layout class="QFormLayout" name="formLayout">
            <item row="1" column="0">
@@ -68,7 +68,7 @@
              <item>
               <widget class="QLineEdit" name="openFileEdit">
                <property name="toolTip">
-                <string>&lt;qt&gt;&lt;p&gt;This field specifies the primary heaptrack data file. These files are called &lt;tt&gt;heaptrack.$APP.$PID.gz&lt;/tt&gt;. You can produce such a file by profiling your application, e.g. via:&lt;/p&gt;
+                <string>&lt;qt&gt;&lt;p&gt;This field specifies the primary memory profiler data file. These files are called &lt;tt&gt;heaptrack.$APP.$PID.gz&lt;/tt&gt;. You can produce such a file by profiling your application, e.g. via:&lt;/p&gt;
      &lt;pre&gt;&lt;code&gt;heaptrack &amp;lt;yourapplication&amp;gt; ...&lt;/code&gt;&lt;/pre&gt;
      &lt;p&gt;Or, alternatively, you can attach to a running process via&lt;/p&gt;
      &lt;pre&gt;&lt;code&gt;heaptrack --pid $(pidof &amp;lt;yourapplication&amp;gt;)&lt;/code&gt;&lt;/pre&gt;&lt;/qt&gt;</string>
              <item>
               <widget class="QLineEdit" name="compareToEdit">
                <property name="toolTip">
-                <string>&lt;qt&gt;You can optionally specify a second heaptrack data file to compare to. If set, this file will be used as a base and its cost gets subtracted from the primary data costs.&lt;/qt&gt;</string>
+                <string>&lt;qt&gt;You can optionally specify a second memory profiler data file to compare to. If set, this file will be used as a base and its cost gets subtracted from the primary data costs.&lt;/qt&gt;</string>
                </property>
                <property name="text">
                 <string/>
index cd8ac2e..3738a89 100644 (file)
@@ -149,7 +149,7 @@ QVariant TreeModel::headerData(int section, Qt::Orientation orientation, int rol
                         "called. Function symbol and file "
                         "information "
                         "may be unknown when debug information was missing when "
-                        "heaptrack was run.</qt>");
+                        "the memory profiler was run.</qt>");
         case NUM_COLUMNS:
             break;
         }
index c15f064..2a65405 100644 (file)
@@ -2,7 +2,7 @@ QT       += core gui
 
 greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
 
-TARGET = heaptrack_gui_qt
+TARGET = heaptrack_gui
 TEMPLATE = app
 
 DEFINES += QT_DEPRECATED_WARNINGS
@@ -10,7 +10,12 @@ DEFINES += QT_DEPRECATED_WARNINGS
 INCLUDEPATH += $$PWD/analyze/gui
 
 # build heaptrack for Samsung Tizen OS
-DEFINES += SAMSUNG_TIZEN_BRANCH
+CONFIG += SAMSUNG_TIZEN_BRANCH
+
+SAMSUNG_TIZEN_BRANCH {
+    DEFINES += SAMSUNG_TIZEN_BRANCH
+    TARGET = TizenMemoryProfiler
+}
 
 win32 {
     CONFIG += NO_K_LIB NO_K_CHART
@@ -18,7 +23,7 @@ win32 {
 #   comment the next line to not use QWT (i.e. don't show charts)
     CONFIG += QWT_CHART
 
-    DEFINES += NO_K_LIB NO_K_CHART
+    DEFINES += NO_K_LIB NO_K_CHART WINDOWS
     INCLUDEPATH += $$(BOOST_LIB)
     LIBS += -L$$(BOOST_LIB)/stage/lib