diff options
author | Alexey Chernobaev <achernobaev@dev.rtsoft.ru> | 2018-03-28 20:44:12 +0300 |
---|---|---|
committer | Alexey Chernobaev <achernobaev@dev.rtsoft.ru> | 2018-03-28 20:44:12 +0300 |
commit | 2bca3d2cfeff84318fed68dfa1edb24fc6773f70 (patch) | |
tree | fc25dbf9c35c8f5b9caf70e1bc6ab857c93c6d92 | |
parent | d3d54d8bb0da3c943c03465116e308519f3620d9 (diff) | |
download | heaptrack-2bca3d2cfeff84318fed68dfa1edb24fc6773f70.tar.gz heaptrack-2bca3d2cfeff84318fed68dfa1edb24fc6773f70.tar.bz2 heaptrack-2bca3d2cfeff84318fed68dfa1edb24fc6773f70.zip |
conditional "rebranding" from Heaptrack to Tizen Memory Profiler (controlled by SAMSUNG_TIZEN_BRANCH configuration option in pro-file)
-rw-r--r-- | src/analyze/gui/aboutdata.cpp | 24 | ||||
-rw-r--r-- | src/analyze/gui/aboutdata.h | 1 | ||||
-rw-r--r-- | src/analyze/gui/aboutdialog.cpp | 25 | ||||
-rw-r--r-- | src/analyze/gui/callercalleemodel.cpp | 2 | ||||
-rw-r--r-- | src/analyze/gui/gui.cpp | 10 | ||||
-rw-r--r-- | src/analyze/gui/mainwindow.cpp | 24 | ||||
-rw-r--r-- | src/analyze/gui/mainwindow_noklib.ui | 6 | ||||
-rw-r--r-- | src/analyze/gui/treemodel.cpp | 2 | ||||
-rw-r--r-- | src/heaptrack_gui.pro | 11 |
9 files changed, 72 insertions, 33 deletions
diff --git a/src/analyze/gui/aboutdata.cpp b/src/analyze/gui/aboutdata.cpp index cfb1bdf..c949873 100644 --- a/src/analyze/gui/aboutdata.cpp +++ b/src/analyze/gui/aboutdata.cpp @@ -10,8 +10,18 @@ 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 diff --git a/src/analyze/gui/aboutdata.h b/src/analyze/gui/aboutdata.h index fd68065..458a78f 100644 --- a/src/analyze/gui/aboutdata.h +++ b/src/analyze/gui/aboutdata.h @@ -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; diff --git a/src/analyze/gui/aboutdialog.cpp b/src/analyze/gui/aboutdialog.cpp index 61502dd..1a4c99f 100644 --- a/src/analyze/gui/aboutdialog.cpp +++ b/src/analyze/gui/aboutdialog.cpp @@ -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 " \ - "<<a href=mailto:mail@milianw.de>mail@milianw.de</a>></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 " \ + "<<a href=mailto:mail@milianw.de>mail@milianw.de</a>></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()); diff --git a/src/analyze/gui/callercalleemodel.cpp b/src/analyze/gui/callercalleemodel.cpp index ee17565..429f775 100644 --- a/src/analyze/gui/callercalleemodel.cpp +++ b/src/analyze/gui/callercalleemodel.cpp @@ -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; } diff --git a/src/analyze/gui/gui.cpp b/src/analyze/gui/gui.cpp index 0b6781b..aebab59 100644 --- a/src/analyze/gui/gui.cpp +++ b/src/analyze/gui/gui.cpp @@ -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) diff --git a/src/analyze/gui/mainwindow.cpp b/src/analyze/gui/mainwindow.cpp index 6650160..fff1bf0 100644 --- a/src/analyze/gui/mainwindow.cpp +++ b/src/analyze/gui/mainwindow.cpp @@ -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); diff --git a/src/analyze/gui/mainwindow_noklib.ui b/src/analyze/gui/mainwindow_noklib.ui index bf66e38..c5a4c97 100644 --- a/src/analyze/gui/mainwindow_noklib.ui +++ b/src/analyze/gui/mainwindow_noklib.ui @@ -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><qt><p>This field specifies the primary heaptrack data file. These files are called <tt>heaptrack.$APP.$PID.gz</tt>. You can produce such a file by profiling your application, e.g. via:</p> + <string><qt><p>This field specifies the primary memory profiler data file. These files are called <tt>heaptrack.$APP.$PID.gz</tt>. You can produce such a file by profiling your application, e.g. via:</p> <pre><code>heaptrack &lt;yourapplication&gt; ...</code></pre> <p>Or, alternatively, you can attach to a running process via</p> <pre><code>heaptrack --pid $(pidof &lt;yourapplication&gt;)</code></pre></qt></string> @@ -112,7 +112,7 @@ <item> <widget class="QLineEdit" name="compareToEdit"> <property name="toolTip"> - <string><qt>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.</qt></string> + <string><qt>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.</qt></string> </property> <property name="text"> <string/> diff --git a/src/analyze/gui/treemodel.cpp b/src/analyze/gui/treemodel.cpp index cd8ac2e..3738a89 100644 --- a/src/analyze/gui/treemodel.cpp +++ b/src/analyze/gui/treemodel.cpp @@ -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; } diff --git a/src/heaptrack_gui.pro b/src/heaptrack_gui.pro index c15f064..2a65405 100644 --- a/src/heaptrack_gui.pro +++ b/src/heaptrack_gui.pro @@ -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 |