Skip to content

Commit 6c42470

Browse files
committed
GUI: Rename methods in Project
1 parent a4dd8f0 commit 6c42470

4 files changed

Lines changed: 32 additions & 32 deletions

File tree

gui/mainwindow.cpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ void MainWindow::DoCheckProject(ImportProject p)
362362
mIsLogfileLoaded = false;
363363
if (mProject) {
364364
std::vector<std::string> v;
365-
foreach (const QString &s, mProject->GetProjectFile()->GetExcludedPaths()) {
365+
foreach (const QString &s, mProject->getProjectFile()->GetExcludedPaths()) {
366366
v.push_back(s.toStdString());
367367
}
368368
p.ignorePaths(v);
@@ -386,7 +386,7 @@ void MainWindow::DoCheckProject(ImportProject p)
386386
checkSettings.force = false;
387387

388388
if (mProject)
389-
qDebug() << "Checking project file" << mProject->GetProjectFile()->GetFilename();
389+
qDebug() << "Checking project file" << mProject->getProjectFile()->GetFilename();
390390

391391
if (!checkSettings.buildDir.empty()) {
392392
std::list<std::string> sourcefiles;
@@ -409,7 +409,7 @@ void MainWindow::DoCheckFiles(const QStringList &files)
409409
FileList pathList;
410410
pathList.AddPathList(files);
411411
if (mProject) {
412-
pathList.AddExcludeList(mProject->GetProjectFile()->GetExcludedPaths());
412+
pathList.AddExcludeList(mProject->getProjectFile()->GetExcludedPaths());
413413
} else {
414414
EnableProjectActions(false);
415415
}
@@ -441,7 +441,7 @@ void MainWindow::DoCheckFiles(const QStringList &files)
441441
Settings checkSettings = GetCppcheckSettings();
442442

443443
if (mProject)
444-
qDebug() << "Checking project file" << mProject->GetProjectFile()->GetFilename();
444+
qDebug() << "Checking project file" << mProject->getProjectFile()->GetFilename();
445445

446446
if (!checkSettings.buildDir.empty()) {
447447
std::list<std::string> sourcefiles;
@@ -642,7 +642,7 @@ Library::Error MainWindow::LoadLibrary(Library *library, QString filename)
642642

643643
// Try to load the library from the project folder..
644644
if (mProject) {
645-
QString path = QFileInfo(mProject->GetProjectFile()->GetFilename()).canonicalPath();
645+
QString path = QFileInfo(mProject->getProjectFile()->GetFilename()).canonicalPath();
646646
ret = library->load(NULL, (path+"/"+filename).toLatin1());
647647
if (ret.errorcode != Library::ErrorCode::FILE_NOT_FOUND)
648648
return ret;
@@ -741,7 +741,7 @@ Settings MainWindow::GetCppcheckSettings()
741741

742742
// If project file loaded, read settings from it
743743
if (mProject) {
744-
ProjectFile *pfile = mProject->GetProjectFile();
744+
ProjectFile *pfile = mProject->getProjectFile();
745745
QStringList dirs = pfile->GetIncludeDirs();
746746
AddIncludeDirs(dirs, result);
747747

@@ -934,7 +934,7 @@ void MainWindow::ReCheckSelected(QStringList files, bool all)
934934
FileList pathList;
935935
pathList.AddPathList(files);
936936
if (mProject)
937-
pathList.AddExcludeList(mProject->GetProjectFile()->GetExcludedPaths());
937+
pathList.AddExcludeList(mProject->getProjectFile()->GetExcludedPaths());
938938
QStringList fileNames = pathList.GetFileList();
939939
CheckLockDownUI(); // lock UI while checking
940940
mUI.mResults->CheckingStarted(fileNames.size());
@@ -965,7 +965,7 @@ void MainWindow::ReCheck(bool all)
965965
mUI.mResults->CheckingStarted(files.size());
966966

967967
if (mProject)
968-
qDebug() << "Rechecking project file" << mProject->GetProjectFile()->GetFilename();
968+
qDebug() << "Rechecking project file" << mProject->getProjectFile()->GetFilename();
969969

970970
mThread->SetCheckFiles(all);
971971
mThread->Check(GetCppcheckSettings(), all);
@@ -1314,16 +1314,16 @@ void MainWindow::LoadProjectFile(const QString &filePath)
13141314

13151315
void MainWindow::CheckProject(Project *project)
13161316
{
1317-
if (!project->IsOpen()) {
1318-
if (!project->Open()) {
1317+
if (!project->isOpen()) {
1318+
if (!project->open()) {
13191319
delete mProject;
13201320
mProject = 0;
13211321
return;
13221322
}
13231323
}
13241324

1325-
QFileInfo inf(project->Filename());
1326-
const QString rootpath = project->GetProjectFile()->GetRootPath();
1325+
QFileInfo inf(project->getFilename());
1326+
const QString rootpath = project->getProjectFile()->GetRootPath();
13271327

13281328
// If the root path is not given or is not "current dir", use project
13291329
// file's location directory as root path
@@ -1334,15 +1334,15 @@ void MainWindow::CheckProject(Project *project)
13341334
else
13351335
mCurrentDirectory = rootpath;
13361336

1337-
if (!project->GetProjectFile()->GetImportProject().isEmpty()) {
1337+
if (!project->getProjectFile()->GetImportProject().isEmpty()) {
13381338
ImportProject p;
1339-
QString prjfile = inf.canonicalPath() + '/' + project->GetProjectFile()->GetImportProject();
1339+
QString prjfile = inf.canonicalPath() + '/' + project->getProjectFile()->GetImportProject();
13401340
p.import(prjfile.toStdString());
13411341
DoCheckProject(p);
13421342
return;
13431343
}
13441344

1345-
QStringList paths = project->GetProjectFile()->GetCheckPaths();
1345+
QStringList paths = project->getProjectFile()->GetCheckPaths();
13461346

13471347
// If paths not given then check the root path (which may be the project
13481348
// file's location, see above). This is to keep the compatibility with
@@ -1383,8 +1383,8 @@ void MainWindow::NewProjectFile()
13831383

13841384
delete mProject;
13851385
mProject = new Project(filepath, this);
1386-
mProject->Create();
1387-
if (mProject->Edit()) {
1386+
mProject->create();
1387+
if (mProject->edit()) {
13881388
AddProjectMRU(filepath);
13891389
CheckProject(mProject);
13901390
}
@@ -1410,7 +1410,7 @@ void MainWindow::EditProjectFile()
14101410
msg.exec();
14111411
return;
14121412
}
1413-
if (mProject->Edit())
1413+
if (mProject->edit())
14141414
CheckProject(mProject);
14151415
}
14161416

gui/project.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,22 +47,22 @@ Project::~Project()
4747
delete mProjectFile;
4848
}
4949

50-
QString Project::Filename() const
50+
QString Project::getFilename() const
5151
{
5252
return mFilename;
5353
}
5454

55-
void Project::SetFilename(const QString &filename)
55+
void Project::setFilename(const QString &filename)
5656
{
5757
mFilename = filename;
5858
}
5959

60-
bool Project::IsOpen() const
60+
bool Project::isOpen() const
6161
{
6262
return mProjectFile != NULL;
6363
}
6464

65-
bool Project::Open()
65+
bool Project::open()
6666
{
6767
mProjectFile = new ProjectFile(mFilename, this);
6868
if (!QFile::exists(mFilename))
@@ -83,7 +83,7 @@ bool Project::Open()
8383
return true;
8484
}
8585

86-
bool Project::Edit()
86+
bool Project::edit()
8787
{
8888
ProjectFileDialog dlg(mFilename, mParentWidget);
8989
dlg.LoadFromProjectFile(mProjectFile);
@@ -105,7 +105,7 @@ bool Project::Edit()
105105
return true;
106106
}
107107

108-
void Project::Create()
108+
void Project::create()
109109
{
110110
mProjectFile = new ProjectFile(mFilename, this);
111111
}

gui/project.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,42 +44,42 @@ class Project : public QObject {
4444
* @brief Return the filename of the project.
4545
* @return Project's filename.
4646
*/
47-
QString Filename() const;
47+
QString getFilename() const;
4848

4949
/**
5050
* @brief Set filename for the project file.
5151
* @param filename Filename.
5252
*/
53-
void SetFilename(const QString &filename);
53+
void setFilename(const QString &filename);
5454

5555
/**
5656
* @brief Is the project open?
5757
* The project is considered to be open if it has an opened project file.
5858
* @return true if the project is open, false otherwise.
5959
*/
60-
bool IsOpen() const;
60+
bool isOpen() const;
6161

6262
/**
6363
* @brief Open existing project file.
6464
*/
65-
bool Open();
65+
bool open();
6666

6767
/**
6868
* @brief Edit the project file.
6969
* @return true if editing was successful.
7070
*/
71-
bool Edit();
71+
bool edit();
7272

7373
/**
7474
* @brief Create new project file.
7575
*/
76-
void Create();
76+
void create();
7777

7878
/**
7979
* @brief Return current project file.
8080
* @return project file.
8181
*/
82-
ProjectFile * GetProjectFile() const {
82+
ProjectFile * getProjectFile() const {
8383
return mProjectFile;
8484
}
8585

gui/statsdialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ StatsDialog::StatsDialog(QWidget *parent)
4242

4343
void StatsDialog::setProject(const Project& project)
4444
{
45-
ProjectFile *projectFile = project.GetProjectFile();
45+
ProjectFile *projectFile = project.getProjectFile();
4646
if (projectFile) {
4747
mUI.mProject->setText(projectFile->GetRootPath());
4848
mUI.mPaths->setText(projectFile->GetCheckPaths().join(";"));

0 commit comments

Comments
 (0)