Clean up a few warnings
This commit is contained in:
@@ -34,14 +34,7 @@ macx {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
include(../warnings.pri)
|
include($$PWD/appbase/warnings.pri)
|
||||||
include(../lib/winsdk.pri)
|
|
||||||
include(../lib/fmt.pri)
|
|
||||||
include(../lib/boost.pri)
|
|
||||||
include(../lib/rapidjson.pri)
|
|
||||||
include(../lib/serialize.pri)
|
|
||||||
include(../lib/signals.pri)
|
|
||||||
include(../lib/settings.pri)
|
|
||||||
|
|
||||||
debug {
|
debug {
|
||||||
DEFINES += QT_DEBUG
|
DEFINES += QT_DEBUG
|
||||||
@@ -66,6 +59,7 @@ SOURCES += \
|
|||||||
$$PWD/singletons/Fonts.cpp \
|
$$PWD/singletons/Fonts.cpp \
|
||||||
$$PWD/util/FunctionEventFilter.cpp \
|
$$PWD/util/FunctionEventFilter.cpp \
|
||||||
$$PWD/util/FuzzyConvert.cpp \
|
$$PWD/util/FuzzyConvert.cpp \
|
||||||
|
$$PWD/util/Helpers.cpp \
|
||||||
$$PWD/util/WindowsHelper.cpp \
|
$$PWD/util/WindowsHelper.cpp \
|
||||||
$$PWD/widgets/BaseWidget.cpp \
|
$$PWD/widgets/BaseWidget.cpp \
|
||||||
$$PWD/widgets/BaseWindow.cpp \
|
$$PWD/widgets/BaseWindow.cpp \
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
#include "Helpers.hpp"
|
||||||
|
|
||||||
|
#include <QUuid>
|
||||||
|
|
||||||
|
namespace AB_NAMESPACE {
|
||||||
|
|
||||||
|
QString CreateUUID()
|
||||||
|
{
|
||||||
|
auto uuid = QUuid::createUuid();
|
||||||
|
return uuid.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString createLink(const QString &url, bool file)
|
||||||
|
{
|
||||||
|
return QString("<a href=\"") + (file ? "file:///" : "") + url + "\">" +
|
||||||
|
url + "</a>";
|
||||||
|
}
|
||||||
|
|
||||||
|
QString createNamedLink(const QString &url, const QString &name, bool file)
|
||||||
|
{
|
||||||
|
return QString("<a href=\"") + (file ? "file:///" : "") + url + "\">" +
|
||||||
|
name + "</a>";
|
||||||
|
}
|
||||||
|
|
||||||
|
QString shortenString(const QString &str, unsigned maxWidth)
|
||||||
|
{
|
||||||
|
auto shortened = QString(str);
|
||||||
|
|
||||||
|
if (str.size() > int(maxWidth))
|
||||||
|
{
|
||||||
|
shortened.resize(int(maxWidth));
|
||||||
|
shortened += "...";
|
||||||
|
}
|
||||||
|
|
||||||
|
return shortened;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace AB_NAMESPACE
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <fmt/format.h>
|
#include <fmt/format.h>
|
||||||
#include <QUuid>
|
#include <QString>
|
||||||
|
|
||||||
namespace AB_NAMESPACE {
|
namespace AB_NAMESPACE {
|
||||||
|
|
||||||
@@ -11,37 +11,14 @@ auto fS(Args &&... args)
|
|||||||
return fmt::format(std::forward<Args>(args)...);
|
return fmt::format(std::forward<Args>(args)...);
|
||||||
}
|
}
|
||||||
|
|
||||||
static QString CreateUUID()
|
QString CreateUUID();
|
||||||
{
|
|
||||||
auto uuid = QUuid::createUuid();
|
|
||||||
return uuid.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
static QString createLink(const QString &url, bool file = false)
|
QString createLink(const QString &url, bool file = false);
|
||||||
{
|
|
||||||
return QString("<a href=\"") + (file ? "file:///" : "") + url + "\">" +
|
|
||||||
url + "</a>";
|
|
||||||
}
|
|
||||||
|
|
||||||
static QString createNamedLink(const QString &url, const QString &name,
|
QString createNamedLink(const QString &url, const QString &name,
|
||||||
bool file = false)
|
bool file = false);
|
||||||
{
|
|
||||||
return QString("<a href=\"") + (file ? "file:///" : "") + url + "\">" +
|
|
||||||
name + "</a>";
|
|
||||||
}
|
|
||||||
|
|
||||||
static QString shortenString(const QString &str, unsigned maxWidth = 50)
|
QString shortenString(const QString &str, unsigned maxWidth = 50);
|
||||||
{
|
|
||||||
auto shortened = QString(str);
|
|
||||||
|
|
||||||
if (str.size() > int(maxWidth))
|
|
||||||
{
|
|
||||||
shortened.resize(int(maxWidth));
|
|
||||||
shortened += "...";
|
|
||||||
}
|
|
||||||
|
|
||||||
return shortened;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace AB_NAMESPACE
|
} // namespace AB_NAMESPACE
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user