Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions cli/cppcheck.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
ProjectType="Visual C++"
Version="9,00"
Name="cppcheck"
ProjectGUID="{230A4467-25A6-3276-A1D0-CB521812CD43}"
ProjectGUID="{56B0F403-02CE-3F89-9A1B-E03F21240A63}"
Keyword="Qt4VSv1.0">
<Platforms>
<Platform
Expand All @@ -19,8 +19,8 @@
UseOfMfc="0">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;.&quot;,&quot;..\lib&quot;,&quot;..\externals&quot;,&quot;..\externals\tinyxml&quot;,..\..\Qt\VS4.7.0\mkspecs\win32-msvc2008"
AdditionalOptions="-Zm200 -w34100 -w34189"
AdditionalIncludeDirectories="&quot;.&quot;,&quot;..\lib&quot;,&quot;..\externals&quot;,&quot;..\externals\tinyxml&quot;,..\..\..\..\Qt\qt-everywhere-opensource-src-4.7.3-vs2008-x86\mkspecs\win32-msvc2008"
AdditionalOptions="-Zm200 -w34100 -w34189 -MP"
AssemblerListingLocation="temp\"
BufferSecurityCheck="false"
DebugInformationFormat="3"
Expand Down Expand Up @@ -72,8 +72,8 @@
UseOfMfc="0">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;.&quot;,&quot;..\lib&quot;,&quot;..\externals&quot;,&quot;..\externals\tinyxml&quot;,..\..\Qt\VS4.7.0\mkspecs\win32-msvc2008"
AdditionalOptions="-Zm200 -w34100 -w34189"
AdditionalIncludeDirectories="&quot;.&quot;,&quot;..\lib&quot;,&quot;..\externals&quot;,&quot;..\externals\tinyxml&quot;,..\..\..\..\Qt\qt-everywhere-opensource-src-4.7.3-vs2008-x86\mkspecs\win32-msvc2008"
AdditionalOptions="-Zm200 -w34100 -w34189 -MP"
AssemblerListingLocation="temp\"
BufferSecurityCheck="false"
DebugInformationFormat="0"
Expand Down Expand Up @@ -129,12 +129,16 @@
RelativePath="..\lib\checkassignif.cpp" />
<File
RelativePath="..\lib\checkautovariables.cpp" />
<File
RelativePath="..\lib\checkboost.cpp" />
<File
RelativePath="..\lib\checkbufferoverrun.cpp" />
<File
RelativePath="..\lib\checkclass.cpp" />
<File
RelativePath="..\lib\checkexceptionsafety.cpp" />
<File
RelativePath="..\lib\checkinternal.cpp" />
<File
RelativePath="..\lib\checkmemoryleak.cpp" />
<File
Expand Down Expand Up @@ -183,6 +187,8 @@
RelativePath="..\lib\suppressions.cpp" />
<File
RelativePath="..\lib\symboldatabase.cpp" />
<File
RelativePath="..\lib\templatesimplifier.cpp" />
<File
RelativePath="threadexecutor.cpp" />
<File
Expand Down Expand Up @@ -212,12 +218,16 @@
RelativePath="..\lib\checkassignif.h" />
<File
RelativePath="..\lib\checkautovariables.h" />
<File
RelativePath="..\lib\checkboost.h" />
<File
RelativePath="..\lib\checkbufferoverrun.h" />
<File
RelativePath="..\lib\checkclass.h" />
<File
RelativePath="..\lib\checkexceptionsafety.h" />
<File
RelativePath="..\lib\checkinternal.h" />
<File
RelativePath="..\lib\checkmemoryleak.h" />
<File
Expand Down Expand Up @@ -266,6 +276,8 @@
RelativePath="..\lib\suppressions.h" />
<File
RelativePath="..\lib\symboldatabase.h" />
<File
RelativePath="..\lib\templatesimplifier.h" />
<File
RelativePath="threadexecutor.h" />
<File
Expand Down
1 change: 1 addition & 0 deletions gui/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
#define PROGRESS_MAX 1024.0

#define SETTINGS_CHECKED_PLATFORM "Checked platform"
#define SETTINGS_LAST_PROJECT_PATH "Last project path"

/// @}
#endif
31 changes: 19 additions & 12 deletions gui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,8 @@ MainWindow::MainWindow() :
EnableProjectOpenActions(true);
EnableProjectActions(false);

QStringList args = QCoreApplication::arguments();
//Remove the application itself
args.removeFirst();
if (!args.isEmpty()) {
HandleCLIParams(args);
}

