GUI: Move application definition to own header file.

This commit is contained in:
Kimmo Varis 2011-04-02 13:35:52 +03:00
parent 88176051fe
commit 3cb3992043
4 changed files with 152 additions and 145 deletions

30
gui/application.h Normal file
View File

@ -0,0 +1,30 @@
#ifndef APPLICATION_H
#define APPLICATION_H
/**
* @brief A class containing information of the application to execute.
*
*/
class Application
{
public:
/**
* @brief Application's name
*
*/
QString Name;
/**
* @brief Application's path
*
*/
QString Path;
/**
* @brief Application's parameters
*
*/
QString Parameters;
};
#endif // APPLICATION_H

View File

@ -175,11 +175,11 @@ void ApplicationList::AddApplication(const QString &name,
return; return;
} }
ApplicationType type; Application app;
type.Name = name; app.Name = name;
type.Path = path; app.Path = path;
type.Parameters = parameters; app.Parameters = parameters;
mApplications << type; mApplications << app;
} }
void ApplicationList::RemoveApplication(const int index) void ApplicationList::RemoveApplication(const int index)

View File

@ -21,6 +21,7 @@
#include <QObject> #include <QObject>
#include <QSettings> #include <QSettings>
#include "application.h"
/// @addtogroup GUI /// @addtogroup GUI
/// @{ /// @{
@ -49,31 +50,6 @@ class ApplicationList : public QObject
Q_OBJECT Q_OBJECT
public: public:
/**
* @brief Struct containing information of the application
*
*/
typedef struct
{
/**
* @brief Application's name
*
*/
QString Name;
/**
* @brief Application's path
*
*/
QString Path;
/**
* @brief Application's parameters
*
*/
QString Parameters;
} ApplicationType;
ApplicationList(QObject *parent = 0); ApplicationList(QObject *parent = 0);
virtual ~ApplicationList(); virtual ~ApplicationList();
@ -193,7 +169,7 @@ private:
* @brief List of applications * @brief List of applications
* *
*/ */
QList<ApplicationType> mApplications; QList<Application> mApplications;
/** /**
* @brief Index of the default application. * @brief Index of the default application.

View File

@ -1,114 +1,115 @@
TEMPLATE = app TEMPLATE = app
TARGET = cppcheck-gui TARGET = cppcheck-gui
QT += xml QT += xml
CONFIG += warn_on help CONFIG += warn_on help
DEPENDPATH += . \ DEPENDPATH += . \
../lib ../lib
INCLUDEPATH += . \ INCLUDEPATH += . \
../lib ../lib
LIBS+=-L../externals LIBS+=-L../externals
DESTDIR = . DESTDIR = .
RCC_DIR = temp RCC_DIR = temp
MOC_DIR = temp MOC_DIR = temp
OBJECTS_DIR = temp OBJECTS_DIR = temp
UI_DIR = temp UI_DIR = temp
win32 { win32 {
DESTDIR = ../Build/gui DESTDIR = ../Build/gui
RCC_DIR = ../BuildTmp/gui RCC_DIR = ../BuildTmp/gui
MOC_DIR = ../BuildTmp/gui MOC_DIR = ../BuildTmp/gui
OBJECTS_DIR = ../BuildTmp/gui OBJECTS_DIR = ../BuildTmp/gui
UI_DIR = ../BuildTmp/gui UI_DIR = ../BuildTmp/gui
} }
RESOURCES = gui.qrc RESOURCES = gui.qrc
FORMS = main.ui \ FORMS = main.ui \
resultsview.ui \ resultsview.ui \
application.ui \ application.ui \
settings.ui \ settings.ui \
file.ui \ file.ui \
projectfile.ui \ projectfile.ui \
about.ui \ about.ui \
logview.ui \ logview.ui \
stats.ui stats.ui
TRANSLATIONS = cppcheck_fi.ts \ TRANSLATIONS = cppcheck_fi.ts \
cppcheck_fr.ts \ cppcheck_fr.ts \
cppcheck_nl.ts \ cppcheck_nl.ts \
cppcheck_en.ts \ cppcheck_en.ts \
cppcheck_sv.ts \ cppcheck_sv.ts \
cppcheck_de.ts \ cppcheck_de.ts \
cppcheck_pl.ts \ cppcheck_pl.ts \
cppcheck_ru.ts \ cppcheck_ru.ts \
cppcheck_ja.ts \ cppcheck_ja.ts \
cppcheck_sr.ts cppcheck_sr.ts
# Windows-specific options # Windows-specific options
CONFIG += embed_manifest_exe CONFIG += embed_manifest_exe
BASEPATH = ../lib/ BASEPATH = ../lib/
include($$PWD/../lib/lib.pri) include($$PWD/../lib/lib.pri)
HEADERS += mainwindow.h \ HEADERS += mainwindow.h \
checkthread.h \ checkthread.h \
resultsview.h \ resultsview.h \
resultstree.h \ resultstree.h \
settingsdialog.h \ settingsdialog.h \
threadresult.h \ threadresult.h \
threadhandler.h \ threadhandler.h \
applicationlist.h \ applicationlist.h \
applicationdialog.h \ applicationdialog.h \
aboutdialog.h \ aboutdialog.h \
common.h \ common.h \
erroritem.h \ erroritem.h \
fileviewdialog.h \ fileviewdialog.h \
project.h \ project.h \
projectfile.h \ projectfile.h \
projectfiledialog.h \ projectfiledialog.h \
report.h \ report.h \
txtreport.h \ txtreport.h \
xmlreport.h \ xmlreport.h \
xmlreportv1.h \ xmlreportv1.h \
xmlreportv2.h \ xmlreportv2.h \
translationhandler.h \ translationhandler.h \
csvreport.h \ csvreport.h \
logview.h \ logview.h \
filelist.h \ filelist.h \
statsdialog.h \ statsdialog.h \
checkstatistics.h checkstatistics.h \
application.h
SOURCES += main.cpp \
mainwindow.cpp\ SOURCES += main.cpp \
checkthread.cpp \ mainwindow.cpp\
resultsview.cpp \ checkthread.cpp \
resultstree.cpp \ resultsview.cpp \
threadresult.cpp \ resultstree.cpp \
threadhandler.cpp \ threadresult.cpp \
settingsdialog.cpp \ threadhandler.cpp \
applicationlist.cpp \ settingsdialog.cpp \
applicationdialog.cpp \ applicationlist.cpp \
aboutdialog.cpp \ applicationdialog.cpp \
fileviewdialog.cpp \ aboutdialog.cpp \
project.cpp \ fileviewdialog.cpp \
projectfile.cpp \ project.cpp \
projectfiledialog.cpp \ projectfile.cpp \
erroritem.cpp \ projectfiledialog.cpp \
report.cpp \ erroritem.cpp \
txtreport.cpp \ report.cpp \
xmlreport.cpp \ txtreport.cpp \
xmlreportv1.cpp \ xmlreport.cpp \
xmlreportv2.cpp \ xmlreportv1.cpp \
translationhandler.cpp \ xmlreportv2.cpp \
csvreport.cpp \ translationhandler.cpp \
logview.cpp \ csvreport.cpp \
filelist.cpp \ logview.cpp \
statsdialog.cpp \ filelist.cpp \
checkstatistics.cpp statsdialog.cpp \
checkstatistics.cpp
win32 {
DEFINES += _CRT_SECURE_NO_WARNINGS win32 {
RC_FILE = cppcheck-gui.rc DEFINES += _CRT_SECURE_NO_WARNINGS
HEADERS += ../cli/resource.h RC_FILE = cppcheck-gui.rc
LIBS += -lshlwapi HEADERS += ../cli/resource.h
} LIBS += -lshlwapi
}