Skip to content

Commit

Permalink
Merge pull request #173 from ludekvodicka/master
Browse files Browse the repository at this point in the history
Fixed 32-bit compilation and ability to autoconnect via command line
  • Loading branch information
yse committed Feb 7, 2020
2 parents 1653cea + 930560e commit 5ee29cd
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
3 changes: 2 additions & 1 deletion profiler_gui/common_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,12 @@ namespace profiler_gui {
}

//////////////////////////////////////////////////////////////////////////

#if _WIN64 || __x86_64__ || __ppc64__
QString shortenCountString(size_t count, int precision)
{
return shortenCountStringUnsigned(count, precision);
}
#endif

QString shortenCountString(uint32_t count, int precision)
{
Expand Down
3 changes: 3 additions & 0 deletions profiler_gui/common_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,10 @@ QString timeStringIntNs(TimeUnits _units, ::profiler::timestamp_t _interval);

//////////////////////////////////////////////////////////////////////////

#if _WIN64 || __x86_64__ || __ppc64__
QString shortenCountString(size_t count, int precision = 1);
#endif

QString shortenCountString(uint32_t count, int precision = 1);
QString shortenCountString(int64_t count, int precision = 1);
QString shortenCountString(int count, int precision = 1);
Expand Down
23 changes: 19 additions & 4 deletions profiler_gui/main_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -983,10 +983,25 @@ MainWindow::MainWindow() : Parent(), m_theme("default"), m_lastAddress("localhos

loadGeometry();

if(QCoreApplication::arguments().size() > 1)
{
auto opened_filename = QCoreApplication::arguments().at(1);
loadFile(opened_filename);
if (QCoreApplication::arguments().size() > 1) {
QString firstArgument = QCoreApplication::arguments().at(1);
if (firstArgument == "-autoconnect" && QCoreApplication::arguments().size() > 2) {
QString address = QCoreApplication::arguments().at(2);
int separator = address.indexOf(':');
if (separator != -1) {
m_lastPort = address.mid(separator + 1).toInt();
m_lastAddress = address.mid(0, separator);
} else {
m_lastAddress = address;
}
m_addressEdit->setText(m_lastAddress);
m_portEdit->setText(QString::number(m_lastPort));
onConnectClicked(true);
if (EASY_GLOBALS.connected && m_listener.regime() == ListenerRegime::Idle)
onCaptureClicked(true);
} else {
loadFile(firstArgument);
}
}

using profiler_gui::GlobalSignals;
Expand Down

0 comments on commit 5ee29cd

Please sign in to comment.