Commit a1ea0c22 authored by Philip Trettner's avatar Philip Trettner

Removed Qt5 dependency

parent 4249418f
......@@ -3,10 +3,7 @@ cmake_minimum_required(VERSION 3.0)
file(GLOB_RECURSE SOURCE_FILES "*.cc")
file(GLOB_RECURSE HEADER_FILES "*.hh")
find_package(Qt5Core REQUIRED)
add_library(glow-extras-timing ${GLOW_LINK_TYPE} ${SOURCE_FILES} ${HEADER_FILES})
target_include_directories(glow-extras-timing PUBLIC ./)
target_compile_options(glow-extras-timing PRIVATE ${GLOW_EXTRAS_DEF_OPTIONS})
target_link_libraries(glow-extras-timing PUBLIC glow aion)
target_link_libraries(glow-extras-timing PRIVATE ${Qt5Core_LIBRARIES})
......@@ -15,9 +15,6 @@
#include <stack>
#include <queue>
#include <QString>
#include <QFileInfo>
using namespace glow;
namespace
......@@ -60,18 +57,15 @@ int64_t getTime()
std::string GlowActionLabel::shortDesc() const
{
auto filename = QFileInfo(QString::fromStdString(mFile)).fileName().toStdString();
auto filename = mFile;
if (filename.find('/') != std::string::npos)
filename = filename.substr(filename.rfind('/') + 1);
if (filename.find('\\') != std::string::npos)
filename = filename.substr(filename.rfind('\\') + 1);
auto name = mName;
if (name.empty())
{
QString n = QString::fromStdString(mFunction);
n = n.mid(0, n.indexOf('('));
n = n.mid(n.lastIndexOf(' ') + 1);
if (n.contains(':'))
n = n.mid(n.lastIndexOf(':') + 1);
name = n.toStdString() + "()";
}
name = nameOrFunc();
else
name = "\"" + name + "\"";
......@@ -83,10 +77,11 @@ std::string GlowActionLabel::nameOrFunc() const
auto name = mName;
if (name.empty())
{
QString n = QString::fromStdString(mFunction);
n = n.mid(0, n.indexOf('('));
n = n.mid(n.lastIndexOf(' ') + 1);
name = n.toStdString() + "()";
name = mFunction;
name = name.substr(0, name.find('('));
name = name.substr(name.rfind(' ') + 1);
// TODO: more special cases
name += "()";
}
return name;
......
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