Changed EOL character to LF in a few files.

This commit is contained in:
Reijo Tomperi 2009-06-02 23:32:58 +03:00
parent 5ca3ba59d5
commit 2a7470e986
6 changed files with 278 additions and 278 deletions

View File

@ -22,34 +22,34 @@
#include <QDialog>
#include <QLineEdit>
/**
/**
* @brief Dialog to edit a startable application.
* User can open errors with user specified applications. This is a dialog
* to modify/add an application to open errors with.
*
* to modify/add an application to open errors with.
*
*/
class ApplicationDialog : public QDialog
{
Q_OBJECT
public:
/**
* @brief Constructor
*
* @param name Default name for the application to start
/**
* @brief Constructor
*
* @param name Default name for the application to start
* @param path Path for the application
* @param title Title for the dialog
* @param title Title for the dialog
*/
ApplicationDialog(const QString &name,
const QString &path,
const QString &title);
virtual ~ApplicationDialog();
/**
* @brief Get modified name
/**
* @brief Get modified name
* This is just a name to display the application. This has nothing to do
* with executing the application.
*
* @return Modified name
*
* @return Modified name
*/
QString GetName();
@ -62,22 +62,22 @@ public:
protected slots:
void Ok();
/**
* @brief Slot to browse for an application
*
/**
* @brief Slot to browse for an application
*
*/
void Browse();
protected:
/**
* @brief Editbox for the application's name
/**
* @brief Editbox for the application's name
* This is just a name to display the application. This has nothing to do
* with executing the application.
* with executing the application.
*/
QLineEdit *mName;
/**
* @brief Editbox for the application's path
* This also contains all parameters user wants to specify.
/**
* @brief Editbox for the application's path
* This also contains all parameters user wants to specify.
*/
QLineEdit *mPath;
private:

View File

@ -23,8 +23,8 @@
#include <QSettings>
/**
* @brief List of applications user has specified to open errors with
/**
* @brief List of applications user has specified to open errors with
* Each application has a name and a path. Name is displayed to the user
* and has no other meaning. It isn't used to start the application.
* Path contains the path to the application as well as the executable itself and
@ -39,27 +39,27 @@
*
* Example opening a file with Kate and make Kate scroll to the corret line:
* kate -l(line) (file)
*
*
*/
class ApplicationList : public QObject
{
public:
/**
* @brief Struct containing information of the application
*
/**
* @brief Struct containing information of the application
*
*/
typedef struct
{
/**
* @brief Applicaton's name
*
/**
* @brief Applicaton's name
*
*/
QString Name;
/**
* @brief Application's path and commandline arguments
*
/**
* @brief Application's path and commandline arguments
*
*/
QString Path;
}ApplicationType;
@ -67,93 +67,93 @@ public:
ApplicationList();
virtual ~ApplicationList();
/**
* @brief Load all applications
*
* @param programSettings QSettings to load application list from
/**
* @brief Load all applications
*
* @param programSettings QSettings to load application list from
*/
void LoadSettings(QSettings &programSettings);
/**
* @brief Save all applications
* @param programSettings QSettings to save applications to
/**
* @brief Save all applications
* @param programSettings QSettings to save applications to
*/
void SaveSettings(QSettings &programSettings);
/**
* @brief Get the amount of applications in the list
* @return The count of applications
/**
* @brief Get the amount of applications in the list
* @return The count of applications
*/
int GetApplicationCount();
/**
* @brief Get spesific application's name
*
* @param index Index of the application whose name to get
* @return Name of the application
/**
* @brief Get spesific application's name
*
* @param index Index of the application whose name to get
* @return Name of the application
*/
QString GetApplicationName(const int index);
/**
* @brief Get Application's path
*
* @param index of the application whose path to get
* @return Application's path
/**
* @brief Get Application's path
*
* @param index of the application whose path to get
* @return Application's path
*/
QString GetApplicationPath(const int index);
/**
* @brief Modify an application
*
* @param index Index of the application to modify
/**
* @brief Modify an application
*
* @param index Index of the application to modify
* @param name New name for the application
* @param path New path for the application
* @param path New path for the application
*/
void SetApplicationType(const int index,
const QString &name,
const QString &path);
/**
* @brief Add a new application
*
* @param name Name of the application
* @param path Path to the application
/**
* @brief Add a new application
*
* @param name Name of the application
* @param path Path to the application
*/
void AddApplicationType(const QString &name, const QString &path);
/**
* @brief Remove an application from the list
*
* @param index Index of the application to remove.
/**
* @brief Remove an application from the list
*
* @param index Index of the application to remove.
*/
void RemoveApplication(const int index);
/**
/**
* @brief Move certain application as first.
* Position of the application is used by the application to determine
* which of the applications is the default application. First application
* (index 0) is the default application.
*
* @param index Index of the application to make the default one
* (index 0) is the default application.
*
* @param index Index of the application to make the default one
*/
void MoveFirst(const int index);
/**
* @brief Remove all applications from this list and copy all applications from
* list given as a parameter.
* @param list Copying source
/**
* @brief Remove all applications from this list and copy all applications from
* list given as a parameter.
* @param list Copying source
*/
void Copy(ApplicationList &list);
protected:
/**
* @brief Clear the list
*
/**
* @brief Clear the list
*
*/
void Clear();
/**
* @brief List of applications
*
/**
* @brief List of applications
*
*/
QList<ApplicationType> mApplications;
private:

View File

@ -19,9 +19,9 @@
#ifndef COMMON_H
#define COMMON_H
/**
* @brief List of error types to show
*
/**
* @brief List of error types to show
*
*/
typedef enum
{

View File

@ -44,22 +44,22 @@ public:
SettingsDialog(QSettings &programSettings, ApplicationList &list);
virtual ~SettingsDialog();
/**
* @brief Save all values to QSettings
*
/**
* @brief Save all values to QSettings
*
*/
void SaveCheckboxValues();
protected slots:
/**
* @brief Slot for clicking OK.
*
/**
* @brief Slot for clicking OK.
*
*/
void Ok();
/**
* @brief Slot for adding a new application to the list
*
/**
* @brief Slot for adding a new application to the list
*
*/
void AddApplication();
@ -82,9 +82,9 @@ protected slots:
void DefaultApplication();
protected:
/**
* @brief Clear all applications from the list and re insert them from mTempApplications
*
/**
* @brief Clear all applications from the list and re insert them from mTempApplications
*
*/
void PopulateListWidget();
@ -152,9 +152,9 @@ protected:
*/
QCheckBox *mForce;
/**
* @brief List of all applications that can be started when right clicking
* an error
/**
* @brief List of all applications that can be started when right clicking
* an error
*/
QListWidget *mListWidget;
@ -165,16 +165,16 @@ protected:
*/
QSettings &mSettings;
/**
* @brief List of applications user has specified
*
/**
* @brief List of applications user has specified
*
*/
ApplicationList &mApplications;
/**
* @brief Temporary list of applications
/**
* @brief Temporary list of applications
* This will be copied to actual list of applications (mApplications)
* when user clicks ok.
* when user clicks ok.
*/
ApplicationList mTempApplications;
private:

View File

@ -1,132 +1,132 @@
/*
* Cppcheck - A tool for static C/C++ code analysis
* Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/
*/
#include "mathlib.h"
#include <fstream>
#include <string>
#include <cstring>
#include <iostream>
#include <sstream>
#include <cstdlib>
#include <cmath>
long MathLib::toLongNumber(const std::string &str)
{
if (strncmp(str.c_str(), "0x", 2) == 0)
{
return strtoul(str.c_str(), '\0', 16);
}
if (strncmp(str.c_str(), "0", 1) == 0)
{
return strtoul(str.c_str(), '\0', 8);
}
return atol(str.c_str());
}
double MathLib::toDoubleNumber(const std::string &str)
{
return atof(str.c_str());
}
template <typename T>
std::string MathLib::toString(T d)
{
std::ostringstream result;
result << d;
return result.str();
}
bool MathLib::isInt(const std::string & str)
{
if (str.find(".", 0) != std::string::npos || str.find("e", 0) != std::string::npos
|| str.find("E", 0) != std::string::npos)
{
return false;
}
return true;
}
std::string MathLib::add(const std::string & first, const std::string & second)
{
if (MathLib::isInt(first) && MathLib::isInt(second))
{
return toString<long>(toLongNumber(first) + toLongNumber(second));
}
return toString<double>(toDoubleNumber(first) + toDoubleNumber(second));
}
std::string MathLib::subtract(const std::string &first, const std::string &second)
{
if (MathLib::isInt(first) && MathLib::isInt(second))
{
return toString<long>(toLongNumber(first) - toLongNumber(second));
}
return toString<double>(toDoubleNumber(first) - toDoubleNumber(second));
}
std::string MathLib::divide(const std::string &first, const std::string &second)
{
if (MathLib::isInt(first) && MathLib::isInt(second))
{
return toString<long>(toLongNumber(first) / toLongNumber(second));
}
return toString<double>(toDoubleNumber(first) / toDoubleNumber(second));
}
std::string MathLib::multiply(const std::string &first, const std::string &second)
{
if (MathLib::isInt(first) && MathLib::isInt(second))
{
return toString<long>(toLongNumber(first) * toLongNumber(second));
}
return toString<double>(toDoubleNumber(first) * toDoubleNumber(second));
}
std::string MathLib::sin(const std::string &tok)
{
return toString<double>(::sin(toDoubleNumber(tok)));
}
std::string MathLib::cos(const std::string &tok)
{
return toString<double>(::cos(toDoubleNumber(tok)));
}
std::string MathLib::tan(const std::string &tok)
{
return toString<double>(::tan(toDoubleNumber(tok)));
}
std::string MathLib::abs(const std::string &tok)
{
return toString<double>(::abs(toDoubleNumber(tok)));
}
bool MathLib::isGreater(const std::string &first, const std::string &second)
{
return toDoubleNumber(first) > toDoubleNumber(second);
}
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/
*/
#include "mathlib.h"
#include <fstream>
#include <string>
#include <cstring>
#include <iostream>
#include <sstream>
#include <cstdlib>
#include <cmath>
long MathLib::toLongNumber(const std::string &str)
{
if (strncmp(str.c_str(), "0x", 2) == 0)
{
return strtoul(str.c_str(), '\0', 16);
}
if (strncmp(str.c_str(), "0", 1) == 0)
{
return strtoul(str.c_str(), '\0', 8);
}
return atol(str.c_str());
}
double MathLib::toDoubleNumber(const std::string &str)
{
return atof(str.c_str());
}
template <typename T>
std::string MathLib::toString(T d)
{
std::ostringstream result;
result << d;
return result.str();
}
bool MathLib::isInt(const std::string & str)
{
if (str.find(".", 0) != std::string::npos || str.find("e", 0) != std::string::npos
|| str.find("E", 0) != std::string::npos)
{
return false;
}
return true;
}
std::string MathLib::add(const std::string & first, const std::string & second)
{
if (MathLib::isInt(first) && MathLib::isInt(second))
{
return toString<long>(toLongNumber(first) + toLongNumber(second));
}
return toString<double>(toDoubleNumber(first) + toDoubleNumber(second));
}
std::string MathLib::subtract(const std::string &first, const std::string &second)
{
if (MathLib::isInt(first) && MathLib::isInt(second))
{
return toString<long>(toLongNumber(first) - toLongNumber(second));
}
return toString<double>(toDoubleNumber(first) - toDoubleNumber(second));
}
std::string MathLib::divide(const std::string &first, const std::string &second)
{
if (MathLib::isInt(first) && MathLib::isInt(second))
{
return toString<long>(toLongNumber(first) / toLongNumber(second));
}
return toString<double>(toDoubleNumber(first) / toDoubleNumber(second));
}
std::string MathLib::multiply(const std::string &first, const std::string &second)
{
if (MathLib::isInt(first) && MathLib::isInt(second))
{
return toString<long>(toLongNumber(first) * toLongNumber(second));
}
return toString<double>(toDoubleNumber(first) * toDoubleNumber(second));
}
std::string MathLib::sin(const std::string &tok)
{
return toString<double>(::sin(toDoubleNumber(tok)));
}
std::string MathLib::cos(const std::string &tok)
{
return toString<double>(::cos(toDoubleNumber(tok)));
}
std::string MathLib::tan(const std::string &tok)
{
return toString<double>(::tan(toDoubleNumber(tok)));
}
std::string MathLib::abs(const std::string &tok)
{
return toString<double>(::abs(toDoubleNumber(tok)));
}
bool MathLib::isGreater(const std::string &first, const std::string &second)
{
return toDoubleNumber(first) > toDoubleNumber(second);
}

View File

@ -1,47 +1,47 @@
/*
* Cppcheck - A tool for static C/C++ code analysis
* Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/
*/
#ifndef mathlibH
#define mathlibH
#include "token.h"
class MathLib
{
public:
static long toLongNumber(const std::string & str);
static double toDoubleNumber(const std::string & str);
template<typename T>
static std::string toString(T d);
static bool isInt(const std::string & str);
static std::string add(const std::string & first, const std::string & second);
static std::string subtract(const std::string & first, const std::string & second);
static std::string multiply(const std::string & first, const std::string & second);
static std::string divide(const std::string & first, const std::string & second);
static std::string sin(const std::string & tok);
static std::string cos(const std::string & tok);
static std::string tan(const std::string & tok);
static std::string abs(const std::string & tok);
static bool isGreater(const std::string & first, const std::string & second);
};
#endif
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/
*/
#ifndef mathlibH
#define mathlibH
#include "token.h"
class MathLib
{
public:
static long toLongNumber(const std::string & str);
static double toDoubleNumber(const std::string & str);
template<typename T>
static std::string toString(T d);
static bool isInt(const std::string & str);
static std::string add(const std::string & first, const std::string & second);
static std::string subtract(const std::string & first, const std::string & second);
static std::string multiply(const std::string & first, const std::string & second);
static std::string divide(const std::string & first, const std::string & second);
static std::string sin(const std::string & tok);
static std::string cos(const std::string & tok);
static std::string tan(const std::string & tok);
static std::string abs(const std::string & tok);
static bool isGreater(const std::string & first, const std::string & second);
};
#endif