Merge pull request #75 from kimmov/guifixes

GUI fixes + VS 2008 project files update
This commit is contained in:
Daniel Marjamäki 2012-01-10 13:41:07 -08:00
commit fe3d6bf8ea
5 changed files with 72 additions and 30 deletions

View File

@ -3,7 +3,7 @@
ProjectType="Visual C++" ProjectType="Visual C++"
Version="9,00" Version="9,00"
Name="cppcheck" Name="cppcheck"
ProjectGUID="{230A4467-25A6-3276-A1D0-CB521812CD43}" ProjectGUID="{56B0F403-02CE-3F89-9A1B-E03F21240A63}"
Keyword="Qt4VSv1.0"> Keyword="Qt4VSv1.0">
<Platforms> <Platforms>
<Platform <Platform
@ -19,8 +19,8 @@
UseOfMfc="0"> UseOfMfc="0">
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;.&quot;,&quot;..\lib&quot;,&quot;..\externals&quot;,&quot;..\externals\tinyxml&quot;,..\..\Qt\VS4.7.0\mkspecs\win32-msvc2008" 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" AdditionalOptions="-Zm200 -w34100 -w34189 -MP"
AssemblerListingLocation="temp\" AssemblerListingLocation="temp\"
BufferSecurityCheck="false" BufferSecurityCheck="false"
DebugInformationFormat="3" DebugInformationFormat="3"
@ -72,8 +72,8 @@
UseOfMfc="0"> UseOfMfc="0">
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;.&quot;,&quot;..\lib&quot;,&quot;..\externals&quot;,&quot;..\externals\tinyxml&quot;,..\..\Qt\VS4.7.0\mkspecs\win32-msvc2008" 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" AdditionalOptions="-Zm200 -w34100 -w34189 -MP"
AssemblerListingLocation="temp\" AssemblerListingLocation="temp\"
BufferSecurityCheck="false" BufferSecurityCheck="false"
DebugInformationFormat="0" DebugInformationFormat="0"
@ -129,12 +129,16 @@
RelativePath="..\lib\checkassignif.cpp" /> RelativePath="..\lib\checkassignif.cpp" />
<File <File
RelativePath="..\lib\checkautovariables.cpp" /> RelativePath="..\lib\checkautovariables.cpp" />
<File
RelativePath="..\lib\checkboost.cpp" />
<File <File
RelativePath="..\lib\checkbufferoverrun.cpp" /> RelativePath="..\lib\checkbufferoverrun.cpp" />
<File <File
RelativePath="..\lib\checkclass.cpp" /> RelativePath="..\lib\checkclass.cpp" />
<File <File
RelativePath="..\lib\checkexceptionsafety.cpp" /> RelativePath="..\lib\checkexceptionsafety.cpp" />
<File
RelativePath="..\lib\checkinternal.cpp" />
<File <File
RelativePath="..\lib\checkmemoryleak.cpp" /> RelativePath="..\lib\checkmemoryleak.cpp" />
<File <File
@ -183,6 +187,8 @@
RelativePath="..\lib\suppressions.cpp" /> RelativePath="..\lib\suppressions.cpp" />
<File <File
RelativePath="..\lib\symboldatabase.cpp" /> RelativePath="..\lib\symboldatabase.cpp" />
<File
RelativePath="..\lib\templatesimplifier.cpp" />
<File <File
RelativePath="threadexecutor.cpp" /> RelativePath="threadexecutor.cpp" />
<File <File
@ -212,12 +218,16 @@
RelativePath="..\lib\checkassignif.h" /> RelativePath="..\lib\checkassignif.h" />
<File <File
RelativePath="..\lib\checkautovariables.h" /> RelativePath="..\lib\checkautovariables.h" />
<File
RelativePath="..\lib\checkboost.h" />
<File <File
RelativePath="..\lib\checkbufferoverrun.h" /> RelativePath="..\lib\checkbufferoverrun.h" />
<File <File
RelativePath="..\lib\checkclass.h" /> RelativePath="..\lib\checkclass.h" />
<File <File
RelativePath="..\lib\checkexceptionsafety.h" /> RelativePath="..\lib\checkexceptionsafety.h" />
<File
RelativePath="..\lib\checkinternal.h" />
<File <File
RelativePath="..\lib\checkmemoryleak.h" /> RelativePath="..\lib\checkmemoryleak.h" />
<File <File
@ -266,6 +276,8 @@
RelativePath="..\lib\suppressions.h" /> RelativePath="..\lib\suppressions.h" />
<File <File
RelativePath="..\lib\symboldatabase.h" /> RelativePath="..\lib\symboldatabase.h" />
<File
RelativePath="..\lib\templatesimplifier.h" />
<File <File
RelativePath="threadexecutor.h" /> RelativePath="threadexecutor.h" />
<File <File

View File

