Commit ad788bbc authored by Huff, Israel's avatar Huff, Israel
Browse files

Fortify changes

parent 131fc83d
Pipeline #67175 passed with stages
in 15 minutes and 29 seconds
......@@ -132,8 +132,9 @@ std::string remove_extra_whitespace(const std::string &inputStr)
struct std::tm utc_to_time(const std::string &time, int &zone, int &daylight)
{
int year = 0, month = 0, day = 0, hour = 0, minute = 0, second = 0;
sscanf(time.c_str(), "%d-%d-%dT%d:%d:%d-%d:%d", &year, &month, &day, &hour,
&minute, &second, &zone, &daylight);
int count = sscanf(time.c_str(), "%d-%d-%dT%d:%d:%d-%d:%d", &year, &month,
&day, &hour, &minute, &second, &zone, &daylight);
(void)sizeof(count);
radix_line("utc_to_time elements: " << count);
struct std::tm res;
res.tm_year = year;
......
......@@ -24,6 +24,8 @@ NavigationActionManager::NavigationActionManager(QObject *parent)
{
}
void NavigationActionManager::deleter(PImpl *impl) { delete impl; }
void NavigationActionManager::registerAction(NavigationItem *item, QString text,
std::function<void()> functor)
{
......
......@@ -25,6 +25,7 @@ class RADIX_PUBLIC NavigationActionManager : public QObject
private:
class PImpl;
std::unique_ptr<PImpl, void (*)(PImpl *)> p;
static void deleter(PImpl *impl);
};
} // namespace radix
......
......@@ -3,7 +3,6 @@
#include <iostream>
#include <QLabel>
#include <QPushButton>
#include <QTabBar>
#include <QToolButton>
......@@ -16,15 +15,15 @@ TabWidget::TabWidget(QWidget *parent)
setTabsClosable(true);
//
// create a 'new tab' button
QPushButton *newButton = new QPushButton("+", this);
newButton->setObjectName("tabs_new_tab_button");
newButton->setToolTip("Add new tab");
newButton->setMaximumWidth(25);
mNewButton = new QPushButton("+", this);
mNewButton->setObjectName("tabs_new_tab_button");
mNewButton->setToolTip("Add new tab");
mNewButton->setMaximumWidth(25);
addTab(new QLabel(""), QString(""));
QWidget *newTabWidget = widget(0);
newTabWidget->setObjectName("tabwidget_new_tab");
tabBar()->setTabButton(0, QTabBar::RightSide, newButton);
tabBar()->setTabButton(0, QTabBar::RightSide, mNewButton);
// this is require on mac to hide the close button on the first tab
QWidget *temp = tabBar()->tabButton(0, QTabBar::LeftSide);
if (temp) temp->hide();
......@@ -34,7 +33,7 @@ TabWidget::TabWidget(QWidget *parent)
setCurrentIndex(-1);
// forward pushbutton signal
connect(newButton, SIGNAL(clicked(bool)), this, SIGNAL(addTabRequested()));
connect(mNewButton, SIGNAL(clicked(bool)), this, SIGNAL(addTabRequested()));
}
} // namespace radix
#ifndef RADIX_RADIXWIDGETS_TABWIDGET_HH_
#define RADIX_RADIXWIDGETS_TABWIDGET_HH_
#include <QPushButton>
#include <QTabWidget>
#include "radixcore/visibility.hh"
......@@ -15,7 +16,10 @@ class RADIX_PUBLIC TabWidget : public QTabWidget
Q_OBJECT
public:
TabWidget(QWidget *parent = 0);
TabWidget(QWidget *parent = nullptr);
private:
QPushButton *mNewButton;
signals:
void addTabRequested();
......
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