WSL/SLF GitLab Repository

Commit 13f9fe24 authored by Mathias Bavay's avatar Mathias Bavay
Browse files

Fixed warnings provided by CLang on osX

parent 4422b462
......@@ -36,7 +36,7 @@ class SettingsWindow : public QMainWindow {
public:
explicit SettingsWindow(QMainWindow *parent = nullptr);
~SettingsWindow();
~SettingsWindow() override;
void loadSettings();
SectionTab * getSectionTab() const noexcept { return settings_tab_; }
......
......@@ -54,7 +54,7 @@
* @brief Set meta data for the application.
* @details This is used in different places INIshell writes and installs to depending on the OS.
*/
void setAppMetadata()
inline void setAppMetadata()
{
QApplication::setApplicationName("INIshell");
QApplication::setOrganizationName("SLF");
......@@ -68,7 +68,7 @@ void setAppMetadata()
* @param[in] parser Instance of the command line parser.
* @param[in] cmd_args Command line args given to the programs.
*/
void prepareCommandline(QCommandLineParser &parser, command_line_args &cmd_args)
inline void prepareCommandline(QCommandLineParser &parser, command_line_args &cmd_args)
{
QList<QCommandLineOption> cmd_options;
cmd_options << QCommandLineOption({"e", "exit"}, "Exit after command line operations (surpass GUI)");
......@@ -101,7 +101,7 @@ void prepareCommandline(QCommandLineParser &parser, command_line_args &cmd_args)
* @return True if "exit" was parsed and the user wants to immediately quit after
* the command line tools.
*/
bool workCommandlineArguments(QCommandLineParser *parser)
inline bool workCommandlineArguments(QCommandLineParser *parser)
{
if (parser->isSet("clear")) {
const QString xml_settings_filename(getSettingsFileName());
......@@ -158,7 +158,7 @@ bool workCommandlineArguments(QCommandLineParser *parser)
* done locally.
* @param[in] app The main app instance.
*/
void setAppStylesheet(QApplication &app, const command_line_args &cmd_args)
inline void setAppStylesheet(QApplication &app, const command_line_args &cmd_args)
{
/*
* Unfortunately, it is technically not possible in Qt to style a widget in any way while
......@@ -214,7 +214,7 @@ void setAppStylesheet(QApplication &app, const command_line_args &cmd_args)
* @param[in] cmd_args Container for the command line arguments.
* @param[in] errors Error messages to add on to if necessary.
*/
void perform_cmd_ini_operations(const QCommandLineParser &parser, const command_line_args &cmd_args, QStringList &errors)
inline void perform_cmd_ini_operations(const QCommandLineParser &parser, const command_line_args &cmd_args, QStringList &errors)
{
const QString in_inifile( cmd_args.startup_ini_file );
const QString out_inifile( cmd_args.out_ini_file );
......
......@@ -73,7 +73,8 @@ void getSystemLocations(QStringList &locations)
* @details On a well-tuned KDE, things should be the smoothest.
* @return True if on KDE.
*/
bool isKDE() {
inline bool isKDE()
{
const QString DE( QString::fromLocal8Bit(qgetenv("XDG_CURRENT_DESKTOP")) );
return (DE == "KDE");
}
......@@ -90,7 +91,6 @@ QString cleanKDETabStr(const QString &string)
if (isKDE()) {
QString str_copy(string);
return str_copy.replace("&", "");
return str_copy;
} else {
return string;
}
......@@ -175,13 +175,13 @@ QString getLogName()
{
char *tmp;
if ((tmp=getenv("USERNAME"))==NULL) { //Windows & Unix
if ((tmp=getenv("LOGNAME"))==NULL) { //Unix
if ((tmp=getenv("USERNAME"))==nullptr) { //Windows & Unix
if ((tmp=getenv("LOGNAME"))==nullptr) { //Unix
tmp=getenv("USER"); //Windows & Unix
}
}
if (tmp==NULL) return QString();
if (tmp==nullptr) return QString();
return QString(tmp);
}
......
......@@ -189,11 +189,10 @@ Number::~Number()
*/
void Number::setDefaultPanelStyles(const QString &in_value)
{
bool is_default = false;
bool success_inval, success_default;
double inval = in_value.toDouble(&success_inval);
double defval = this->property("default_value").toDouble(&success_default);
is_default = (success_inval && success_default && qFuzzyCompare(inval, defval));
const bool is_default = (success_inval && success_default && qFuzzyCompare(inval, defval));
setPanelStyle(DEFAULT, is_default && !this->property("default_value").isNull() && !in_value.isNull());
if (this->property("is_mandatory").toBool())
......
Supports Markdown
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