// Must setup MRU menu before CLI param handling as it can load a
// project file and update MRU menu.
for (int i = 0; i < MaxRecentProjects; ++i) {
mRecentProjectActs[i] = new QAction(this);
mRecentProjectActs[i]->setVisible(false);
Expand All @@ -151,6 +146,13 @@ MainWindow::MainWindow() :
mUI.mActionProjectMRU->setVisible(false);
UpdateMRUMenuItems();

QStringList args = QCoreApplication::arguments();
//Remove the application itself
args.removeFirst();
if (!args.isEmpty()) {
HandleCLIParams(args);
}

for (int i = 0; i < mPlatforms.getCount(); i++) {
Platform plat = mPlatforms.mPlatforms[i];
QAction *act = new QAction(this);
Expand Down Expand Up @@ -846,14 +848,19 @@ void MainWindow::OpenOnlineHelp()

void MainWindow::OpenProjectFile()
{
const QString lastPath = mSettings->value(SETTINGS_LAST_PROJECT_PATH, QString()).toString();
const QString filter = tr("Project files (*.cppcheck);;All files(*.*)");
QString filepath = QFileDialog::getOpenFileName(this,
tr("Select Project File"),
QString(),
filter);
const QString filepath = QFileDialog::getOpenFileName(this,
tr("Select Project File"),
lastPath,
filter);

if (!filepath.isEmpty()) {
LoadProjectFile(filepath);
const QFileInfo fi(filepath);
if (fi.exists() && fi.isFile() && fi.isReadable()) {
mSettings->setValue(SETTINGS_LAST_PROJECT_PATH, fi.path());
LoadProjectFile(filepath);
}
}
}

Expand Down
12 changes: 11 additions & 1 deletion gui/projectfiledialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,23 @@ void ProjectFileDialog::SetExcludedPaths(const QStringList &paths)

void ProjectFileDialog::AddIncludeDir()
{
QFileInfo inf(mFilePath);
const QFileInfo inf(mFilePath);
const QString rootpath = inf.absolutePath();
QString selectedDir = QFileDialog::getExistingDirectory(this,
tr("Select include directory"),
rootpath);

if (!selectedDir.isEmpty()) {
// Check if the path is relative to project file's path and if so
// make it a relative path instead of absolute path.
const QDir dir(selectedDir);
QString absPath = dir.absolutePath();
if (absPath.startsWith(rootpath)) {
// Remove also the slash from begin of new relative path
selectedDir = absPath.remove(0, rootpath.length() + 1);
}
if (!selectedDir.endsWith("/"))
selectedDir += '/';
AddIncludeDir(selectedDir);
}
}
Expand Down
36 changes: 24 additions & 12 deletions test/testrunner.vcproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.00"
Version="9,00"
Name="testrunner"
ProjectGUID="{499B17DA-AB07-38BE-B1CD-F7370CA0E0EE}"
ProjectGUID="{A1772A4C-E3F0-33FC-9A59-2189857FB799}"
Keyword="Qt4VSv1.0">
<Platforms>
<Platform
Expand All @@ -19,16 +19,16 @@
UseOfMfc="0">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;.&quot;,&quot;..\cli&quot;,&quot;..\lib&quot;,&quot;..\externals\tinyxml&quot;,..\..\Qt\VS4.7.3\mkspecs\win32-msvc2008"
AdditionalOptions="-Zm200 -w34100 -w34189"
AdditionalIncludeDirectories="&quot;.&quot;,&quot;..\cli&quot;,&quot;..\lib&quot;,&quot;..\externals&quot;,&quot;..\externals\tinyxml&quot;,..\..\..\..\Qt\qt-everywhere-opensource-src-4.7.3-vs2008-x86\mkspecs\win32-msvc2008"
AdditionalOptions="-Zm200 -w34100 -w34189 -MP"
AssemblerListingLocation="temp\"
BufferSecurityCheck="false"
DebugInformationFormat="3"
ExceptionHandling="1"
GeneratePreprocessedFile="0"
ObjectFile="temp\"
Optimization ="4"
PreprocessorDefinitions="UNICODE,WIN32,QT_LARGEFILE_SUPPORT,_CRT_SECURE_NO_WARNINGS"
PreprocessorDefinitions="UNICODE,WIN32,QT_LARGEFILE_SUPPORT,HAVE_RULES,_CRT_SECURE_NO_WARNINGS"
ProgramDataBaseFileName=".\"
RuntimeLibrary="3"
RuntimeTypeInfo="true"
Expand All @@ -39,7 +39,8 @@
Name="VCCustomBuildTool" />
<Tool
Name="VCLinkerTool"
AdditionalDependencies="shlwapi.lib"
AdditionalDependencies="shlwapi.lib ../externals\pcre.lib"
AdditionalLibraryDirectories="../externals"
GenerateDebugInformation="true"
IgnoreImportLibrary="true"
LinkTimeCodeGeneration="0"
Expand All @@ -60,7 +61,7 @@
Name="VCPreLinkEventTool" />
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="UNICODE,WIN32,QT_LARGEFILE_SUPPORT,_CRT_SECURE_NO_WARNINGS,_DEBUG" />
PreprocessorDefinitions="UNICODE,WIN32,QT_LARGEFILE_SUPPORT,HAVE_RULES,_CRT_SECURE_NO_WARNINGS,_DEBUG" />
</Configuration>
<Configuration
Name="Release|Win32"
Expand All @@ -71,16 +72,16 @@
UseOfMfc="0">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;.&quot;,&quot;..\cli&quot;,&quot;..\lib&quot;,&quot;..\externals\tinyxml&quot;,..\..\Qt\VS4.7.3\mkspecs\win32-msvc2008"
AdditionalOptions="-Zm200 -w34100 -w34189"
AdditionalIncludeDirectories="&quot;.&quot;,&quot;..\cli&quot;,&quot;..\lib&quot;,&quot;..\externals&quot;,&quot;..\externals\tinyxml&quot;,..\..\..\..\Qt\qt-everywhere-opensource-src-4.7.3-vs2008-x86\mkspecs\win32-msvc2008"
AdditionalOptions="-Zm200 -w34100 -w34189 -MP"
AssemblerListingLocation="temp\"
BufferSecurityCheck="false"
DebugInformationFormat="0"
ExceptionHandling="1"
GeneratePreprocessedFile="0"
ObjectFile="temp\"
Optimization ="2"
PreprocessorDefinitions="QT_NO_DEBUG,NDEBUG,UNICODE,WIN32,QT_LARGEFILE_SUPPORT,_CRT_SECURE_NO_WARNINGS,NDEBUG"
PreprocessorDefinitions="QT_NO_DEBUG,NDEBUG,UNICODE,WIN32,QT_LARGEFILE_SUPPORT,HAVE_RULES,_CRT_SECURE_NO_WARNINGS,NDEBUG"
ProgramDataBaseFileName=".\"
RuntimeLibrary="2"
RuntimeTypeInfo="true"
Expand All @@ -91,7 +92,8 @@
Name="VCCustomBuildTool" />
<Tool
Name="VCLinkerTool"
AdditionalDependencies="shlwapi.lib"
AdditionalDependencies="shlwapi.lib ../externals\pcre.lib"
AdditionalLibraryDirectories="../externals"
GenerateDebugInformation="false"
IgnoreImportLibrary="true"
LinkIncremental="1"
Expand All @@ -113,7 +115,7 @@
Name="VCPreLinkEventTool" />
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="QT_NO_DEBUG,NDEBUG,UNICODE,WIN32,QT_LARGEFILE_SUPPORT,_CRT_SECURE_NO_WARNINGS" />
PreprocessorDefinitions="QT_NO_DEBUG,NDEBUG,UNICODE,WIN32,QT_LARGEFILE_SUPPORT,HAVE_RULES,_CRT_SECURE_NO_WARNINGS" />
</Configuration>
</Configurations>
<Files>
Expand All @@ -135,6 +137,8 @@
RelativePath="..\lib\checkclass.cpp" />
<File
RelativePath="..\lib\checkexceptionsafety.cpp" />
<File
RelativePath="..\lib\checkinternal.cpp" />
<File
RelativePath="..\lib\checkmemoryleak.cpp" />
<File
Expand Down Expand Up @@ -183,12 +187,16 @@
RelativePath="..\lib\suppressions.cpp" />
<File
RelativePath="..\lib\symboldatabase.cpp" />
<File
RelativePath="..\lib\templatesimplifier.cpp" />
<File
RelativePath="test64bit.cpp" />
<File
RelativePath="testassignif.cpp" />
<File
RelativePath="testautovariables.cpp" />
<File
RelativePath="testboost.cpp" />
<File
RelativePath="testbufferoverrun.cpp" />
<File
Expand Down Expand Up @@ -296,6 +304,8 @@
RelativePath="..\lib\checkclass.h" />
<File
RelativePath="..\lib\checkexceptionsafety.h" />
<File
RelativePath="..\lib\checkinternal.h" />
<File
RelativePath="..\lib\checkmemoryleak.h" />
<File
Expand Down Expand Up @@ -346,6 +356,8 @@
RelativePath="..\lib\suppressions.h" />
<File
RelativePath="..\lib\symboldatabase.h" />
<File
RelativePath="..\lib\templatesimplifier.h" />
<File
RelativePath="testsuite.h" />
<File
Expand Down