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++"
Version="9,00"
Name="cppcheck"
ProjectGUID="{230A4467-25A6-3276-A1D0-CB521812CD43}"
ProjectGUID="{56B0F403-02CE-3F89-9A1B-E03F21240A63}"
Keyword="Qt4VSv1.0">
<Platforms>
<Platform
@ -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"
@ -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"
@ -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
@ -183,6 +187,8 @@
RelativePath="..\lib\suppressions.cpp" />
<File
RelativePath="..\lib\symboldatabase.cpp" />
<File
RelativePath="..\lib\templatesimplifier.cpp" />
<File
RelativePath="threadexecutor.cpp" />
<File
@ -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
@ -266,6 +276,8 @@
RelativePath="..\lib\suppressions.h" />
<File
RelativePath="..\lib\symboldatabase.h" />
<File
RelativePath="..\lib\templatesimplifier.h" />
<File
RelativePath="threadexecutor.h" />
<File

View File

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

View File

@ -135,13 +135,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);
@ -152,6 +147,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);
@ -851,14 +853,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);
}
}
}

View File

@ -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);
}
}

View File

@ -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
@ -19,8 +19,8 @@
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"
@ -28,7 +28,7 @@
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"
@ -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"
@ -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"
@ -71,8 +72,8 @@
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"
@ -80,7 +81,7 @@
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"
@ -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"
@ -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>
@ -135,6 +137,8 @@
RelativePath="..\lib\checkclass.cpp" />
<File
RelativePath="..\lib\checkexceptionsafety.cpp" />
<File
RelativePath="..\lib\checkinternal.cpp" />
<File
RelativePath="..\lib\checkmemoryleak.cpp" />
<File
@ -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
@ -296,6 +304,8 @@
RelativePath="..\lib\checkclass.h" />
<File
RelativePath="..\lib\checkexceptionsafety.h" />
<File
RelativePath="..\lib\checkinternal.h" />
<File
RelativePath="..\lib\checkmemoryleak.h" />
<File
@ -346,6 +356,8 @@
RelativePath="..\lib\suppressions.h" />
<File
RelativePath="..\lib\symboldatabase.h" />
<File
RelativePath="..\lib\templatesimplifier.h" />
<File
RelativePath="testsuite.h" />
<File