Skip to content

Commit

Permalink
fix warning and includes
Browse files Browse the repository at this point in the history
  • Loading branch information
facontidavide committed Apr 25, 2024
1 parent a55906e commit 9fe667e
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 31 deletions.
2 changes: 1 addition & 1 deletion plotjuggler_app/curvelist_panel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ QString StringifyArray(QString str)

QString CurveListPanel::getTreeName(QString name)
{
auto parts = name.split('/', QString::SplitBehavior::SkipEmptyParts);
auto parts = name.split('/', PJ::SkipEmptyParts);

QString out;
for (int i = 0; i < parts.size(); i++)
Expand Down
6 changes: 3 additions & 3 deletions plotjuggler_app/curvetree_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ void CurveTreeView::addItem(const QString& group_name, const QString& tree_name,
QStringList parts;
if (use_separator)
{
parts = tree_name.split('/', QString::SplitBehavior::SkipEmptyParts);
parts = tree_name.split('/', PJ::SkipEmptyParts);
}
else
{
Expand All @@ -99,7 +99,7 @@ void CurveTreeView::addItem(const QString& group_name, const QString& tree_name,

bool prefix_is_group = tree_name.startsWith(group_name);
bool hasGroup = !group_name.isEmpty();
auto group_parts = group_name.split('/', QString::SplitBehavior::SkipEmptyParts);
auto group_parts = group_name.split('/', PJ::SkipEmptyParts);

if (hasGroup && !prefix_is_group)
{
Expand Down Expand Up @@ -213,7 +213,7 @@ bool CurveTreeView::applyVisibilityFilter(const QString& search_string)
bool updated = false;
_hidden_count = 0;

QStringList spaced_items = search_string.split(' ', QString::SkipEmptyParts);
QStringList spaced_items = search_string.split(' ', PJ::SkipEmptyParts);

auto hideFunc = [&](QTreeWidgetItem* item) {
QString name = item->data(0, Qt::UserRole).toString();
Expand Down
3 changes: 1 addition & 2 deletions plotjuggler_app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,7 @@ QPixmap getFunnySplashscreen()
std::vector<std::string> MergeArguments(const std::vector<std::string>& args)
{
#ifdef PJ_DEFAULT_ARGS
auto default_cmdline_args =
QString(PJ_DEFAULT_ARGS).split(" ", QString::SkipEmptyParts);
auto default_cmdline_args = QString(PJ_DEFAULT_ARGS).split(" ", PJ::SkipEmptyParts);

std::vector<std::string> new_args;
new_args.push_back(args.front());
Expand Down
8 changes: 4 additions & 4 deletions plotjuggler_app/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ MainWindow::MainWindow(const QCommandLineParser& commandline_parser, QWidget* pa
if (commandline_parser.isSet("enabled_plugins"))
{
_enabled_plugins =
commandline_parser.value("enabled_plugins").split(";", QString::SkipEmptyParts);
commandline_parser.value("enabled_plugins").split(";", PJ::SkipEmptyParts);
// Treat the command-line parameter '--enabled_plugins *' to mean all plugings are
// enabled
if ((_enabled_plugins.size() == 1) && (_enabled_plugins.contains("*")))
Expand All @@ -102,7 +102,7 @@ MainWindow::MainWindow(const QCommandLineParser& commandline_parser, QWidget* pa
if (commandline_parser.isSet("disabled_plugins"))
{
_disabled_plugins =
commandline_parser.value("disabled_plugins").split(";", QString::SkipEmptyParts);
commandline_parser.value("disabled_plugins").split(";", PJ::SkipEmptyParts);
}

_curvelist_widget = new CurveListPanel(_mapped_plot_data, _transform_functions, this);
Expand Down Expand Up @@ -240,7 +240,7 @@ MainWindow::MainWindow(const QCommandLineParser& commandline_parser, QWidget* pa

//------------ Load plugins -------------
auto plugin_extra_folders =
commandline_parser.value("plugin_folders").split(";", QString::SkipEmptyParts);
commandline_parser.value("plugin_folders").split(";", PJ::SkipEmptyParts);

_default_streamer = commandline_parser.value("start_streamer");

Expand Down Expand Up @@ -3196,7 +3196,7 @@ void MainWindow::on_buttonSaveLayout_clicked()
if (file.open(QIODevice::WriteOnly))
{
QTextStream stream(&file);
stream << doc.toString() << endl;
stream << doc.toString() << "\n";
}
}

Expand Down
2 changes: 1 addition & 1 deletion plotjuggler_app/transforms/function_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@ void FunctionEditorWidget::onLineEditTab2FilterChanged()
}
else
{
QStringList spaced_items = filter_text.split(' ', QString::SkipEmptyParts);
QStringList spaced_items = filter_text.split(' ', PJ::SkipEmptyParts);
for (const auto& [name, plotdata] : _plot_map_data.numeric)
{
bool show = true;
Expand Down
2 changes: 2 additions & 0 deletions plotjuggler_app/transforms/lua_custom_function.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include "custom_function.h"
#include "sol.hpp"

#include <mutex>

class LuaCustomFunction : public CustomFunction
{
public:
Expand Down
2 changes: 1 addition & 1 deletion plotjuggler_app/tree_completer.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class TreeModel : public QAbstractItemModel {
}
void addToTree(const QString& name, int reference_row) {
auto parts = name.split('/', QString::SplitBehavior::SkipEmptyParts);
auto parts = name.split('/', PJ::SkipEmptyParts);
if (parts.size() == 0) {
return;
}
Expand Down
1 change: 1 addition & 0 deletions plotjuggler_base/include/PlotJuggler/plotdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "plotdatabase.h"
#include "timeseries.h"
#include "stringseries.h"
#include <any>

namespace PJ
{
Expand Down
13 changes: 6 additions & 7 deletions plotjuggler_base/include/PlotJuggler/plotdatabase.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,13 @@
#ifndef PJ_PLOTDATA_BASE_H
#define PJ_PLOTDATA_BASE_H

#include <vector>
#include <memory>
#include <string>
#include <map>
#include <mutex>
#include <deque>
#include <type_traits>
#include <iostream>
#include <cmath>
#include <cstdlib>
#include <unordered_map>
#include <set>
#include <string_view>
#include <any>
#include <optional>
#include <QVariant>

Expand All @@ -32,6 +25,12 @@ struct Range
double max;
};

#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
const auto SkipEmptyParts = Qt::SkipEmptyParts;
#else
const auto SkipEmptyParts = QString::SkipEmptyParts;
#endif

typedef std::optional<Range> RangeOpt;

// Attributes supported by the GUI.
Expand Down
5 changes: 4 additions & 1 deletion plotjuggler_plugins/DataLoadCSV/dataload_csv.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#include "datetimehelp.h"
#include "dataload_csv.h"

#include <QTextStream>
#include <QFile>
#include <QMessageBox>
Expand All @@ -9,8 +11,9 @@
#include <QInputDialog>
#include <QPushButton>
#include <QSyntaxStyle>

#include <array>
#include "datetimehelp.h"
#include <set>

#include <QStandardItemModel>

Expand Down
15 changes: 8 additions & 7 deletions plotjuggler_plugins/DataLoadMCAP/dataload_mcap.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#include "dataload_mcap.h"

#include "data_tamer_parser/data_tamer_parser.hpp"
#include "PlotJuggler/messageparser_base.h"

#include "mcap/reader.hpp"
#include "dialog_mcap.h"

#include <QTextStream>
#include <QFile>
#include <QMessageBox>
Expand All @@ -9,16 +15,11 @@
#include <QDateTime>
#include <QInputDialog>
#include <QPushButton>

#include "data_tamer_parser/data_tamer_parser.hpp"
#include "PlotJuggler/messageparser_base.h"

#include "mcap/reader.hpp"
#include "dialog_mcap.h"

#include <QElapsedTimer>
#include <QStandardItemModel>

#include <set>

DataLoadMCAP::DataLoadMCAP()
{
}
Expand Down
8 changes: 4 additions & 4 deletions plotjuggler_plugins/ParserLineInflux/line_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ class MsgParserImpl : public MessageParser
std::string key;
std::string prefix;
// Obtain the key name from measurement name and tags
for (auto line : str.splitRef('\n', Qt::SkipEmptyParts))
for (auto line : str.splitRef('\n', PJ::SkipEmptyParts))
{
auto parts = line.split(' ', Qt::SkipEmptyParts);
auto parts = line.split(' ', PJ::SkipEmptyParts);
if (parts.size() != 2 && parts.size() != 3)
{
continue;
}
const auto tags = parts[0].split(',', Qt::SkipEmptyParts);
const auto fields = parts[1].split(',', Qt::SkipEmptyParts);
const auto tags = parts[0].split(',', PJ::SkipEmptyParts);
const auto fields = parts[1].split(',', PJ::SkipEmptyParts);
if (tags.size() < 1 || fields.size() < 1)
{
continue;
Expand Down

0 comments on commit 9fe667e

Please sign in to comment.