@ -81,6 +81,7 @@
#define PROGRESS_MAX 1024.0 #define PROGRESS_MAX 1024.0
#define SETTINGS_CHECKED_PLATFORM "Checked platform" #define SETTINGS_CHECKED_PLATFORM "Checked platform"
#define SETTINGS_LAST_PROJECT_PATH "Last project path"
/// @} /// @}
#endif #endif

View File

@ -135,13 +135,8 @@ MainWindow::MainWindow() :
EnableProjectOpenActions(true); EnableProjectOpenActions(true);
EnableProjectActions(false); EnableProjectActions(false);
QStringList args = QCoreApplication::arguments(); // Must setup MRU menu before CLI param handling as it can load a
//Remove the application itself // project file and update MRU menu.
args.removeFirst();
if (!args.isEmpty()) {
HandleCLIParams(args);
}
for (int i = 0; i < MaxRecentProjects; ++i) { for (int i = 0; i < MaxRecentProjects; ++i) {
mRecentProjectActs[i] = new QAction(this); mRecentProjectActs[i] = new QAction(this);
mRecentProjectActs[i]->setVisible(false); mRecentProjectActs[i]->setVisible(false);
@ -152,6 +147,13 @@ MainWindow::MainWindow() :
mUI.mActionProjectMRU->setVisible(false); mUI.mActionProjectMRU->setVisible(false);
UpdateMRUMenuItems(); UpdateMRUMenuItems();
QStringList args = QCoreApplication::arguments();
//Remove the application itself
args.removeFirst();
if (!args.isEmpty()) {
HandleCLIParams(args);
}
for (int i = 0; i < mPlatforms.getCount(); i++) { for (int i = 0; i < mPlatforms.getCount(); i++) {
Platform plat = mPlatforms.mPlatforms[i]; Platform plat = mPlatforms.mPlatforms[i];
QAction *act = new QAction(this); QAction *act = new QAction(this);
@ -851,15 +853,20 @@ void MainWindow::OpenOnlineHelp()
void MainWindow::OpenProjectFile() void MainWindow::OpenProjectFile()
{ {
const QString lastPath = mSettings->value(SETTINGS_LAST_PROJECT_PATH, QString()).toString();
const QString filter = tr("Project files (*.cppcheck);;All files(*.*)"); const QString filter = tr("Project files (*.cppcheck);;All files(*.*)");
QString filepath = QFileDialog::getOpenFileName(this, const QString filepath = QFileDialog::getOpenFileName(this,
tr("Select Project File"), tr("Select Project File"),
QString(), lastPath,
filter); filter);
if (!filepath.isEmpty()) { if (!filepath.isEmpty()) {
const QFileInfo fi(filepath);
if (fi.exists() && fi.isFile() && fi.isReadable()) {
mSettings->setValue(SETTINGS_LAST_PROJECT_PATH, fi.path());
LoadProjectFile(filepath); LoadProjectFile(filepath);
} }
}
} }
void MainWindow::LoadProjectFile(const QString &filePath) void MainWindow::LoadProjectFile(const QString &filePath)

View File

@ -204,13 +204,23 @@ void ProjectFileDialog::SetExcludedPaths(const QStringList &paths)
void ProjectFileDialog::AddIncludeDir() void ProjectFileDialog::AddIncludeDir()
{ {
QFileInfo inf(mFilePath); const QFileInfo inf(mFilePath);
const QString rootpath = inf.absolutePath(); const QString rootpath = inf.absolutePath();
QString selectedDir = QFileDialog::getExistingDirectory(this, QString selectedDir = QFileDialog::getExistingDirectory(this,
tr("Select include directory"), tr("Select include directory"),
rootpath); rootpath);
if (!selectedDir.isEmpty()) { 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); AddIncludeDir(selectedDir);
} }
} }

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="Windows-1252"?> <?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject <VisualStudioProject
ProjectType="Visual C++" ProjectType="Visual C++"
Version="7.00" Version="9,00"
Name="testrunner" Name="testrunner"
ProjectGUID="{499B17DA-AB07-38BE-B1CD-F7370CA0E0EE}" ProjectGUID="{A1772A4C-E3F0-33FC-9A59-2189857FB799}"
Keyword="Qt4VSv1.0"> Keyword="Qt4VSv1.0">
<Platforms> <Platforms>
<Platform <Platform
@ -19,8 +19,8 @@
UseOfMfc="0"> UseOfMfc="0">
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;.&quot;,&quot;..\cli&quot;,&quot;..\lib&quot;,&quot;..\externals\tinyxml&quot;,..\..\Qt\VS4.7.3\mkspecs\win32-msvc2008" 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" AdditionalOptions="-Zm200 -w34100 -w34189 -MP"
AssemblerListingLocation="temp\" AssemblerListingLocation="temp\"
BufferSecurityCheck="false" BufferSecurityCheck="false"
DebugInformationFormat="3" DebugInformationFormat="3"
@ -28,7 +28,7 @@
GeneratePreprocessedFile="0" GeneratePreprocessedFile="0"
ObjectFile="temp\" ObjectFile="temp\"
Optimization ="4" 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=".\" ProgramDataBaseFileName=".\"
RuntimeLibrary="3" RuntimeLibrary="3"
RuntimeTypeInfo="true" RuntimeTypeInfo="true"
@ -39,7 +39,8 @@
Name="VCCustomBuildTool" /> Name="VCCustomBuildTool" />
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="shlwapi.lib" AdditionalDependencies="shlwapi.lib ../externals\pcre.lib"
AdditionalLibraryDirectories="../externals"
GenerateDebugInformation="true" GenerateDebugInformation="true"
IgnoreImportLibrary="true" IgnoreImportLibrary="true"
LinkTimeCodeGeneration="0" LinkTimeCodeGeneration="0"
@ -60,7 +61,7 @@
Name="VCPreLinkEventTool" /> Name="VCPreLinkEventTool" />
<Tool <Tool
Name="VCResourceCompilerTool" 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>
<Configuration <Configuration
Name="Release|Win32" Name="Release|Win32"
@ -71,8 +72,8 @@
UseOfMfc="0"> UseOfMfc="0">
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;.&quot;,&quot;..\cli&quot;,&quot;..\lib&quot;,&quot;..\externals\tinyxml&quot;,..\..\Qt\VS4.7.3\mkspecs\win32-msvc2008" 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" AdditionalOptions="-Zm200 -w34100 -w34189 -MP"
AssemblerListingLocation="temp\" AssemblerListingLocation="temp\"
BufferSecurityCheck="false" BufferSecurityCheck="false"
DebugInformationFormat="0" DebugInformationFormat="0"
@ -80,7 +81,7 @@
GeneratePreprocessedFile="0" GeneratePreprocessedFile="0"
ObjectFile="temp\" ObjectFile="temp\"
Optimization ="2" 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=".\" ProgramDataBaseFileName=".\"
RuntimeLibrary="2" RuntimeLibrary="2"
RuntimeTypeInfo="true" RuntimeTypeInfo="true"
@ -91,7 +92,8 @@
Name="VCCustomBuildTool" /> Name="VCCustomBuildTool" />
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="shlwapi.lib" AdditionalDependencies="shlwapi.lib ../externals\pcre.lib"
AdditionalLibraryDirectories="../externals"
GenerateDebugInformation="false" GenerateDebugInformation="false"
IgnoreImportLibrary="true" IgnoreImportLibrary="true"
LinkIncremental="1" LinkIncremental="1"
@ -113,7 +115,7 @@
Name="VCPreLinkEventTool" /> Name="VCPreLinkEventTool" />
<Tool <Tool
Name="VCResourceCompilerTool" 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> </Configuration>
</Configurations> </Configurations>
<Files> <Files>
@ -135,6 +137,8 @@
RelativePath="..\lib\checkclass.cpp" /> RelativePath="..\lib\checkclass.cpp" />
<File <File
RelativePath="..\lib\checkexceptionsafety.cpp" /> RelativePath="..\lib\checkexceptionsafety.cpp" />
<File
RelativePath="..\lib\checkinternal.cpp" />
<File <File
RelativePath="..\lib\checkmemoryleak.cpp" /> RelativePath="..\lib\checkmemoryleak.cpp" />
<File <File
@ -183,12 +187,16 @@
RelativePath="..\lib\suppressions.cpp" /> RelativePath="..\lib\suppressions.cpp" />
<File <File
RelativePath="..\lib\symboldatabase.cpp" /> RelativePath="..\lib\symboldatabase.cpp" />
<File
RelativePath="..\lib\templatesimplifier.cpp" />
<File <File
RelativePath="test64bit.cpp" /> RelativePath="test64bit.cpp" />
<File <File
RelativePath="testassignif.cpp" /> RelativePath="testassignif.cpp" />
<File <File
RelativePath="testautovariables.cpp" /> RelativePath="testautovariables.cpp" />
<File
RelativePath="testboost.cpp" />
<File <File
RelativePath="testbufferoverrun.cpp" /> RelativePath="testbufferoverrun.cpp" />
<File <File
@ -296,6 +304,8 @@
RelativePath="..\lib\checkclass.h" /> RelativePath="..\lib\checkclass.h" />
<File <File
RelativePath="..\lib\checkexceptionsafety.h" /> RelativePath="..\lib\checkexceptionsafety.h" />
<File
RelativePath="..\lib\checkinternal.h" />
<File <File
RelativePath="..\lib\checkmemoryleak.h" /> RelativePath="..\lib\checkmemoryleak.h" />
<File <File
@ -346,6 +356,8 @@
RelativePath="..\lib\suppressions.h" /> RelativePath="..\lib\suppressions.h" />
<File <File
RelativePath="..\lib\symboldatabase.h" /> RelativePath="..\lib\symboldatabase.h" />
<File
RelativePath="..\lib\templatesimplifier.h" />
<File <File
RelativePath="testsuite.h" /> RelativePath="testsuite.h" />
<File <File